/* StreamCat acceleration console. Route colours are a validated categorical set on the panel surface
   #0b1119 (origin blue, ESA orange, node aqua, ESA update yellow; orange and yellow never adjacent).
   Status colours (good / warning / critical) always come with a label. No capsule shapes around text. */
:root {
  color-scheme: dark;
  --bg: #04070c;
  --surface: #0b1119;
  --surface-2: #0f1722;
  --surface-3: #131d2a;
  --line: rgba(140, 180, 230, 0.10);
  --line-2: rgba(140, 180, 230, 0.18);
  --grid: rgba(140, 180, 230, 0.06);
  --axis: #2a3647;
  --ink: #e8eef6;
  --ink-2: #93a1b3;
  --ink-3: #5d6b7d;
  --accent: #7fd3ff;
  --accent-dim: rgba(127, 211, 255, 0.14);
  --origin: #338ced;
  --esa: #e76624;
  --node: #00a888;
  --esa-update: #d28e05;
  --good: #0aac23;
  --warn: #fbb315;
  --bad: #dc3c3d;
  --sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", "Consolas", ui-monospace, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- backdrop ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.backdrop .grid {
  position: absolute; inset: -60px;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 80%);
  animation: drift 90s linear infinite;
}
.backdrop .glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(900px 420px at 18% -8%, rgba(51, 140, 237, 0.16), transparent 70%),
    radial-gradient(800px 380px at 92% 4%, rgba(0, 168, 136, 0.12), transparent 70%),
    radial-gradient(700px 500px at 50% 120%, rgba(127, 211, 255, 0.06), transparent 70%);
}
@keyframes drift { to { transform: translate(56px, 56px); } }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; }
.login-field { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-card {
  position: relative; width: min(460px, calc(100vw - 32px)); padding: 32px 32px 26px;
  background: linear-gradient(180deg, rgba(15, 23, 34, 0.86), rgba(8, 13, 20, 0.92));
  border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  animation: rise 0.8s var(--ease) both;
}
.login-card::before, .panel::before {
  content: ""; position: absolute; left: -1px; top: -1px; width: 14px; height: 14px;
  border-left: 1px solid var(--accent); border-top: 1px solid var(--accent); opacity: 0.55; border-top-left-radius: 6px;
}
.login-card::after, .panel::after {
  content: ""; position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px;
  border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); opacity: 0.35; border-bottom-right-radius: 6px;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 40px; height: 40px; filter: drop-shadow(0 0 12px rgba(127, 211, 255, 0.35)); }
