:root {
  --bg: #080c12;
  --panel: #0e141d;
  --card: #121a25;
  --card2: #0c121a;
  --line: #213044;
  --line-bright: #324966;
  --text: #dce6f2;
  --muted: #7f91a8;
  --green: #2ee58d;
  --green-bg: #0c2e20;
  --amber: #f5c044;
  --amber-bg: #33260b;
  --red: #ff4d5e;
  --red-bg: #361018;
  --blue: #4aa8ff;
  --blue-bg: #0d2742;
  --cyan: #22d3ee;
  --cyan-bg: #092c36;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 13px/1.4 var(--sans); }
body {
  display: grid;
  grid-template-rows: 48px 1fr 196px;
  overflow: hidden;
}
.mono { font-family: var(--mono); }

/* Header */
header.bb-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: #0b1018;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.bb-back {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.bb-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.bb-title b { font-size: 14.5px; letter-spacing: 0.1em; color: #fff; }
.bb-title span { font-size: 11px; color: var(--muted); }
@media (max-width: 1480px) { .bb-title span { display: none; } }
.bb-mode-pill {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--cyan);
  background: var(--cyan-bg);
  color: var(--cyan);
  white-space: nowrap;
}
.bb-mode-pill.bound {
  border-color: var(--green);
  background: var(--green-bg);
  color: var(--green);
}

/* 6-system live pipeline strip */
.sys-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}
.sys-pill {
  font-size: 10px;
  font-family: var(--mono);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}
