/* Elysium Console. One stylesheet, tokens first. Dark is the default; light follows the OS
   unless the viewer picks a theme (data-theme on <html>). */

:root {
  color-scheme: dark;
  --bg: #0b0d11;
  --surface: #12151b;
  --raised: #181c24;
  --sunken: #0e1015;
  --line: #232833;
  --line-soft: #1b1f28;
  --text: #e9ebef;
  --text-2: #a9b0bd;
  --muted: #727a8a;
  --accent: #5fd0a6;
  --accent-ink: #06231a;
  --accent-soft: rgba(95, 208, 166, 0.12);
  --focus: #8fe3c4;

  /* lanes: identity colours, used on marks and tags only (never on running text) */
  --core: #3987e5;
  --core-soft: rgba(57, 135, 229, 0.14);
  --evm: #d95926;
  --evm-soft: rgba(217, 89, 38, 0.16);

  /* status: reserved, always shown with a word */
  --good: #2fb344;
  --good-soft: rgba(47, 179, 68, 0.14);
  --warn: #fab219;
  --warn-soft: rgba(250, 178, 25, 0.13);
  --bad: #ef5d5d;
  --bad-soft: rgba(239, 93, 93, 0.14);
  --info: #7aa7f0;
  --info-soft: rgba(122, 167, 240, 0.13);

  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --r: 10px;
  --r-sm: 6px;
  --nav-w: 216px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f6f6f4;
    --surface: #ffffff;
    --raised: #f1f1ee;
    --sunken: #f3f3f0;
    --line: #dedcd6;
    --line-soft: #eae8e3;
    --text: #15171a;
    --text-2: #4b505a;
    --muted: #7a7f89;
    --accent: #0f7a57;
    --accent-ink: #ffffff;
    --accent-soft: rgba(15, 122, 87, 0.1);
    --focus: #0f7a57;
    --core: #2a78d6;
    --core-soft: rgba(42, 120, 214, 0.12);
    --evm: #d4551f;
    --evm-soft: rgba(212, 85, 31, 0.12);
    --good: #0b8a1e;
    --good-soft: rgba(11, 138, 30, 0.1);
    --warn: #9a6a00;
    --warn-soft: rgba(237, 161, 0, 0.16);
    --bad: #c93434;
    --bad-soft: rgba(201, 52, 52, 0.1);
    --info: #2a66c4;
    --info-soft: rgba(42, 102, 196, 0.1);
    --shadow: 0 12px 32px rgba(20, 20, 20, 0.14);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f4;
  --surface: #ffffff;
  --raised: #f1f1ee;
  --sunken: #f3f3f0;
  --line: #dedcd6;
  --line-soft: #eae8e3;
  --text: #15171a;
  --text-2: #4b505a;
  --muted: #7a7f89;
  --accent: #0f7a57;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 122, 87, 0.1);
  --focus: #0f7a57;
  --core: #2a78d6;
  --core-soft: rgba(42, 120, 214, 0.12);
  --evm: #d4551f;
  --evm-soft: rgba(212, 85, 31, 0.12);
  --good: #0b8a1e;
  --good-soft: rgba(11, 138, 30, 0.1);
  --warn: #9a6a00;
  --warn-soft: rgba(237, 161, 0, 0.16);
  --bad: #c93434;
  --bad-soft: rgba(201, 52, 52, 0.1);
  --info: #2a66c4;
  --info-soft: rgba(42, 102, 196, 0.1);
  --shadow: 0 12px 32px rgba(20, 20, 20, 0.14);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--accent-soft); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); font-size: 0.93em; }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.grow { flex: 1 1 auto; min-width: 0; }
.hide { display: none !important; }

