:root {
  --bg: #0b0f19;
  --bg-2: #10141e;
  --card: #16161a;
  --card-2: #1b1c22;
  --inset: #0d1118;
  --border: rgba(255, 255, 255, 0.075);
  --border-hi: rgba(255, 255, 255, 0.14);
  --text: #e8eef7;
  --muted: #8b93a7;
  --dim: #5c6478;
  --cyan: #00e5ff;
  --purple: #a855f7;
  --green: #00ff66;
  --red: #ff3366;
  --amber: #ffc14a;
  --orange: #ff8a3d;
  --blue: #5b8cff;
  --pink: #ff4d9a;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --glow-cyan: 0 0 18px rgba(0, 229, 255, 0.25);
  --radius: 12px;
  --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}
[data-theme="light"] {
  --bg: #eef1f6;
  --bg-2: #e4e8f0;
  --card: #ffffff;
  --card-2: #f6f7fb;
  --inset: #eef1f6;
  --border: rgba(16, 20, 32, 0.08);
  --border-hi: rgba(16, 20, 32, 0.16);
  --text: #16161a;
  --muted: #5a6274;
  --dim: #8a93a6;
  --shadow: 0 8px 24px rgba(20, 24, 40, 0.08);
  --glow-cyan: 0 0 14px rgba(0, 170, 200, 0.15);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.01em;
  overflow: hidden;
}
body {
  background-image:
    radial-gradient(1200px 500px at 80% -10%, rgba(168, 85, 247, 0.08), transparent 50%),
    radial-gradient(900px 400px at -10% 110%, rgba(0, 229, 255, 0.06), transparent 50%),
    linear-gradient(var(--bg), var(--bg));
}
button { font-family: inherit; cursor: pointer; }
b, strong { font-weight: 600; }

.app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 340px;
  grid-template-rows: 86px minmax(0, 1.15fr) minmax(0, 0.95fr);
  grid-template-areas:
    "header header header"
    "side   flow   right"
    "side   mid    right";
  height: 100vh;
  width: 100vw;
  gap: 10px;
  padding: 12px 12px 12px 14px;
}
.header { grid-area: header; }
.sidebar { grid-area: side; }
.flow-panel { grid-area: flow; }
.detail-panel { grid-area: detail; }
.log-panel { grid-area: log; }
.right { grid-area: right; }

/* mid is split into two columns */
.app {
  grid-template-columns: 268px minmax(0, 0.95fr) minmax(0, 0.95fr) 340px;
  grid-template-areas:
    "header header header header"
    "side   flow   flow   right"
    "side   detail log    right";
}

.header, .sidebar, .flow-panel, .detail-panel, .log-panel, .right .card, .stats-grid .stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
  z-index: 3;
}
.header::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--cyan), var(--purple));
}
.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-right { display: flex; align-items: center; gap: 16px; }

.avatar { position: relative; width: 56px; height: 56px; flex: 0 0 56px; }
.avatar-face {
  position: absolute; inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #2a2e3c, #12141c 70%);
  border: 2px solid rgba(0, 229, 255, 0.35);
  display: grid; place-items: center;
  z-index: 2;
  box-shadow: inset 0 0 12px rgba(0, 229, 255, 0.15), var(--glow-cyan);
}
[data-theme="light"] .avatar-face { background: radial-gradient(circle at 35% 30%, #fff, #e8eef4 70%); }
.avatar-face .bars {
  width: 16px; height: 16px;
  background:
    linear-gradient(var(--text), var(--text)) 0 0 / 5px 100% no-repeat,
    linear-gradient(var(--text), var(--text)) 11px 0 / 5px 100% no-repeat;
  border-radius: 1px;
  opacity: 0.9;
}
.pulse-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}
.pulse-ring.delay { animation-delay: 1.2s; }
@keyframes pulse {
  0% { transform: scale(0.72); opacity: 0.55; }
  100% { transform: scale(1.15); opacity: 0; }
}

.brand-row { display: flex; align-items: baseline; gap: 10px; }
.brand h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand h1 .dot { color: var(--dim); font-weight: 500; }
.ver {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.35);
  border-radius: 999px;
  padding: 1px 7px;
  background: rgba(0, 229, 255, 0.08);
}
.brand-sub { display: flex; align-items: center; gap: 12px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 193, 74, 0.12);
  color: var(--amber);
  border: 1px solid rgba(255, 193, 74, 0.3);
  border-radius: 999px;
  padding: 2px 9px 2px 7px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.status-pill.running { background: rgba(0, 255, 102, 0.1); color: var(--green); border-color: rgba(0, 255, 102, 0.3); }
