/* Transformation workbench — layered on repl.css (palette, tables, modal). */

#wb { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

header .controls { flex-wrap: wrap; justify-content: flex-end; }
header select {
  font-family: var(--font); font-size: var(--sz);
  background: var(--bg); border: 1px solid var(--border);
  color: var(--fg); padding: 2px 6px; border-radius: 3px;
}

.wb-btn, #logout-btn {
  font-family: var(--font); font-size: var(--sz);
  background: transparent; border: 1px solid var(--border);
  color: var(--fg-dim); padding: 2px 8px; border-radius: 3px; cursor: pointer;
  text-decoration: none; white-space: nowrap;
}
.wb-btn:hover { color: var(--fg); border-color: var(--fg-dim); }
.wb-btn:disabled { opacity: .45; cursor: default; }
.wb-btn-commit { color: var(--accent); border-color: var(--accent); }

.wb-badge {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 1px 8px; font-size: 11px; color: var(--fg-dim); cursor: help; white-space: nowrap;
}
.wb-badge.named { color: var(--echo); border-color: var(--echo); }
.wb-badge.shape { color: var(--accent); border-color: var(--accent); }

.wb-intro {
  border-bottom: 1px solid var(--border); padding: 6px 12px;
  color: var(--fg-dim); font-size: 12px; line-height: 1.55; flex-shrink: 0;
}
.wb-intro summary { cursor: pointer; user-select: none; }
.wb-intro p { margin-top: 6px; max-width: 110ch; }
.wb-intro b { color: var(--fg); font-weight: 600; }
.wb-intro code { color: var(--accent); }

.wb-main { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }

/* ── Stages ─────────────────────────────────────────────────────────────── */

.wb-stages {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; padding: 10px 12px; flex-shrink: 0;
}
@media (max-width: 900px) { .wb-stages { grid-template-columns: 1fr; } }

.wb-stage {
  display: flex; flex-direction: column; gap: 5px;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 8px; background: var(--surface); min-width: 0;
}
.wb-stage.active { border-color: var(--accent); }
.wb-stage.collapsed { opacity: .7; }
.wb-stage-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.wb-stage-title { font-weight: 600; }
.wb-stage-head select {
  font-family: var(--font); font-size: 12px;
  background: var(--bg); border: 1px solid var(--border); color: var(--fg);
  padding: 1px 4px; border-radius: 3px;
}
.wb-stage-sub { color: var(--fg-dim); font-size: 11px; min-height: 1.4em; }
.wb-stage textarea {
  font-family: var(--font); font-size: 12px; line-height: 1.5;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 6px 8px; resize: vertical; min-height: 120px; width: 100%;
}
.wb-stage textarea:focus { outline: none; border-color: var(--accent); }
.wb-note { color: var(--fg-dim); font-size: 12px; line-height: 1.5; padding: 6px 2px; flex: 1; }
.wb-note code { color: var(--accent); }
.wb-caps { display: flex; gap: 8px; font-size: 11px; color: var(--fg-dim); }
.wb-caps label { display: flex; gap: 3px; align-items: center; cursor: pointer; }

.wb-run {
  align-self: flex-start;
  font-family: var(--font); font-size: 12px;
  background: transparent; border: 1px solid var(--accent); color: var(--accent);
  padding: 2px 10px; border-radius: 3px; cursor: pointer;
}
.wb-run:hover { background: var(--accent); color: var(--bg); }
.wb-run:disabled { opacity: .45; cursor: default; background: transparent; color: var(--accent); }

/* ── Window + actions ───────────────────────────────────────────────────── */

.wb-window, .wb-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 6px 12px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.wb-window label { display: flex; align-items: center; gap: 5px; color: var(--fg-dim); }
.wb-window select, .wb-window input, .wb-actions select, .wb-actions input {
  font-family: var(--font); font-size: 12px;
  background: var(--bg); border: 1px solid var(--border); color: var(--fg);
  padding: 2px 5px; border-radius: 3px;
}
.wb-label { color: var(--fg); font-weight: 600; cursor: help; }
.wb-resolved { color: var(--echo); font-size: 12px; }
.wb-status { color: var(--fg-dim); font-size: 12px; }
.wb-status.error { color: var(--error); }