/* ---- shell ------------------------------------------------------------------------- */
.shell { display: flex; min-height: 100vh; }
.nav {
  width: var(--nav-w); flex: 0 0 var(--nav-w);
  background: var(--surface); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 14px 10px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav-group { margin-top: 14px; }
.nav-label { font-size: 11px; color: var(--muted); padding: 0 8px 4px; }
.nav a.item {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: var(--r-sm);
  color: var(--text-2); font-size: 13.5px;
}
.nav a.item:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.nav a.item[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.nav a.item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: 0.85; }
.nav a.item .ext { margin-left: auto; color: var(--muted); font-size: 11px; }
.nav-foot { margin-top: auto; padding: 12px 8px 0; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.nav-foot .row { margin-top: 8px; }

.col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.main { padding: 22px 24px 64px; width: 100%; max-width: 1360px; margin: 0 auto; outline: none; }
.icon-btn.menu-btn { display: none; }

.search { position: relative; flex: 1 1 auto; max-width: 620px; }
.search input {
  width: 100%; height: 36px; padding: 0 44px 0 34px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--muted); }
.search kbd { position: absolute; right: 9px; top: 8px; }
kbd {
  font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 5px; background: var(--raised);
}
.search-pop {
  position: absolute; left: 0; right: 0; top: 42px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; z-index: 30;
}
.search-pop .opt { display: flex; gap: 10px; align-items: baseline; padding: 7px 9px; border-radius: var(--r-sm); cursor: pointer; }
.search-pop .opt[aria-selected="true"], .search-pop .opt:hover { background: var(--raised); }
.search-pop .opt .what { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.search-pop .hint { padding: 7px 9px; color: var(--muted); font-size: 12.5px; }

.head-live { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.head-live b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; flex: 0 0 8px; }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.live { box-shadow: 0 0 0 0 var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47,179,68,.5); } 70% { box-shadow: 0 0 0 7px rgba(47,179,68,0); } 100% { box-shadow: 0 0 0 0 rgba(47,179,68,0); } }
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- page furniture ---------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; font-weight: 680; letter-spacing: -0.015em; line-height: 1.25; }
.page-head .lede { color: var(--text-2); margin-top: 4px; max-width: 76ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--text-2); }
h2.sec { font-size: 15px; font-weight: 650; margin: 0; }
.sec-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.g-main { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(220px, 270px) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.spread { justify-content: space-between; }
.mt { margin-top: 14px; }
.mt-lg, h2.sec.mt-lg { margin-top: 26px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); min-width: 0; }
.card > .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.card > .hd .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card > .bd { padding: 14px 16px; }
.card > .bd.flush { padding: 0; }
.card > .ft { padding: 10px 16px; border-top: 1px solid var(--line-soft); color: var(--text-2); font-size: 12.5px; }
.card.pad { padding: 16px; }

/* stat tile: a headline number, not a chart */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 16px 12px; min-width: 0; position: relative; }
.stat .k { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; margin-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.stat .v small { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin-left: 3px; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.stat .spark { position: absolute; right: 12px; top: 12px; width: 96px; height: 30px; }
.stat.sm .v { font-size: 19px; }

/* badges and tags */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 550; line-height: 1.6; white-space: nowrap; border: 1px solid transparent;
  background: var(--raised); color: var(--text-2);
}
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.plain { background: transparent; border-color: var(--line); }
.badge .dot { width: 6px; height: 6px; flex-basis: 6px; background: currentColor; }
.lane { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.lane::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--muted); }
.lane.core::before { background: var(--core); }
.lane.evm::before { background: var(--evm); }
.tag { font: 12px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--raised); color: var(--text-2); white-space: nowrap; }
.label-chip { font-size: 11.5px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--text); margin-left: 6px; white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--text);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.btn.ghost { background: transparent; }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12.5px; border-radius: 6px; }
.btn svg { width: 14px; height: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; background: transparent;
  color: var(--muted); border-radius: 5px; cursor: pointer; padding: 0; vertical-align: middle;
}
.icon-btn:hover { color: var(--text); background: var(--raised); }
.icon-btn svg { width: 13px; height: 13px; }
.icon-btn.done { color: var(--good); }

/* segmented control and tabs */
.seg { display: inline-flex; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--text-2); height: 26px; padding: 0 10px; border-radius: 6px; cursor: pointer; font-size: 12.5px; font-weight: 550; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.tabs { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 14px; overflow-x: auto; overflow-y: hidden; }
.tabs button {
  border: 0; background: transparent; color: var(--text-2); padding: 9px 12px; cursor: pointer; font-size: 13.5px; font-weight: 550;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .count { color: var(--muted); font-weight: 500; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* forms */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .field > .lbl { font-size: 12.5px; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 34px; padding: 6px 10px; border-radius: 8px; background: var(--sunken);
  border: 1px solid var(--line); font-size: 13.5px;
}
textarea.input { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; resize: vertical; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); align-items: end; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-weight: 550; color: var(--muted); font-size: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface);
}
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.link { cursor: pointer; }
.tbl tbody tr.link:hover { background: var(--raised); }
.tbl th.right, .tbl td.right { text-align: right; }
.tbl td.wrap { overflow-wrap: anywhere; }
.tbl td.clip { max-width: 0; width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl.compact td, .tbl.compact th { padding: 6px 8px; }
.tbl.compact td:first-child, .tbl.compact th:first-child { padding-left: 14px; }
.tbl.compact td:last-child, .tbl.compact th:last-child { padding-right: 14px; }
.scroll-y { max-height: 460px; overflow-y: auto; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.empty b { display: block; color: var(--text-2); font-weight: 600; margin-bottom: 2px; }

/* key/value lists */
dl.kv { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); gap: 0; margin: 0; }
dl.kv dt { color: var(--text-2); font-size: 13px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
dl.kv dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line-soft); overflow-wrap: anywhere; min-width: 0; }
dl.kv dt:last-of-type, dl.kv dd:last-of-type { border-bottom: 0; }
dl.kv.tight dt, dl.kv.tight dd { padding: 5px 0; }

