:root {
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --hairline: #e1e0d9;
  --line: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --good: #006300;
  --bad: #d03b3b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}

.brand {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.topbar nav { display: flex; gap: 4px; }

.topbar nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
}

.topbar nav a:hover { color: var(--ink); background: var(--border); }
.topbar nav a.active { color: var(--ink); font-weight: 600; }

.session { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.session .tenant-name, .session .user-email { color: var(--ink-2); font-size: 13px; }
.session select { padding: 4px 6px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink); }
.session .logout button { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface); color: var(--ink-2); cursor: pointer; }
.session .logout button:hover { color: var(--ink); background: var(--border); }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
main.wide { max-width: none; }

h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 28px 0 10px; }
h3 { font-size: 13px; margin: 0 0 10px; }

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.muted { color: var(--muted); }

a { color: var(--accent); }

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}

pre {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre-wrap;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}

.tile-link:hover { border-color: var(--accent); }

.tile-label {
  display: block;
  font-size: 12px;
  color: var(--ink-2);
}

.tile-value {
  font-size: 26px;
  font-weight: 600;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px 20px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
}

table.data th, table.data td {
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

table.data thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}

table.data thead th[aria-sort="ascending"]::after { content: " \25B2"; font-size: 9px; color: var(--muted); }
table.data thead th[aria-sort="descending"]::after { content: " \25BC"; font-size: 9px; color: var(--muted); }

table.data.fixed { table-layout: fixed; }
table.data.fixed td { overflow-wrap: break-word; }

table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody th { font-weight: 500; color: var(--ink-2); width: 220px; }

td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.status { white-space: nowrap; }

.status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--muted);
  vertical-align: baseline;
}

.status[data-status="running"]::before { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent); opacity: 1; }
  70% { box-shadow: 0 0 0 5px transparent; opacity: 0.6; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}
.status[data-status="succeeded"]::before { background: var(--good); }
.status[data-status="failed"]::before { background: var(--bad); }
.status[data-status="stopped"]::before { background: var(--muted); }
.status[data-status="confirmed"]::before { background: var(--good); }
.status[data-status="overturned"]::before { background: var(--bad); }
.status[data-status=""]::before { display: none; }

button.small { padding: 3px 8px; font-size: 12px; }
td.verdict-cell, td.label-cell, td.controls { white-space: nowrap; }

.search { display: flex; gap: 8px; margin-bottom: 16px; }

input[type="search"], input[type="text"], input[type="number"], select, textarea {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 6px 9px;
  font: inherit;
}

input[type="search"] { width: 320px; }
.input-narrow { width: 80px; }

textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.45;
}

button {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button:disabled { opacity: 0.45; cursor: default; }
button:disabled:hover { filter: none; }

.pager { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; }
.pager-status { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

tr.row-hidden { display: none; }

.pager { display: flex; gap: 14px; align-items: baseline; margin-top: 12px; }

.run-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.run-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.run-form label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }

#runs-table tbody tr[data-run-id] { cursor: pointer; }
#runs-table tbody tr[data-run-id]:hover td { background: var(--border); }

#run-log { min-height: 160px; max-height: 480px; overflow-y: auto; }

.feed {
  min-height: 200px;
  max-height: 520px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.error { color: var(--bad); }
.notice { color: var(--ink-2); }

#monitor-panel > h3, #monitor-panel > .page-head { margin-top: 30px; }
#monitor-panel > .page-head:first-child { margin-top: 0; }

ul.drift {
  list-style: none;
  margin: 12px 0;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 12.5px;
}

ul.drift li { margin: 2px 0; }
ul.drift li code { margin-right: 6px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.quick-form {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px 16px;
}

.quick-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 10px;
}

.form-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.form-message.ok { color: var(--good); }
.form-message.error { color: var(--bad); }

.file-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }

.file-tabs a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.file-tabs a:hover { color: var(--ink); background: var(--border); }
.file-tabs a.active { color: var(--ink); background: var(--surface); border-color: var(--hairline); font-weight: 600; }

.trajectory {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 16px 16px 10px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.traj-caption { font-size: 12px; color: var(--ink-2); margin-bottom: 14px; }

.traj-track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 640px;
}

.traj-node {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 0 4px;
}

.traj-node::before {
  content: "";
  position: absolute;
  top: 8px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--hairline);
  z-index: 0;
}

.traj-node:first-child::before { display: none; }

.traj-dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
}

.traj-num { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.traj-label { font-size: 11px; color: var(--ink-2); line-height: 1.2; }

.traj-node[data-state="past"] .traj-dot { background: var(--good); border-color: var(--good); }
.traj-node[data-state="past"]::before { background: var(--good); }
.traj-node[data-state="current"]::before { background: var(--good); }
.traj-node[data-state="current"] .traj-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--border); }
.traj-node[data-state="current"] .traj-num { color: var(--ink); }
.traj-node[data-state="current"] .traj-label { color: var(--ink); font-weight: 600; }

.traj-current { margin-bottom: 18px; }
.traj-current-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }

.traj-badge {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: var(--accent);
  border-radius: 6px;
  padding: 2px 8px;
}