.sys-pill.ok { border-color: #1f7a50; background: var(--green-bg); color: var(--green); }
.sys-pill.warn { border-color: #8f6b18; background: var(--amber-bg); color: var(--amber); }
.sys-pill.bad { border-color: #9e2230; background: var(--red-bg); color: var(--red); }
.sys-pill.info { border-color: #1a6680; background: var(--cyan-bg); color: var(--cyan); }
.sys-arrow { color: #394d66; font-size: 10px; }

.head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#rtcClock {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  background: var(--card2);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 3px;
}

/* Main 3-column grid */
main.bb-main {
  display: grid;
  grid-template-columns: 288px 1fr 390px;
  min-height: 0;
}

aside.bb-side {
  overflow-y: auto;
  padding: 8px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}
aside.bb-right {
  border-right: 0;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Cards & controls */
.card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 4px;
  padding: 9px;
  margin-bottom: 8px;
}
.card h4 {
  margin: 0 0 7px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.sub-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 7px 0 4px;
}
select, textarea, input[type="text"] {
  width: 100%;
  background: var(--card2);
  color: var(--text);
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  padding: 6px 7px;
  font: 12px var(--sans);
}
select:focus, textarea:focus { outline: 1px solid var(--blue); border-color: var(--blue); }

button {
  background: #182332;
  color: var(--text);
  border: 1px solid #30455f;
  border-radius: 3px;
  padding: 6px 8px;
  font: 600 11.5px/1.2 var(--sans);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
button:hover:not(:disabled) { border-color: var(--blue); background: #1e2d40; }
button:disabled { opacity: 0.42; cursor: not-allowed; }
button.btn-go { background: #0e4a2f; border-color: var(--green); color: #eafff5; }
button.btn-go:hover:not(:disabled) { background: #14633f; }
button.btn-blue { background: #0d3c6e; border-color: var(--blue); color: #eef7ff; }
button.btn-blue:hover:not(:disabled) { background: #124d8c; }
button.btn-red { background: #5c121d; border-color: var(--red); color: #fff0f2; }
button.btn-red:hover:not(:disabled) { background: #7a1827; }
button.btn-amber { background: #4d370c; border-color: var(--amber); color: #fff8e6; }
button.btn-amber:hover:not(:disabled) { background: #664910; }
button.btn-cyan { background: #0b3c4a; border-color: var(--cyan); color: #e8fcff; }
button.btn-sm { padding: 4px 7px; font-size: 11px; }
button.btn-full { width: 100%; padding: 8px; }

.btn-row { display: flex; gap: 5px; margin-top: 6px; }
.btn-row button { flex: 1; }
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 4px;
  margin-top: 6px;
  padding: 3px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.mode-switch button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 5px;
}
.mode-switch button.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: #fff;
}
.mode-switch button.live-active {
  background: var(--green-bg);
  border-color: var(--green);
  color: var(--green);
}
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.btn-grid button { font-size: 10.5px; padding: 5px 6px; text-align: left; }

.scenario-desc {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0;
  padding: 6px 7px;
  background: var(--card2);
  border-left: 2px solid var(--blue);
  border-radius: 2px;
}

.prog-wrap {
  margin-top: 7px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
}
.prog-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width 0.25s ease;
}
.prog-bar.bad { background: linear-gradient(90deg, var(--amber), var(--red)); }

.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #182332;
  font-size: 11.5px;
}
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; word-break: break-all; }

.ok { color: var(--green); }
.warn { color: var(--amber); }
.bad { color: var(--red); }
.info { color: var(--cyan); }
.muted { color: var(--muted); }

/* Center viewport: 3D Box + Interactive Route Map */
section.bb-center {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #070b10;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: #0c121b;
  border-bottom: 1px solid var(--line);
}
#statusBanner {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--card2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
#statusBanner.gc { color: var(--green); border-color: #1f7a50; background: var(--green-bg); }
#statusBanner.yc { color: var(--amber); border-color: #8f6b18; background: var(--amber-bg); }
#statusBanner.rc { color: var(--red); border-color: var(--red); background: var(--red-bg); animation: pulse-red 1.2s infinite; }
@keyframes pulse-red { 50% { box-shadow: 0 0 12px rgba(255, 77, 94, 0.35); } }

.view-switch { display: flex; gap: 4px; }
.view-switch button.active { background: var(--blue-bg); border-color: var(--blue); color: #fff; }

.stage-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 52% 48%;
  gap: 1px;
  background: var(--line);
}
.stage-split.mode-3d { grid-template-rows: 1fr 0fr; }
.stage-split.mode-map { grid-template-rows: 0fr 1fr; }
.stage-split.mode-3d .pane-map,
.stage-split.mode-map .pane-3d { display: none; }

.viewport-pane {
  position: relative;
  min-height: 0;
  min-width: 0;
  background: #070b10;
  overflow: hidden;
}
#cv3d, #routeMap {
  width: 100%;
  height: 100%;
  display: block;
}
#cv3d { cursor: grab; touch-action: none; }
#routeMap { background: #09111c; z-index: 1; }

.pane-overlay-tl {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  z-index: 500;
}
.pane-overlay-tr {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 3px;
  align-items: center;
  z-index: 500;
}
.map-layer-btn.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: #fff;
}
.pane-badge {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 7px;
  background: rgba(8, 12, 18, 0.88);
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  color: var(--text);
}
.pane-overlay-br {
  position: absolute;
  right: 8px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 8px;
  background: rgba(8, 12, 18, 0.88);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10px;
  color: var(--muted);
  z-index: 500;
}
.pane-3d .pane-overlay-br { bottom: 8px; }

.pane-map .pane-overlay-tl {
  max-width: calc(100% - 210px);
  overflow: hidden;
}
.pane-map #mapRouteBadge {
  max-width: 195px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pane-map #mapCoordBadge {
  white-space: nowrap;
}
.warden-tiles-osm-dark {
  filter: invert(100%) hue-rotate(188deg) brightness(90%) contrast(106%) saturate(68%);
}
.warden-tiles-topo-dark {
  filter: brightness(0.76) contrast(1.12) saturate(0.88);
}
.warden-tiles-sat {
  filter: brightness(0.82) contrast(1.10) saturate(0.95);
}
.leaflet-container {
  background: #09111c;
  font-family: var(--sans);
}
.leaflet-control-zoom {
  border: 1px solid var(--line-bright) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}
.leaflet-control-zoom a {
  background: rgba(11, 17, 26, 0.9) !important;
  color: var(--text) !important;
  border-bottom-color: var(--line) !important;
  width: 24px !important;
  height: 24px !important;
  line-height: 24px !important;
  font-size: 14px !important;
}
.leaflet-control-zoom a:hover {
  background: #1b2c42 !important;
  color: #fff !important;
}
.leaflet-control-attribution {
  background: rgba(8, 12, 18, 0.78) !important;
  color: #6b7f99 !important;
  font-size: 9px !important;
  padding: 1px 6px !important;
}
.leaflet-control-attribution a { color: #87a8ce !important; }

.warden-map-icon { background: transparent; border: 0; }
.wm-end {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(8, 13, 22, 0.9);
  border: 1px solid var(--line-bright);
  white-space: nowrap;
  font-size: 9.5px;
  color: var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
}
.wm-end span {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
}
.wm-end.origin span { background: var(--green-bg); color: var(--green); border: 1px solid #1f7a50; }
.wm-end.dest span { background: var(--blue-bg); color: var(--blue); border: 1px solid #2b6fb3; }

.wm-kineis {
  position: relative;
  width: 14px;
  height: 14px;
}
.wm-kineis i {
  display: block;
  width: 11px;
  height: 11px;
  background: var(--cyan);
  border: 1.5px solid #060a0f;
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.75);
}
.wm-kineis.breach i {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 77, 94, 0.85);
}
.wm-kineis span {
  position: absolute;
  left: 15px;
  top: -4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: #8df5ff;
  background: rgba(8, 14, 22, 0.86);
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 2px;
  padding: 0 4px;
  white-space: nowrap;
}
.wm-kineis.breach span {
  color: #ffb3bc;
  border-color: rgba(255, 77, 94, 0.6);
}

.wm-breach {
  position: relative;
  width: 24px;
  height: 24px;
}
.wm-breach-ring {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--red);
  background: rgba(255, 77, 94, 0.16);
  animation: wm-pulse 1.3s ease-out infinite;
}
.wm-breach span {
  position: absolute;
  left: 26px;
  top: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  color: #ffd6db;
  background: rgba(54, 16, 24, 0.94);
  border: 1px solid var(--red);
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}

.wm-cargo {
  position: relative;
  width: 22px;
  height: 22px;
}
.wm-cargo-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--green);
  animation: wm-pulse 1.6s ease-out infinite;
}
.wm-cargo-dot {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--green);
  box-shadow: 0 0 10px var(--green);
}
.wm-cargo.warn .wm-cargo-pulse, .wm-cargo.warn .wm-cargo-dot { border-color: var(--amber); box-shadow: 0 0 10px var(--amber); }
.wm-cargo.bad .wm-cargo-pulse, .wm-cargo.bad .wm-cargo-dot { border-color: var(--red); box-shadow: 0 0 10px var(--red); }
.wm-cargo.air .wm-cargo-pulse, .wm-cargo.air .wm-cargo-dot { border-color: #38bdf8; box-shadow: 0 0 10px #38bdf8; }
.wm-cargo-tag {
  position: absolute;
  left: 24px;
  top: 2px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: #eef7ff;
  background: rgba(8, 14, 22, 0.90);
  border: 1px solid var(--green);
  border-radius: 3px;
  padding: 1px 5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}
.wm-cargo.air .wm-cargo-tag { border-color: #38bdf8; color: #bae6fd; }
.wm-cargo.warn .wm-cargo-tag { border-color: var(--amber); color: #fde68a; }
.wm-cargo.bad .wm-cargo-tag { border-color: var(--red); color: #fecdd3; }

.wm-leg-tag {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
}
.wm-leg-tag.air {
  background: rgba(7, 26, 44, 0.92);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
}
.wm-leg-tag.sea {
  background: rgba(42, 30, 8, 0.92);
  border: 1px solid var(--amber);
  color: #fcd34d;
}

@keyframes wm-pulse {
  0% { transform: scale(0.75); opacity: 0.95; }
  100% { transform: scale(1.95); opacity: 0; }
}

.warden-tip {
  background: rgba(9, 15, 24, 0.94) !important;
  color: var(--text) !important;
  border: 1px solid var(--line-bright) !important;
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}
.warden-tip::before { display: none; }
.warden-popup .leaflet-popup-content-wrapper,
.warden-popup .leaflet-popup-tip {
  background: rgba(10, 16, 26, 0.96) !important;
  color: var(--text) !important;
  border: 1px solid var(--cyan);
}
.wm-popup { font-family: var(--mono); font-size: 10.5px; line-height: 1.5; }
.wm-popup .wmp-title { color: var(--cyan); font-weight: 700; margin-bottom: 4px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.wm-popup code { color: #8df5ff; }
.leg-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}

/* Epoch Scrubber Timeline */
.timeline-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #0b1119;
  border-top: 1px solid var(--line);
}
.timeline-ticks {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow-x: auto;
  padding: 2px 0;
}
.tick-btn {
  min-width: 24px;
  height: 20px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 10px;
  border-radius: 2px;
  border: 1px solid var(--line-bright);
  background: #141f2d;
  color: var(--muted);
}
.tick-btn.ok { border-color: #1f7a50; background: #0e3524; color: var(--green); }
.tick-btn.warn { border-color: #8f6b18; background: #36280c; color: var(--amber); }
.tick-btn.bad { border-color: var(--red); background: #42111b; color: #ff8e99; }
.tick-btn.kineis { box-shadow: inset 0 -2px 0 var(--cyan); }
.tick-btn.selected { outline: 2px solid #fff; color: #fff; font-weight: 700; }

/* Right Panel Tabs */
.tab-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #0b1018;
  border-bottom: 1px solid var(--line);
}
.tab-btn {
  border: 0;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 9px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.tab-btn:hover { background: #131c29; color: var(--text); }
.tab-btn.active {
  color: #fff;
  background: var(--panel);
  border-bottom-color: var(--blue);
}
.tab-btn.badge-green { color: var(--green); }
.tab-btn.badge-red { color: var(--red); }

.tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 9px;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Sensor & Telemetry Widgets */
.meter-bar {
  height: 10px;
  background: #0a1018;
  border: 1px solid var(--line);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  margin: 4px 0 6px;
}
.meter-fill { height: 100%; width: 0%; background: var(--green); transition: width 0.2s; }
.meter-fill.warn { background: var(--amber); }
.meter-fill.bad { background: var(--red); }
.meter-thresh {
  position: absolute;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--red);
}

.console-box {
  background: #060a0f;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  color: #98b4d4;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.check-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 6px;
}
.check-pill {
  font-family: var(--mono);
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--card2);
  display: flex;
  justify-content: space-between;
}
.check-pill.ok { border-color: #1f7a50; background: var(--green-bg); color: var(--green); }
.check-pill.bad { border-color: #9e2230; background: var(--red-bg); color: var(--red); }

/* 16-Byte Kinéis Byte Map */
.byte-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-top: 6px;
}
.byte-cell {
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 4px 6px;
  font-family: var(--mono);
  font-size: 10px;
}
.byte-cell .bc-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 9.5px; }
.byte-cell .bc-hex { color: var(--cyan); font-weight: 700; margin-top: 2px; word-break: break-all; }

.cp-card {
  border: 1px solid #1b4d63;
  background: #0a1822;
  border-radius: 3px;
  padding: 7px;
  margin-bottom: 6px;
  font-size: 11px;
}
.cp-card.breach { border-color: #9e2230; background: #260d14; }

/* System 5 Independent Arrival Verifier */
.verdict-card {
  padding: 10px;
  border-radius: 4px;
  border: 2px solid var(--line);
  margin-bottom: 8px;
}
.verdict-card.GREEN { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.verdict-card.RED { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.verdict-card h3 { margin: 0 0 4px; font-size: 13px; letter-spacing: 0.04em; }
.verdict-card p { margin: 0; font-size: 11px; color: var(--text); }
.failure-pin {
  margin-top: 6px;
  padding: 5px 7px;
  background: rgba(0, 0, 0, 0.45);
  border-left: 3px solid var(--red);
  font-family: var(--mono);
  font-size: 10.5px;
  color: #ffd0d6;
}
.v-check {
  padding: 5px 6px;
  border-bottom: 1px solid #1a2535;
  font-size: 11px;
}
.v-check .vc-head { display: flex; justify-content: space-between; font-weight: 600; }
.v-check small { display: block; color: var(--muted); margin-top: 2px; font-size: 10.5px; }

/* Bottom Footer: System 3 Hash Chain Strip */
footer.bb-foot {
  display: grid;
  grid-template-columns: 260px 1fr;
  border-top: 1px solid var(--line);
  background: var(--panel);
  min-height: 0;
}
.chain-meta {
  padding: 7px 10px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  font-size: 11px;
}
.chain-meta .kv { padding: 1.5px 0; font-size: 11px; }
.chain-meta h4 {
  margin: 0 0 5px;
  font-size: 11px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.flag-wrap { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.flag-chip {
  font-family: var(--mono);
  font-size: 9.5px;
  padding: 2px 5px;
  border-radius: 2px;
  border: 1px solid #9e2230;
  background: var(--red-bg);
  color: var(--red);
}
.flag-chip.info { border-color: #8f6b18; background: var(--amber-bg); color: var(--amber); }
.flag-chip.clean { border-color: #1f7a50; background: var(--green-bg); color: var(--green); }

#chainStrip {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  padding: 8px;
  gap: 0;
}
.c-blk {
  flex: 0 0 184px;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  padding: 6px 7px;
  background: var(--card);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.c-blk:hover { border-color: var(--blue); }
.c-blk.selected { outline: 2px solid #fff; }
.c-blk.bad { border-color: var(--red); background: #260d14; }
.c-blk.warn { border-color: var(--amber); background: #261e09; }
.c-blk.kineis { box-shadow: inset 0 2px 0 var(--cyan); }
.c-blk b { font-size: 10.5px; color: #fff; }
.c-arrow {
  flex: 0 0 18px;
  align-self: center;
  text-align: center;
  color: var(--blue);
  font-size: 11px;
}

#toastMsg {
  position: fixed;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(8, 12, 18, 0.95);
  border: 1px solid var(--cyan);
  color: #e8fcff;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 99;
  display: none;
  max-width: 72vw;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

@media (max-width: 1150px) {
  body { grid-template-rows: auto auto 190px; overflow: auto; }
  main.bb-main { grid-template-columns: 1fr; }
  section.bb-center { height: 640px; }
  aside.bb-right { max-height: 620px; }
  .sys-strip { display: none; }
}
