/* VPS Trading Dashboard — base styles
   Theme is driven by CSS variables on [data-theme]. */

:root {
  --bg: oklch(0.158 0.012 250);
  --bg-1: oklch(0.188 0.013 250);
  --bg-2: oklch(0.218 0.014 250);
  --bg-3: oklch(0.255 0.015 250);
  --line: oklch(0.30 0.012 250);
  --line-soft: oklch(0.26 0.011 250);
  --fg: oklch(0.96 0.005 250);
  --fg-1: oklch(0.84 0.008 250);
  --fg-2: oklch(0.68 0.010 250);
  --fg-3: oklch(0.52 0.012 250);
  --long: oklch(0.78 0.17 145);
  --long-soft: oklch(0.78 0.17 145 / 0.14);
  --short: oklch(0.66 0.22 25);
  --short-soft: oklch(0.66 0.22 25 / 0.14);
  --warn: oklch(0.82 0.16 80);
  --accent: oklch(0.78 0.13 220);
  --accent-soft: oklch(0.78 0.13 220 / 0.16);
  --blofin: oklch(0.74 0.16 60);    /* orange */
  --bitget: oklch(0.66 0.19 305);   /* purple */
  --bybit:  oklch(0.83 0.16 95);    /* yellow */
  --shadow-card: 0 1px 0 oklch(1 0 0 / 0.04) inset;
  --radius: 12px;
  --radius-sm: 8px;
  --font-ui: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg: oklch(0.985 0.003 250);
  --bg-1: oklch(0.965 0.005 250);
  --bg-2: oklch(0.945 0.007 250);
  --bg-3: oklch(0.92 0.009 250);
  --line: oklch(0.88 0.008 250);
  --line-soft: oklch(0.92 0.006 250);
  --fg: oklch(0.20 0.012 250);
  --fg-1: oklch(0.32 0.014 250);
  --fg-2: oklch(0.48 0.014 250);
  --fg-3: oklch(0.62 0.012 250);
  --long: oklch(0.58 0.18 145);
  --long-soft: oklch(0.58 0.18 145 / 0.10);
  --short: oklch(0.56 0.22 25);
  --short-soft: oklch(0.56 0.22 25 / 0.10);
  --accent: oklch(0.58 0.15 220);
  --accent-soft: oklch(0.58 0.15 220 / 0.12);
  --shadow-card: 0 1px 0 oklch(0 0 0 / 0.03) inset;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--font-ui); }
body {
  min-height: 100vh;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tnum { font-variant-numeric: tabular-nums; }

/* App shell */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.app__main { flex: 1; padding: 18px 24px 64px; max-width: 1640px; width: 100%; margin: 0 auto; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 24px;
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, oklch(0.56 0.20 280) 100%);
  display: grid; place-items: center; color: white;
  font-family: var(--font-mono); font-weight: 700; font-size: 13px;
  box-shadow: 0 0 0 1px oklch(1 0 0 / 0.08) inset;
}
.brand__name { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
.brand__sub { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

.topbar__spacer { flex: 1; }
.topbar__group { display: flex; align-items: center; gap: 8px; }

.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 9px 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-1);
}
.live-pill[data-mode="live"] { color: var(--long); border-color: color-mix(in oklab, var(--long) 35%, var(--line)); }
.live-pill[data-mode="paper"] { color: var(--warn); border-color: color-mix(in oklab, var(--warn) 35%, var(--line)); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; position: relative;
}
.live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: currentColor; opacity: 0.4;
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { transform: scale(0.6); opacity: 0.5; }
  80%  { transform: scale(2.0); opacity: 0; }
  100% { transform: scale(2.0); opacity: 0; }
}
.no-anim .live-dot::after { animation: none; opacity: 0; }

.iconbtn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; min-width: 30px; padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  color: var(--fg-1);
  font-size: 12px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.iconbtn:hover { background: var(--bg-2); border-color: color-mix(in oklab, var(--line) 60%, var(--fg-3)); color: var(--fg); }