.chip {
  display: inline-block;
  font-size: 12px;
  background: var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  margin: 0 4px 4px 0;
}

.chip-gap { background: transparent; border: 1px dashed var(--muted); color: var(--ink-2); }

.traj-offer {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 14px;
}

.traj-thesis { margin: 8px 0 0; color: var(--ink-2); }

.stage-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.stage-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }

.stage-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--border);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.onboard-chat { max-width: 720px; }
.chat-log { min-height: 320px; display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 12px; line-height: 1.4; white-space: pre-wrap; }
.chat-msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--hairline); color: var(--ink); }
.chat-msg.me { align-self: flex-end; background: var(--accent); color: #ffffff; }
.chat-input { display: flex; gap: 8px; margin-top: 8px; }
.chat-input input { flex: 1; padding: 10px; }
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 320px; padding: 24px; }
.login-card h1 { margin-top: 0; }
.login-card label { display: block; margin: 12px 0; }
.login-card input { width: 100%; padding: 8px; box-sizing: border-box; }
.login-alt { margin: 16px 0 0; font-size: 13px; color: var(--ink-2); }

.alerts-strip { margin: 16px 0 24px; }
.alerts-strip h2 { margin-bottom: 8px; }
.alert-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--hairline); border-left: 3px solid var(--bad); border-radius: 8px; background: var(--surface); }
.alert-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.alert-actions { display: flex; gap: 8px; flex-shrink: 0; }
.alert-actions button { padding: 6px 12px; font-size: 13px; cursor: pointer; }
.reason { font-size: 12px; line-height: 1.5; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }

