:root {
  color-scheme: dark;
  --bg: #0a0c0d;
  --bg-2: #0f1214;
  --panel: #121619;
  --panel-2: #171c20;
  --line: #263038;
  --line-soft: #1c242a;
  --text: #edf2f4;
  --muted: #91a0aa;
  --faint: #5f6d76;
  --cyan: #67d5de;
  --cyan-dim: #163a3e;
  --green: #71d69a;
  --green-dim: #173425;
  --amber: #e8b95f;
  --amber-dim: #3b2f17;
  --red: #ef7d79;
  --red-dim: #40201f;
  --purple: #b2a3ff;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { display: grid; grid-template-columns: 238px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line-soft); background: linear-gradient(180deg,#0d1012 0%,#0a0c0d 100%); display: flex; flex-direction: column; gap: 18px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #e7edef; color: #0b0d0e; font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.brand h1 { margin: 0; font-size: 15px; line-height: 1.2; }
.brand p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.observer-badge { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #0f1416; color: var(--muted); font-size: 12px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(113,214,154,.08); }
.nav { display: grid; gap: 5px; }
.nav-item { border: 0; background: transparent; color: var(--muted); text-align: left; padding: 10px 11px; border-radius: 9px; display: flex; justify-content: space-between; align-items: center; }
.nav-item:hover { background: #11161a; color: var(--text); }
.nav-item.active { color: var(--text); background: #172026; }
.nav-count { min-width: 24px; text-align: center; font-size: 11px; padding: 2px 6px; border-radius: 99px; background: #222b31; color: var(--muted); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--line-soft); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; color: var(--muted); }
.kv strong { color: var(--text); font-weight: 650; }
.main { min-width: 0; padding: 22px 24px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.topbar h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.topbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.pill { padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 750; border: 1px solid var(--line); }
.pill.ok { background: var(--green-dim); color: var(--green); border-color: #245a3c; }
.pill.bad { background: var(--red-dim); color: var(--red); border-color: #63302e; }
.pill.neutral { background: #14191c; color: var(--muted); }
.subtle { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.view { display: none; gap: 16px; }
.view.active { display: grid; }
.metric-grid { display: grid; grid-template-columns: repeat(6,minmax(130px,1fr)); gap: 12px; }
.metric-card { background: linear-gradient(180deg,#151a1e,#111518); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; min-height: 108px; box-shadow: var(--shadow); }
.metric-card .label { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; font-weight: 750; }
.metric-card .value { margin-top: 12px; font-size: 27px; line-height: 1; font-weight: 760; letter-spacing: -.04em; }
.metric-card .foot { margin-top: 9px; color: var(--faint); font-size: 11px; }
.panel { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head.wrap { flex-wrap: wrap; }
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.two-col { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.chart-panel canvas { width: 100%; height: 180px; display: block; }
.live-tag { font-size: 9px; font-weight: 800; letter-spacing: .12em; color: var(--green); }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.detail { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 11px; background: #101417; }
.detail span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.detail strong { display: block; margin-top: 5px; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.feature-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.feature { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px; color: var(--muted); font-size: 11px; }
.feature b { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.feature.on b { background: var(--green); }
.event-stream { height: 320px; overflow: auto; display: grid; align-content: start; gap: 1px; background: #0d1113; border: 1px solid var(--line-soft); border-radius: 10px; }
.event { display: grid; grid-template-columns: 82px 150px minmax(0,1fr); gap: 10px; padding: 8px 10px; border-bottom: 1px solid #151c20; font-size: 11px; }
.event .time { color: var(--faint); }
.event .kind { color: var(--cyan); font-weight: 650; }
.event.error .kind { color: var(--red); }
.event .detail-json { color: var(--muted); overflow-wrap: anywhere; }
.table-wrap { width: 100%; overflow: auto; max-height: 560px; border: 1px solid var(--line-soft); border-radius: 10px; }
.table-wrap.compact { max-height: 420px; }
.table-wrap.tall { max-height: 680px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 11px; }
th { position: sticky; top: 0; z-index: 1; text-align: left; background: #161c20; color: #9eadb5; padding: 9px 10px; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid #1a2227; color: #dbe2e5; vertical-align: middle; }
tbody tr { background: #101417; }
tbody tr:hover { background: #141b1f; }
.worker-id { font-weight: 650; color: var(--text); }
.bar { width: 86px; height: 6px; border-radius: 99px; background: #222c32; overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--cyan); border-radius: inherit; }
.bar.warn > i { background: var(--amber); }
.bar.bad > i { background: var(--red); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dot.green { background: var(--green); }.dot.amber { background: var(--amber); }.dot.gray { background: var(--faint); }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 10px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.status { display: inline-flex; gap: 6px; align-items: center; font-weight: 650; }
.status.ok { color: var(--green); }.status.fail { color: var(--red); }.status.pending { color: var(--amber); }
.stack-list { display: grid; gap: 8px; }
.stack-item { border: 1px solid var(--line-soft); background: #101417; border-radius: 10px; padding: 10px; }
.stack-item .title { font-size: 12px; font-weight: 650; }
.stack-item .meta { margin-top: 5px; color: var(--muted); font-size: 10px; }
.inline-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.inline-stat { background: #101417; border: 1px solid var(--line-soft); padding: 8px 10px; border-radius: 9px; color: var(--muted); font-size: 10px; }
.inline-stat strong { color: var(--text); margin-left: 4px; }
.search, input, select, textarea { width: 100%; border: 1px solid var(--line); background: #0e1214; color: var(--text); border-radius: 9px; padding: 9px 10px; outline: none; }
.search { width: min(280px,100%); }
input:focus, select:focus, textarea:focus { border-color: #3e606b; box-shadow: 0 0 0 3px rgba(103,213,222,.06); }
textarea { min-height: 112px; resize: vertical; font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.tool-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.tool-card { display: grid; gap: 12px; align-content: start; }
.form-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
button.primary, button.secondary, button.danger, button.ghost { border-radius: 9px; padding: 9px 12px; font-size: 11px; font-weight: 750; }
button.primary { border: 1px solid #4e9097; background: #d8f5f7; color: #0a1113; }
button.secondary { border: 1px solid var(--line); background: #1b2328; color: var(--text); }
button.danger { border: 1px solid #7d3c39; background: #3b201f; color: #ffaaa5; }
button.ghost { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.secondary-link { display: inline-block; border: 1px solid var(--line); background: #1b2328; color: var(--text); text-decoration: none; text-align: center; border-radius: 9px; padding: 9px 12px; font-size: 11px; font-weight: 750; }
.warning-banner { border: 1px solid #604f2a; background: #251f13; color: #e5c985; border-radius: 11px; padding: 11px 13px; font-size: 11px; }
.result-box { min-height: 170px; max-height: 480px; overflow: auto; margin: 0; border: 1px solid var(--line-soft); background: #0c1012; border-radius: 10px; padding: 12px; color: #c9d4d9; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.hidden { display: none !important; }
.empty { color: var(--faint); padding: 18px !important; text-align: center; }
.hash { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

@media (max-width: 1250px) { .metric-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 940px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line-soft); } .nav { grid-template-columns: repeat(3,1fr); } .sidebar-bottom { display: none; } .two-col, .tool-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .main { padding: 16px 12px 30px; } .metric-grid { grid-template-columns: repeat(2,1fr); } .nav { grid-template-columns: repeat(2,1fr); } .topbar { align-items: flex-start; flex-direction: column; } .feature-grid, .detail-grid, .form-row { grid-template-columns: 1fr; } }