.iconbtn:active { transform: translateY(1px); }
.iconbtn--primary {
  background: var(--accent-soft);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--line));
  color: var(--accent);
}
.iconbtn--primary:hover { background: color-mix(in oklab, var(--accent-soft) 100%, var(--accent) 10%); }
.iconbtn[data-state="loading"] { color: var(--fg-3); }
.iconbtn[data-state="loading"] .ic-refresh { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn[data-state="done"] {
  color: var(--long);
  border-color: color-mix(in oklab, var(--long) 40%, var(--line));
  background: var(--long-soft);
}

.clock {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
  letter-spacing: 0.02em;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
}

/* Tabs */
.tabs {
  display: flex; align-items: center; gap: 2px;
  margin: 4px 0 18px;
  padding: 4px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  width: fit-content;
}
.tab {
  appearance: none; border: 0; background: transparent;
  color: var(--fg-2);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease, color .15s ease;
}
.tab:hover { color: var(--fg-1); }
.tab[aria-selected="true"],
.tab.tab--active {
  background: var(--bg-3);
  color: var(--fg);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.05) inset;
}
.tab__badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--fg) 8%, transparent);
  color: var(--fg-2);
}
.tab[aria-selected="true"] .tab__badge,
.tab.tab--active .tab__badge { color: var(--fg-1); background: color-mix(in oklab, var(--fg) 14%, transparent); }

/* Grids */
.grid { display: grid; gap: 14px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 1180px) {
  .cols-4 { grid-template-columns: repeat(2, 1fr); }
  .cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Card */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.card--tight { padding: 12px 14px; }
.card--padless { padding: 0; overflow: hidden; }
.card__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card__title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.card__meta { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

/* Stat card */
.stat__label {
  font-size: 10.5px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.stat__value {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
  line-height: 1.1;
  margin-top: 6px;
}
.stat__value--xl { font-size: 32px; }
.stat__sub {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
  margin-top: 6px;
  display: flex; align-items: center; gap: 8px;
}
.stat__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--blofin { background: var(--blofin); }
.dot--bitget { background: var(--bitget); }
.dot--bybit  { background: var(--bybit); }
.dot--ok     { background: var(--long); }
.dot--warn   { background: var(--warn); }
.dot--err    { background: var(--short); }

/* Sparkline */
.spark { width: 100%; height: 36px; display: block; overflow: visible; }
.spark__line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark__area { fill: currentColor; opacity: 0.12; }
.spark__dot  { fill: currentColor; }

/* Delta chip */
.delta {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
}
.delta--up { color: var(--long); background: var(--long-soft); }
.delta--down { color: var(--short); background: var(--short-soft); }
.delta--flat { color: var(--fg-2); background: color-mix(in oklab, var(--fg) 6%, transparent); }

/* Progress bar */
.bar {
  height: 6px;
  background: color-mix(in oklab, var(--fg) 8%, transparent);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.bar__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width .35s cubic-bezier(.4,.0,.2,1);
}
.bar__fill--ok { background: var(--long); }
.bar__fill--warn { background: var(--warn); }
.bar__fill--err { background: var(--short); }

/* Table */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
  user-select: none;
  white-space: nowrap;
}
.table th[role="button"] { cursor: pointer; }
.table th[role="button"]:hover { color: var(--fg-1); }
.table th .sort-ind { opacity: 0.5; font-family: var(--font-mono); }
.table td {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--fg-1);
  white-space: nowrap;
}
.table tr.row--flash-up td { animation: flashUp .9s ease-out; }
.table tr.row--flash-down td { animation: flashDown .9s ease-out; }
@keyframes flashUp {
  0% { background: var(--long-soft); }
  100% { background: transparent; }
}
@keyframes flashDown {
  0% { background: var(--short-soft); }
  100% { background: transparent; }
}
.table tr:hover td { background: color-mix(in oklab, var(--fg) 3%, transparent); }
.table tr:last-child td { border-bottom: 0; }

.side-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.side-pill--long { color: var(--long); background: var(--long-soft); }
.side-pill--short { color: var(--short); background: var(--short-soft); }

/* Filter chips */
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--bg-1);
  color: var(--fg-2);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .12s ease;
}
.chip:hover { color: var(--fg-1); border-color: color-mix(in oklab, var(--line) 50%, var(--fg-3)); }
.chip[aria-pressed="true"] {
  color: var(--fg);
  background: var(--bg-3);
  border-color: color-mix(in oklab, var(--fg) 18%, var(--line));
}
.chip .dot { width: 7px; height: 7px; }

