/* Vertex Lab — стили. Цвета заданы ролями; тёмная тема — свои значения тех же ролей. */
:root {
  color-scheme: light;
  --plane: #f9f9f7;
  --surface-1: #fcfcfb;
  --surface-2: #f3f2ee;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --border-strong: rgba(11, 11, 11, 0.22);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --pos: #2a78d6;
  --neg: #e34948;
  --pos-text: #1c5cab;
  --neg-text: #c22f2f;
  --heat-mid: #f0efec;
  --deemph: #c3c2b7;
  --deemph-strong: #898781;
  --good: #0ca30c; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b;
  --good-text: #006300; --warning-text: #7a5200; --critical-text: #a82626;
  --good-bg: rgba(12, 163, 12, 0.10); --warning-bg: rgba(250, 178, 25, 0.16); --critical-bg: rgba(208, 59, 59, 0.10);
  --accent: #2a78d6; --on-accent: #fff;
  --accent-bg: rgba(42, 120, 214, 0.10);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04);
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --plane: #0f172a; --surface-1: #1e293b; --surface-2: #273449;
    --text-primary: #f1f5f9; --text-secondary: #cbd5e1; --text-muted: #94a3b8;
    --grid: #2b3a52; --axis: #3d4c66;
    --border: rgba(148, 163, 184, 0.20); --border-strong: rgba(148, 163, 184, 0.42);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
    --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --pos: #3987e5; --neg: #e66767; --pos-text: #86b6ef; --neg-text: #f09a9a;
    --heat-mid: #334155; --deemph: #475569; --deemph-strong: #94a3b8;
    --good-text: #4cc94c; --warning-text: #fab219; --critical-text: #f08a8a;
    --good-bg: rgba(12, 163, 12, 0.16); --warning-bg: rgba(250, 178, 25, 0.14); --critical-bg: rgba(208, 59, 59, 0.18);
    --accent: #22d3ee; --accent-bg: rgba(34, 211, 238, 0.14); --on-accent: #0f172a;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --plane: #0f172a; --surface-1: #1e293b; --surface-2: #273449;
  --text-primary: #f1f5f9; --text-secondary: #cbd5e1; --text-muted: #94a3b8;
  --grid: #2b3a52; --axis: #3d4c66;
  --border: rgba(148, 163, 184, 0.20); --border-strong: rgba(148, 163, 184, 0.42);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
  --pos: #3987e5; --neg: #e66767; --pos-text: #86b6ef; --neg-text: #f09a9a;
  --heat-mid: #334155; --deemph: #475569; --deemph-strong: #94a3b8;
  --good-text: #4cc94c; --warning-text: #fab219; --critical-text: #f08a8a;
  --good-bg: rgba(12, 163, 12, 0.16); --warning-bg: rgba(250, 178, 25, 0.14); --critical-bg: rgba(208, 59, 59, 0.18);
  --accent: #22d3ee; --accent-bg: rgba(34, 211, 238, 0.14); --on-accent: #0f172a;
  --shadow: none;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body { margin: 0; background: var(--plane); color: var(--text-primary); font-family: var(--font); line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; text-wrap: balance; }