#register-area { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#register-area .wb-hint { color: var(--fg-dim); font-size: 11px; max-width: 70ch; }
#named-actions { display: flex; gap: 8px; }

/* ── Results ────────────────────────────────────────────────────────────── */

.wb-results { display: flex; flex-direction: column; border-top: 1px solid var(--border); flex: 1; min-height: 240px; }
.wb-tabs { display: flex; gap: 2px; padding: 4px 12px 0; background: var(--surface); flex-shrink: 0; }
.wb-tabs button {
  font-family: var(--font); font-size: 12px;
  background: transparent; border: 1px solid transparent; border-bottom: none;
  color: var(--fg-dim); padding: 4px 12px; cursor: pointer; border-radius: 3px 3px 0 0;
}
.wb-tabs button:hover { color: var(--fg); }
.wb-tabs button.active { color: var(--fg); background: var(--bg); border-color: var(--border); }
.wb-tabs button .wb-dot { color: var(--accent); margin-left: 4px; }
.wb-tab-body { flex: 1; overflow: auto; padding: 8px 12px; }
.wb-empty { color: var(--fg-dim); font-style: italic; font-size: 12px; }

.wb-call { margin-bottom: 10px; }
.wb-code {
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface); border: 1px solid var(--border); border-radius: 3px;
  padding: 6px 8px; font-size: 12px; margin: 4px 0 8px;
}
.wb-copy-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--fg-dim); font-size: 12px; }

.wb-gap td { color: var(--error); }

/* ── Views ──────────────────────────────────────────────────────────────── */

/* The editor's controls belong to the Transform view (badges rewrite their own classes, hence the ids). */
body[data-view="nav"] .tx-only, body[data-view="nav"] #identity, body[data-view="nav"] #shape { display: none !important; }

.wb-views { display: inline-flex; margin-left: 12px; gap: 2px; }
.wb-views button {
  font-family: var(--font); font-size: var(--sz); cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--fg-dim); padding: 2px 10px;
}
.wb-views button:first-child { border-radius: 3px 0 0 3px; }
.wb-views button:last-child  { border-radius: 0 3px 3px 0; }
.wb-views button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); }

/* ── Navigator (lab D22, workbench step 4) ───────────────────────────────── */