/* API counters card */
.api-row { display: grid; grid-template-columns: 1fr auto auto auto auto 110px; gap: 14px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.api-row:last-child { border-bottom: 0; }
.api-row__name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.api-row__name strong { font-weight: 600; color: var(--fg); font-size: 13px; }
.api-row__name small { color: var(--fg-3); font-family: var(--font-mono); font-size: 11px; }
.api-row__name .dot { flex: 0 0 auto; }
.api-row__num { font-family: var(--font-mono); font-size: 13px; text-align: right; color: var(--fg-1); }
.api-row__num small { color: var(--fg-3); display: block; font-size: 10.5px; margin-top: 2px; }
.api-row__bars { display: flex; align-items: flex-end; gap: 2px; height: 28px; }
.api-row__bars span {
  display: block; width: 4px; border-radius: 1.5px;
  background: color-mix(in oklab, var(--accent) 60%, var(--fg-3));
  opacity: 0.85;
}
.api-row__bars span.err { background: var(--short); }

/* Container card */
.cnt {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  background: var(--bg-1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.cnt:hover { border-color: color-mix(in oklab, var(--line) 50%, var(--fg-3)); }
.cnt[data-open="true"] { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }
.cnt__head { display: flex; align-items: center; gap: 10px; }
.cnt__icon {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--bg-3); color: var(--fg-1);
  border-radius: 8px; font-size: 14px;
  font-family: var(--font-mono);
}
.cnt__name { font-weight: 600; font-size: 13.5px; }
.cnt__status {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--long);
  letter-spacing: 0.06em;
  background: var(--long-soft);
  padding: 2px 6px;
  border-radius: 4px;
}
.cnt__spacer { flex: 1; }
.cnt__chev { color: var(--fg-3); transition: transform .2s ease; }
.cnt[data-open="true"] .cnt__chev { transform: rotate(90deg); color: var(--accent); }
.cnt__kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 11.5px; }
.cnt__kv dt { color: var(--fg-3); }
.cnt__kv dd { margin: 0; color: var(--fg-1); font-family: var(--font-mono); }
.cnt__logs {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-1);
  max-height: 180px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
}
.cnt__logs .lvl { color: var(--fg-3); margin-right: 6px; }
.cnt__logs .lvl--INFO { color: var(--accent); }
.cnt__logs .lvl--WARN { color: var(--warn); }
.cnt__logs .lvl--ERR  { color: var(--short); }
.cnt__logs .lvl--OK   { color: var(--long); }
.cnt__logs .ts { color: var(--fg-3); margin-right: 6px; }

/* Flow diagram */
.flow {
  display: grid;
  grid-template-columns: 130px 1fr 140px 1fr 180px;
  align-items: center;
  gap: 0;
  padding: 18px 6px 12px;
}
.flow__node {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px;
  padding: 12px 12px;
  text-align: center;
  position: relative;
}
.flow__node small {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.flow__node b { display: block; font-weight: 600; font-size: 13px; }
.flow__node .sub { display: block; font-family: var(--font-mono); color: var(--fg-2); font-size: 10.5px; margin-top: 2px; }
.flow__edge { position: relative; height: 32px; }
.flow__exchanges { display: flex; flex-direction: column; gap: 8px; }
.flow__exch {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
}
.flow__exch .name { font-weight: 600; font-size: 12.5px; }
.flow__exch .meta { font-family: var(--font-mono); font-size: 10.5px; color: var(--fg-3); margin-left: auto; }

.flow svg.flow__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.flow__svg .lane { stroke: var(--line); stroke-width: 1.5; fill: none; }
.flow__svg .pulse {
  fill: var(--accent);
  filter: drop-shadow(0 0 4px var(--accent));
}

/* Logs tab */
.log-feed {
  display: flex; flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  height: 70vh;
  min-height: 480px;
}
.log-feed__head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
}
.log-feed__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.log-line { display: grid; grid-template-columns: 92px 56px 90px 1fr; gap: 12px; line-height: 1.5; }
.log-line .lts { color: var(--fg-3); }
.log-line .llvl { font-weight: 600; }
.log-line .lsvc { color: var(--fg-2); }
.log-line .lmsg { color: var(--fg-1); white-space: pre-wrap; }
.log-line[data-lvl="INFO"] .llvl { color: var(--accent); }
.log-line[data-lvl="OK"]   .llvl { color: var(--long); }
.log-line[data-lvl="WARN"] .llvl { color: var(--warn); }
.log-line[data-lvl="ERR"]  .llvl { color: var(--short); }
.log-line.is-new { animation: flashUp 0.6s ease-out; }

