/* Engineering console theme: monospace data, sans-serif chrome, dark-first. */
:root {
  --bg: #0b0f14;
  --bg-grid: #0e131a;
  --surface: #121820;
  --surface2: #171f2a;
  --surface3: #1d2733;
  --text: #dde5ef;
  --text-strong: #f2f6fb;
  --muted: #7d8fa6;
  --faint: #58697e;
  --border: #232e3d;
  --border-strong: #2f3d4f;
  --accent: #58a6ff;
  --accent-dim: rgba(88, 166, 255, 0.14);
  --success: #46d3a0;
  --error: #ff6b76;
  --warning: #f0b849;
  --pending: #7d8fa6;
  --active: #4fc3f7;

  --radius: 6px;
  --radius-sm: 4px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-lg: 16px;
  --header-h: 52px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  font-feature-settings: "cv05" 1, "ss01" 1;
  background:
    linear-gradient(var(--bg-grid) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.mono, code, kbd, .col-name, .status-pill, .stamp {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "zero" 1;
}

/* Numbers line up column-to-column everywhere they carry meaning. */
.data-table td, .data-table th, .count, .chip strong, .metric-value {
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

::selection { background: var(--accent-dim); color: var(--text-strong); }

/* ---------- header ---------- */

.site-header {
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1500px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-id { display: flex; align-items: center; gap: 0.6rem; }

.logo {
  font-weight: 700;
  font-size: var(--fs-md);
  letter-spacing: 0.04em;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
}
.logo:hover { text-decoration: none; }
.logo-sub { color: var(--faint); font-weight: 500; text-transform: none; letter-spacing: 0; }

.logo-mark {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.badge {
  font-size: var(--fs-xs);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
}

.live-state { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.live-state[data-state="live"] .live-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.live-state[data-state="loading"] .live-dot { background: var(--active); animation: pulse 0.9s ease-in-out infinite; }
.live-state[data-state="error"] .live-dot { background: var(--error); box-shadow: 0 0 8px var(--error); }
.live-state[data-state="paused"] .live-dot { background: var(--warning); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.stamp { font-size: var(--fs-xs); color: var(--faint); min-width: 8ch; }

.auto-toggle { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; user-select: none; }
.auto-toggle input { accent-color: var(--accent); cursor: pointer; margin: 0; }

.interval-select,
.btn-refresh {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}

.btn-refresh {
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.7rem;
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  transition: background 0.12s ease;
}
.btn-refresh:hover { background: rgba(88, 166, 255, 0.24); }
.btn-refresh:disabled { opacity: 0.55; cursor: progress; }
.btn-refresh .refresh-icon { display: inline-block; font-size: 13px; line-height: 1; }
.btn-refresh.busy .refresh-icon { animation: spin 0.7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Thin progress line that fills toward the next auto-refresh. */
.refresh-bar {
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, transparent, var(--accent));
  transition: width 0.25s linear;
  opacity: 0.7;
}

.alert {
  max-width: 1500px;
  margin: 0.75rem auto -0.25rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--error);
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  background: rgba(255, 107, 118, 0.08);
  color: var(--error);
  font-family: var(--mono);
  font-size: var(--fs-sm);
  width: calc(100% - 2.5rem);
}

/* ---------- layout ---------- */

.container {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem 1.1rem;
}

.panel > h1 { font-size: 1.15rem; letter-spacing: -0.01em; margin: 0 0 0.2rem; color: var(--text-strong); }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.panel h2 {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-note { font-size: var(--fs-xs); color: var(--faint); font-family: var(--mono); }

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

code, .col-name { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- metrics ---------- */

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.metric {
  background: var(--surface);
  padding: 0.7rem 0.9rem;
}

.metric-label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.metric-value {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-strong);
  line-height: 1.2;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  font-family: var(--mono);
  font-size: var(--fs-xs);
}
.chip strong { font-weight: 700; }

/* ---------- waterfall ---------- */

/* One centred board: fixed label gutter, shared track, fixed total gutter, so
   every row starts and ends on the same axis no matter how long the names are. */
.waterfall {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.waterfall-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }

.swatch {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  border: 1px solid currentColor;
  display: inline-block;
}
.swatch.status-success { background: var(--success); color: var(--success); }
.swatch.status-active  { background: var(--active); color: var(--active); }
.swatch.status-pending { background: var(--pending); color: var(--pending); }
.swatch.status-error   { background: var(--error); color: var(--error); }
.swatch.status-review  { background: var(--warning); color: var(--warning); }
.swatch.status-neutral { background: var(--muted); color: var(--muted); }

.wf-row[data-statement="pl"] { margin-top: -0.18rem; }
.wf-row[data-statement="pl"] .wf-step { border-color: transparent; background: transparent; }

.wf-row {
  display: grid;
  grid-template-columns: 230px 1fr 84px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.22rem 0;
}

.wf-label { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }

.wf-step {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

.wf-statement {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
  margin-left: 0.35rem;
}

.wf-name {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wf-track {
  display: flex;
  height: 20px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--surface3);
  border: 1px solid var(--border);
}

.wf-seg { display: block; height: 100%; transition: width 0.35s ease; }
.wf-seg.status-success { background: var(--success); }
.wf-seg.status-active  { background: var(--active); }
.wf-seg.status-pending { background: var(--pending); }
.wf-seg.status-error   { background: var(--error); }
.wf-seg.status-review  { background: var(--warning); }
.wf-seg.status-neutral { background: var(--muted); }
.wf-seg + .wf-seg { border-left: 1px solid var(--surface); }

.wf-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-strong);
  text-align: right;
}

/* ---------- funnel ---------- */

.funnel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  align-items: stretch;
  gap: 0.6rem;
}

.funnel-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  transition: border-color 0.12s ease;
}
.funnel-card:hover { border-color: var(--border-strong); }

.funnel-card h3 {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.005em;
}

.funnel-card .col-name { display: block; margin-top: 0.1rem; word-break: break-all; }

.branch-tag {
  display: inline-block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.05rem 0.35rem;
  border-radius: 2px;
  color: var(--warning);
  border: 1px solid rgba(240, 184, 73, 0.35);
}

.status-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0.5rem 0 0;
  border-top: 1px dashed var(--border);
  max-height: 11.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  font-size: var(--fs-xs);
}

.status-list .count { font-family: var(--mono); font-weight: 700; color: var(--text-strong); flex-shrink: 0; }
.status-list .status-pill { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

.status-pill {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 3px;
  font-size: var(--fs-xs);
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-success { background: rgba(70, 211, 160, 0.12); color: var(--success); border-color: rgba(70, 211, 160, 0.3); }
.status-error   { background: rgba(255, 107, 118, 0.12); color: var(--error); border-color: rgba(255, 107, 118, 0.3); }
.status-pending { background: rgba(125, 143, 166, 0.14); color: var(--pending); border-color: rgba(125, 143, 166, 0.28); }
.status-active  { background: rgba(79, 195, 247, 0.12); color: var(--active); border-color: rgba(79, 195, 247, 0.3); }
.status-review  { background: rgba(240, 184, 73, 0.12); color: var(--warning); border-color: rgba(240, 184, 73, 0.3); }
.status-neutral { background: rgba(125, 143, 166, 0.1); color: var(--muted); border-color: var(--border); }
.status-none    { color: var(--faint); }

/* Freshly changed values flash once so live updates are visible. */
@keyframes flash { from { background-color: var(--accent-dim); } to { background-color: transparent; } }
.value-changed { animation: flash 1.1s ease-out; }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 62vh;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface3);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  border-bottom: 1px solid var(--border-strong);
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.4rem 0.65rem;
  border-bottom: 1px solid var(--border);
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.012); }
.data-table tbody tr:hover td { background: var(--accent-dim); }
.data-table td code { color: var(--text); }
.data-table .num { text-align: right; }

/* ---------- filters / pagination ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  margin-bottom: 0.7rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.filters input,
.filters select,
.filters button {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
}

.filters input { min-width: 240px; }
.filters input:focus,
.filters select:focus,
.interval-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.filters button {
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  background: var(--surface3);
  color: var(--text-strong);
}
.filters button:hover { border-color: var(--accent); color: var(--accent); }

.pagination {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.7rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--fs-xs);
}

.pagination button {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
}
.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- file detail ---------- */

.file-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.file-meta div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.file-meta dt { color: var(--faint); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.file-meta dd { margin: 0; font-family: var(--mono); font-size: var(--fs-sm); color: var(--text-strong); overflow-wrap: anywhere; }

.stepper { display: flex; flex-direction: column; gap: 0.4rem; }

.step-card {
  position: relative;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  background: var(--surface2);
}

.step-card.step-inactive { opacity: 0.4; }
.step-card.step-branch { border-left-color: var(--warning); }
.step-card.step-done { border-left-color: var(--success); }
.step-card.step-running { border-left-color: var(--active); }
.step-card.step-failed { border-left-color: var(--error); }

.step-header { display: flex; align-items: center; gap: 0.7rem; }

.step-num {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface3);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  flex-shrink: 0;
}

.step-header h3 { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--text-strong); }
.step-header > div { flex: 1; min-width: 0; }
.step-header code { display: block; word-break: break-all; }

.worker-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.3rem 1.25rem;
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: var(--fs-xs);
}