/* --- Network graph: full-bleed dark viewport with floating glass panels --- */
.graph-page { position: fixed; inset: 52px 0 0 0; background: #0d0d0d; overflow: hidden; }
#graph-canvas { position: absolute; inset: 0; }
#graph-canvas canvas { display: block; outline: none; }
#graph-overlays { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.graph-hub-label {
  position: absolute;
  transform: translate(-50%, -150%);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #f4f4f0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 12px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
  text-align: center;
}
.graph-hub-label small { display: block; font-weight: 400; font-size: 10.5px; color: #b9c4d4; }

.graph-panel {
  position: absolute;
  z-index: 5;
  background: rgba(20, 22, 26, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  color: #e8e8e3;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.graph-controls {
  top: 16px; left: 16px; width: 250px;
  padding: 14px 15px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.graph-panel-head { font-size: 15px; font-weight: 600; color: #fff; }
.graph-search {
  width: 100% !important;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 7px 10px;
}
.graph-search::placeholder { color: #9a9a93; }
.graph-group { display: flex; flex-direction: column; gap: 7px; }
.graph-group-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #9a9a93; }
.graph-filters { display: flex; flex-direction: column; gap: 6px; }
.graph-toggle, .graph-filter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #dcdcd6; cursor: pointer; }
.graph-toggle input, .graph-filter input { accent-color: #3987e5; margin: 0; }
.graph-swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.graph-filter-count { margin-left: auto; font-size: 11px; color: #8f8f88; font-variant-numeric: tabular-nums; }
.graph-hint { font-size: 11px; color: #8f8f88; line-height: 1.4; }
.graph-slider { width: 100%; accent-color: #3987e5; }
.graph-actions { gap: 9px; }
.graph-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e8e8e3;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  padding: 6px 10px;
  font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.graph-btn:hover { background: rgba(255, 255, 255, 0.16); }
.graph-legend { display: flex; flex-direction: column; gap: 5px; margin-bottom: 4px; }
.graph-legend-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cfcfc8; }
.graph-legend-ramp { display: flex; gap: 3px; align-items: center; }
.graph-ramp-cell { width: 15px; height: 10px; border-radius: 2px; }
.graph-status { font-size: 11.5px; color: #8f8f88; }

.graph-detail {
  top: 16px; right: 16px; width: 300px;
  padding: 16px 17px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
}
.graph-detail-kind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #9a9a93; }
.graph-detail-title { font-size: 17px; font-weight: 600; color: #fff; margin: 3px 22px 12px 0; line-height: 1.25; }
.graph-detail-title a { color: #6da7ec; text-decoration: none; }
.graph-detail-title a:hover { text-decoration: underline; }
.graph-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; }
.graph-detail dt { color: #9a9a93; font-size: 12px; }
.graph-detail dd { margin: 0; color: #e4e4de; font-size: 12.5px; }
.graph-detail .gd-block { margin-top: 12px; }
.graph-detail .gd-block h4 { margin: 0 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: #9a9a93; font-weight: 600; }
.graph-detail .gd-block p { margin: 0; font-size: 12.5px; line-height: 1.5; color: #d6d6cf; }
.graph-detail .gd-close { position: absolute; top: 12px; right: 14px; background: none; border: none; color: #9a9a93; font-size: 20px; cursor: pointer; padding: 0; line-height: 1; }
.graph-detail .gd-close:hover { color: #fff; }
.graph-flag { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: #c98500; border-radius: 5px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }

.scene-tooltip { color: #fff !important; font: 13px/1.4 system-ui, -apple-system, sans-serif !important; }
.gtip { background: rgba(18, 20, 24, 0.92); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; padding: 7px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }
.gtip b { display: block; font-size: 13px; }
.gtip span { display: block; font-size: 11.5px; color: #b9b9b2; }

/* --- Portfolio dashboard: stage x archetype heatmap + distributions --- */
.heatmap-wrap { overflow-x: auto; margin-bottom: 6px; }
table.heatmap { border-collapse: separate; border-spacing: 3px; width: auto; }
table.heatmap thead th { font-weight: 500; color: var(--ink-2); text-align: center; padding: 4px 8px 6px; vertical-align: bottom; border: none; }
table.heatmap thead th:first-child { text-align: left; }
table.heatmap .hcol small { display: block; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 400; }
table.heatmap th.harch { text-align: left; font-weight: 500; color: var(--ink); padding-right: 12px; white-space: nowrap; border: none; }
table.heatmap td.hcell {
  text-align: center;
  min-width: 48px;
  padding: 11px 8px;
  border: none;
  border-radius: 6px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
table.heatmap td.hcell.dark { color: #ffffff; }
table.heatmap td.htotal { text-align: right; padding-left: 12px; font-weight: 600; border: none; font-variant-numeric: tabular-nums; }
.heatmap-legend { margin: 4px 0 24px; font-size: 12px; }

.dash-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; margin-top: 8px; }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 64px 1fr 40px; align-items: center; gap: 10px; }
.bar-label { font-size: 12px; color: var(--ink-2); }
.bar-track { background: var(--border); border-radius: 5px; height: 16px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; }
.bar-count { font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

.partition {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 3px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin: 12px 0; }
.chart { position: relative; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.chart figcaption { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.chart canvas { width: 100%; height: 170px; display: block; }
.chart-legend { margin-top: 4px; font-size: 11px; color: var(--muted); }
.legend-item { margin-right: 8px; white-space: nowrap; }
.legend-item i { display: inline-block; width: 8px; height: 8px; margin-right: 3px; border-radius: 1px; }
.chart-tip { position: absolute; z-index: 6; pointer-events: none; display: flex; flex-direction: column; gap: 1px; padding: 4px 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 2px 6px var(--border); font-size: 11px; color: var(--ink); white-space: nowrap; }
.chart-tip-head { display: flex; align-items: center; gap: 5px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 1px; }
.chart-tip-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-tip-at { color: var(--muted); font-size: 10px; }
.chart-dot { position: absolute; z-index: 6; width: 7px; height: 7px; border-radius: 50%; border: 2px solid var(--surface); transform: translate(-50%, -50%); pointer-events: none; }

.signal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0; }
.signal-box { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.signal-name { font-size: 15px; font-weight: 600; color: var(--ink); }

/* Flow: fixed-coordinate block diagram. Colour is never the only channel - every node also
   carries its state as a text value and a hover title. */
.rail { display: flex; flex-wrap: wrap; gap: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; }
.rail-item { display: flex; flex-direction: column; gap: 2px; }
.rail-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rail-value { font-variant-numeric: tabular-nums; }
.flow-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
#flow-canvas { width: 100%; min-width: 1000px; display: block; }

.wire { fill: none; stroke: var(--line); stroke-width: 1.5; }
.wire-produce { stroke-dasharray: 4 3; }
.wire-consume { stroke: var(--accent); }
.wire-persist { stroke: var(--line); }
.wire-bypass { stroke-dasharray: 2 4; }
.wire-unrouted { stroke: var(--muted); opacity: 0.35; }
.wire-lagging { stroke: var(--warn, #d98b2b); stroke-width: 2.5; }
.wire-label { font: 10px ui-monospace, monospace; fill: var(--muted); text-anchor: middle; }

.node { cursor: pointer; }
.node rect { fill: var(--bg, #fff); stroke: var(--line); stroke-width: 1; }
.node-label { font: 12px ui-monospace, monospace; fill: var(--fg, #1c2126); }
.node-value { font: 11px ui-monospace, monospace; fill: var(--muted); text-anchor: end; }
.node[data-state="working"] rect { stroke: var(--accent); stroke-width: 2; }
.node[data-state="failing"] rect { stroke: var(--bad, #b5563f); stroke-width: 2; }
.node[data-state="unconsumed"] rect { stroke: var(--bad, #b5563f); stroke-dasharray: 3 2; }
.node[data-state="unrouted"] rect { stroke: var(--muted); stroke-dasharray: 3 2; opacity: 0.55; }
.node[data-state="unrouted"] .node-label { fill: var(--muted); }
.node[data-state="disabled"] rect { stroke: var(--muted); opacity: 0.55; }
.node-sink rect { fill: var(--line); }

.flow-detail { margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; }

#bus-topics tr[data-topic] { cursor: pointer; }
#bus-topics tr[data-topic]:hover td { background: var(--border); }
#bus-topics tr.active td { background: var(--border); }
#bus-messages tr[data-ref] { cursor: pointer; }
#bus-messages tr[data-ref]:hover td { background: var(--border); }
#bus-messages tr.detail pre { margin: 0; }
