/* Lineage dashboard. Tokens first: light palette on :root, dark redefined in both scopes. */

:root {
  color-scheme: light;
  --page: #f6f6f4;
  --panel: #ffffff;
  --panel-2: #f3f3f0;
  --panel-3: #ebebe7;
  --line: #e1e0d9;
  --line-soft: #ecebe6;
  --text: #121212;
  --dim: #52514e;
  --faint: #8a8984;

  --accent: #2a78d6;
  --accent-soft: color-mix(in oklab, var(--accent) 10%, transparent);
  --accent-ink: #1c5cab;

  --good: #0a7d0a;
  --good-soft: color-mix(in oklab, #0ca30c 12%, transparent);
  --warn: #9a6b00;
  --warn-soft: color-mix(in oklab, #fab219 18%, transparent);
  --bad: #c03030;
  --bad-soft: color-mix(in oklab, #d03b3b 11%, transparent);
  --info-soft: color-mix(in oklab, var(--accent) 9%, transparent);

  --series-1: #2a78d6; /* base samples */
  --series-2: #eb6834; /* candidate samples */
  --grid: #e1e0d9;
  --axis: #c3c2b7;

  --diff-add: color-mix(in oklab, #0ca30c 13%, var(--panel));
  --diff-add-ink: #0a6a0a;
  --diff-del: color-mix(in oklab, #d03b3b 11%, var(--panel));
  --diff-del-ink: #a42a2a;
  --diff-hunk: color-mix(in oklab, var(--accent) 8%, var(--panel));

  --shadow: 0 1px 0 rgba(17, 17, 17, 0.03), 0 1px 3px rgba(17, 17, 17, 0.04);
  --radius: 10px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0b0c0e;
    --panel: #121418;
    --panel-2: #171a1f;
    --panel-3: #1d2027;
    --line: #252932;
    --line-soft: #1c1f26;
    --text: #eceef2;
    --dim: #a4a9b4;
    --faint: #6b717d;
    --accent: #4b93ea;
    --accent-ink: #8fbcf3;
    --good: #3cc23c;
    --warn: #e7b23a;
    --bad: #f07272;
    --series-1: #3987e5;
    --series-2: #d95926;
    --grid: #22252c;
    --axis: #383c45;
    --diff-add: color-mix(in oklab, #0ca30c 16%, var(--panel));
    --diff-add-ink: #7fd67f;
    --diff-del: color-mix(in oklab, #d03b3b 18%, var(--panel));
    --diff-del-ink: #f29a9a;
    --diff-hunk: color-mix(in oklab, var(--accent) 12%, var(--panel));
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0c0e;
  --panel: #121418;
  --panel-2: #171a1f;
  --panel-3: #1d2027;
  --line: #252932;
  --line-soft: #1c1f26;
  --text: #eceef2;
  --dim: #a4a9b4;
  --faint: #6b717d;
  --accent: #4b93ea;
  --accent-ink: #8fbcf3;
  --good: #3cc23c;
  --warn: #e7b23a;
  --bad: #f07272;
  --series-1: #3987e5;
  --series-2: #d95926;
  --grid: #22252c;
  --axis: #383c45;
  --diff-add: color-mix(in oklab, #0ca30c 16%, var(--panel));
  --diff-add-ink: #7fd67f;
  --diff-del: color-mix(in oklab, #d03b3b 18%, var(--panel));
  --diff-del-ink: #f29a9a;
  --diff-hunk: color-mix(in oklab, var(--accent) 12%, var(--panel));
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 13px/1.45 var(--font);
  font-feature-settings: "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--accent-ink); }
a.link:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.unit { color: var(--faint); font-weight: 400; margin-left: 3px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.eyebrow { font: 600 10.5px/1.2 var(--font); letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); }
.hash { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; color: var(--dim); }
.hash.full { word-break: break-all; }

/* ---------------------------------------------------------------- shell */

.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1360px; margin: 0 auto; padding: 0 24px; height: 52px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 14.5px; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 20px; height: 20px; flex: none; }
.brand .ph { font-weight: 450; color: var(--faint); font-size: 11.5px; letter-spacing: 0; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 6px 10px; border-radius: 7px; color: var(--dim); font-weight: 500; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.nav a:hover { color: var(--text); background: var(--panel-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--panel-3); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live[data-s="open"] i { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.live[data-s="down"] i { background: var(--bad); }
.iconbtn {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); cursor: pointer; color: var(--dim);
  transition: background 0.15s, color 0.15s;
}
.iconbtn:hover { color: var(--text); background: var(--panel-2); }
.iconbtn svg { width: 15px; height: 15px; }

main { max-width: 1360px; margin: 0 auto; padding: 20px 24px 64px; }
.foot { max-width: 1360px; margin: 0 auto; padding: 0 24px 32px; color: var(--faint); font-size: 11.5px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- page header */

.ph-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.ph-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ph-title h1 { font-size: 22px; line-height: 1.15; word-break: break-word; }
.ph-sub { color: var(--dim); display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; color: var(--faint); font-size: 12px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }

/* ---------------------------------------------------------------- panels */

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); min-height: 44px; }
.panel-h h2 { font-size: 13px; font-weight: 600; }
.panel-h .count { color: var(--faint); font-weight: 500; }
.panel-h .aside { margin-left: auto; color: var(--faint); font-size: 12px; display: flex; gap: 10px; align-items: center; }
.panel-b { padding: 14px; }
.panel-note { padding: 10px 14px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 12px; }
.milled { position: relative; overflow: hidden; }
.milled::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--accent) 55%, transparent), transparent); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }
.sticky { position: sticky; top: 68px; }

/* ---------------------------------------------------------------- stat strip */

.stats { display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); }
.stat { padding: 13px 16px 14px; min-width: 0; border-left: 1px solid var(--line-soft); }
.stat:first-child { border-left: 0; }
.stat .v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.stat .v.sm { font-size: 17px; }
.stat .s { color: var(--faint); font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats-2 { border-top: 1px solid var(--line-soft); }

/* ---------------------------------------------------------------- tables */

.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.t th { text-align: left; font: 600 10.5px/1.2 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 9px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t th:first-child, .t td:first-child { padding-left: 14px; }
.t th:last-child, .t td:last-child { padding-right: 14px; }
.t th.right, .t td.right { text-align: right; }
.t tbody tr.rowlink { cursor: pointer; transition: background 0.12s; }
.t tbody tr.rowlink:hover { background: var(--panel-2); }
.t .sub { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.t td.wrap { white-space: normal; }
.t tr.reverted td { opacity: 0.62; }
.t tr.reverted td .eff { text-decoration: line-through; text-decoration-color: var(--faint); }

/* key/value lists */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; }
.kv > div { padding: 7px 14px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.kv > div:nth-child(odd) { color: var(--faint); padding-right: 6px; white-space: nowrap; }
.kv > div:nth-child(even) { word-break: break-word; }
.kv > div:nth-last-child(-n + 2) { border-bottom: 0; }

/* ---------------------------------------------------------------- badges */

.b { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 550; white-space: nowrap; background: var(--panel-3); color: var(--dim); vertical-align: middle; }
.b svg { width: 11px; height: 11px; flex: none; }
.b.good { background: var(--good-soft); color: var(--good); }
.b.bad { background: var(--bad-soft); color: var(--bad); }
.b.warn { background: var(--warn-soft); color: var(--warn); }
.b.info { background: var(--info-soft); color: var(--accent-ink); }
.b.outline { background: transparent; border: 1px solid var(--line); }
.b.kind { background: transparent; border: 1px solid var(--line); color: var(--dim); font-weight: 500; }

/* effect */
.eff { font-weight: 600; white-space: nowrap; }
.eff.good { color: var(--good); }
.eff.bad { color: var(--bad); }
.ratio { color: var(--dim); font-weight: 400; }
.pr { display: flex; gap: 4px 10px; flex-wrap: wrap; color: var(--faint); font-size: 11.5px; margin-top: 3px; }

/* ---------------------------------------------------------------- feed */

.feed { max-height: calc(100vh - 140px); overflow-y: auto; overscroll-behavior: contain; }
.feed-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line-soft); align-items: start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
.feed-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--panel-3); color: var(--dim); }
.feed-ic svg { width: 12px; height: 12px; }
.feed-ic.good { background: var(--good-soft); color: var(--good); }
.feed-ic.bad { background: var(--bad-soft); color: var(--bad); }
.feed-ic.warn { background: var(--warn-soft); color: var(--warn); }
.feed-ic.info { background: var(--info-soft); color: var(--accent-ink); }
.feed-t { min-width: 0; }
.feed-t .h { font-weight: 550; }
.feed-t .d { color: var(--dim); font-size: 12px; margin-top: 1px; word-break: break-word; }
.feed-time { color: var(--faint); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-soft); }
.seg button { border: 0; background: transparent; padding: 3px 9px; border-radius: 6px; cursor: pointer; color: var(--dim); font-size: 12px; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--panel-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: var(--panel-3); } }

/* ---------------------------------------------------------------- chain */

.chain { position: relative; }
.chain-node { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0; }
.chain-rail { position: relative; display: flex; justify-content: center; }
.chain-rail::before { content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: var(--line); }
.chain-node:first-child .chain-rail::before { top: 22px; }
.chain-node:last-child .chain-rail::before { bottom: calc(100% - 22px); }
.chain-dot { position: relative; margin-top: 15px; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); }
.chain-dot.genesis { border-color: var(--faint); }
.chain-dot.revert { border-color: var(--bad); }
.chain-dot.reverted { border-color: var(--faint); background: var(--panel-3); }
.chain-dot.tip { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.chain-body { padding: 10px 14px 10px 0; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.chain-node:last-child .chain-body { border-bottom: 0; }
.chain-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chain-head .h { font-weight: 600; }
.chain-meta { display: flex; gap: 4px 14px; flex-wrap: wrap; color: var(--faint); font-size: 12px; margin-top: 4px; }
.chain-body:hover .h { color: var(--accent-ink); }

/* ---------------------------------------------------------------- hero */

.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)); }
.hero > div { padding: 16px; border-left: 1px solid var(--line-soft); min-width: 0; }
.hero > div:first-child { border-left: 0; }
.hero .big { font-size: 34px; font-weight: 650; letter-spacing: -0.03em; line-height: 1.05; margin-top: 8px; font-variant-numeric: tabular-nums; }
.hero .mid { font-size: 18px; font-weight: 600; margin-top: 8px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hero .s { color: var(--dim); margin-top: 4px; font-size: 12px; }

/* ---------------------------------------------------------------- diff (owner rule: no monospace in UI; Geist with preserved whitespace) */

.diff { font: 400 12.5px/1.6 var(--font); font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; font-variant-numeric: tabular-nums; overflow-x: auto; tab-size: 4; }
.diff table { border-collapse: collapse; min-width: 100%; }
.diff td { padding: 0 12px; white-space: pre; vertical-align: top; }
.diff td.ln { width: 1%; color: var(--faint); text-align: right; user-select: none; padding: 0 8px; font-size: 11.5px; }
.diff td.sg { width: 1%; padding: 0 2px 0 6px; user-select: none; color: var(--faint); }
.diff tr.add { background: var(--diff-add); }
.diff tr.add td.code, .diff tr.add td.sg { color: var(--diff-add-ink); }
.diff tr.del { background: var(--diff-del); }
.diff tr.del td.code, .diff tr.del td.sg { color: var(--diff-del-ink); }
.diff tr.hunk td { background: var(--diff-hunk); color: var(--accent-ink); padding-top: 3px; padding-bottom: 3px; font-size: 11.5px; }
.diff tr.file td { background: var(--panel-2); color: var(--text); font-weight: 600; padding-top: 7px; padding-bottom: 7px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.diff tr.file:first-child td { border-top: 0; }

/* ---------------------------------------------------------------- replays */

.replay { border-top: 1px solid var(--line-soft); }
.replay:first-child { border-top: 0; }
.replay-h { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 12px 14px 8px; }
.replay-h .h { font-weight: 600; }
.replay-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 0; }
.replay-grid > div { padding: 4px 14px 14px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.testlist { margin: 6px 0 0; padding: 0; list-style: none; color: var(--dim); font-size: 12px; }
.testlist li { padding: 2px 0; word-break: break-all; }

.chart { width: 100%; display: block; }
.chart text { font-family: var(--font); font-size: 10.5px; fill: var(--faint); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .base { fill: var(--series-1); stroke: var(--panel); stroke-width: 1.5; }
.chart .cand { fill: var(--series-2); stroke: var(--panel); stroke-width: 1.5; }
.chart .med { stroke-width: 2; stroke-linecap: round; }
.chart .med.base { stroke: var(--series-1); }
.chart .med.cand { stroke: var(--series-2); }
.chart .lbl { fill: var(--dim); font-weight: 500; }
.chart .hit { fill: transparent; cursor: default; }
.legend { display: flex; gap: 14px; align-items: center; color: var(--dim); font-size: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.legend i.base { background: var(--series-1); }
.legend i.cand { background: var(--series-2); }
.metric-block + .metric-block { margin-top: 10px; }
.metric-block .mh { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.metric-block .mh .n { font-weight: 600; }

#tip {
  position: fixed; z-index: 50; pointer-events: none; padding: 7px 9px; border-radius: 8px;
  background: var(--text); color: var(--panel); font-size: 12px; line-height: 1.35; max-width: 280px;
  font-variant-numeric: tabular-nums; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

/* ---------------------------------------------------------------- misc */

.banner { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); margin-bottom: 16px; }
.banner svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.banner.warn { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 30%, transparent); }
.banner.warn svg { color: var(--warn); }
.banner.bad { background: var(--bad-soft); border-color: color-mix(in oklab, var(--bad) 30%, transparent); }
.banner.bad svg { color: var(--bad); }
.banner.info { background: var(--info-soft); border-color: color-mix(in oklab, var(--accent) 25%, transparent); }
.banner.info svg { color: var(--accent-ink); }
.banner .t1 { font-weight: 600; }
.banner .t2 { color: var(--dim); margin-top: 2px; }

.empty { padding: 22px 14px; color: var(--dim); text-align: center; overflow-wrap: anywhere; }
.empty .t1 { color: var(--text); font-weight: 550; }
.empty code, .errorbox code { font-family: var(--font); background: var(--panel-3); padding: 2px 6px; border-radius: 5px; color: var(--text); }

.errorbox { max-width: 640px; margin: 48px auto; padding: 22px; }
.errorbox h1 { font-size: 17px; margin-bottom: 8px; }
.errorbox p { color: var(--dim); margin: 6px 0; }

.skel { height: 12px; border-radius: 4px; background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: 0 0; } }

.paths { display: flex; flex-wrap: wrap; gap: 5px; }
.paths span { padding: 2px 7px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-soft); font-size: 12px; color: var(--dim); }
.paths.prot span { background: var(--bad-soft); border-color: transparent; color: var(--bad); }

.bar { position: relative; height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; min-width: 60px; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); }

details.more summary { cursor: pointer; color: var(--accent-ink); padding: 10px 14px; list-style: none; font-weight: 500; }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary { border-bottom: 1px solid var(--line-soft); }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .feed { max-height: 520px; }
  .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero > div:nth-child(3) { border-left: 0; }
  .hero > div:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats .stat:nth-child(3n + 1) { border-left: 0; }
  .stats .stat:nth-child(n + 4) { border-top: 1px solid var(--line-soft); }
}
@media (max-width: 760px) {
  .top-in { padding: 0 16px; gap: 12px; height: auto; min-height: 52px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; width: 100%; margin: 0 -4px; }
  .brand .ph { display: none; }
  main { padding: 16px 16px 48px; }
  .foot { padding: 0 16px 24px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats .stat:nth-child(3n + 1) { border-left: 1px solid var(--line-soft); }
  .stats .stat:nth-child(2n + 1) { border-left: 0; }
  .stats .stat:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .stat .v { font-size: 19px; }
  .hero .big { font-size: 28px; }
  .replay-grid { grid-template-columns: minmax(0, 1fr); }
  .ph-title h1 { font-size: 19px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .kv > div:nth-child(odd) { padding-bottom: 0; border-bottom: 0; font-size: 11.5px; }
  .kv > div:nth-last-child(2) { border-bottom: 0; }
  .t .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

a .ic, .ic { width: 12px; height: 12px; display: inline-block; vertical-align: -1px; }
a.link svg { width: 12px; height: 12px; vertical-align: -1px; }
.mlist { border-top: 1px solid var(--line-soft); }
.mrow { padding: 8px 14px; border-top: 1px solid var(--line-soft); }
.mrow:first-of-type { border-top: 0; }
.mrow-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mrow .sub { color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.panel-note, .hash, .kv > div, .banner .t2, .t .sub { overflow-wrap: anywhere; }
.show-sm { display: none; }
@media (max-width: 760px) {
  .show-sm { display: block; }
  .stat .s { white-space: normal; }
  .t th, .t td { padding-left: 10px; padding-right: 10px; }
}
.b.kind { white-space: normal; height: auto; min-height: 20px; padding-top: 1px; padding-bottom: 1px; overflow-wrap: anywhere; }
.chain-body, .eff + .sub, .sub { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .panel-h { flex-wrap: wrap; row-gap: 4px; }
  .panel-h .aside { margin-left: 0; width: 100%; }
  .panel-h:has(.seg) .aside { width: auto; margin-left: auto; }
}
@media (max-width: 760px) {
  .stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- live wall (owner rule: no monospace; code in Geist, whitespace kept) */

.min0 { min-width: 0; }
pre { font-family: var(--font); }
.chgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.chgrid .panel + .panel { margin-top: 0; }
.ch { display: flex; flex-direction: column; overflow: hidden; }
.ch.active { border-color: color-mix(in oklab, var(--good) 35%, var(--line)); }
.ch-h { display: flex; align-items: center; gap: 10px; padding: 11px 14px 0; }
.ch-t { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ch-t a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-s { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ch-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 4px 14px 10px; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line-soft); }
.ch-who { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 14px; font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--line-soft); background: var(--good-soft); }
.ch-who svg { width: 11px; height: 11px; vertical-align: -1px; }
.ch-last { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 10px 14px; align-items: start; }
.ch-last b, .ch-trail b, .ch-note b { font-weight: 600; overflow-wrap: anywhere; }
.ch-note { padding: 0 14px 8px 46px; color: var(--faint); font-size: 12px; }
.ch-idle { padding: 18px 14px 20px; color: var(--dim); }
.ch-trail { list-style: none; margin: 0; padding: 4px 0; border-top: 1px solid var(--line-soft); }
.ch-trail li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; padding: 4px 14px; font-size: 12px; color: var(--dim); align-items: baseline; }
.ch-trail .ic svg { width: 11px; height: 11px; color: var(--faint); vertical-align: -1px; }
.code-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 7px 14px; background: var(--panel-2); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 12px; }
.code-h svg { width: 12px; height: 12px; vertical-align: -1px; color: var(--faint); }
.code-h .b { margin-left: auto; }
.codeview { font: 400 12.5px/1.65 var(--font); font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; font-variant-numeric: tabular-nums; tab-size: 4; overflow-x: auto; background: var(--panel); }
.codeview table { border-collapse: collapse; min-width: 100%; }
.codeview td { padding: 0 12px; white-space: pre; vertical-align: top; }
.codeview td.ln { width: 1%; text-align: right; color: var(--faint); user-select: none; padding: 0 10px 0 14px; font-size: 11.5px; border-right: 1px solid var(--line-soft); }
.codeview tr.hit td { background: color-mix(in oklab, var(--accent) 11%, var(--panel)); }
.codeview tr.hit td.ln { color: var(--accent-ink); box-shadow: inset 2px 0 0 var(--accent); }
.codeview.none { padding: 14px; color: var(--dim); background: var(--panel-2); border-top: 1px solid var(--line-soft); font: inherit; }
.code-more { padding: 6px 14px; color: var(--faint); font-size: 11.5px; border-top: 1px solid var(--line-soft); }

/* machine wall */
.t.htop tr.asleep td { opacity: 0.55; }
.t.htop td { vertical-align: middle; }
.t.htop svg { width: 11px; height: 11px; vertical-align: -1px; }

/* spawn */
.kit { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cmd { border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.cmd-h { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line-soft); font-size: 12px; color: var(--dim); }
.cmd-h span { min-width: 0; }
.copy { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--panel); border-radius: 6px; padding: 2px 8px; font-size: 11.5px; cursor: pointer; color: var(--dim); white-space: nowrap; }
.copy:hover { color: var(--text); }
.copy svg { width: 11px; height: 11px; }
.cmd pre, pre.json, pre.block { margin: 0; padding: 9px 10px; font: 400 12.5px/1.6 var(--font); font-variant-ligatures: none; white-space: pre; overflow-x: auto; color: var(--text); tab-size: 4; }
pre.json, pre.block { background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: 8px; }
.kit-note { margin-top: 12px; color: var(--dim); font-size: 12px; }
.launch { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.launch label { display: flex; flex-direction: column; gap: 5px; }
.launch select, .launch input[type="url"] { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-width: 0; width: 100%; }
.launch fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.launch legend { padding: 0; margin-bottom: 4px; }
.launch label.radio { flex-direction: row; align-items: flex-start; gap: 8px; color: var(--dim); }
.launch label.radio input { margin-top: 3px; accent-color: var(--accent); }
.launch label.radio b { color: var(--text); font-weight: 600; }

/* manual */
.manual { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.toc { position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow-y: auto; }
.toc nav { display: flex; flex-direction: column; padding: 6px 0; }
.toc a { padding: 4px 14px; color: var(--dim); font-size: 12.5px; }
.toc a.sub { padding-left: 26px; font-size: 12px; color: var(--faint); }
.toc a:hover { color: var(--text); background: var(--panel-2); }
.prose { padding: 6px 22px 22px; font-size: 13.5px; line-height: 1.6; max-width: 100%; }
.prose h3 { font-size: 17px; margin: 26px 0 8px; padding-top: 14px; border-top: 1px solid var(--line-soft); scroll-margin-top: 70px; }
.prose h3:first-child { border-top: 0; margin-top: 10px; }
.prose h4 { font-size: 14px; margin: 20px 0 6px; scroll-margin-top: 70px; }
.prose h5 { font-size: 13px; margin: 14px 0 4px; }
.prose p { margin: 8px 0; color: var(--text); }
.prose ul, .prose ol { margin: 8px 0; padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose code { font-family: var(--font); background: var(--panel-3); padding: 1px 5px; border-radius: 4px; font-size: 0.94em; }
.prose pre.block { margin: 10px 0; font-size: 12px; }
.prose .tw { margin: 10px 0; border: 1px solid var(--line-soft); border-radius: 8px; }
.prose .t.spec td { font-size: 12.5px; }
.cfg { display: inline-flex; align-items: baseline; border-radius: 5px; overflow: hidden; border: 1px solid color-mix(in oklab, var(--accent) 30%, var(--line)); font-size: 0.92em; white-space: nowrap; vertical-align: baseline; }
.cfg .k { padding: 0 5px; background: var(--panel-3); }
.cfg .v { padding: 0 5px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.params > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 14px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); font-size: 12.5px; min-width: 0; }
.params .k { color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.params .v { font-weight: 600; white-space: nowrap; }

@media (max-width: 1100px) {
  .chgrid { grid-template-columns: minmax(0, 1fr); }
  .manual { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: 260px; }
  .params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .params { grid-template-columns: minmax(0, 1fr); }
  .prose { padding: 4px 14px 16px; }
  .code-h .b { margin-left: 0; }
  .ch-note { padding-left: 14px; }
}
.grid-2 > .panel + .panel, .grid-main > .panel + .panel { margin-top: 0; }
.cmd pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.mark { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 550; white-space: nowrap; margin-left: 4px; }
.mark svg { width: 10px; height: 10px; }
.mark.good { color: var(--good); }
.mark.warn { color: var(--warn); }

/* wallet (M2, devnet) */
.wl-tabs { margin: 16px 0 12px; }
.wl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wl-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 12.5px; font-weight: 550; cursor: pointer; white-space: nowrap; text-decoration: none; }
.wl-btn:hover:not(:disabled) { background: var(--panel-2); text-decoration: none; }
.wl-btn svg { width: 11px; height: 11px; }
.wl-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.wl-btn.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--accent) 88%, #000); }
.wl-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wl-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.wl-btn:focus-visible, .wl-wallet:focus-visible, .wl-field input:focus-visible, .wl-form input:focus-visible, .wl-form select:focus-visible, .wl-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wl-why { color: var(--faint); font-size: 11.5px; }
.wl-fine { color: var(--dim); font-size: 12px; line-height: 1.55; }
.wl-help { color: var(--faint); font-size: 11.5px; line-height: 1.45; }
.wl-wallets { display: flex; flex-wrap: wrap; gap: 8px; }
.wl-wallet { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 600; font-size: 13px; }
.wl-wallet:hover { border-color: var(--accent); }
.wl-wallet img { border-radius: 5px; }
.wl-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.wl-form input:not([type="radio"]):not([type="checkbox"]), .wl-field input, .wl-field textarea {
  font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; min-width: 0; width: 100%; font-variant-numeric: tabular-nums; }
.wl-form input:disabled { background: var(--panel-2); color: var(--faint); }
.wl-field { display: flex; flex-direction: column; gap: 5px; }
.wl-field textarea { resize: vertical; }
.wl-custody { border-left: 2px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 6px; }
.wl-custody label { display: flex; flex-direction: column; gap: 5px; }
.wl-steps { margin: 10px 0 0; padding-left: 18px; color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.wl-steps li { margin: 4px 0; }
.wl-acc td { font-size: 12.5px; }
.wl-hash { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; color: var(--dim); }
.wl-sub { padding: 10px 14px 0; }
.wl-logs { margin-top: 8px; font-size: 11.5px; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.wl-quote { margin-top: 10px; font-size: 12.5px; color: var(--dim); }
.wl-quote b { color: var(--text); }
.wl-crank { border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 4px; }
.wl-trade { border-top: 1px solid var(--line-soft); }
.wl-selrow td { background: var(--accent-soft); }
.wl-cosign { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.wl-cosign .banner { margin-bottom: 0; }
pre.wl-wrap { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 140px; overflow-y: auto; }
.wl-bal { border-bottom: 1px solid var(--line-soft); }
.wl-bal .stat:first-child, .wl-params + .panel-b { border-left: 0; }
.wl-params { border-bottom: 1px solid var(--line-soft); }
.wl-params > div:nth-child(3n) { border-right: 0; }
#w-launch-out .banner, #w-trade-out .banner, #w-vout .banner, #w-claim-out .banner, #w-conn .banner { margin-bottom: 0; }
#w-launch-out .kv, #w-trade .kv { border-bottom: 1px solid var(--line-soft); }
@media (max-width: 1100px) { .wl-params > div:nth-child(3n) { border-right: 1px solid var(--line-soft); } .wl-params > div:nth-child(2n) { border-right: 0; } }
@media (max-width: 760px) {
  .wl-2 { grid-template-columns: minmax(0, 1fr); }
  .wl-params > div { border-right: 0 !important; }
  .wl-bal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wl-bal .stat { border-top: 0 !important; padding: 10px 10px 12px; }
  .wl-bal .stat:nth-child(n + 2) { border-left: 1px solid var(--line-soft) !important; }
}
.wl-stats2 .stat:nth-child(odd) { border-left: 0; }
.wl-stats2 .stat:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
.wl-params { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.wl-params > div:nth-child(3n) { border-right: 1px solid var(--line-soft); }
.wl-params > div:nth-child(2n) { border-right: 0; }
@media (max-width: 760px) {
  .stats.wl-bal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.wl-bal .stat:first-child { grid-column: 1 / -1; border-left: 0 !important; }
  .stats.wl-bal .stat:nth-child(2) { border-left: 0 !important; border-top: 1px solid var(--line-soft) !important; }
  .stats.wl-bal .stat:nth-child(3) { border-top: 1px solid var(--line-soft) !important; grid-column: auto; }
  .wl-stats2 .stat .v { font-size: 16px; }
}
@media (max-width: 760px) {
  .wl-params { grid-template-columns: minmax(0, 1fr) !important; }
  .wl-params > div { border-right: 0 !important; }
}

/* souls (SPEC 14.8): the launch step's soul preview and the agent page's soul panel */
.wl-soul { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); display: grid; gap: 8px; }
.wl-soul p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--text); }
.wl-soul-h { font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.wl-soul-list { margin: 4px 0 0; padding-left: 16px; font-size: 12.5px; line-height: 1.5; }
.wl-soul-edit { width: 100%; margin-top: 6px; font-family: inherit; font-size: 12px; line-height: 1.5; padding: 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.wl-form textarea { width: 100%; font-family: inherit; font-size: 13px; padding: 7px 9px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.soul { padding: 12px 14px; display: grid; gap: 10px; }
.soul p { margin: 2px 0 0; font-size: 13px; line-height: 1.6; }
.soul .eyebrow { margin-bottom: 2px; }
.soul ul { margin: 2px 0 0; padding-left: 16px; font-size: 13px; line-height: 1.55; }
.soul-sample { border-left: 2px solid var(--line); padding-left: 10px; color: var(--dim); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
@media (max-width: 640px) { .wl-soul .wl-2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------------------------------------------------------------- launchpad (plan L3): token list and token page; mk- prefix */

.mk-tok { display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; }
.mk-sym { font-weight: 600; color: var(--text); }
.mk-name { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.mk-rowlink:hover .mk-sym { color: var(--accent-ink); }
.mk-list tbody tr { cursor: pointer; }
.mk-progcell { min-width: 130px; }
.mk-prog { display: inline-flex; align-items: center; gap: 8px; width: 100%; }
.mk-prog .bar { flex: 1; min-width: 56px; }
.mk-prog .num { color: var(--dim); font-size: 12px; min-width: 52px; text-align: right; }
.mk-chg.up { color: var(--good); }
.mk-chg.down { color: var(--bad); }
.mk-sort { flex-wrap: wrap; }
.mk-h1sym { color: var(--faint); font-weight: 500; font-size: 0.72em; margin-left: 4px; }
.mk-statspanel .stat .v { font-size: 20px; }
.mk-statspanel .stat .s { white-space: nowrap; }
.mk-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.mk-main > .panel + .panel, .mk-main > section + section { margin-top: 16px; }
.mk-col > .panel + .panel { margin-top: 16px; }
.mk-live { padding: 12px; }
.mk-livepanel .panel-h h2::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f5821f; margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in oklab, #f5821f 22%, transparent); }
.mk-chartwrap { padding: 10px 6px 6px 10px; }
.mk-chart { width: 100%; position: relative; }
.mk-chart-empty { height: 100%; display: grid; place-items: center; color: var(--faint); }
.mk-svg { display: block; }
.mk-svg text { font: 400 10.5px var(--font); fill: var(--faint); font-variant-numeric: tabular-nums; }
.mk-svg text.ref { fill: var(--dim); }
.mk-svg .grid { stroke: var(--grid); stroke-width: 1; }
.mk-svg .axis { stroke: var(--axis); stroke-width: 1; }
.mk-svg .ref { stroke: var(--axis); stroke-dasharray: 3 3; }
.mk-svg .c line { stroke-width: 1.2; }
.mk-svg .c.up line { stroke: var(--good); }
.mk-svg .c.up rect { fill: var(--good); }
.mk-svg .c.down line { stroke: var(--bad); }
.mk-svg .c.down rect { fill: var(--bad); }
.mk-svg .c rect.v { opacity: 0.28; }
.mk-svg .c rect.hit { fill: transparent; }
.mk-svg .c:hover rect.v { opacity: 0.5; }
.mk-tf button { min-width: 30px; }
.mk-trades td, .mk-holders td, .mk-fees td { vertical-align: middle; }
.mk-side { font-weight: 600; }
.mk-side.buy { color: var(--good); }
.mk-side.sell { color: var(--bad); }
.mk-curve-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mk-curve-bar .bar { height: 8px; border-radius: 4px; }
.mk-curve-bar .bar i { border-radius: 4px; }
.mk-curve-bar .num { font-size: 13px; font-weight: 600; color: var(--text); }
.mk-curve-n { margin-top: 8px; font-size: 12.5px; }
.mk-steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.mk-steps li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; color: var(--faint); }
.mk-steps li.done { color: var(--text); }
.mk-steps li i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; margin-top: 1px; }
.mk-steps li.done i { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.mk-steps li i svg { width: 11px; height: 11px; }
.mk-steps .sub { font-size: 11.5px; margin-top: 1px; display: flex; gap: 8px; flex-wrap: wrap; }
.mk-fstats { border-bottom: 1px solid var(--line-soft); }
.mk-lins { display: inline-flex; flex-direction: column; gap: 2px; }
.mk-copy { border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px; vertical-align: -2px; }
.mk-copy:hover { color: var(--text); }

.mk-tb { display: grid; gap: 12px; }
.mk-tb-venue { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.mk-tb-acct { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 12.5px; }
.mk-tb-acct .wl-btn { height: 26px; padding: 0 9px; font-size: 12px; }
.mk-tb-bal { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.mk-tb-bal > div { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; border-left: 1px solid var(--line-soft); }
.mk-tb-bal > div:first-child { border-left: 0; }
.mk-tb-bal b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-tb-side { display: grid; grid-template-columns: 1fr 1fr; }
.mk-tb-side button { padding: 6px 9px; font-size: 13px; }
.mk-tb-side button[data-side="buy"][aria-pressed="true"] { color: var(--good); }
.mk-tb-side button[data-side="sell"][aria-pressed="true"] { color: var(--bad); }
.mk-tb-in { position: relative; display: block; }
.mk-tb-in input { width: 100%; padding-right: 54px !important; }
.mk-tb-f input { font: 500 15px var(--font); height: 38px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); width: 100%; font-variant-numeric: tabular-nums; }
.mk-tb-f input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mk-tb-max { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 1px solid var(--line); background: var(--panel-2); color: var(--dim); border-radius: 6px; font-size: 11.5px; padding: 3px 8px; cursor: pointer; }
.mk-tb-max:hover { color: var(--text); }
.mk-tb-quote { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); font-size: 12.5px; }
.mk-tb-quote > div { display: flex; justify-content: space-between; gap: 10px; }
.mk-tb-quote span { color: var(--dim); }
.mk-tb-quote b { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.mk-tb-go { display: flex; gap: 8px; }
.mk-tb-go .wl-btn { height: 38px; flex: 1; justify-content: center; font-size: 13.5px; }
.mk-tb-go .wl-btn:not(.primary) { flex: 0 0 auto; }
.mk-tb-msg .banner { margin: 0; }

@media (max-width: 1100px) {
  /* one column: the trade box follows the agent's panel instead of the whole activity column */
  .mk-grid { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .mk-main, .mk-col { display: contents; }
  .mk-grid .panel, .mk-grid .panel + .panel { margin-top: 0 !important; }
  .mk-livepanel { order: 1; }
  .mk-tradepanel { order: 2; }
  .mk-pricepanel { order: 3; }
  .mk-curvepanel { order: 4; }
  .mk-activity { order: 5; }
  .mk-feespanel { order: 6; }
  .mk-agentpanel { order: 7; }
}
@media (max-width: 760px) {
  .hide-xs { display: none !important; }
  .mk-live { padding: 8px; }
  .mk-name { max-width: 120px; }
  .mk-statspanel .stat .v { font-size: 17px; }
  .mk-progcell { min-width: 96px; }
  .mk-sort button { padding: 3px 7px; }
}
.mk-list th, .mk-list td { padding-left: 10px; padding-right: 10px; }
@media (max-width: 1360px) { .mk-list .hide-md { display: none; } }
.mk-gradtag { color: var(--good); font-weight: 550; }