.nv { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 8px 12px; gap: 8px; }
.nv-crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; }
.nv-crumb { color: var(--fg-dim); text-decoration: none; }
.nv-crumb:hover { color: var(--fg); }
.nv-crumb.current { color: var(--fg); }
.nv-sep { color: var(--border); }
.nv-kind { color: var(--accent); font-size: 11px; text-transform: lowercase; }
.nv-head { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.nv-search { margin: 6px 0; }
.nv-search input { width: 100%; max-width: 640px; box-sizing: border-box; padding: 4px 8px; font: inherit; background: var(--bg-input, transparent); color: inherit; border: 1px solid var(--border); border-radius: 4px; }
.nv-hit { margin-left: 12px; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-title { font-size: 15px; }
.nv-title .nv-name { color: var(--fg); }
.nv-desc { color: var(--fg); margin-top: 4px; line-height: 1.45; max-width: 100ch; }
.nv-none, .nv-dim { color: var(--fg-dim); }
.nv-none { font-size: 12px; font-style: italic; }
.nv-body { flex: 1; display: grid; grid-template-columns: minmax(260px, 45%) 1fr; gap: 12px; min-height: 0; }
.nv-list-pane { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: 3px; }
.nv-tabs { display: flex; border-bottom: 1px solid var(--border); }
.nv-tab {
  font-family: var(--font); font-size: 12px; background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--fg-dim); padding: 4px 10px; cursor: pointer;
}
.nv-tab.active { color: var(--fg); border-bottom-color: var(--accent); }
.nv-list { list-style: none; margin: 0; padding: 2px 0; overflow-y: auto; flex: 1; outline: none; }
.nv-item { display: flex; gap: 8px; align-items: baseline; padding: 2px 8px; cursor: default; white-space: nowrap; }
.nv-item .nv-name { overflow: hidden; text-overflow: ellipsis; }
.nv-item.sel { background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.nv-list:focus .nv-item.sel { background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
.nv-item.dangling .nv-name { color: var(--fg-dim); text-decoration: line-through dotted; }
.nv-item.more { color: var(--fg-dim); }
.nv-rel { color: var(--echo); font-size: 11px; min-width: 8ch; }
.nv-flag { color: var(--fg-dim); font-size: 11px; margin-left: auto; }
.nv-empty { color: var(--fg-dim); padding: 6px 8px; font-style: italic; }
.nv-detail { overflow-y: auto; min-height: 0; padding: 2px 4px; }
.nv-section { color: var(--fg-dim); font-size: 12px; margin: 8px 0 4px; }
.nv-fields { border-collapse: collapse; margin-top: 6px; font-size: 12px; width: auto; }
.nv-fields td { padding: 2px 10px 2px 0; vertical-align: top; }
.nv-fields td:first-child { color: var(--fg-dim); white-space: nowrap; }
.nv-fields td.nv-id { color: var(--accent); }
.nv-fields .nv-desc { margin: 0; }
/* The record detail's per-value tools (lab D36): copy, add to / remove from the filter */
.nv-fields td.nv-tools { white-space: nowrap; padding-right: 0; }
.nv-icon { background: none; border: 1px solid transparent; color: var(--fg-dim); cursor: pointer; font: inherit; padding: 0 3px; border-radius: 3px; }
.nv-icon:hover { border-color: var(--fg-dim); color: var(--fg); }
.nv-icon.on { color: var(--accent); }
.nv-relsum { font-size: 12px; margin-top: 6px; }
.nv-keys { color: var(--fg-dim); font-size: 11px; border-top: 1px solid var(--border); padding-top: 4px; }
.nv-status { padding: 2px 12px; font-size: 12px; color: var(--fg-dim); min-height: 1.4em; }
.nv-status.error { color: var(--error); }

@media (max-width: 700px) {
  .nv { padding: 8px 16px; }
  .nv-body { grid-template-columns: 1fr; grid-template-rows: minmax(200px, 50%) 1fr; }
}

/* ── Data and history tables (review F22) ─────────────────────────────────
   A schema's rows: a plain table. An entry's history: the same table, framed in the history
   colour, one row per version, the values that changed marked. */
:root { --hist: #d7ba7d; }
@media (prefers-color-scheme: light) { :root { --hist: #9a6700; } }

.nv-body.wide { grid-template-columns: minmax(0, 1fr) minmax(240px, 30%); }
.nv-table { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
.nv-table caption { caption-side: top; text-align: left; padding: 4px 8px; color: var(--hist); font-size: 11px; }
.nv-table th {
  position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: normal;
  color: var(--fg-dim); padding: 3px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.nv-table td { padding: 2px 10px; white-space: nowrap; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; }
.nv-table .nv-id { color: var(--accent); }
.nv-table tr.sel td { background: var(--surface); }
.nv-table tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.nv-list:focus .nv-table tr.sel td { background: color-mix(in srgb, var(--accent) 22%, var(--bg)); }
.nv-table.history { outline: 1px solid var(--hist); outline-offset: -1px; background: color-mix(in srgb, var(--hist) 6%, var(--bg)); }
.nv-table.history th { background: color-mix(in srgb, var(--hist) 12%, var(--surface)); }
.nv-table.history tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--hist); }
.nv-table td.chg { color: var(--hist); font-weight: 600; }
.nv-table .nv-meta { color: var(--fg-dim); }
.nv-list-pane { overflow: hidden; }
.nv-list { overflow: auto; }
.nv-tab.hist.active { border-bottom-color: var(--hist); color: var(--hist); }

/* ── Filter, pages, editing (review) ──────────────────────────────────── */
.nv-filter { display: flex; gap: 6px; align-items: center; padding: 4px 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.nv-filter input {
  font-family: var(--font); font-size: 12px; background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: 3px; padding: 2px 6px; flex: 1; min-width: 10ch;
}
.nv-filter input:last-child { flex: 0 1 22ch; }
.nv-filter input:focus { outline: none; border-color: var(--accent); }
.nv-query { border-top: 1px solid var(--border); padding: 3px 8px; font-size: 11px; color: var(--fg-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-query code { color: var(--accent); }
.nv-table th.sortable { cursor: pointer; user-select: none; }
.nv-table th.sortable:hover { color: var(--fg); }
.nv-table tr.editing td { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.nv-table td.nv-edit { padding: 0 4px; }
.nv-table td.nv-edit input {
  font-family: var(--font); font-size: 12px; background: var(--bg); color: var(--fg);
  border: 1px solid var(--accent); border-radius: 2px; padding: 1px 4px; width: auto;
}
.nv-table td.locked { color: var(--fg-dim); cursor: not-allowed; }

/* Scrollbars: a page of rows fits, so tables don't scroll vertically; what remains is thin. */
.nv-list { overflow-y: hidden; overflow-x: auto; }
.nv-body:not(.wide) .nv-list { overflow-y: auto; }
.nv-list, .nv-detail { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.nv-list::-webkit-scrollbar, .nv-detail::-webkit-scrollbar { width: 6px; height: 6px; }
.nv-list::-webkit-scrollbar-thumb, .nv-detail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nv-list::-webkit-scrollbar-track, .nv-detail::-webkit-scrollbar-track { background: transparent; }
.nv-table tr.draft td { background: color-mix(in srgb, var(--hist) 16%, var(--bg)); }
.nv-table tr.draft td:first-child { box-shadow: inset 2px 0 0 var(--hist); color: var(--hist); }

/* ── A transformation's stages (input → computation → output), top to bottom ── */
.nv-body.stages .nv-list { overflow-y: auto; }
.nv-stage-window { padding: 4px 8px; font-size: 11px; color: var(--fg-dim); border-bottom: 1px solid var(--border); }
.nv-stage { padding: 6px 8px 8px; border-bottom: 1px solid var(--border); }
.nv-stage.sel { box-shadow: inset 2px 0 0 var(--accent); background: color-mix(in srgb, var(--surface) 60%, var(--bg)); }
.nv-stage-title { font-size: 12px; margin-bottom: 4px; }
.nv-stage-src {
  font-family: var(--font); font-size: 12px; margin: 0 0 6px; padding: 6px 8px; white-space: pre-wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 3px; color: var(--fg);
  max-height: 16em; overflow: auto; scrollbar-width: thin;
}
textarea.nv-stage-src { width: 100%; box-sizing: border-box; border-color: var(--accent); resize: vertical; max-height: none; outline: none; }
.nv-stage-schema { font-size: 11px; color: var(--accent); margin: 6px 0 2px; }
.nv-stage-data { overflow-x: auto; scrollbar-width: thin; }
.nv-stage-data .nv-table { min-width: 0; }
/* Draft vs published (D23) */
.nv-draft { color: var(--hist); font-weight: 600; }
.nv-stage-window.draft { background: color-mix(in srgb, var(--hist) 10%, var(--bg)); }
.nv-table tr.nv-diff td { color: var(--hist); }

/* n: a new one, drafted where it goes */
.nv-form { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 8px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--hist) 12%, var(--bg)); box-shadow: inset 2px 0 0 var(--hist); font-size: 12px; }
.nv-form label { display: flex; align-items: center; gap: 6px; color: var(--fg-dim); }
.nv-form input { font-family: var(--font); font-size: 12px; background: var(--bg); color: var(--fg); border: 1px solid var(--accent); border-radius: 2px; padding: 1px 4px; min-width: 14ch; }
.nv-form input::placeholder { color: var(--fg-dim); opacity: .7; }

/* Transformation views (review): queries on one line, data in per-schema tabs, the next run marked */
.nv-stage-q { display: block; font-family: var(--font); font-size: 12px; color: var(--accent); margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-code { max-height: 9em; }
.nv-dtabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 2px 0 4px; }
.nv-dtab { font-family: var(--font); font-size: 11px; background: transparent; color: var(--fg-dim); border: 1px solid var(--border); border-radius: 3px; padding: 1px 8px; cursor: pointer; }
.nv-dtab.active { color: var(--fg); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.nv-table tr.nv-next td { color: var(--hist); }
.nv-table tr.nv-next td:first-child { font-weight: 600; }
.nv-table td.nv-wrote { color: var(--accent); font-weight: 600; }
.nv-table tr.nv-dryrow td { color: var(--hist); }
.nv-dtab.empty { opacity: .45; border-style: dashed; }
.nv-defpart { display: grid; grid-template-columns: 3ch 1fr auto; gap: 6px; align-items: start; margin: 2px 0; }
.nv-defpart .nv-meta { font-size: 11px; padding-top: 2px; }
.nv-defpart .nv-stage-q { margin: 0; }
.nv-defpart .nv-stage-src { margin: 0; }
.nv-editor { min-width: 0; }
.nv-defpart .nv-stage-q { white-space: pre-wrap; overflow: visible; text-overflow: clip; word-break: break-word; }
.nv-defpart.sel { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); box-shadow: inset 2px 0 0 var(--accent); }
.nv-window { display: flex; gap: 12px; align-items: center; margin: 2px 0 6px; font-size: 12px; }
.nv-window label { display: flex; gap: 6px; align-items: center; color: var(--fg-dim); }
.nv-window input { font-family: var(--font); font-size: 12px; background: var(--bg); color: var(--fg); border: 1px solid var(--accent); border-radius: 2px; padding: 1px 4px; width: 27ch; }
.nv-window input { border-color: var(--border); }
.nv-window.editing input:focus { border-color: var(--accent); outline: none; }
.nv-window .nv-window-hint { visibility: hidden; }
.nv-window.editing .nv-window-hint { visibility: visible; }
.nv-stage .nv-window.sel, .nv-stage .nv-datablock.sel { box-shadow: inset 2px 0 0 var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.nv-stage .nv-window, .nv-stage .nv-datablock { padding-left: 4px; }
.nv-window-text { font-size: 12px; margin: 2px 0 4px; }
.nv-schemahead { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 12px; }
.nv-schemahead label { display: flex; gap: 6px; align-items: center; color: var(--fg-dim); }
.nv-schemahead input:not([type=checkbox]), .nv-schemahead select { font-family: var(--font); font-size: 12px; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 2px; padding: 1px 4px; }
.nv-schemahead input:focus, .nv-schemahead select:focus { border-color: var(--accent); outline: none; }
.nv-table td.nv-edit input[type=checkbox] { width: auto; accent-color: var(--accent); }
.nv-table tr.nv-addrow td { cursor: pointer; font-style: italic; }
.nv-table tr.nv-addrow:hover td { color: var(--fg); }
.nv-table tr.draft:not(.editing) td { background: color-mix(in srgb, var(--hist) 8%, var(--bg)); }
.nv-btn-create { font-family: var(--font); font-size: 11px; color: var(--hist); background: transparent; border: 1px solid var(--hist); border-radius: 3px; padding: 0 8px; cursor: pointer; margin-left: 6px; }
.nv-grid td.nv-edit input[type=text], .nv-grid select.nv-type, .nv-table select.nv-type {
  font-family: var(--font); font-size: 12px; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 2px; padding: 1px 4px; }
.nv-grid td.nv-edit input[type=text] { width: 100%; min-width: 10ch; box-sizing: border-box; }
.nv-grid td.nv-edit input:focus, .nv-table select.nv-type:focus { border-color: var(--accent); outline: none; }
.nv-grid tr.nv-newrow input[type=text] { border-style: dashed; }
.nv-grid tr.nv-newrow input[type=text]::placeholder { color: var(--fg-dim); font-style: italic; }
.nv-x { font-family: var(--font); background: transparent; color: var(--fg-dim); border: 0; cursor: pointer; font-size: 14px; }
.nv-x:hover { color: var(--error); }
.nv-body.scrollrows .nv-list { overflow-y: auto; }
.nv-query { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nv-query code { overflow: hidden; text-overflow: ellipsis; }
.nv-pager { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
.nv-pgbtn { font-family: var(--font); font-size: 12px; background: transparent; color: var(--fg); border: 1px solid var(--border); border-radius: 2px; padding: 0 6px; cursor: pointer; }
.nv-pgbtn:disabled { opacity: .35; cursor: default; }
.nv-pgin { font-family: var(--font); font-size: 11px; background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 2px; padding: 0 3px; text-align: right; }
.nv-pgin:focus { border-color: var(--accent); outline: none; }

/* A data block an edit in progress will change: being recomputed (lab D26 — previews are downstream only) */
.nv-stage .nv-datablock.pending { opacity: .45; position: relative; }
.nv-stage .nv-datablock.pending::after { content: 'previewing…'; position: absolute; top: 2px; right: 6px; font-size: 11px; color: var(--dim, #888); }

/* What's wrong with the output — fields its schema doesn't have, rows landing on one element */
.nv-output-issue { color: var(--error); padding: 4px 0 6px; font-size: 12px; }

/* A row asked about for deletion (d): y deletes, any other key keeps it */
.nv-table tr.to-delete td { text-decoration: line-through; color: var(--error); }

/* D: the debug window — every call, timed */
.nv-debug { position: fixed; right: 12px; bottom: 12px; width: min(960px, calc(100vw - 24px)); max-height: 40vh; overflow: auto;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border); border-radius: 6px; font-size: 11px; z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.nv-debug-head { position: sticky; top: 0; padding: 6px 8px; background: var(--surface); color: var(--fg-dim); border-bottom: 1px solid var(--border); }
.nv-debug table { width: 100%; border-collapse: collapse; }
.nv-debug th, .nv-debug td { padding: 2px 6px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.nv-debug td.call { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.nv-debug td.num { text-align: right; font-variant-numeric: tabular-nums; }
.nv-debug tr.running td { color: var(--accent); }
.nv-debug tr.slow td { color: #d29922; }
.nv-debug tr.bad td { color: var(--error); }
.nv-debug tr.cancelled td { color: var(--fg-dim); text-decoration: line-through; text-decoration-color: var(--border); }
.nv-debug tr.cancelled td:last-child { text-decoration: none; font-style: italic; }
/* Where an entry came from (lab D37) */
.nv-wherefrom { margin-top: 10px; }
.nv-link { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-decoration: none; }
.nv-link:hover { text-decoration: underline; }
.nv-changed { color: var(--accent); }
.nv-fedby { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; min-width: 0; }
.nv-fedby .nv-link { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.nv-fedby .nv-changed { padding-left: 12px; font-size: 0.92em; }
/* A remote (lab D38) */
.nv-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0; }
.nv-fresh-current { color: var(--fg); }
.nv-fresh-failing { color: var(--accent); }
.nv-fresh-never-pulled { color: var(--fg-dim); }
/* A transformation switched off (lab D41) */
.nv-paused { color: var(--fg-dim); border-left-color: var(--fg-dim); }
.nv-switch { margin: 4px 0 6px; }
.nv-stage-src.nv-whole { max-height: none; overflow: visible; }