.hash { font-family: var(--mono); font-size: 12.5px; }
a.hash { white-space: nowrap; }
.copyable a.hash { white-space: normal; }
a.hash, .tbl a { color: var(--accent); }
.copyable { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.copyable > span, .copyable > a { overflow-wrap: anywhere; min-width: 0; }

/* code and json */
pre.code {
  margin: 0; padding: 12px 14px; background: var(--sunken); border: 1px solid var(--line); border-radius: 8px;
  font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-height: 420px; overflow: auto;
}
.code-wrap { position: relative; }
.code-wrap > .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--raised); }
.json { font: 12.5px/1.55 var(--mono); overflow-wrap: anywhere; }
.json details { margin-left: 14px; }
.json details > summary { cursor: pointer; margin-left: -14px; list-style: none; }
.json details > summary::-webkit-details-marker { display: none; }
.json details > summary::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted); }
.json details[open] > summary::before { content: "▾"; }
.json .leaf { margin-left: 14px; }
.json .k { color: var(--info); }
.json .s { color: var(--text); }
.json .n { color: var(--warn); }
.json .b { color: var(--accent); }
.json .z { color: var(--muted); }
.json .more { color: var(--muted); }

/* meters and bars */
.meter { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; vertical-align: middle; }
.meter > i { display: block; height: 100%; background: var(--evm); border-radius: 3px; }
.meter.core > i { background: var(--core); }
.meter.neutral > i { background: var(--text-2); }
.meter.wide { width: 100%; height: 8px; }
.split-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface); }
.split-bar > i { display: block; height: 100%; min-width: 2px; }

/* notes and callouts */
.note { border: 1px solid var(--line); border-left: 3px solid var(--info); background: var(--surface); border-radius: var(--r-sm); padding: 10px 14px; color: var(--text-2); font-size: 13px; }
.note.warn { border-left-color: var(--warn); }
.note.bad { border-left-color: var(--bad); }
.note.good { border-left-color: var(--good); }
.note b { color: var(--text); }

.steps { counter-reset: step; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.step::before {
  counter-increment: step; content: counter(step); width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12.5px; display: grid; place-items: center;
}
.step h3 { font-size: 14.5px; font-weight: 650; }
.step p { color: var(--text-2); font-size: 13px; }
.step .row { margin-top: auto; padding-top: 4px; }

/* trace tree */
.trace { font-size: 13px; }
.trace details { border-left: 2px solid var(--line); margin-left: 7px; padding-left: 12px; }
.trace > details { border-left: 0; margin-left: 0; padding-left: 0; }
.trace summary { cursor: pointer; padding: 5px 6px; border-radius: var(--r-sm); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; list-style: none; }
.trace summary::-webkit-details-marker { display: none; }
.trace summary::before { content: "▸"; color: var(--muted); width: 10px; flex: 0 0 10px; }
.trace details[open] > summary::before { content: "▾"; }
.trace summary:hover { background: var(--raised); }
.trace .leaf { border-left: 2px solid var(--line); margin-left: 7px; padding: 4px 6px 4px 12px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.trace .stepno { font: 11.5px var(--mono); color: var(--muted); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.trace .name { font-weight: 600; }
.trace .native { font: 11.5px var(--mono); color: var(--muted); }
.trace .hl { background: var(--accent-soft); border-radius: var(--r-sm); }
.trace .arrow { color: var(--muted); }
.diff-old { color: var(--bad); }
.diff-new { color: var(--good); }
.call { font: 12.5px/1.5 var(--mono); }
.call .op { font-weight: 700; }
.call .gas { color: var(--muted); }

/* opcode table */
.ops td, .ops th { font-family: var(--mono); font-size: 12px; }

/* charts */
.chart { width: 100%; display: block; }
.chart text { font: 11px var(--sans); fill: var(--muted); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .gridline { stroke: var(--line-soft); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--raised); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 9px; font-size: 12.5px; box-shadow: var(--shadow); max-width: 280px;
}

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 70; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--raised); border: 1px solid var(--line); border-left: 3px solid var(--info); border-radius: 8px; padding: 10px 14px; box-shadow: var(--shadow); font-size: 13px; overflow-wrap: anywhere; }
.toast.good { border-left-color: var(--good); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }

.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--raised), var(--line-soft), var(--raised)); background-size: 200% 100%; animation: sk 1.4s infinite; min-height: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

.ladder { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ladder .rung { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface); }
.ladder .rung.on { border-color: var(--accent); background: var(--accent-soft); }
.ladder .rung .n { font-size: 12px; color: var(--muted); }
.ladder .rung .t { font-weight: 650; margin-top: 2px; }
.ladder .rung .d { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }

/* ---- responsive -------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .nav { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform 0.18s ease; box-shadow: var(--shadow); }
  .shell.nav-open .nav { transform: none; }
  .icon-btn.menu-btn { display: inline-grid; }
  .top { padding: 10px 14px; }
  .main { padding: 16px 14px 48px; }
  .g2, .g3, .g4, .g-side { grid-template-columns: minmax(0, 1fr); }
  .head-live .opt { display: none; }
  dl.kv { grid-template-columns: minmax(0, 1fr); }
  dl.kv dt { border-bottom: 0; padding-bottom: 0; }
}