.brand-title { font-size: 19px; font-weight: 600; letter-spacing: 0.06em; }
.brand-sub { color: var(--ink-2); font-size: 12px; letter-spacing: 0.04em; }
.brand-row.compact .brand-mark { width: 28px; height: 28px; }
.brand-row.compact .brand-title { font-size: 15px; }
.drop {
  margin-top: 26px; padding: 26px 18px; text-align: center; cursor: pointer; position: relative;
  border: 1px dashed rgba(127, 211, 255, 0.35); border-radius: 8px; background: rgba(127, 211, 255, 0.03);
  transition: border-color 0.25s, background 0.25s, transform 0.25s var(--ease); outline: none; overflow: hidden;
}
.drop::after {
  content: ""; position: absolute; left: -40%; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(127, 211, 255, 0.10), transparent);
  animation: sweep 3.6s ease-in-out infinite;
}
@keyframes sweep { 0% { left: -40%; } 60%, 100% { left: 110%; } }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: rgba(127, 211, 255, 0.07); transform: translateY(-1px); }
.drop.busy { pointer-events: none; opacity: 0.6; }
.drop-icon { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.drop-title { margin-top: 10px; font-size: 15px; font-weight: 500; }
.drop-sub { margin-top: 4px; color: var(--ink-2); font-size: 12px; }
.steps { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { position: relative; padding-top: 12px; font-size: 11.5px; color: var(--ink-3); text-align: center; transition: color 0.3s; }
.steps li::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 1px; background: var(--line-2);
  transition: background 0.4s;
}
.steps li.run { color: var(--ink); }
.steps li.run::before { background: linear-gradient(90deg, var(--accent), transparent); background-size: 200% 100%; animation: flow 1s linear infinite; }
.steps li.done { color: var(--ink-2); }
.steps li.done::before { background: var(--accent); }
.steps li.fail { color: var(--bad); }
.steps li.fail::before { background: var(--bad); }
@keyframes flow { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.totp { margin-top: 22px; text-align: center; animation: rise 0.5s var(--ease) both; }
.totp-title { color: var(--ink-2); font-size: 12px; margin-bottom: 10px; }
.totp-boxes { display: flex; gap: 8px; justify-content: center; }
.totp-boxes input {
  width: 44px; height: 52px; text-align: center; font: 600 22px var(--mono); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 6px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.totp-boxes input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.login-error { min-height: 20px; margin-top: 14px; color: var(--bad); font-size: 12.5px; text-align: center; }

/* ---------- shell ---------- */
.app { position: relative; z-index: 1; min-height: 100%; }
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 28px; height: 58px; padding: 0 24px;
  background: rgba(4, 7, 12, 0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.tabs { position: relative; display: flex; gap: 4px; height: 100%; }
.tabs a { display: flex; align-items: center; padding: 0 14px; text-decoration: none; color: var(--ink-2); font-size: 13.5px; transition: color 0.2s; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); }
.tab-ink {
  position: absolute; bottom: -1px; height: 2px; left: 0; width: 0; background: var(--accent);
  box-shadow: 0 0 12px var(--accent); transition: left 0.45s var(--ease), width 0.45s var(--ease);
}
.top-right { margin-left: auto; display: flex; align-items: center; gap: 16px; color: var(--ink-2); font-size: 12px; }
.pulse { display: inline-flex; align-items: center; gap: 7px; }
.pulse i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); position: relative; }
.pulse.live i { background: var(--good); }
.pulse.live i::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid var(--good); animation: ping 1.8s ease-out infinite;
}
.pulse.lost i { background: var(--bad); }
.pulse b { font-weight: 400; }
@keyframes ping { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(2.2); opacity: 0; } }
.clock { font-family: var(--mono); color: var(--ink); }
.view { padding: 22px 24px 48px; max-width: 1680px; margin: 0 auto; animation: fade 0.5s var(--ease) both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.btn {
  height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.02);
  cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.btn.primary { border-color: rgba(127, 211, 255, 0.55); background: linear-gradient(180deg, rgba(127, 211, 255, 0.20), rgba(127, 211, 255, 0.08)); color: #eaf8ff; }
.btn.danger:hover { border-color: var(--bad); background: rgba(220, 60, 61, 0.12); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { color: var(--ink); border-color: var(--line-2); }
.btn.small { height: 26px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.seg button { height: 28px; padding: 0 12px; border: 0; background: none; color: var(--ink-2); cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent-dim); color: var(--ink); }
.field { display: grid; gap: 6px; }
.field label { color: var(--ink-2); font-size: 12px; }
.field input, .search {
  height: 34px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface-2); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus, .search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ---------- panels and tiles ---------- */
.panel {
  position: relative; background: linear-gradient(180deg, rgba(15, 23, 34, 0.80), rgba(11, 17, 25, 0.88));
  border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px;
}
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; min-height: 28px; }
.panel-title { font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em; }
.panel-sub { color: var(--ink-3); font-size: 12px; }
.panel-head .spacer { flex: 1; }
.row { display: grid; gap: 16px; }
.row + .row, .row + .panel, .panel + .row, .panel + .panel { margin-top: 16px; }
.row > .panel, .nodes > .panel { margin-top: 0; }   /* grid gap spaces these, not sibling margins */
.tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cols-3-1 { grid-template-columns: minmax(0, 2.6fr) minmax(320px, 1fr); }
.tile { padding: 14px 16px 15px; animation: rise 0.6s var(--ease) both; }
.tile:nth-child(2) { animation-delay: 0.05s; } .tile:nth-child(3) { animation-delay: 0.1s; }
.tile:nth-child(4) { animation-delay: 0.15s; } .tile:nth-child(5) { animation-delay: 0.2s; }
.tile-label { color: var(--ink-2); font-size: 12px; letter-spacing: 0.05em; }
.tile-value { margin-top: 6px; font: 600 28px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.tile-value small { font-size: 13px; font-weight: 400; color: var(--ink-2); margin-left: 4px; }
.tile-sub { margin-top: 8px; color: var(--ink-2); font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.key i.origin { background: var(--origin); } .key i.esa { background: var(--esa); }
.key i.node { background: var(--node); } .key i.esa-update { background: var(--esa-update); }
.key i.neutral { background: var(--ink-2); } .key i.bad { background: var(--bad); }
.split { display: flex; gap: 2px; height: 4px; margin-top: 10px; border-radius: 2px; overflow: hidden; background: var(--surface-3); }
.split span { height: 100%; transition: flex-grow 0.8s var(--ease); min-width: 0; }
.split .origin { background: var(--origin); } .split .esa { background: var(--esa); } .split .node { background: var(--node); }
.split .esa-update { background: var(--esa-update); }
.ring { display: flex; align-items: center; gap: 14px; }
.ring svg { width: 58px; height: 58px; flex: none; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .arc { transition: stroke-dashoffset 1.2s var(--ease); }

/* status: dot + text (never a filled capsule) */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.status.good::before { background: var(--good); box-shadow: 0 0 8px var(--good); }
.status.warn::before { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.status.bad::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.status.idle::before { background: var(--ink-3); }
.flag { display: inline-flex; align-items: center; gap: 6px; padding-left: 8px; border-left: 3px solid var(--warn); font-size: 12px; color: var(--ink); margin-right: 10px; }
.flag.bad { border-left-color: var(--bad); }
.flag.info { border-left-color: var(--ink-3); color: var(--ink-2); }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }

/* ---------- routing matrix ---------- */
.matrix { position: relative; min-height: 440px; padding: 0; overflow: hidden; }
.matrix canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.matrix-head { position: absolute; left: 18px; top: 14px; z-index: 2; display: flex; gap: 14px; align-items: baseline; }
.sources { position: absolute; left: 18px; top: 62px; bottom: 18px; width: 210px; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.source {
  position: relative; padding: 11px 14px 11px 16px; border: 1px solid var(--line-2); border-radius: 6px;
  background: rgba(8, 13, 20, 0.82); backdrop-filter: blur(6px); transition: border-color 0.4s, box-shadow 0.4s, opacity 0.4s;
}
.source::before { content: ""; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--c, var(--ink-3)); box-shadow: 0 0 10px var(--c, transparent); }
.source.hot { border-color: var(--c); box-shadow: 0 0 22px -6px var(--c); }
.source.off { opacity: 0.5; padding-top: 9px; padding-bottom: 9px; }
.source.off .source-rate { display: none; }
.source-name { font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.source-rate { margin-top: 4px; font: 600 17px var(--mono); font-variant-numeric: tabular-nums; }
.source-rate small { font-size: 11px; color: var(--ink-2); font-weight: 400; margin-left: 3px; }
.source-meta { margin-top: 2px; color: var(--ink-2); font-size: 11.5px; }
.hub {
  position: absolute; z-index: 2; left: 50%; top: 18px; transform: translateX(-50%); text-align: center; padding: 8px 16px;
  border: 1px solid var(--line-2); border-radius: 6px; background: rgba(8, 13, 20, 0.85);
}
.hub-name { font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; }
.hub-sub { font-size: 11px; color: var(--ink-2); }
.hub.flash { animation: hubflash 0.9s var(--ease); }
@keyframes hubflash { 30% { border-color: var(--accent); box-shadow: 0 0 26px -4px var(--accent); } }
.lanes { position: absolute; right: 18px; top: 62px; bottom: 18px; width: min(46%, 640px); z-index: 2; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; padding-right: 2px; }
.lane {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center;
  height: 58px; padding: 8px 14px 9px 16px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 6px;
  background: rgba(8, 13, 20, 0.80); backdrop-filter: blur(6px); animation: lanein 0.7s var(--ease) both;
  transition: border-color 0.5s, opacity 0.6s, transform 0.6s var(--ease);
}
.lane::before { content: ""; position: absolute; left: -1px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--c, var(--ink-3)); transition: background 0.6s; }
.lane.switch { animation: laneswitch 0.9s var(--ease); }
.lane.gone { opacity: 0; transform: translateX(24px); }
.lane.done-ok { border-color: rgba(10, 172, 35, 0.6); }
@keyframes lanein { from { opacity: 0; transform: translateX(30px); } }
@keyframes laneswitch { 30% { border-color: var(--c); box-shadow: 0 0 24px -8px var(--c); } }
.lane-top { display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; overflow: hidden; }
.lane-ip { font: 500 13px var(--mono); flex: none; }
.lane-ver { color: var(--ink-2); font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lane-stage { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-stage em { font-style: normal; color: var(--ink-2); }
.lane-speed { text-align: right; font: 600 15px var(--mono); font-variant-numeric: tabular-nums; }
.lane-speed small { font-size: 11px; color: var(--ink-2); font-weight: 400; margin-left: 2px; }
.lane-eta { text-align: right; font-size: 11px; color: var(--ink-2); }
.lane-bar { position: absolute; left: 16px; right: 14px; bottom: 5px; height: 2px; background: var(--surface-3); border-radius: 1px; overflow: hidden; }
.lane-bar span { display: block; height: 100%; width: 0; background: var(--c, var(--ink-3)); transition: width 1.8s linear, background 0.6s; box-shadow: 0 0 8px var(--c); }
.empty-lanes { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--ink-3); pointer-events: none; }
.empty-lanes b { display: block; font-size: 15px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.legend-strip { position: absolute; left: 248px; right: calc(min(46%, 640px) + 36px); bottom: 14px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: 11.5px; }

/* ---------- events ---------- */
.events { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; scrollbar-width: thin; }
.events li { display: grid; grid-template-columns: 62px 10px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.events li.new { animation: evin 0.6s var(--ease) both; }
.events time { font-family: var(--mono); color: var(--ink-3); font-size: 11.5px; }
.events i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); align-self: center; }
.events i.origin { background: var(--origin); } .events i.esa { background: var(--esa); } .events i.node { background: var(--node); }
.events i.bad { background: var(--bad); } .events i.good { background: var(--good); } .events i.warn { background: var(--warn); }
.events .ev-text { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.events .ev-text span { color: var(--ink-2); }
@keyframes evin { from { opacity: 0; transform: translateY(-8px); background: rgba(127, 211, 255, 0.08); } }

/* ---------- node cards ---------- */
.nodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.node-card { padding: 16px 18px 14px; animation: rise 0.6s var(--ease) both; }
.node-card.paused, .node-card.staged { opacity: 0.86; }
.node-head { display: flex; align-items: center; gap: 10px; }
.node-name { font-size: 16px; font-weight: 600; letter-spacing: 0.03em; }
.node-host { font: 12px var(--mono); color: var(--ink-2); }
.node-head .spacer { flex: 1; }
.node-body { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 16px; margin-top: 12px; align-items: center; }
.gauge { position: relative; width: 118px; height: 118px; }
.gauge svg { width: 100%; height: 100%; }
.gauge .track { stroke: var(--surface-3); }
.gauge .arc { transition: stroke-dashoffset 1.2s var(--ease); filter: drop-shadow(0 0 6px rgba(0, 168, 136, 0.6)); }
.gauge-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-text b { font: 600 20px var(--mono); }
.gauge-text span { font-size: 11px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 12px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spark { height: 46px; margin-top: 12px; }
.spark svg { width: 100%; height: 100%; display: block; }
.progress { height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--node); transition: width 1s var(--ease); position: relative; }
.progress span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent); animation: flow 1.4s linear infinite; background-size: 200% 100%; }
.node-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.node-add { display: grid; place-content: center; text-align: center; min-height: 260px; cursor: pointer; border-style: dashed; border-color: rgba(127, 211, 255, 0.3); transition: border-color 0.25s, background 0.25s; }
.node-add:hover { border-color: var(--accent); background: rgba(127, 211, 255, 0.04); }
.node-add .plus { width: 44px; height: 44px; margin: 0 auto 10px; stroke: var(--accent); stroke-width: 2; fill: none; }
.files { margin-top: 10px; font-size: 12px; color: var(--ink-2); display: grid; gap: 3px; }
.files div { display: flex; justify-content: space-between; gap: 8px; }

/* ---------- charts ---------- */
.chart { position: relative; height: 240px; }
.chart.tall { height: 300px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--ink-2); font: 11px var(--mono); }
.chart .bar { transition: opacity 0.2s; }
.chart .bar.dim { opacity: 0.35; }
.chart .hover-line { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .grow { transform-origin: bottom; animation: grow 0.9s var(--ease) both; transform-box: fill-box; }
@keyframes grow { from { transform: scaleY(0); } }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 12px; }
.legend .key i.line { width: 14px; height: 2px; border-radius: 1px; }
.legend .key i.dash { width: 14px; height: 0; border-top: 2px dashed var(--ink-2); background: none; border-radius: 0; }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 64px; gap: 10px; align-items: center; font-size: 12px; }
.hbar-label { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 6px; background: var(--surface-3); border-radius: 0 3px 3px 0; overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--accent); opacity: 0.75; border-radius: 0 3px 3px 0; width: 0; transition: width 1s var(--ease); }
.hbar-track span.bad { background: var(--bad); opacity: 0.85; }
.hbar-value { text-align: right; font-family: var(--mono); color: var(--ink-2); }
.tip {
  position: fixed; z-index: 50; pointer-events: none; min-width: 150px; padding: 10px 12px; font-size: 12px; line-height: 1.6;
  background: rgba(8, 13, 20, 0.96); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.tip-title { color: var(--ink-2); margin-bottom: 4px; font-family: var(--mono); }
.tip-row { display: flex; justify-content: space-between; gap: 16px; }
.tip-row b { font-family: var(--mono); font-weight: 500; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th { text-align: left; font-weight: 500; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; cursor: default; user-select: none; }
table.data th.sort { cursor: pointer; }
table.data th.sort:hover { color: var(--ink); }
table.data th.on { color: var(--accent); }
table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td.r, table.data th.r { text-align: right; }
table.data tbody tr { transition: background 0.2s; animation: fade 0.4s var(--ease) both; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr:hover { background: rgba(127, 211, 255, 0.04); }
.mix { display: flex; gap: 2px; width: 90px; height: 5px; }
.mix span { height: 100%; border-radius: 1px; }
.mix .origin { background: var(--origin); } .mix .esa { background: var(--esa); } .mix .node { background: var(--node); }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search { width: 220px; }

/* ---------- drawer / modal / toast ---------- */
.drawer, .modal { position: fixed; inset: 0; z-index: 30; background: rgba(2, 4, 8, 0.6); backdrop-filter: blur(3px); animation: fadeonly 0.3s both; }
@keyframes fadeonly { from { opacity: 0; } }
.drawer-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(760px, 100vw); overflow-y: auto; padding: 26px 28px;
  background: linear-gradient(180deg, #0c131d, #080d14); border-left: 1px solid var(--line-2); animation: slidein 0.45s var(--ease) both;
}
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.drawer-close { position: absolute; right: 18px; top: 18px; }
.modal { display: grid; place-items: center; }
.modal-panel {
  width: min(620px, calc(100vw - 32px)); padding: 26px 28px; border-radius: 10px; position: relative;
  background: linear-gradient(180deg, #0f1722, #0a1018); border: 1px solid var(--line-2); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: rise 0.45s var(--ease) both;
}
.modal-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.cmd {
  position: relative; margin-top: 12px; padding: 12px 14px; border-radius: 6px; background: #05090f; border: 1px solid var(--line-2);
  font: 12px/1.6 var(--mono); color: #bfe9ff; word-break: break-all;
}
.join-steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.join-steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; transition: color 0.3s; }
.join-steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--ink-3); flex: none; transition: all 0.3s; }
.join-steps li.run { color: var(--ink); }
.join-steps li.run::before { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: blink 1.2s ease-in-out infinite; }
.join-steps li.done { color: var(--ink-2); }
.join-steps li.done::before { background: var(--good); border-color: var(--good); }
@keyframes blink { 50% { opacity: 0.35; } }
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 10px 16px; border-radius: 6px;
  background: rgba(8, 13, 20, 0.96); border: 1px solid var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); animation: rise 0.35s var(--ease) both;
}
.toast.bad { border-color: rgba(220, 60, 61, 0.6); }
.timeline { display: grid; gap: 12px; margin-top: 16px; }
.session { padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: rgba(8, 13, 20, 0.6); }
.session-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; }
.ribbon { display: flex; gap: 2px; height: 6px; margin-top: 10px; }
.ribbon span { height: 100%; border-radius: 1px; min-width: 3px; }
.ribbon .origin { background: var(--origin); } .ribbon .esa { background: var(--esa); } .ribbon .node { background: var(--node); }
.ribbon .refused { background: var(--bad); }
.session-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--ink-2); font-size: 12px; }

@media (max-width: 1200px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-3-1, .cols-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .top { gap: 12px; padding: 0 12px; overflow-x: auto; }
  .top-right .who, .clock { display: none; }
  .view { padding: 14px 12px 40px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sources { width: 150px; }
  .lanes { width: 52%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