h2 { font-size: 20px; letter-spacing: -0.01em; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
::selection { background: var(--accent-bg); }

/* ---------- каркас ---------- */
.vx-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 52px; background: var(--surface-1); border-bottom: 1px solid var(--border); }
.vx-brand { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; display: flex; align-items: baseline; gap: 8px; }
.vx-brand small { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.vx-nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.vx-nav button { border: 0; background: none; padding: 8px 12px; border-radius: 8px; color: var(--text-secondary); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.vx-nav button:hover { background: var(--surface-2); color: var(--text-primary); }
.vx-nav button.on { background: var(--accent-bg); color: var(--text-primary); font-weight: 600; }
.vx-nav .count { font-size: 11px; color: var(--text-muted); font-weight: 400; background: var(--surface-2); border-radius: 9px; padding: 0 6px; }
.vx-top-tools { display: flex; gap: 8px; align-items: center; }
/* Содержимое занимает 88% ширины экрана. Ширина расходуется на число колонок (сетки ниже), а не на растягивание:
   текст ограничен длиной строки, таблицы стоят в колонках рядом с графиками. */
.vx-main { width: 88vw; max-width: 2300px; margin: 0 auto; padding: 20px 0 80px; }
.vx-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.vx-page-head .lead { color: var(--text-secondary); margin-top: 4px; max-width: 78ch; }
.vx-status { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; background: var(--text-primary); color: var(--surface-1); padding: 9px 16px; border-radius: 10px; font-size: 13px; max-width: min(720px, 90vw); box-shadow: 0 6px 24px rgba(0,0,0,.25); display: none; }
.vx-status.err { background: var(--critical); color: #fff; }

/* ---------- кнопки и поля ---------- */
.vx-btn { border: 1px solid var(--border-strong); background: var(--surface-1); padding: 6px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.vx-btn:hover { background: var(--surface-2); }
.vx-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.vx-btn.primary:hover { filter: brightness(1.08); }
.vx-btn.small { padding: 3px 9px; font-size: 12.5px; border-radius: 7px; }
.vx-btn.ghost { border-color: transparent; background: none; color: var(--text-secondary); }
.vx-btn.ghost:hover { background: var(--surface-2); color: var(--text-primary); }
.vx-btn:disabled { opacity: .5; cursor: default; }
.vx-linkbtn { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: 4px; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.vx-linkbtn:hover { color: var(--text-primary); }
.vx-input, .vx-select { border: 1px solid var(--border-strong); background: var(--surface-1); padding: 5px 9px; border-radius: 8px; min-width: 0; }
.vx-input.num { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.vx-field { display: inline-flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-secondary); }
.vx-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-secondary); }
.vx-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.vx-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.vx-seg-ctl { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.vx-seg-ctl button { border: 0; background: var(--surface-1); padding: 5px 11px; cursor: pointer; color: var(--text-secondary); border-right: 1px solid var(--border); }
.vx-seg-ctl button:last-child { border-right: 0; }
.vx-seg-ctl button.on { background: var(--accent-bg); color: var(--text-primary); font-weight: 600; }

/* ---------- карточки и сетки ---------- */
.vx-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.vx-card > h3 { margin-bottom: 4px; }
.vx-card > .sub { color: var(--text-secondary); font-size: 13px; margin-bottom: 12px; max-width: 86ch; }
.vx-grid { display: grid; gap: 14px; }
.vx-grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vx-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vx-grid.c21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.vx-grid.c12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
/* w2/w3/w4 — сетки, которые получают дополнительные колонки только на широком экране */
.vx-grid.w2 { grid-template-columns: minmax(0, 1fr); }
.vx-grid.w3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vx-grid.w4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vx-grid.w12 { grid-template-columns: minmax(0, 1fr); }
.vx-grid.w3t { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 981px) { .vx-grid.w3t { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1500px) {
  .vx-grid.w2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vx-grid.w3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vx-grid.w4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .vx-grid.w12 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
@media (min-width: 1800px) { .vx-grid.w3t { grid-template-columns: minmax(0, 1fr) minmax(0, 1.34fr) minmax(0, 1.34fr); } }
@media (max-width: 980px) { .vx-grid.c2, .vx-grid.c3, .vx-grid.c21, .vx-grid.c12, .vx-grid.w3, .vx-grid.w4 { grid-template-columns: minmax(0, 1fr); } }
.vx-section { margin-top: 28px; scroll-margin-top: 110px; }
.vx-section > .vx-section-head { margin-bottom: 12px; }
.vx-section > .vx-section-head h2 { display: flex; align-items: baseline; gap: 10px; }
.vx-section > .vx-section-head p { color: var(--text-secondary); margin-top: 3px; max-width: 86ch; }
.vx-kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 600; }
.vx-stack { display: flex; flex-direction: column; gap: 14px; }
.vx-subnav { position: sticky; top: 52px; z-index: 20; background: var(--plane); padding: 8px 0; margin: 0 0 4px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.vx-subnav a { text-decoration: none; color: var(--text-secondary); padding: 4px 10px; border-radius: 7px; white-space: nowrap; font-size: 13px; }
.vx-subnav a:hover { background: var(--surface-2); color: var(--text-primary); }

/* ---------- плитки показателей ---------- */
.vx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.vx-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.vx-tile-label { color: var(--text-secondary); font-size: 12px; }
.vx-tile-value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; overflow-wrap: anywhere; }
.vx-tile-sub { color: var(--text-muted); font-size: 12px; margin-top: 2px; }
.vx-tile.pos .vx-tile-value { color: var(--pos-text); }
.vx-tile.neg .vx-tile-value { color: var(--neg-text); }
.vx-tile.warn { border-color: var(--warning); }
.vx-hero { display: flex; align-items: center; gap: 18px; }
.vx-hero-num { font-size: 52px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.vx-hero-num small { font-size: 16px; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }

/* ---------- метки состояния ---------- */
.vx-badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--text-secondary); white-space: nowrap; }
.vx-badge.good { color: var(--good-text); background: var(--good-bg); border-color: transparent; }
.vx-badge.warn { color: var(--warning-text); background: var(--warning-bg); border-color: transparent; }
.vx-badge.bad { color: var(--critical-text); background: var(--critical-bg); border-color: transparent; }
.vx-badge.info { color: var(--pos-text); background: var(--accent-bg); border-color: transparent; }
.vx-flag { display: flex; gap: 10px; padding: 9px 12px; border-radius: 8px; background: var(--surface-2); align-items: flex-start; }
.vx-flag .ico { flex: none; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 700; display: grid; place-items: center; color: #fff; margin-top: 1px; }
.vx-flag.good .ico { background: var(--good); } .vx-flag.warn .ico { background: var(--warning); color: #0b0b0b; } .vx-flag.bad .ico { background: var(--critical); } .vx-flag.info .ico { background: var(--deemph-strong); }
.vx-flag b { font-weight: 600; }
.vx-flag .more { color: var(--text-secondary); font-size: 13px; }
.vx-flags { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: 6px; align-items: start; }
.vx-flag .more { max-width: 92ch; }
/* ---------- подсказки «сет ↔ результат» ---------- */
.vx-adv-grid { columns: 470px; column-gap: 14px; }
.vx-adv-grid > * { break-inside: avoid; margin: 0 0 14px; }
.vx-adv { border-left: 3px solid var(--deemph); }
.vx-adv.act { border-left-color: var(--warning); } .vx-adv.check { border-left-color: var(--accent); } .vx-adv.ok { border-left-color: var(--good); }
.vx-adv-head { display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.vx-adv > h3 { font-size: 15px; margin-bottom: 10px; text-wrap: pretty; }
.vx-adv-body { display: grid; grid-template-columns: minmax(96px, 124px) minmax(0, 1fr); gap: 7px 12px; font-size: 13px; }
.vx-adv-k { color: var(--text-muted); font-size: 12px; padding-top: 1px; }
.vx-adv-v { color: var(--text-secondary); min-width: 0; }
.vx-adv-list { margin: 0; padding-left: 16px; color: var(--text-secondary); font-size: 13px; } .vx-adv-list li + li { margin-top: 3px; }
.vx-adv-legend { display: flex; flex-wrap: wrap; gap: 4px 24px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; }
.vx-adv-legend b { color: var(--text-primary); }
/* ---------- окно сборки сета ---------- */
.vx-modal { position: fixed; inset: 0; z-index: 70; background: rgba(11, 11, 11, 0.45); display: grid; place-items: center; }
.vx-modal-panel { width: min(94vw, 2100px); height: 94vh; background: var(--plane); border: 1px solid var(--border-strong); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35); }
.vx-modal-head { padding: 14px 18px 12px; background: var(--surface-1); border-bottom: 1px solid var(--border); }
.vx-modal-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.vx-modal-lead { color: var(--text-secondary); font-size: 13px; margin-top: 4px; max-width: 120ch; }
.vx-modal-src { color: var(--text-secondary); font-size: 12.5px; margin-top: 6px; } .vx-modal-src b { color: var(--text-primary); font-weight: 600; }
.vx-modal-count { font-size: 12.5px; color: var(--text-secondary); padding: 6px 0; } .vx-modal-count.warn { color: var(--warning-text); }
.vx-modal-body { flex: 1; min-height: 0; overflow: auto; background: var(--surface-1); }
.vx-modal-intro { padding: 10px 18px 12px; border-bottom: 1px solid var(--border); } .vx-modal-intro .vx-modal-lead { margin-top: 0; }
.vx-modal-intro .vx-modal-src { max-width: 200ch; }
.vx-build { table-layout: fixed; } .vx-build th:nth-child(1) { width: 26%; } .vx-build th:nth-child(2) { width: 128px; } .vx-build th:nth-child(4) { width: 292px; }
.vx-build td { vertical-align: top; padding-top: 8px; padding-bottom: 8px; }
.vx-build-name { white-space: normal !important; } .vx-build-name b { font-weight: 600; overflow-wrap: anywhere; }
.vx-build-desc { color: var(--text-muted); font-size: 12px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vx-build-was { color: var(--text-muted); font-size: 11.5px; text-align: right; margin-top: 2px; }
.vx-build tr.changed td:nth-child(2) .vx-input { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vx-rec-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vx-rec-chip { display: inline-block; padding: 2px 10px; border-radius: 6px; font-weight: 600; font-size: 12.5px; background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; }
.vx-rec-chip.info { background: var(--accent-bg); color: var(--pos-text); } .vx-rec-chip.good { background: var(--good-bg); color: var(--good-text); }
.vx-rec-chip.warn { background: var(--warning-bg); color: var(--warning-text); } .vx-rec-chip.bad { background: var(--critical-bg); color: var(--critical-text); }
.vx-rec-why { color: var(--text-secondary); font-size: 12.5px; margin-top: 4px; max-width: 110ch; }
.vx-rec-why .vx-badge { font-weight: 500; font-size: 11px; padding: 0 6px; }
/* термин с пояснением: пунктир под словом, пояснение — при наведении */
.vx-term { border-bottom: 1px dotted var(--deemph-strong); cursor: help; }
.vx-gloss { columns: 44ch; column-gap: 40px; } .vx-gloss > div { break-inside: avoid; margin-bottom: 10px; } .vx-gloss dt { color: var(--text-primary); font-weight: 600; } .vx-gloss dd { margin: 1px 0 0; color: var(--text-secondary); }
.pos { color: var(--pos-text); } .neg { color: var(--neg-text); } .muted { color: var(--text-muted); } .sec { color: var(--text-secondary); }
.nowrap { white-space: nowrap; }

/* ---------- таблицы ---------- */
.vx-tablewrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-1); }
.vx-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
.vx-table th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-secondary); font-weight: 600; font-size: 12px; padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.vx-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.vx-table tr:last-child td { border-bottom: 0; }
.vx-table .r { text-align: right; } .vx-table .l { text-align: left; } .vx-table .c { text-align: center; }
.vx-table th.sortable { cursor: pointer; }
.vx-table th.sortable:hover { color: var(--text-primary); }
.vx-table th.sorted { color: var(--text-primary); }
.vx-table .sticky { position: sticky; left: 0; z-index: 1; background: var(--surface-1); }
.vx-table th.sticky { z-index: 3; background: var(--surface-2); }
.vx-table tr.clickable { cursor: pointer; }
.vx-table tbody tr:hover td { background: var(--surface-2); }
.vx-table tr.sel td { background: var(--accent-bg); }
.vx-table tr.dimrow td { color: var(--text-muted); }
.vx-table td.empty { text-align: center; color: var(--text-muted); padding: 24px; }
.vx-table td.diff { background: var(--warning-bg); }
.vx-table td.dead, .vx-table tr.dead td { color: var(--text-muted); }
.vx-table.compact td, .vx-table.compact th { padding: 4px 8px; }
.vx-table td.wrap { white-space: normal; min-width: 220px; }
.vx-table td.soft, .vx-table th.soft { white-space: normal; }
.vx-table tr.group td { background: var(--surface-2); font-weight: 600; color: var(--text-secondary); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; position: sticky; }
.vx-sort { font-size: 9px; }
.vx-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.vx-kv dt { color: var(--text-secondary); } .vx-kv dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- графики ---------- */
.vx-chart { margin: 0; min-width: 0; }
.vx-chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px 10px; margin-bottom: 8px; flex-wrap: wrap; }
.vx-chart-title { font-weight: 600; }
.vx-chart-sub { color: var(--text-secondary); font-size: 12.5px; margin-top: 1px; max-width: 80ch; }
.vx-chart-tools { display: flex; gap: 6px; align-items: center; flex: none; margin-left: auto; }
.vx-chart-note { color: var(--text-muted); font-size: 12px; margin-top: 8px; max-width: 86ch; }
.vx-chart-table { display: none; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.vx-plot { width: 100%; min-width: 0; }
.vx-svg { display: block; overflow: visible; }
.vx-gl { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.vx-axis { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.vx-ref { stroke: var(--deemph-strong); stroke-width: 1; shape-rendering: crispEdges; }
.vx-tick { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.vx-vlabel { fill: var(--text-secondary); font-size: 11px; font-variant-numeric: tabular-nums; }
.vx-endlabel { fill: var(--text-secondary); font-size: 11px; }
.vx-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vx-line.muted { stroke-width: 1.5; opacity: .75; }
.vx-area { opacity: .10; stroke: none; }
.vx-bar { transition: opacity .1s; }
.vx-bar.dim { opacity: .35; }
.vx-hit.clickable { cursor: pointer; }
.vx-hit:hover, .vx-hit:focus { fill: var(--text-primary); fill-opacity: .05; outline: none; }
.vx-cross { stroke: var(--deemph-strong); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.vx-dot { stroke: var(--surface-1); stroke-width: 2; pointer-events: none; }
.vx-empty { color: var(--text-muted); padding: 28px 8px; text-align: center; font-size: 13px; }
.vx-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.vx-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.vx-swatch.rect { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.vx-swatch.line { width: 14px; height: 2px; border-radius: 1px; display: inline-block; }
.vx-tip { position: fixed; z-index: 100; display: none; pointer-events: none; background: var(--surface-1); color: var(--text-primary); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.16); max-width: 340px; }
.vx-tip-title { color: var(--text-secondary); margin-bottom: 4px; font-size: 12px; }
.vx-tip-row { display: flex; align-items: center; gap: 8px; }
.vx-tip-k { color: var(--text-secondary); flex: 1; }
.vx-tip-v { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 12px; text-align: right; }
.vx-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }

.vx-hbars { display: grid; grid-template-columns: minmax(90px, var(--label-w, 150px)) minmax(60px, 1fr) auto; gap: 7px 10px; align-items: center; }
.vx-hbar-row { display: contents; }
.vx-hbar-row.clickable > * { cursor: pointer; }
.vx-hbar-row.dim > * { opacity: .5; }
.vx-hbar-label { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.vx-hbar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-hbar-sub { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vx-hbar-track { position: relative; height: 14px; }
.vx-hbar-fill { position: absolute; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 1px; }
.vx-hbar-fill.neg { border-radius: 4px 0 0 4px; }
.vx-hbar-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--axis); }
.vx-hbar-value { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-size: 13px; }
.vx-hbar-row:focus-visible > .vx-hbar-label { outline: 2px solid var(--accent); }

.vx-heat-wrap { overflow-x: auto; }
.vx-heat { display: grid; gap: 2px; font-size: 11px; font-variant-numeric: tabular-nums; min-width: min-content; }
.vx-heat-col, .vx-heat-row, .vx-heat-corner { color: var(--text-muted); display: grid; place-items: center; padding: 0 4px; white-space: nowrap; }
.vx-heat-row { justify-items: end; padding-right: 8px; color: var(--text-secondary); }
.vx-heat-cell { height: 26px; border-radius: 3px; display: grid; place-items: center; color: var(--text-primary); overflow: hidden; white-space: nowrap; }
.vx-heat-cell.strong { color: #fff; }
.vx-heat-cell.void { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.vx-heat-cell.clickable { cursor: pointer; }
.vx-heat-cell:hover, .vx-heat-cell:focus-visible { outline: 2px solid var(--text-primary); outline-offset: -1px; }
.vx-segbar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; }
.vx-seg { min-width: 2px; }
.vx-seg:first-child { border-radius: 4px 0 0 4px; } .vx-seg:last-child { border-radius: 0 4px 4px 0; }
.vx-spark { display: block; }
.vx-meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; position: relative; }
.vx-meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }

/* ---------- загрузка файлов ---------- */
.vx-drop { border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 34px 20px; text-align: center; background: var(--surface-1); cursor: pointer; transition: background .12s, border-color .12s; }
.vx-drop:hover, .vx-drop.over { border-color: var(--accent); background: var(--accent-bg); }
.vx-drop h3 { font-size: 17px; margin-bottom: 6px; }
.vx-drop p { color: var(--text-secondary); max-width: 70ch; margin: 0 auto; }
body.dragging::after { content: 'Отпустите файлы — разберу сам'; position: fixed; inset: 10px; z-index: 200; border: 2px dashed var(--accent); border-radius: 16px; background: color-mix(in srgb, var(--plane) 86%, var(--accent)); display: grid; place-items: center; font-size: 20px; font-weight: 600; pointer-events: none; }
.vx-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vx-item { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; cursor: pointer; }
.vx-item:hover { border-color: var(--border-strong); }
.vx-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.vx-item-name { font-weight: 600; overflow-wrap: anywhere; }
.vx-item-meta { color: var(--text-secondary); font-size: 12.5px; }
.vx-item-nums { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; font-size: 13px; }
.vx-item-nums span b { font-weight: 600; }
.vx-x { border: 0; background: none; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 4px; }
.vx-x:hover { color: var(--critical-text); background: var(--critical-bg); }

/* ---------- прочее ---------- */
.vx-score-ring { --v: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; flex: none; background: conic-gradient(var(--ring, var(--accent)) calc(var(--v) * 1%), var(--surface-2) 0); position: relative; }
.vx-score-ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface-1); }
.vx-score-ring span { position: relative; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.vx-parts { display: grid; grid-template-columns: minmax(120px, auto) minmax(80px, 1fr) auto; gap: 6px 12px; align-items: center; font-size: 13px; }
.vx-parts .name { color: var(--text-secondary); }
.vx-parts .val { font-variant-numeric: tabular-nums; text-align: right; }
.vx-timeline { position: relative; height: 150px; }
.vx-prose { color: var(--text-secondary); columns: 62ch; column-gap: 48px; }
.vx-prose > div { break-inside: avoid-column; }
.vx-prose h3 { break-after: avoid; }
.vx-prose > div:first-child h3 { margin-top: 0; }
.vx-prose p + p { margin-top: 8px; }
.vx-prose h3 { color: var(--text-primary); margin: 18px 0 6px; }
.vx-prose code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.vx-prose ul { margin: 6px 0; padding-left: 20px; }
details.vx-details > summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; padding: 4px 0; }
details.vx-details[open] > summary { margin-bottom: 8px; }
.vx-pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.vx-pill { padding: 2px 9px; border-radius: 20px; background: var(--surface-2); font-size: 12.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.vx-pill b { color: var(--text-primary); font-weight: 600; }
.vx-divider { height: 1px; background: var(--border); margin: 14px 0; }
.vx-progress { height: 3px; background: var(--surface-2); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.vx-progress > i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .15s; }
@media print { .vx-top, .vx-subnav, .vx-chart-tools, .vx-btn { display: none !important; } .vx-main { width: auto; max-width: none; padding: 0; } .vx-card { break-inside: avoid; } }

/* ---------- две колонки: список слева, содержимое справа ---------- */
.vx-split { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 16px; align-items: start; }
.vx-side { padding: 10px; position: sticky; top: 64px; max-height: calc(100vh - 90px); overflow: auto; }
@media (max-width: 900px) { .vx-split { grid-template-columns: minmax(0, 1fr); } .vx-side { position: static; max-height: 240px; } }

/* ---------- узкие экраны ---------- */
@media (max-width: 1100px) {
  .vx-top { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 6px 12px; }
  .vx-brand small { display: none; }
  .vx-nav { order: 3; flex-basis: 100%; }
  .vx-top-tools { margin-left: auto; }
  .vx-subnav { top: 92px; }
  .vx-main { width: auto; padding: 14px 12px 70px; }
  .vx-hero-num { font-size: 40px; }
}

/* ---------- вход на сервер и панель ИИ ---------- */
.vx-login { position: fixed; inset: 0; z-index: 300; background: var(--plane); display: grid; place-items: center; }
.vx-login-box { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 28px 32px; background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 14px; }
.vx-login-err { color: var(--critical-text); font-size: 13px; min-height: 18px; }
.vx-ai { position: fixed; top: 52px; right: 0; bottom: 0; width: 440px; z-index: 40; display: none; flex-direction: column; background: var(--surface-1); border-left: 1px solid var(--border-strong); }
.vx-ai-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 6px 14px; }
.vx-ai-tabs { padding: 0 12px 8px; border-bottom: 1px solid var(--border); }
.vx-ai-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.vx-ai-foot { padding: 10px 12px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.vx-ai-foot textarea { width: 100%; resize: vertical; min-height: 62px; }
.vx-ai-empty { color: var(--text-secondary); font-size: 13px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.vx-ai-msg { font-size: 13.5px; border-radius: 12px; padding: 9px 12px; max-width: 100%; overflow-wrap: anywhere; }
.vx-ai-msg.user { align-self: flex-end; background: var(--accent-bg); white-space: pre-wrap; max-width: 88%; }
.vx-ai-msg.bot { background: var(--surface-2); }
.vx-ai-msg.err { background: var(--critical-bg); color: var(--critical-text); }
.vx-ai-text p { margin: 0 0 7px; } .vx-ai-text p:last-child { margin-bottom: 0; } .vx-ai-text ul { margin: 0 0 7px; padding-left: 18px; } .vx-ai-text li { margin-bottom: 3px; }
.vx-ai-h { font-weight: 600; margin: 8px 0 4px; }
.vx-ai-status { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.vx-ai-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); font-size: 13px; }
.vx-ai-card.done { opacity: .6; }
.vx-ai-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 11.5px; }
.vx-ai-card-title { font-weight: 600; font-size: 14px; margin: 6px 0; }
.vx-ai-kv { margin-top: 4px; overflow-wrap: anywhere; } .vx-ai-refs { margin-top: 6px; font-size: 12px; color: var(--text-secondary); overflow-wrap: anywhere; }
.vx-btn.on { border-color: var(--accent); color: var(--accent); }
@media (min-width: 1500px) { body.vx-ai-open .vx-main { width: auto; max-width: none; margin: 0 464px 0 24px; } body.vx-ai-open .vx-subnav { margin-right: 0; } }
@media (max-width: 700px) { .vx-ai { width: 100vw; } }