.status-pill.halted { background: rgba(255, 51, 102, 0.12); color: var(--red); border-color: rgba(255, 51, 102, 0.35); }
.status-pill .dot-live {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: 0.35; } }
.uptime b, #uptime { font-family: var(--mono); font-weight: 500; color: var(--text); }
.feed { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.theme-btn {
  width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--muted);
  display: grid; place-items: center;
}
.theme-btn:hover { color: var(--text); border-color: var(--border-hi); }
[data-theme="dark"] .icon-moon, [data-theme="light"] .icon-sun { display: none; }

.balance-block { text-align: right; }
.balance-meta { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 2px; }
.balance-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.mode-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 229, 255, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(0, 229, 255, 0.35);
}
.mode-badge.live {
  background: rgba(0, 255, 102, 0.1);
  color: var(--green);
  border-color: rgba(0, 255, 102, 0.4);
}

.odometer {
  display: flex; align-items: flex-start; justify-content: flex-end;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}
.odo-cur { font-size: 22px; margin-right: 3px; margin-top: 8px; color: var(--muted); font-weight: 500; }
.odo-digits { display: flex; height: 44px; overflow: hidden; }
.odo-col {
  width: 26px; height: 44px; overflow: hidden; position: relative;
}
.odo-col.dot, .odo-col.comma { width: 12px; }
.odo-strip {
  display: flex; flex-direction: column;
  transition: transform 0.7s cubic-bezier(.2,.8,.2,1);
}
.odo-strip span {
  height: 44px; display: grid; place-items: center;
  font-size: 40px; font-weight: 700;
}
.odo-col.dot .odo-strip span, .odo-col.comma .odo-strip span { font-size: 36px; }

/* ===== SHARED ===== */
.col-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px 6px;
}
.col-head .pipe { color: var(--dim); }
.col-head .arr { color: var(--cyan); padding: 0 2px; }
.muted { color: var(--dim); letter-spacing: 0.04em; text-transform: none; font-weight: 400; font-size: 10px; }

/* ===== SIDEBAR AGENTS ===== */
.sidebar {
  display: flex; flex-direction: column;
  overflow: hidden;
  padding-bottom: 6px;
}
#agents { /* container itself */ }
.sidebar .col-head { flex: 0 0 auto; }
.agent-list { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 0 8px 4px; overflow: hidden; }
.agent {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 9px 7px;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 0;
  flex: 1;
  position: relative;
  overflow: hidden;
}
.agent::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--accent, var(--cyan));
  opacity: 0.85;
}
.agent[data-id="hunter"] { --accent: var(--amber); }
.agent[data-id="auditor"] { --accent: var(--cyan); }
.agent[data-id="builder"] { --accent: var(--purple); }
.agent[data-id="guardian"] { --accent: var(--red); }
.agent[data-id="executor"] { --accent: var(--green); }
.agent[data-id="logger"] { --accent: var(--orange); }
.agent-top { display: flex; align-items: center; gap: 8px; }
.agent-ico {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  flex: 0 0 26px;
}
.agent-ico svg { width: 14px; height: 14px; }
.agent-id { flex: 1; min-width: 0; }
.agent-id h3 { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; line-height: 1.1; }
.agent-id .role { font-size: 10px; color: var(--muted); letter-spacing: 0; font-weight: 400; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-sched {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-radius: 999px;
  padding: 2px 6px;
  text-transform: uppercase;
}
.agent-sched.live { color: var(--green); background: rgba(0,255,102,0.1); border-color: rgba(0,255,102,0.3); }
.agent-sched.halted { color: var(--red); background: rgba(255,51,102,0.12); border-color: rgba(255,51,102,0.35); }
.agent-sched.idle { color: var(--muted); background: rgba(139,147,167,0.1); border-color: var(--border); }
.agent .rule {
  font-size: 10.5px;
  line-height: 1.3;
  color: var(--accent);
  font-weight: 500;
}
.agent .st {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== FLOW ===== */
.flow-panel {
  display: flex; flex-direction: column;
  overflow: hidden;
  position: relative;
}
.marble-rail {
  display: flex; gap: 6px; padding: 0 10px 6px;
  overflow: hidden;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}
.chip {
  flex: 1 1 0;
  min-width: 0;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px 4px;
  display: flex; flex-direction: column; gap: 1px;
}
.chip .sym { font-family: var(--mono); font-weight: 600; font-size: 11px; display: flex; justify-content: space-between; }
.chip .meta { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.chip .up { color: var(--green); }
.chip .dn { color: var(--red); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); display: inline-block; margin-left: 6px; box-shadow: 0 0 6px var(--cyan); }

.pipeline {
  position: relative;
  flex: 1;
  min-height: 150px;
  margin: 0 8px;
}
.pipes { position: absolute; inset: 28px 8% 54px; width: 84%; height: auto; left: 8%; pointer-events: none; }
.nodes {
  position: absolute; inset: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 18px;
}
.node {
  width: 86px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  position: relative; z-index: 2;
}
.node .orb {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 22%, var(--card-2)), var(--inset));
  color: var(--accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 25%, transparent);
}
.node[data-id="scan"] { --accent: var(--amber); }
.node[data-id="regime"] { --accent: var(--purple); }
.node[data-id="signal"] { --accent: var(--cyan); }
.node[data-id="risk"] { --accent: var(--red); }
.node[data-id="exec"] { --accent: var(--green); }
.node.dim .orb { opacity: 0.45; filter: grayscale(0.3); box-shadow: none; }
.node .lab { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--text); }
.node .sub { font-family: var(--mono); font-size: 9px; color: var(--muted); }