.worker-meta div { display: flex; flex-direction: column; }
.worker-meta dt { color: var(--faint); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.worker-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

.branch-connector {
  text-align: center;
  color: var(--warning);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.error-panel pre {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.9rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: var(--fs-sm);
  color: var(--error);
}

/* ---------- footer ---------- */

.site-footer {
  max-width: 1500px;
  width: 100%;
  margin: 0 auto;
  padding: 0.8rem 1.25rem 1.4rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  border-top: 1px solid var(--border);
}

kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0 0.25rem;
  background: var(--surface2);
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 760px) {
  .funnel-grid { grid-template-columns: 1fr; }
  .header-inner { align-items: flex-start; }
  .header-controls { width: 100%; justify-content: flex-start; }
  .filters input { min-width: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- combo statuses split per statement ---------- */

.funnel-card-wide { grid-column: span 2; }

.statement-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.statement-col h4 {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

.statement-col .status-list {
  margin-top: 0.3rem;
  padding-top: 0;
  border-top: none;
  max-height: none;
}

.combo-details { margin-top: 0.6rem; }

.combo-details summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}
.combo-details summary:hover { color: var(--accent); }
.combo-details .status-list { border-top: 1px dashed var(--border); max-height: 13rem; }

@media (max-width: 760px) {
  .funnel-card-wide { grid-column: span 1; }
  .statement-split { grid-template-columns: 1fr; }
}

/* ---------- worker card totals ---------- */

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.card-title { min-width: 0; }

.card-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  flex-shrink: 0;
}

.card-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}

.card-total-label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--faint);
}