/* Ticker / running */
.ticker {
  display: flex;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
  padding: 6px 0;
  margin: 14px 0 18px;
  mask-image: linear-gradient(to right, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
}
.ticker__track {
  display: flex; gap: 36px; padding-left: 24px;
  white-space: nowrap;
  animation: tick 60s linear infinite;
  will-change: transform;
}
.no-anim .ticker__track { animation: none; }
.ticker b { color: var(--fg); font-weight: 500; margin-right: 6px; }
.ticker .up { color: var(--long); }
.ticker .down { color: var(--short); }
@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Section header */
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 6px 2px 10px;
}
.section__title {
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  font-weight: 600;
}
.section__hint { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

/* Layout helpers */
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack--lg { gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.muted { color: var(--fg-3); }

/* Toast */
.toast-host { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--fg);
  box-shadow: 0 8px 28px oklch(0 0 0 / 0.35);
  animation: toastIn .25s ease-out;
}
.toast--ok { border-color: color-mix(in oklab, var(--long) 40%, var(--line)); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Equity hero */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  align-items: stretch;
}
@media (max-width: 980px) { .hero { grid-template-columns: 1fr; } }
.hero__main {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
  overflow: hidden;
}
.hero__main::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(800px 200px at 90% 0%, var(--accent-soft), transparent 60%);
  pointer-events: none;
}
.hero__label { font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase; color: var(--fg-3); font-weight: 600; }
.hero__value {
  font-family: var(--font-mono); font-weight: 600;
  font-size: 44px; letter-spacing: -0.025em; line-height: 1.05; margin: 8px 0 4px;
}
.hero__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero__chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--fg-2);
  padding: 4px 9px;
  background: var(--bg-1);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}
.hero__break {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-top: 18px;
}
.hero__breakItem {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 12px;
  background: color-mix(in oklab, var(--bg-1) 60%, transparent);
}
.hero__breakLabel { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); display: flex; align-items: center; gap: 8px; font-weight: 600; }
.hero__breakVal { font-family: var(--font-mono); font-size: 18px; font-weight: 600; margin-top: 4px; }
.hero__breakSub { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); margin-top: 2px; }

/* Memory bars in container card */
.memrow { display: flex; align-items: center; gap: 10px; }
.memrow .name { font-size: 12px; flex: 0 0 110px; color: var(--fg-1); }
.memrow .val  { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-2); width: 60px; text-align: right; }

/* Reset counters confirm hint */
kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--fg-2);
}

/* Density variants */
.density-compact .card { padding: 12px; }
.density-compact .stat__value { font-size: 24px; }
.density-compact .hero__value { font-size: 36px; }
.density-compact .api-row { padding: 9px 0; }
.density-compact .table td { padding: 8px 12px; }

.density-comfy .card { padding: 20px; }
.density-comfy .stat__value { font-size: 30px; }
.density-comfy .hero__value { font-size: 52px; }
.density-comfy .api-row { padding: 16px 0; }

/* ── Telegram Mini App · mobile (добавлено при сборке production) ─────────── */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .brand__sub { display: none; }
  .clock { display: none; }
  .app__main { padding: 12px 10px 48px; }
  .hero { grid-template-columns: 1fr !important; }
  .hero__value { font-size: 34px; }
  .grid, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr !important; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .table { font-size: 11px; }
  .table th, .table td { padding: 7px 8px; }
  .log-feed__head { flex-wrap: wrap; }
  .log-line { grid-template-columns: 64px 42px 80px 1fr; }
  .toast-host { bottom: 12px; right: 12px; left: 12px; }
}