.marbles { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.marble {
  position: absolute;
  top: 28%;
  transform: translate(-50%, -50%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--inset);
  border: 1px solid var(--border-hi);
  color: var(--text);
  white-space: nowrap;
  transition: left 1.6s cubic-bezier(.22,.8,.25,1), top 0.8s ease, opacity 0.6s ease, transform 0.8s ease, background 0.3s, border-color 0.3s, color 0.3s;
}
.marble.alta { border-color: rgba(0,255,102,0.4); color: var(--green); }
.marble.baixa { border-color: rgba(255,51,102,0.4); color: var(--red); }
.marble.lateral { border-color: rgba(255,193,74,0.4); color: var(--amber); }
.marble.rejected {
  background: rgba(255,51,102,0.15);
  border-color: var(--red);
  color: var(--red);
  animation: drop 0.9s ease forwards;
}
@keyframes drop {
  0% { opacity: 1; transform: translate(-50%, -50%); }
  100% { transform: translate(-50%, 80px); opacity: 0; }
}
.marble .skull { margin-right: 3px; }

.pending-banner {
  margin: 6px 10px 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 229, 255, 0.06);
  border: 1px dashed rgba(0, 229, 255, 0.28);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}
.pending-banner.hide { display: none; }

/* ===== DETAIL + LOG (bottom mid) ===== */
.detail-panel, .log-panel {
  display: flex; flex-direction: column;
  overflow: hidden;
}
.pill-mini {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.pill-mini.open { color: var(--cyan); border-color: rgba(0,229,255,0.35); background: rgba(0,229,255,0.08); }
.pill-mini.closed { color: var(--muted); }
.trade-body { flex: 1; padding: 4px 14px 12px; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.trade-empty {
  flex: 1;
  display: grid; place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 10px;
  margin-bottom: 4px;
  background: var(--inset);
}
.trade-empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.trade-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.trade-pair { font-family: var(--mono); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.trade-pair .side { font-size: 10px; letter-spacing: 0.1em; margin-left: 8px; padding: 2px 6px; border-radius: 4px; vertical-align: middle; }
.trade-pair .side.long { background: rgba(0,255,102,0.12); color: var(--green); }
.trade-pnl { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.trade-pnl.up { color: var(--green); }
.trade-pnl.dn { color: var(--red); }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 3px 8px; font-size: 12px; }
.kv .k { color: var(--dim); text-transform: uppercase; font-size: 10px; letter-spacing: 0.08em; padding-top: 2px; }
.kv .v { font-family: var(--mono); font-weight: 500; }
.reason { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.reason b { color: var(--cyan); font-weight: 600; font-family: var(--sans); }

.term-head { background: transparent; }
.term-title { font-family: var(--mono); text-transform: none; letter-spacing: 0; color: var(--cyan); font-weight: 500; }
.term {
  flex: 1;
  margin: 0 8px 8px;
  background: var(--inset);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.45;
  color: #c8d0de;
  scrollbar-width: thin;
  scrollbar-color: #2a3140 transparent;
}
[data-theme="light"] .term { color: #2a3140; }
.term .ln { white-space: pre-wrap; word-break: break-word; }
.term .t { color: var(--dim); }
.term .tag { font-weight: 600; }
.term .tag-KRAKEN, .term .tag-DASH { color: var(--cyan); }
.term .tag-GUARDIAN { color: var(--red); }
.term .tag-BOT, .term .tag-MODO { color: var(--amber); }
.term .tag-HUNTER { color: var(--amber); }
.term .tag-AUDITOR { color: var(--cyan); }
.term .tag-BUILDER { color: var(--purple); }
.term .tag-EXECUTOR { color: var(--green); }
.term .tag-LOGGER { color: var(--orange); }
.term .tag-ERRO { color: var(--red); }
.term .cursor {
  display: inline-block; width: 7px; height: 12px; background: var(--cyan);
  margin-left: 2px; animation: blink 1s step-end infinite; vertical-align: text-bottom;
}

/* ===== RIGHT ===== */
.right {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0; overflow: hidden;
  background: transparent;
  border: none;
  padding: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
}
.stat {
  padding: 8px 10px 7px;
  min-height: 62px;
}
.stat .lbl { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.stat .val { font-family: var(--mono); font-size: 16px; font-weight: 700; margin-top: 4px; letter-spacing: -0.03em; }
.stat .sub { font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 2px; }
.stat .bar { height: 3px; background: #222632; border-radius: 99px; margin-top: 6px; overflow: hidden; }
[data-theme="light"] .stat .bar { background: #e4e7ee; }
.stat .bar > i { display: block; height: 100%; border-radius: 99px; background: var(--cyan); }
.stat .bar.warn > i { background: var(--amber); }
.stat .bar.bad > i { background: var(--red); }
.up { color: var(--green); }
.dn { color: var(--red); }
.na { color: var(--dim); font-weight: 500; }

.chart-card { flex: 0.82; min-height: 120px; display: flex; flex-direction: column; overflow: hidden; }
#equity-chart { flex: 1; min-height: 110px; }

.regime-card { flex: 0.82; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.regime-table { flex: 1; overflow: auto; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-color: #2a3140 transparent; }
.rt-row {
  display: grid;
  grid-template-columns: 64px 54px 1fr 58px;
  gap: 6px;
  align-items: center;
  padding: 2px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}
.rt-row.head { color: var(--dim); font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; position: sticky; top: 0; background: var(--card); }
.rt-row .p { font-family: var(--mono); font-weight: 600; }
.badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  text-align: center;
}
.badge.alta { background: rgba(0,255,102,0.12); color: var(--green); }
.badge.baixa { background: rgba(255,51,102,0.12); color: var(--red); }
.badge.lateral { background: rgba(255,193,74,0.12); color: var(--amber); }
.badge.na { background: rgba(139,147,167,0.1); color: var(--muted); }
.rt-chg, .rt-px { font-family: var(--mono); font-size: 10px; text-align: right; }

.champ-card { flex: 1.35; min-height: 210px; display: flex; flex-direction: column; overflow: hidden; }
#champ-body { padding: 0 10px 10px; overflow: auto; flex: 1; }
.champ-empty {
  background: var(--inset);
  border: 1px dashed rgba(168, 85, 247, 0.35);
  border-radius: 8px;
  padding: 6px 8px 5px;
  margin-bottom: 4px;
}
.champ-empty .kicker { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--purple); font-weight: 700; }
.champ-empty h4 { font-size: 13px; margin: 1px 0 2px; }
.champ-empty p { font-size: 10px; color: var(--muted); line-height: 1.3; }
.chal { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.chal .nm { font-size: 11px; font-weight: 600; }
.chal .src { font-size: 9px; color: var(--dim); margin-top: 1px; }
.chal .nums { font-family: var(--mono); font-size: 10px; text-align: right; color: var(--muted); }
.chal .nums b { color: var(--text); }

/* scrollbar general */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 6px; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #c5cad6; }

/* ---------- paper instances + guardian ---------- */
.inst-card { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.inst { border: 1px solid var(--border); border-radius: 10px; padding: 7px 9px; margin-top: 6px; background: var(--inset); font-size: 11px; }
.inst-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.inst-top b { font-family: var(--mono); color: var(--cyan); }
.inst-role { color: var(--muted); font-size: 10px; }
.inst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 8px; margin-top: 6px; }
.inst-grid div { display: flex; flex-direction: column; }
.inst-grid span { color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .04em; }
.inst-grid b { font-family: var(--mono); font-size: 12px; }
.inst-grid i { color: var(--dim); font-size: 9px; font-style: normal; }
.inst-pos { margin-top: 5px; color: var(--muted); font-family: var(--mono); font-size: 10px; }
.inst-pause { margin-top: 5px; color: var(--amber); font-size: 10px; }
.tag { font-family: var(--mono); font-size: 9px; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--border-hi); }
.tag-run { color: var(--green); border-color: rgba(0,255,102,.35); }
.tag-pause { color: var(--amber); border-color: rgba(255,193,74,.4); }
.tag-off { color: var(--muted); }
.tag-live { color: #ff3b3b; border-color: rgba(255,59,59,.55); font-weight: 700; }
.tag-halt { color: #fff; background: var(--red); border-color: var(--red); }
.pos { color: var(--green); } .neg { color: var(--red); } .warn { color: var(--amber); }
.halt-banner { position: sticky; top: 0; z-index: 50; background: var(--red); color: #fff; padding: 10px 16px; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; box-shadow: 0 4px 18px rgba(255,51,102,.45); }
.halt-banner[hidden] { display: none; }
.halt-banner b { font-family: var(--mono); letter-spacing: .06em; }
.halt-banner .hb-meta { opacity: .85; font-family: var(--mono); font-size: 11px; }

/* edge snapshot freshness */
.snap-label { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.offline-badge { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: #1a1200; background: #f5b301; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.offline-badge[hidden], .snap-label[hidden] { display: none; }