/* ---------- file_meta board: statement split + page routing ---------- */

.split-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 0.75rem;
}

.split-worker {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem 0.8rem;
}

.split-worker h3 {
  margin: 0 0 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-strong);
}

.split-statements {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.split-head {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}

.split-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  padding: 0 0.25rem;
}

.split-col {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--faint);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.split-total {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-strong);
}

.split-statement .wf-track { height: 14px; }

.split-statement .status-list {
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  max-height: 9rem;
}

/* Routing is a destination, not an outcome, so it gets its own two colours. */
.route-cv { background: var(--accent); }
.route-adi { background: var(--warning); }
.swatch.route-cv { color: var(--accent); }
.swatch.route-adi { color: var(--warning); }

.status-pill.route-pill { color: var(--bg); font-weight: 700; }

.routing-bar-wrap { margin-bottom: 0.8rem; }

.routing-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.routing-track { height: 22px; }

.routing-metrics { margin-bottom: 0.8rem; }

.routing-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.9rem;
}

.routing-detail h4 {
  margin: 0 0 0.25rem;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
}

/* Keep each count next to its label instead of stranded at the panel edge. */
.routing-detail .status-list { border-top: none; padding-top: 0; max-height: none; max-width: 460px; }

@media (max-width: 760px) {
  .split-board { grid-template-columns: 1fr; }
  .split-statements { grid-template-columns: 1fr; }
}
