/* Blink Visualizer styles.
 * Every rule is scoped under .bv-app so the visualizer can live inside another page (Blazor / MudBlazor)
 * without leaking styles into it or picking up its global styles. Nothing targets html or body.
 * The look follows the host: Material Design 2 surfaces, flat white content, navy primary, a dark code viewer.
 * Colours are CSS variables on .bv-app; the host can override any of them (e.g. --primary).
 * Theme is chosen with data-theme="light" | "dark" | "auto" on the .bv-app element. */
.bv-app {
  height: 100%;
  --font: Consolas, monospace;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --surface-subtle: #F5F5F5;
  --border: rgba(0, 0, 0, .12);
  --border-strong: rgba(0, 0, 0, .42);
  --text: rgba(0, 0, 0, .87);
  --text-2: rgba(0, 0, 0, .60);
  --title: rgba(0, 0, 0, .87);
  --heading: #0A4A8E;
  --primary: #0A4A8E;
  --primary-fill: #0A4A8E;
  --primary-fill-hover: #083B72;
  --tint: rgba(10, 74, 142, .10);
  --hover: rgba(0, 0, 0, .04);
  --sky: #97CAEB;
  --req: #0A4A8E;
  --res: #2196F3;
  --positive: #2E7D32;
  --positive-fill: #00C853;
  --warning: #E65100;
  --critical: #D32F2F;
  --mark: rgba(255, 193, 7, .45);
  --code-bg: #1E1E1E;
  --code-text: #D4D4D4;
  --code-dim: #858585;
  --code-head: #252526;
  --code-hover: #2A2D2E;
  --code-line: #2B2B2B;
  --code-err: #F48771;
  --shadow-1: 0 2px 1px -1px rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .14), 0 1px 3px 0 rgba(0, 0, 0, .12);
  --shadow-2: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12);
  --shadow-3: 0 8px 10px -5px rgba(0, 0, 0, .2), 0 16px 24px 2px rgba(0, 0, 0, .14), 0 6px 30px 5px rgba(0, 0, 0, .12);
  --shadow-4: 0 11px 15px -7px rgba(0, 0, 0, .2), 0 24px 38px 3px rgba(0, 0, 0, .14), 0 9px 46px 8px rgba(0, 0, 0, .12);
  --scrim: rgba(0, 0, 0, .5);
  --glow: rgba(10, 74, 142, .30);
  --focus: 0 0 0 2px rgba(10, 74, 142, .45);
  color-scheme: light;
}
.bv-app[data-theme="dark"] {
  --bg: #32333D;
  --surface: #373740;
  --surface-raised: #3E3E4A;
  --surface-subtle: #2D2D36;
  --border: rgba(255, 255, 255, .12);
  --border-strong: rgba(255, 255, 255, .42);
  --text: #D4D3DC;
  --text-2: rgba(255, 255, 255, .60);
  --title: #E6E5EC;
  --heading: #6AAEF0;
  --primary: #6AAEF0;
  --primary-fill: #1C5A9E;
  --primary-fill-hover: #2468B0;
  --tint: rgba(106, 174, 240, .16);
  --hover: rgba(255, 255, 255, .06);
  --req: #6AAEF0;
  --res: #90CAF9;
  --positive: #66BB6A;
  --positive-fill: #00C853;
  --warning: #FFA726;
  --critical: #EF5350;
  --mark: rgba(255, 193, 7, .35);
  --shadow-1: 0 2px 1px -1px rgba(0, 0, 0, .4), 0 1px 1px 0 rgba(0, 0, 0, .28), 0 1px 3px 0 rgba(0, 0, 0, .24);
  --shadow-2: 0 3px 1px -2px rgba(0, 0, 0, .4), 0 2px 2px 0 rgba(0, 0, 0, .28), 0 1px 5px 0 rgba(0, 0, 0, .24);
  --shadow-3: 0 8px 10px -5px rgba(0, 0, 0, .4), 0 16px 24px 2px rgba(0, 0, 0, .28), 0 6px 30px 5px rgba(0, 0, 0, .24);
  --shadow-4: 0 11px 15px -7px rgba(0, 0, 0, .4), 0 24px 38px 3px rgba(0, 0, 0, .28), 0 9px 46px 8px rgba(0, 0, 0, .24);
  --scrim: rgba(0, 0, 0, .6);
  --glow: rgba(106, 174, 240, .40);
  --focus: 0 0 0 2px rgba(106, 174, 240, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  .bv-app[data-theme="auto"] {
    --bg: #32333D;
    --surface: #373740;
    --surface-raised: #3E3E4A;
    --surface-subtle: #2D2D36;
    --border: rgba(255, 255, 255, .12);
    --border-strong: rgba(255, 255, 255, .42);
    --text: #D4D3DC;
    --text-2: rgba(255, 255, 255, .60);
    --title: #E6E5EC;
    --heading: #6AAEF0;
    --primary: #6AAEF0;
    --primary-fill: #1C5A9E;
    --primary-fill-hover: #2468B0;
    --tint: rgba(106, 174, 240, .16);
    --hover: rgba(255, 255, 255, .06);
    --req: #6AAEF0;
    --res: #90CAF9;
    --positive: #66BB6A;
    --positive-fill: #00C853;
    --warning: #FFA726;
    --critical: #EF5350;
    --mark: rgba(255, 193, 7, .35);
    --shadow-1: 0 2px 1px -1px rgba(0, 0, 0, .4), 0 1px 1px 0 rgba(0, 0, 0, .28), 0 1px 3px 0 rgba(0, 0, 0, .24);
    --shadow-2: 0 3px 1px -2px rgba(0, 0, 0, .4), 0 2px 2px 0 rgba(0, 0, 0, .28), 0 1px 5px 0 rgba(0, 0, 0, .24);
    --shadow-3: 0 8px 10px -5px rgba(0, 0, 0, .4), 0 16px 24px 2px rgba(0, 0, 0, .28), 0 6px 30px 5px rgba(0, 0, 0, .24);
    --shadow-4: 0 11px 15px -7px rgba(0, 0, 0, .4), 0 24px 38px 3px rgba(0, 0, 0, .28), 0 9px 46px 8px rgba(0, 0, 0, .24);
    --scrim: rgba(0, 0, 0, .6);
    --glow: rgba(106, 174, 240, .40);
    --focus: 0 0 0 2px rgba(106, 174, 240, .55);
    color-scheme: dark;
  }
}
.bv-app {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 11.2px; line-height: 1.5;
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  box-sizing: border-box;
}
.bv-app *,
.bv-app *::before,
.bv-app *::after { box-sizing: border-box; }
.bv-app h1,
.bv-app h2,
.bv-app h3 { margin: 0; color: var(--title); font-weight: 500; }
.bv-app p { margin: 0; }
.bv-app button { font-family: inherit; text-transform: none; }
.bv-app .muted { color: var(--text-2); font-size: 11px; line-height: 16px; }
.bv-app .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bv-app [hidden] { display: none !important; }
.bv-app :focus-visible { outline: none; box-shadow: var(--focus); }
.bv-app mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
/* Header */
.bv-app .topbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  min-height: 48px; padding: 4px 16px;
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.bv-app .brand { font-size: 18px; line-height: 28px; letter-spacing: .01em; font-weight: 400; }
/* Inputs: Material "standard" variant (underline only) */
.bv-app input[type="search"],
.bv-app input[type="date"],
.bv-app select {
  width: 100%; min-height: 32px; padding: 4px 2px;
  background: transparent; color: var(--text);
  border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; font: inherit;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.bv-app input[type="search"]::placeholder { color: var(--text-2); }
.bv-app input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.bv-app input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
.bv-app input:hover,
.bv-app select:hover { border-bottom-color: var(--text); }
.bv-app input:focus-visible,
.bv-app select:focus-visible { box-shadow: 0 1px 0 0 var(--primary); border-bottom-color: var(--primary); }
.bv-app select { width: auto; }
.bv-app textarea {
  width: 100%; padding: 8px 12px; resize: vertical;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--border-strong); border-radius: 4px;
  font-family: var(--font); font-size: 11.2px; line-height: 1.5;
}
.bv-app textarea::placeholder { color: var(--code-dim); }
.bv-app textarea:focus-visible { border-color: var(--primary); }
/* Buttons: Material 2 (uppercase, flat or raised) */
.bv-app .btn {
  min-height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid transparent;
  font: 500 11.2px/1.75 var(--font); letter-spacing: .03em; text-transform: uppercase; cursor: pointer;
  transition: background-color 120ms ease-out, box-shadow 120ms ease-out, border-color 120ms ease-out;
}
.bv-app .btn-primary { background: var(--primary-fill); color: #fff; box-shadow: var(--shadow-2); }
.bv-app .btn-primary:hover { background: var(--primary-fill-hover); }
.bv-app .btn-secondary { background: transparent; border-color: color-mix(in srgb, var(--primary) 50%, transparent); color: var(--primary); }
.bv-app .btn-secondary:hover:not(:disabled) { background: var(--tint); border-color: var(--primary); }
.bv-app .btn-ghost { background: transparent; color: var(--primary); }
.bv-app .btn-ghost:hover { background: var(--tint); }
.bv-app .btn:disabled { background: transparent; color: var(--text-2); opacity: .5; border-color: var(--border); box-shadow: none; cursor: not-allowed; }
.bv-app .btn-primary:disabled { background: var(--border); border-color: transparent; }
/* Header actions: [search] [load log] [theme] */
.bv-app .topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 1 1 auto; justify-content: flex-end; min-width: 0; }
.bv-app .search-wrap { flex: 1 1 240px; min-width: 0; max-width: 560px; }
.bv-app .topbar-actions .search-wrap { flex: 0 1 320px; }
.bv-app .icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; padding: 0;
  background: transparent; color: var(--text-2); border: 0; border-radius: 50%; cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.bv-app .icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.bv-app .icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.bv-app .icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bv-app .icon-group { display: inline-flex; flex: 0 0 auto; gap: 2px; }
.bv-app .icon-group .icon-btn { width: 32px; height: 32px; }
.bv-app .icon-group .icon-btn svg { width: 18px; height: 18px; }
.bv-app .icon-group .icon-btn[aria-checked="true"] { background: var(--tint); color: var(--primary); }
@media (max-width: 640px) {
  .bv-app .topbar-actions { flex-basis: 100%; }
  .bv-app .topbar-actions .search-wrap { flex: 1 1 0; }
}
/* Load log dialog (Material dialog: elevation 24, 4px radius) */
.bv-app .dialog {
  width: min(640px, calc(100vw - 32px)); padding: 0; margin: auto;
  background: var(--surface-raised); color: var(--text);
  border: 0; border-radius: 4px; box-shadow: var(--shadow-4);
}
.bv-app .dialog::backdrop { background: rgba(0, 0, 0, .5); }
.bv-app .dialog-form { display: grid; gap: 12px; padding: 16px 24px 8px; }
.bv-app .dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bv-app .dialog-head h2 { font-size: 16px; line-height: 24px; }
.bv-app .dialog-head .btn { padding: 0 12px; }
.bv-app .dialog textarea { min-height: 220px; }
.bv-app .dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.bv-app .dialog-actions .muted { margin-right: auto; }
/* Layout: sidebar and content scroll independently inside whatever height the host gives */
.bv-app .layout { flex: 1 1 auto; min-height: 0; display: block; overflow-y: auto; }
@media (min-width: 960px) {
  .bv-app .layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; }
  .bv-app .layout:not(:has(.sidebar)), .bv-app:not(:has(.sidebar)) .layout { grid-template-columns: minmax(0, 1fr); }
  .bv-app .stage { overflow-y: auto; }
}
.bv-app .sidebar {
  display: flex; flex-direction: column; min-height: 0; max-height: 60vh;
  background: var(--bg); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); overflow: hidden;
}
@media (min-width: 960px) {
  .bv-app .sidebar { border-bottom: 0; max-height: none; }
}
.bv-app .side-tools { display: grid; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.bv-app .group-toggle { display: flex; gap: 8px; }
.bv-app .gpill {
  min-height: 22px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 11px/16px var(--font); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  transition: background-color 120ms, color 120ms;
}
.bv-app .gpill-date { --c: var(--primary); }
.bv-app .gpill-machine { --c: var(--positive); }
.bv-app .gpill-date[aria-pressed="true"] { background: var(--primary-fill); color: #fff; }
.bv-app .gpill-machine[aria-pressed="true"] { background: var(--positive-fill); color: #fff; }
.bv-app .range-title { display: block; margin-bottom: 2px; }
.bv-app .range-row { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.bv-app .range-row input[type="date"] { flex: 1 1 0; min-width: 0; width: auto; }
.bv-app .tree { flex: 1 1 auto; overflow-y: auto; padding: 4px 0 12px; min-height: 0; }
.bv-app .tree-empty { padding: 12px 16px; }
.bv-app .tree-list { list-style: none; margin: 0; padding: 0; }
.bv-app .tree-item { margin: 0; }
.bv-app .tree-row {
  display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 4px 12px;
  background: transparent; border: 0; border-radius: 0; cursor: pointer;
  color: var(--text); font: inherit; text-align: left;
  transition: background-color 120ms ease-out;
}
.bv-app .tree-row:hover { background: var(--hover); }
.bv-app .tree-row.is-selected { background: var(--tint); color: var(--primary); }
.bv-app .tree-l2 { padding-left: 28px; }
.bv-app .tree-l3 { padding-left: 52px; color: var(--text-2); }
.bv-app .tree-l3.is-selected { color: var(--primary); font-weight: 500; }
.bv-app .tree-chev { flex: 0 0 16px; width: 16px; height: 16px; display: grid; place-items: center; color: var(--text-2); transition: transform 180ms cubic-bezier(.2, 0, 0, 1); }
.bv-app .tree-chev svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bv-app .tree-item.is-open > .tree-row .tree-chev { transform: rotate(90deg); }
.bv-app .tree-icon { flex: 0 0 18px; width: 18px; height: 18px; color: var(--text-2); display: grid; place-items: center; }
.bv-app .tree-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bv-app .tree-row.is-selected .tree-icon { color: var(--primary); }
.bv-app .tree-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-app .tree-row .badge { flex: 0 0 auto; }
.bv-app .stage { min-width: 0; display: grid; gap: 0; align-content: start; padding: 16px; }
@media (min-width: 960px) {
  .bv-app .stage { padding: 0; }
}
.bv-app .stage > div { display: grid; gap: 0; }
/* Tabs (Material underline tabs) */
.bv-app .segmented { display: flex; flex-wrap: nowrap; border-bottom: 1px solid var(--border); overflow-x: auto; }
.bv-app .segmented button {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; min-height: 40px; padding: 0 16px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent;
  color: var(--text-2); font: 500 11.2px/16px var(--font); cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.bv-app .segmented button:hover { background: var(--hover); }
.bv-app .segmented button[aria-pressed="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.bv-app .badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 16px; padding: 0 5px; border-radius: 999px;
  font-size: 10px; line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--badge, var(--text-2)); background: color-mix(in srgb, var(--badge, var(--text-2)) 16%, transparent);
}
.bv-app .badge-all { --badge: var(--primary); }
.bv-app .badge-failed { --badge: var(--critical); }
.bv-app .badge-incomplete { --badge: var(--warning); }
.bv-app .badge-success { --badge: var(--positive); }
.bv-app .badge.is-zero { opacity: .5; }
.bv-app .stage > .strip { display: grid; gap: 0; }
.bv-app .strip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap; padding: 0 10px; height: 35px; overflow: hidden; border-bottom: 1px solid rgba(0, 0, 0, 0.11764705882352941);}
.bv-app .strip-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; min-width: 0; }
.bv-app .strip-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; margin-left: auto; }
.bv-app .strip-head .segmented { flex: 0 1 auto; min-width: 0; }
.bv-app .chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 16px; cursor: pointer;
  background: var(--tint); color: var(--primary); border: 0;
  font: 500 11px/16px var(--font); white-space: pre;
}
.bv-app .chip:hover { background: color-mix(in srgb, var(--primary) 20%, transparent); }
/* Pills (Material chips, small) */
.bv-app .pill {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; margin-left: 5px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  background: color-mix(in srgb, currentColor 14%, transparent);
}
.bv-app .pill-success { color: var(--positive); }
.bv-app .pill-failed { color: var(--critical); }
.bv-app .pill-incomplete { color: var(--warning); }
.bv-app .pill-info { color: var(--primary); }
/* Cards (Material paper, elevation 1) */
.bv-app .card { min-width: 0; }
.bv-app .section-title { font-size: 14px; line-height: 22px; margin-bottom: 12px; }
.bv-app .nav { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.bv-app .counter { font-weight: 500; margin-right: 8px; }
.bv-app .summary { display: grid; gap: 0; min-width: 0; }
.bv-app .summary-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bv-app .summary-head h2 { font-size: 18px; line-height: 28px; }
.bv-app .facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding-bottom: 10px; }
.bv-app .facts div { min-width: 0; }
.bv-app .facts dt { font-size: 10px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.bv-app .facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.bv-app .issues { margin: 0; padding: 8px 12px; border-left: 4px solid var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); border-radius: 0 4px 4px 0; list-style: none; }
.bv-app .issues.is-failed { border-left-color: var(--critical); background: color-mix(in srgb, var(--critical) 10%, var(--surface)); }
.bv-app .empty { text-align: center; padding: 48px 16px; }
.bv-app .empty p { color: var(--text-2); margin-top: 8px; }
/* Flow */
.bv-app .flow-card { overflow: hidden; position: relative; min-width: 0; }
.bv-app .flow-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; width: 100%; }
.bv-app .flow-head .section-title { margin: 0; }
.bv-app .flow-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bv-app .legend { display: flex; gap: 16px; flex-wrap: wrap; }
.bv-app .legend span { display: inline-flex; align-items: center; }
.bv-app .legend i { display: inline-block; width: 16px; height: 0; border-top: 2px dashed var(--req); margin-right: 6px; }
.bv-app .legend i.res { border-top-color: var(--res); }
.bv-app .legend i.err { border-top: 2px solid var(--critical); }
.bv-app .flow-stage { border-radius: 4px; padding: 20px 16px 16px;
  background-image: radial-gradient(color-mix(in srgb, var(--text-2) 30%, transparent) 1px, transparent 1px);
  background-size: 20px 20px; background-color: var(--surface-subtle);
  border: 1px solid var(--border);
}
.bv-app .flow-wrap { container-type: inline-size; }
.bv-app .flow-rows { display: grid; gap: 20px; max-width: 1040px; }
.bv-app .flow-row-title { font-size: 10px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin-bottom: 12px; }
.bv-app .flow-row-auth .link { flex: 0 1 260px; }
.bv-app .flow-row-auth .flow { justify-content: flex-start; }
.bv-app .flow { display: flex; align-items: stretch; justify-content: space-between; }
.bv-app .node {
  flex: 0 0 auto; width: 132px; min-height: 124px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  font: inherit; cursor: pointer; align-self: center; position: relative;
  box-shadow: var(--shadow-2);
  transition: box-shadow 160ms ease-out, border-color 160ms ease-out, background-color 160ms ease-out, transform 160ms ease-out;
}
.bv-app .node:hover { transform: translateY(-2px); box-shadow: var(--shadow-3); }
.bv-app .node.is-endpoint { border-style: dashed; border-color: var(--border-strong); }
.bv-app .node-icon {
  width: 40px; height: 40px; border-radius: 50%; margin-bottom: 6px;
  display: grid; place-items: center; color: var(--nc, var(--primary));
  background: color-mix(in srgb, var(--nc, var(--primary)) 14%, var(--surface));
  transition: background-color 160ms, color 160ms;
}
.bv-app .node-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bv-app .node { --nc: var(--primary); }
/* One colour per API node, from the theme palette */
.bv-app .node[data-node="scdm_auth"] { --nc: var(--warning); }
.bv-app .node[data-node="scdm"] { --nc: var(--primary); }
.bv-app .node[data-node="core"] { --nc: var(--res); }
.bv-app .node[data-node="bank_api"] { --nc: var(--positive); }
.bv-app .node[data-node="scdm_auth"], .bv-app .node[data-node="scdm"], .bv-app .node[data-node="core"], .bv-app .node[data-node="bank_api"] { border-top: 3px solid var(--nc); }
.bv-app .node-name { font-weight: 500; color: var(--nc); font-size: 12px; line-height: 18px; }
.bv-app .node-sub { font-size: 10px; line-height: 14px; color: var(--text-2); }
.bv-app .node-count { margin-top: 6px; font-size: 10px; line-height: 16px; padding: 0 8px; border-radius: 8px; background: var(--hover); color: var(--text-2); }
.bv-app .node.is-empty { opacity: .55; box-shadow: none; }
.bv-app .node.is-active { border-color: var(--nc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc) 30%, transparent), 0 0 24px color-mix(in srgb, var(--nc) 30%, transparent); background: color-mix(in srgb, var(--nc) 10%, var(--surface)); }
.bv-app .node.is-active .node-icon { background: var(--nc); color: #fff; }
.bv-app .node.is-match { border-color: #FFC107; box-shadow: 0 0 0 3px var(--mark); }
.bv-app .node.is-failed { border-color: var(--critical); border-style: solid; box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 30%, transparent); }
.bv-app .node.is-failed .node-name,
.bv-app .node.is-failed .node-icon { color: var(--critical); }
.bv-app .node.is-failed .node-icon { background: color-mix(in srgb, var(--critical) 12%, var(--surface)); }
.bv-app .node-flag { position: absolute; top: -10px; right: 8px; padding: 0 8px; border-radius: 10px; font-size: 10px; line-height: 18px; font-weight: 500; background: var(--critical); color: #fff; }
.bv-app .link { flex: 1 1 64px; min-width: 64px; max-width: 100px; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 0 6px; align-self: center; }
.bv-app .lane {
  --lane-color: var(--req);
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  align-items: stretch;
  min-height: 40px; padding: 2px 0; background: transparent; border: 0; border-radius: 4px;
  color: var(--text-2); font: inherit; cursor: pointer;
  transition: background-color 120ms;
}
.bv-app .lane:hover { background: color-mix(in srgb, var(--lane-color) 8%, transparent); }
.bv-app .lane.res { --lane-color: var(--res); }
.bv-app .lane-label { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 10px; line-height: 16px; white-space: nowrap; width: 100%; }
.bv-app .lane-step {
  display: inline-grid; place-items: center; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  font-size: 10px; font-weight: 500; background: var(--lane-color); color: #fff;
}
.bv-app .lane-line { position: relative; display: block; height: 8px; margin: 0 6px; align-self: stretch; width: calc(100% - 12px); }
.bv-app .lane-line::before {
  content: ""; position: absolute; left: 0; right: 8px; top: 3px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--lane-color) 0 6px, transparent 6px 12px);
  background-size: 12px 2px;
}
.bv-app .lane-line::after { content: ""; position: absolute; top: 0; border: 4px solid transparent; }
.bv-app .lane.req .lane-line::after { right: 0; border-left: 7px solid var(--lane-color); border-right: 0; }
.bv-app .lane.res .lane-line::after { left: 0; border-right: 7px solid var(--lane-color); border-left: 0; }
.bv-app .lane.res .lane-line::before { left: 8px; right: 0; }
.bv-app .packet {
  position: absolute; top: 0; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--lane-color); box-shadow: 0 0 10px 3px var(--lane-color); opacity: 0; pointer-events: none;
}
.bv-app .lane.is-empty { --lane-color: var(--border-strong); opacity: .5; }
.bv-app .lane.is-empty .lane-line::before { background: repeating-linear-gradient(90deg, var(--lane-color) 0 2px, transparent 2px 8px); }
.bv-app .lane.is-empty .lane-step { display: none; }
.bv-app .lane.is-failed { --lane-color: var(--critical); }
.bv-app .lane.is-failed .lane-line::before { background: var(--lane-color); }
.bv-app .lane.is-match .lane-label { color: var(--text); font-weight: 500; background: var(--mark); border-radius: 4px; }
.bv-app .lane.is-active { color: var(--text); }
.bv-app .lane.is-active:not(.is-empty) .lane-line::before { animation: bv-flow-fwd 450ms linear infinite; filter: drop-shadow(0 0 3px var(--lane-color)); }
.bv-app .lane.res.is-active:not(.is-empty) .lane-line::before { animation-name: bv-flow-back; }
.bv-app .lane.is-active:not(.is-empty) .lane-label { font-weight: 500; }
.bv-app .lane.is-active:not(.is-empty).req .packet { animation: bv-packet-fwd 900ms ease-in-out infinite; }
.bv-app .lane.is-active:not(.is-empty).res .packet { animation: bv-packet-back 900ms ease-in-out infinite; }
@keyframes bv-flow-fwd { to { background-position-x: 12px; } }
@keyframes bv-flow-back { to { background-position-x: -12px; } }
@keyframes bv-flow-fwd-v { to { background-position-y: 12px; } }
@keyframes bv-flow-back-v { to { background-position-y: -12px; } }
@keyframes bv-packet-fwd { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes bv-packet-back { 0% { left: calc(100% - 8px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 0; opacity: 0; } }
@keyframes bv-packet-down { 0% { top: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: calc(100% - 8px); opacity: 0; } }
@keyframes bv-packet-up { 0% { top: calc(100% - 8px); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { top: 0; opacity: 0; } }
@container (max-width: 760px) {
  .bv-app .flow { flex-direction: column; align-items: center; }
  .bv-app .node { width: 100%; max-width: 320px; min-height: 0; flex-direction: row; gap: 12px; text-align: left; justify-content: flex-start; padding: 8px 12px; }
  .bv-app .node-icon { margin: 0; flex: 0 0 auto; }
  .bv-app .node-count { margin: 0 0 0 auto; }
  .bv-app .link { flex: 0 0 auto; flex-direction: row; justify-content: center; gap: 24px; min-height: 96px; padding: 4px 0; }
  .bv-app .lane { flex-direction: row; align-items: stretch; min-width: 80px; min-height: 80px; justify-content: center; }
  .bv-app .lane-label { writing-mode: vertical-rl; align-self: center; }
  .bv-app .lane.res .lane-label { transform: rotate(180deg); }
  .bv-app .lane-line { width: 8px; height: auto; margin: 6px 0; }
  .bv-app .lane-line::before {
    left: 3px; right: auto; top: 0; bottom: 8px; width: 2px; height: auto;
    background: repeating-linear-gradient(180deg, var(--lane-color) 0 6px, transparent 6px 12px); background-size: 2px 12px;
  }
  .bv-app .lane.is-empty .lane-line::before { background: repeating-linear-gradient(180deg, var(--lane-color) 0 2px, transparent 2px 8px); }
  .bv-app .lane.is-failed .lane-line::before { background: var(--lane-color); }
  .bv-app .lane.res .lane-line::before { top: 8px; bottom: 0; left: 3px; right: auto; }
  .bv-app .lane.req .lane-line::after { top: auto; right: auto; bottom: 0; left: 0; border: 4px solid transparent; border-top: 7px solid var(--lane-color); border-bottom: 0; }
  .bv-app .lane.res .lane-line::after { top: 0; left: 0; bottom: auto; border: 4px solid transparent; border-bottom: 7px solid var(--lane-color); border-top: 0; }
  .bv-app .lane.is-active:not(.is-empty) .lane-line::before { animation-name: bv-flow-fwd-v; }
  .bv-app .lane.res.is-active:not(.is-empty) .lane-line::before { animation-name: bv-flow-back-v; }
  .bv-app .lane.is-active:not(.is-empty).req .packet { left: 0; animation-name: bv-packet-down; }
  .bv-app .lane.is-active:not(.is-empty).res .packet { left: 0; animation-name: bv-packet-up; }
}
.bv-app .hint { margin: 12px 0 0; }
/* Log lines: dark code viewer, like the host's log viewer */
.bv-app .table-wrap { overflow-x: auto; background: var(--code-bg); border-radius: 4px; }
.bv-app .log-table { width: 100%; border-collapse: collapse; min-width: 560px; color: var(--code-text); }
.bv-app .log-table th {
  text-align: left; background: var(--code-head); color: #9DA5B4;
  font-size: 10px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 12px; border-bottom: 1px solid var(--code-line);
}
.bv-app .log-table td { padding: 4px 12px; border-bottom: 1px solid var(--code-line); vertical-align: top; }
.bv-app .log-table tbody tr { cursor: pointer; }
.bv-app .log-table tbody tr:hover { background: var(--code-hover); }
.bv-app .log-table tr.is-match td:first-child { box-shadow: inset 3px 0 0 #FFC107; }
.bv-app .log-table tr.is-failed td:first-child { box-shadow: inset 3px 0 0 var(--critical); }
.bv-app .log-table tr.is-failed td { color: var(--code-err); }
.bv-app .log-table .num { white-space: nowrap; color: var(--code-dim); }
.bv-app .log-table tr.is-extra td { color: var(--code-dim); font-style: italic; }
.bv-app .log-table mark { background: rgba(255, 193, 7, .35); }
.bv-app .pill-extra { color: var(--text-2); }
/* Side panel (Material drawer, elevation 16) */
.bv-app .scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 1500; }
.bv-app .panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1501;
  width: min(560px, 100vw); background: var(--surface-raised);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  transform: translateX(100%); visibility: hidden;
  transition: transform 240ms cubic-bezier(.2, 0, 0, 1), visibility 0s 240ms;
}
.bv-app .panel.is-open { transform: none; visibility: visible; transition: transform 240ms cubic-bezier(.2, 0, 0, 1), visibility 0s; }
.bv-app .panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.bv-app .panel-title { font-size: 16px; line-height: 24px; }
.bv-app .panel-actions { display: flex; align-items: center; gap: 4px; }
.bv-app .btn-icon { min-width: 36px; padding: 0 8px; }
.bv-app .btn-icon svg { display: block; }
.bv-app .panel.is-full { width: 100vw; }
.bv-app .panel.is-full .panel-body { padding: 16px 24px; }
.bv-app .panel.is-full .log-view { font-size: 12px; }
.bv-app .panel-body { padding: 16px; overflow-y: auto; display: grid; grid-auto-rows: max-content; gap: 16px; align-content: start; min-height: 0; }
.bv-app .entry { flex: none; }
.bv-app .entry { border: 1px solid var(--border); border-radius: 4px; background: var(--surface); min-width: 0; overflow: hidden; }
.bv-app .entry.is-failed { border-color: var(--critical); }
.bv-app .entry.is-focus { box-shadow: 0 0 0 2px var(--primary); }
.bv-app .entry-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-subtle); }
.bv-app .entry-msg { font-weight: 500; overflow-wrap: anywhere; }
.bv-app .entry-meta { margin-left: auto; white-space: nowrap; }
.bv-app .entry-reasons { margin: 0; padding: 8px 12px; color: var(--critical); font-size: 11px; border-bottom: 1px solid var(--border); }
.bv-app .entry pre {
  margin: 0; padding: 12px; overflow-x: auto; max-height: 340px;
  font: 11.2px/1.6 var(--font); background: var(--code-bg); color: var(--code-text); white-space: pre;
}
/* Continuous log text in the side panel */
.bv-app .log-view {
  margin: 0; padding: 12px; overflow-x: auto; border-radius: 4px;
  font: 11.2px/1.5 var(--font); background: var(--code-bg); color: var(--code-text); white-space: pre;
}
.bv-app .log-view mark { background: rgba(255, 193, 7, .35); color: inherit; }
.bv-app .log-view .log-head.is-failed { color: #F48771; }
.bv-app .log-view .log-head.is-focus { background: rgba(86, 156, 214, .3); }
.bv-app .entry pre mark { background: rgba(255, 193, 7, .35); }
.bv-app .entry-actions { display: flex; justify-content: flex-end; padding: 4px 8px; background: var(--surface); }
.bv-app .entry-actions .btn { min-height: 28px; padding: 0 10px; }
.bv-app .lane-heading { font-size: 10px; line-height: 16px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
@media (prefers-reduced-motion: reduce) {
  .bv-app .panel,
  .bv-app .node,
  .bv-app .btn { transition: none !important; }
  .bv-app .lane.is-active .packet { animation-duration: 1800ms !important; }
}
/* API focus from the sidebar tree and failed-but-empty lanes */
.bv-app .node.is-focus { border-color: var(--nc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nc) 30%, transparent); background: color-mix(in srgb, var(--nc) 10%, var(--surface)); }
.bv-app .lane.is-empty.is-failed { opacity: 1; }
/* Timeline: one row per operation, one cell per hour of the selected date */
.bv-app .timeline { --lw: 112px; --cw: 36px; }
.bv-app .tl-scroll { overflow-x: auto; }
.bv-app .tl-body { position: relative; min-width: calc(var(--lw) + var(--cw) * 24); padding-top: 28px; }
.bv-app .tl-row { display: grid; grid-template-columns: var(--lw) repeat(24, minmax(var(--cw), 1fr)); align-items: stretch; border-bottom: 1px solid var(--border); }
.bv-app .tl-row:last-child { border-bottom: 0; }
.bv-app .tl-label { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 8px 12px 8px 4px; font-weight: 500; }
.bv-app .tl-label .muted { font-weight: 400; }
.bv-app .tl-counts { display: flex; align-items: center; gap: 6px; }
.bv-app .tl-ruler { border-bottom: 1px solid var(--border-strong); }
.bv-app .tl-ruler .tl-label { padding-top: 4px; padding-bottom: 4px; }
.bv-app .tl-hour { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px 0; color: var(--text-2); font-size: 11px; line-height: 14px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--border); }
.bv-app .tl-hour small { font-size: 9px; line-height: 12px; }
.bv-app .tl-hour.is-first { border-left: 0; }
.bv-app .tl-cell {
  display: flex; flex-wrap: wrap; align-content: safe center; justify-content: center; gap: 3px; padding: 8px 6px; min-height: 52px;
  box-sizing: border-box; max-height: 148px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border-left: 1px solid var(--border);
}
.bv-app .tl-cell.has-data { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.bv-app .tl-cell.has-incomplete { background: color-mix(in srgb, var(--warning) 14%, transparent); }
.bv-app .tl-cell.has-failed { background: color-mix(in srgb, var(--critical) 14%, transparent); }
.bv-app .tl-mark {
  width: 12px; height: 12px; padding: 0; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--primary); transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.bv-app .tl-mark.is-failed { background: var(--critical); }
.bv-app .tl-mark.is-incomplete { background: var(--warning); }
.bv-app .tl-mark.is-success { background: var(--primary); }
.bv-app .tl-mark:hover:not(:disabled) { transform: scaleY(1.15); }
.bv-app .tl-mark.is-current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--positive-fill); }
.bv-app .tl-mark.is-dim { opacity: .22; cursor: default; }
.bv-app .tl-window {
  position: absolute; top: 28px; bottom: 0; pointer-events: none;
  left: calc(var(--lw) + (100% - var(--lw)) * var(--h) / 24);
  width: calc((100% - var(--lw)) * var(--span) / 24);
  border: 2px solid var(--positive-fill); border-radius: 4px;
}
.bv-app .tl-window::before { content: ""; position: absolute; left: -2px; top: -2px; bottom: -2px; border-left: 2px dotted var(--surface); }
.bv-app .tl-bracket {
  position: absolute; top: 0; height: 24px; display: flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 11px; white-space: nowrap;
  left: calc(var(--lw) + (100% - var(--lw)) * var(--h) / 24);
  width: calc((100% - var(--lw)) * var(--span) / 24); min-width: 84px;
}
.bv-app .tl-bracket::before,
.bv-app .tl-bracket::after { content: ""; flex: 1 1 0; border-top: 1px solid var(--text-2); }
.bv-app .tl-bracket span { flex: 0 0 auto; }
.bv-app .tl-empty { padding: 16px 4px; }

.bv-app .log-section { min-width: 0; margin-bottom: 10px; }

/* JSON syntax colours (VS Code Dark+, on the dark code background) */
.bv-app .entry pre .tok-key,
.bv-app .log-view .tok-key { color: #9CDCFE; }
.bv-app .entry pre .tok-str,
.bv-app .log-view .tok-str { color: #CE9178; }
.bv-app .entry pre .tok-num,
.bv-app .log-view .tok-num { color: #B5CEA8; }
.bv-app .entry pre .tok-lit,
.bv-app .log-view .tok-lit { color: #569CD6; }
.bv-app .entry pre .tok-punc,
.bv-app .log-view .tok-punc { color: #D4D4D4; }
#content {padding:0 10px;}