/* «Оракул-1» — токены и каркас по oracle/TZ/oracle_ui_screens_handoff_v2.md.
   Тёмная тема по умолчанию; светлая — вторая, только токенами (data-theme="light").
   Без скруглений, теней, градиентов; линии 1 px. Шрифты — в static/fonts, без CDN. */

@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-500.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-600.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 700; font-display: swap; src: url(fonts/ibm-plex-sans-cyrillic-700.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-cyrillic-400.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191-2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-cyrillic-500.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
  --bg: #141311; --surface: #1E1D1B; --surface-2: #24221F; --rail: #1A1917;
  --selected: #2C2724; --hover: #26241F;
  --line: #34312C; --line-soft: #2A2824; --line-strong: #5A554D;
  /* muted и faint светлее handoff (#A39B8E, #8A8377): на тёмном фоне читались плохо (21.10.2026) */
  --text: #ECE6DA; --muted: #C2BAAD; --faint: #A9A194;
  --gold: #E8B04B;
  --c-new: #E8B04B; --c-spot: #7FA8D6; --c-vol: #A08FC4;
  --signal: #E07A63; --signal-strong: #B23A2A; --on-signal: #FFF7F0; --ok: #8FB3A0;
  --top-h: 48px; --rail-w: 196px; --status-h: 26px; --win-head: 34px; --gap: 12px; --ctl-h: 26px;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F4F1EA; --surface: #FBF9F4; --surface-2: #EFEBE2; --rail: #F0ECE3;
  --selected: #F3E3DC; --hover: #F1EDE5;
  --line: #D9D3C7; --line-soft: #E6E1D6; --line-strong: #BDB5A6;
  --text: #1F1D1A; --muted: #5F584D; --faint: #7A7266;
  --gold: #B07A12;
  --c-new: #B07A12; --c-spot: #3F6E9E; --c-vol: #7B6AA6;
  --signal: #B5452F; --signal-strong: #B23A2A; --on-signal: #FFF7F0; --ok: #4E7A63;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 400 13px/1.4 var(--sans); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.signal { color: var(--signal); }

/* Каркас */
.app { display: grid; height: 100vh; overflow: hidden; grid-template-rows: var(--top-h) minmax(0, 1fr) var(--status-h);
       grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-areas: "top top" "rail main" "status status"; }
.top { grid-area: top; display: flex; align-items: center; gap: 16px; padding: 0 12px;
       background: var(--surface); border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; font: 700 13px var(--sans); letter-spacing: 1.6px; white-space: nowrap; }
.brand svg { display: block; }
.crumbs { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs b { color: var(--text); font-weight: 400; }
.search { flex: 0 1 380px; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px;
          background: var(--bg); border: 1px solid var(--line); color: var(--faint); min-width: 120px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; }
.kbd { font: 400 11px var(--mono); border: 1px solid var(--line-strong); padding: 0 4px; color: var(--muted); }
.top .spacer { flex: 1; }
.top .meta { display: flex; align-items: center; gap: 14px; color: var(--muted); white-space: nowrap; font-size: 12px; }
.top .meta b { color: var(--text); font-weight: 500; }
.langs a { color: var(--faint); padding: 0 3px; }
.langs a.on { color: var(--text); }

.rail { grid-area: rail; background: var(--rail); border-right: 1px solid var(--line); overflow-y: auto; padding: 6px 0; }
.rail a.tab { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 12px; color: var(--text);
              border-left: 2px solid transparent; }
.rail a.tab:hover { background: var(--hover); }
.rail a.tab.on { background: var(--signal-strong); color: var(--on-signal); border-left-color: var(--signal); }
.rail a.tab.on .n { color: var(--on-signal); }
/* Как в plm-web: пункт, по которому кликнули, жёлтый, пока грузится страница */
.rail a.tab.is-loading { background: #eab308; color: #212529; border-left-color: #eab308; }
.rail a.tab.is-loading .n { color: #212529; }
.rail a.tab.is-loading::after { content: 'F3'; margin-left: auto; animation: tab-pulse 1s ease-in-out infinite; }
@keyframes tab-pulse { 50% { opacity: .35; } }
.rail a.tab .n { width: 10px; font: 400 11px var(--mono); color: var(--faint); }
.rail a.tab .cnt { margin-left: auto; font: 500 11px var(--mono); padding: 0 6px; background: var(--surface-2); color: var(--muted); }
.rail a.tab .cnt.red { background: var(--signal-strong); color: var(--on-signal); }
.rail .group { margin: 22px 12px 8px; font: 500 11px var(--sans); letter-spacing: .8px; text-transform: uppercase; color: var(--faint); }
.rail .item { display: flex; gap: 10px; align-items: baseline; min-height: 26px; padding: 4px 12px 4px 14px; line-height: 1.3; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.rail .item::before { content: '·'; color: var(--faint); }
.rail .item.on { background: var(--surface-2); color: var(--text); border-left: 2px solid var(--signal); padding-left: 12px; }
.rail .item.on { background: var(--signal-strong); color: var(--on-signal); font-weight: 500; }
.rail .item.on::before, .rail .item.on .res { color: var(--on-signal); }
.rail .item .res-yes { color: var(--ok); font-weight: 700; }
.rail .item .res-no { color: var(--faint); }
@media (min-width: 761px) {
  .rail:has(#mk-list, .rail-scroll) { display: flex; flex-direction: column; overflow: hidden; }
  .rail:has(#mk-list, .rail-scroll) > * { flex: 0 0 auto; }
  .rail #mk-list, .rail .rail-scroll { flex: 1 1 auto; min-height: 60px; overflow-y: auto; }
}
.rail .item.off { color: var(--faint); cursor: default; }
.rail .item.empty { color: var(--faint); }
.rail .item.empty.on { color: var(--on-signal); }
.sl-note { display: none; }
body.sl-empty .sl-note { display: block; }
body.sl-empty #m22, body.sl-empty #loading { display: none !important; }

.main { grid-area: main; overflow: auto; padding: var(--gap); min-width: 0; }
.status { grid-area: status; display: flex; align-items: center; gap: 18px; padding: 0 12px; overflow: hidden; white-space: nowrap;
          background: var(--surface); border-top: 1px solid var(--line); font: 400 11px var(--mono); color: var(--muted); }
.status .dot { display: inline-block; width: 7px; height: 7px; background: var(--ok); margin-right: 6px; vertical-align: 0; }
.status .off { text-decoration: line-through; color: var(--faint); }
.status .spacer { flex: 1; }

/* Сетка окон */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

.win { background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.win-head { display: flex; align-items: center; gap: 10px; min-height: var(--win-head); padding: 4px 10px; border-bottom: 1px solid var(--line); }
.win-head h2 { margin: 0; font: 600 12px var(--sans); letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }
.win-head .hint { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-head .tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.win-body { padding: 10px; }
.win-foot { padding: 8px 10px; color: var(--muted); font-size: 11.5px; border-top: 1px solid var(--line-soft); }

/* Строка вкладок раздела */
.subtabs { display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--line);
           margin-bottom: var(--gap); min-height: 40px; flex-wrap: wrap; }
.subtabs a { display: flex; align-items: center; padding: 0 16px; font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent; }
.subtabs a.on { color: var(--text); border-bottom-color: var(--signal); }
.subtabs a:hover { color: var(--text); }
.subtabs .tools { margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }

/* Элементы управления */
.btn { height: var(--ctl-h); padding: 0 10px; background: var(--surface-2); border: 1px solid var(--line-strong); cursor: pointer; font-size: 12px; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--signal-strong); border-color: var(--signal-strong); color: var(--on-signal); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); height: var(--ctl-h); }
.seg button { background: none; border: 0; padding: 0 9px; white-space: nowrap; cursor: pointer; font: 400 11.5px var(--mono); color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--text); color: var(--bg); }
.seg button:disabled { color: var(--faint); cursor: default; text-decoration: line-through; }
select.ctl { height: var(--ctl-h); background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text); font: 400 11.5px var(--mono); padding: 0 4px; }

.chip { display: inline-block; font: 500 11px var(--mono); padding: 1px 6px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.chip.sig { border-color: var(--signal); color: var(--signal); }
.chip.strong { background: var(--signal-strong); border-color: var(--signal-strong); color: var(--on-signal); }
.chip.ok { border-color: var(--ok); color: var(--ok); }

/* Таблицы */
table.t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.t th { text-align: left; font: 400 11.5px var(--sans); color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t tr:hover td { background: var(--hover); }
table.t .r { text-align: right; white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.t td.q { max-width: 420px; min-width: 220px; }
table.t td.q small { display: block; color: var(--faint); font-size: 11px; }

/* Таблица 2×2 */
.m2x2 { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr); }
.m2x2 > div { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 10px 12px; min-height: 40px; }
.m2x2 .h { color: var(--muted); font-size: 11.5px; }
.m2x2 .cell { cursor: pointer; min-height: 96px; }
.m2x2 .cell:hover { background: var(--hover); }
.m2x2 .cell.alert { background: var(--selected); }
.m2x2 .cell.alert .name { color: var(--signal); }
.m2x2 .name { font-weight: 600; font-size: 12.5px; }
.m2x2 .big { font: 500 22px var(--mono); font-variant-numeric: tabular-nums; margin: 6px 0 2px; }
.m2x2 .sub { font: 400 11.5px var(--mono); color: var(--muted); }

/* Горизонтальные столбцы отклонения */
.bars { width: 100%; display: block; }
.scroll-x { overflow-x: auto; }
.bars text { font: 400 11px var(--mono); fill: var(--muted); }
.bars text.lbl { font: 400 12px var(--sans); fill: var(--text); }
.bars text.sub { font: 400 10.5px var(--sans); fill: var(--faint); }
.bars line { stroke: var(--line-soft); }
.bars line.zero { stroke: var(--line-strong); }

.kpis { display: flex; gap: 24px; flex-wrap: wrap; padding: 10px; }
.kpi .v { font: 500 20px var(--mono); font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 11.5px; }

.stub { padding: 48px 24px; text-align: center; color: var(--muted); }
.stub h1 { font: 600 14px var(--sans); color: var(--text); margin: 0 0 8px; }
.loading { padding: 30px; text-align: center; color: var(--muted); font: 400 12px var(--mono); }

.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; z-index: 10; }
.drawer.on { display: block; }
.drawer .panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(760px, 100%); background: var(--surface); border-left: 1px solid var(--line); overflow: auto; }


/* Монитор события */
.layers { display: flex; gap: 12px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.layers label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
.layers input { accent-color: var(--signal); margin: 0; }
.chart-wrap { position: relative; }
.chart { width: 100%; display: block; user-select: none; cursor: crosshair; }
.chart text { font: 400 11px var(--mono); fill: var(--faint); }
.chart text.sig { fill: var(--signal); }
.chart .grid-l { stroke: var(--line-soft); }
.chart .price { stroke: var(--text); fill: none; stroke-width: 1.5; }
.chart .burst { stroke: var(--signal); stroke-dasharray: 3 3; }
.chart .burst.on { stroke-dasharray: none; stroke-width: 2; }
.chart .chron { stroke: var(--muted); stroke-dasharray: 2 4; }
.chart .sel { fill: var(--signal); fill-opacity: .12; stroke: var(--signal); }
.chart .cursor { stroke: var(--line-strong); }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-strong);
       padding: 8px 10px; font: 400 11.5px var(--mono); color: var(--text); min-width: 180px; z-index: 2; }
.tip .muted { color: var(--muted); }
.scroll-y { max-height: 340px; overflow: auto; }
.kv { display: grid; grid-template-columns: 1fr auto; }
.kv > div { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div:nth-child(even) { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.kv .later { color: var(--faint); font-family: var(--sans); font-size: 11.5px; }
.note { padding: 10px; font-size: 12.5px; }
table.t tr.on td { background: var(--selected); }

/* Рынок */
.kpi-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpi-cell { padding: 10px 12px; border-right: 1px solid var(--line); min-width: 0; }
.kpi-cell:last-child { border-right: 0; }
.kpi-cell .l { color: var(--muted); font-size: 11.5px; }
.kpi-cell .v { font: 500 22px var(--mono); font-variant-numeric: tabular-nums; margin: 6px 0 2px; white-space: nowrap; }
.kpi-cell .s { font: 400 11px var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asof { display: inline-flex; align-items: center; gap: 6px; }
.asof input { color-scheme: dark; }
:root[data-theme="light"] .asof input { color-scheme: light; }
.scroll-y.tall { max-height: 560px; }
table.t tr.pick { cursor: pointer; }
table.t tr.sel td { background: var(--selected); }
.tone { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 24px; padding: 12px; }
.tone .row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.tone .row span:last-child { font-family: var(--mono); color: var(--muted); }
.tone .track { position: relative; height: 4px; background: var(--line-soft); }
.tone .track i { position: absolute; top: 0; bottom: 0; }
.tone .track b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line-strong); }
.alert-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.alert-row:hover { background: var(--hover); }
.alert-row .tm { font: 400 12px var(--mono); color: var(--muted); }
.alert-row .ttl { font-weight: 600; font-size: 12.5px; }
.alert-row .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Подготовка данных — как loading-icon в sozd-web: по центру, вращается */
.loading-icon { position: fixed; top: 50%; left: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px;
                z-index: 1000; pointer-events: none; animation: spin 1.2s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Поиск в верхней строке */
.search { position: relative; }
.search .results { position: absolute; left: -1px; right: -1px; top: 29px; background: var(--surface-2); border: 1px solid var(--line-strong); z-index: 20; max-height: 420px; overflow-y: auto; }
.search .results a { display: flex; gap: 10px; justify-content: space-between; padding: 7px 10px; color: var(--text); border-bottom: 1px solid var(--line-soft); }
.search .results a:hover, .search .results a.on { background: var(--selected); }
.search .results small { color: var(--faint); font-family: var(--mono); white-space: nowrap; }

@media (max-width: 1279px) {
  .c3, .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-cell { border-bottom: 1px solid var(--line); }
  .tone { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "rail" "main" "status"; grid-template-rows: auto auto 1fr var(--status-h); }
  .rail { display: flex; overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail .group, .rail .item { display: none; }
  .rail a.tab { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .rail a.tab.on { border-bottom-color: var(--signal); }
  .rail a.tab.is-loading { border-bottom-color: #eab308; }
  .top { flex-wrap: wrap; height: auto; padding: 6px 12px; }
  .search, .top .meta .hide-sm { display: none; }
  .main { padding: 8px; }
  .m2x2 { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tone { grid-template-columns: minmax(0, 1fr); }
  .m2x2 > div { padding: 8px; }
  .m2x2 .big { font-size: 18px; }
  .win-head { flex-wrap: wrap; }
  .win-head .tools { margin-left: 0; flex-wrap: wrap; }
  .subtabs .tools { margin-left: 0; padding: 6px 10px; }
}

/* Руководство (guide.html): как на polydata.cloud — прокручивается только текст, справа «На странице», между ними сплиттер */
.main:has(.guide-page) { overflow: hidden; }
.guide-page { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.guide-head h1 { font: 500 20px var(--sans); margin: 0 0 4px; }
.guide-meta { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.guide-meta a { color: var(--signal); }
.guide-body { display: flex; gap: 0; flex: 1 1 auto; min-height: 0; }
.guide-scroll { flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto; padding-right: 8px; }
.guide-text { line-height: 1.55; max-width: 860px; }
.guide-text h2 { font: 500 17px var(--sans); margin: 22px 0 8px; }
.guide-text h3 { font: 500 14px var(--sans); margin: 16px 0 6px; }
.guide-text a { color: var(--signal); text-decoration: underline; }
.guide-text .link-closed { color: inherit; text-decoration: none; }
.guide-text table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 13px; }
.guide-text th, .guide-text td { border: 1px solid var(--line); padding: 6px 8px; vertical-align: top; text-align: left; }
.guide-text th { background: var(--surface-2); font-weight: 500; }
.guide-text .admonition { border-left: 3px solid var(--signal); background: var(--surface); padding: 8px 12px; margin: 12px 0; }
.guide-text .admonition-title { font-weight: 500; margin-bottom: 4px; }
.guide-text img { max-width: 100%; border: 1px solid var(--line); }
.guide-text figure.pic figcaption { color: var(--muted); font-size: 12px; margin-top: 4px; }
.guide-text figure img { cursor: zoom-in; }
.guide-text code { background: var(--surface-2); padding: 1px 4px; font-family: var(--mono); font-size: 12px; }
.guide-split { flex: 0 0 32px; align-self: stretch; cursor: col-resize; position: relative; touch-action: none; }
.guide-split::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--line-strong); transition: background .15s; }
.guide-split:hover::after, .guide-split.is-drag::after { background: var(--signal); }
body.guide-dragging { cursor: col-resize; user-select: none; }
.guide-toc { flex: 0 0 240px; display: flex; flex-direction: column; min-height: 0; font-size: 12px; }
.guide-toc-title { color: var(--faint); text-transform: uppercase; letter-spacing: .4px; font-size: 11px; margin-bottom: 6px; }
.guide-pics-title { margin-top: 14px; }
.guide-toc-list { overflow-y: auto; min-height: 0; }
.guide-toc-list ul { list-style: none; padding-left: 10px; margin: 0; }
.guide-toc-list .toc > ul, .guide-toc-list ul.guide-pics { padding-left: 0; }
.guide-toc-list li { margin: 3px 0; }
.guide-toc-list a { color: var(--muted); text-decoration: none; }
.guide-toc-list a:hover { color: var(--text); }
.guide-toc-list a.on { color: var(--signal); }
@media (max-width: 991px) { .guide-split, .guide-toc { display: none; } }

/* Просмотр картинки — как в базе знаний: одна тёмная карточка в обеих темах */
.pic-view { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(255, 255, 255, .16); }
:root[data-theme="light"] .pic-view { background: rgba(0, 0, 0, .45); }
.pic-view[hidden] { display: none; }
.pic-view .pic-box { position: relative; background: #111111; color: #E8E8E8; border: 1px solid #2A2A2A; padding: 16px 16px 14px; max-width: 94vw; max-height: 92vh;
                     display: flex; flex-direction: column; gap: 8px; box-shadow: 0 18px 60px rgba(0, 0, 0, .55); }
.pic-view .pic-box > img { max-width: calc(94vw - 34px); max-height: calc(92vh - 110px); object-fit: contain; align-self: center; border: 1px solid #2A2A2A; }
.pic-view .pic-x { position: absolute; top: -14px; right: -14px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #2A2A2A; background: #111111; color: #ADADAD; cursor: pointer; z-index: 2; }
.pic-view .pic-x:hover { color: #E8E8E8; border-color: #ADADAD; }
.pic-view .pic-foot { display: flex; align-items: center; gap: 12px; background: #1E1E1E; border-top: 1px solid #2A2A2A; margin: 6px -16px -14px; padding: 10px 16px; }
.pic-view .pic-cap { flex: 1; color: #ADADAD; font-size: 13px; }
.pic-view .btn { background: transparent; color: #ADADAD; border-color: #2A2A2A; }
.pic-view .btn:hover { color: #E8E8E8; border-color: #ADADAD; }

/* Выгрузка таблицы в CSV (M12): кнопка в шапке окна */
.win-head .btn.csv { height: 22px; padding: 0 7px; font-size: 11px; margin-left: auto; }

/* M4: спот Binance на графике монитора */
.chart .spot { fill: none; stroke: var(--c-spot); stroke-width: 1.2; stroke-dasharray: 4 3; }
.chart .spot-l { fill: var(--c-spot); font-size: 11px; }

/* M10: колокольчик оповещений в шапке */
.bell { color: var(--signal); text-decoration: none; }
.bell[hidden] { display: none; }
.bell b { font: 500 11px var(--mono); }

/* Вход через Google: почта и кнопка «Выйти» в шапке, как в plm-web */
.meta .user { color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.logout { height: 22px; line-height: 20px; padding: 0 8px; font-size: 11.5px; text-decoration: none; color: var(--text); }

/* Админ: ссылка в шапке и переключатель пространства */
.btn.adm { height: 22px; line-height: 20px; padding: 0 8px; font-size: 11.5px; text-decoration: none; color: var(--signal); border-color: var(--signal); }
.ws-select { height: 22px; font-size: 11.5px; max-width: 160px; }

/* Гость (почта не внесена подписчику): видит только «Руководство» и подсказку, как получить доступ */
.guest-note { border-left: 3px solid var(--signal); background: var(--surface); padding: 8px 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--muted); }
.guest-note b { color: var(--text); font-weight: 500; }

/* Страница входа: карточка по центру */
.login-body { min-height: 100%; background: radial-gradient(900px 500px at 50% 0%, var(--surface-2), var(--bg)); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); padding: 28px 28px 18px; }
.login-brand { display: flex; align-items: center; gap: 12px; font: 600 15px var(--sans); letter-spacing: .22em; color: var(--text); margin-bottom: 18px; }
.login-card h1 { font: 500 18px/1.3 var(--sans); margin: 0 0 6px; }
.login-sub { color: var(--muted); margin: 0 0 20px; font-size: 12.5px; }
.login-error { border-left: 3px solid var(--signal); background: var(--surface-2); padding: 8px 10px; margin-bottom: 14px; font-size: 12.5px; color: var(--text); }
.login-google { display: flex; align-items: center; justify-content: center; gap: 10px; height: 40px; background: #fff; color: #1F1F1F; border: 1px solid #DADCE0; text-decoration: none; font: 500 14px var(--sans); }
.login-google:hover { background: #F6F8FA; border-color: #BDC1C6; }
.login-note { color: var(--faint); font-size: 11.5px; margin: 14px 0 18px; line-height: 1.5; }
.login-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); padding-top: 10px; color: var(--faint); font-size: 11px; }

/* Журнал операций: интервал со сдвигом и постраничный вывод */
.log-range { display: flex; align-items: center; gap: 8px; }
.log-range .btn, .pager .btn { min-width: 26px; text-align: center; text-decoration: none; color: var(--text); }
.btn.off { opacity: .35; pointer-events: none; }
.pager { display: flex; align-items: center; gap: 6px; }
.pager-go { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px; }
.pager-go input { width: 44px; text-align: center; }

/* Окно с таблицей до конца экрана: форма не прокручивается, прокручивается только содержимое таблицы (шапка таблицы остаётся на месте) */
.main:has(.fit-win) { overflow: hidden; display: flex; flex-direction: column; }
.fit-win { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.fit-win > * { flex: 0 0 auto; }
.fit-win > .fit-scroll { flex: 1 1 auto; min-height: 0; max-height: none; overflow: auto; }
.fit-win table.t thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* Руководство: кнопки админа — правка текста и картинок в базе знаний */
.guide-admin { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: middle; }
.guide-admin .btn { height: 22px; line-height: 20px; padding: 0 8px; font-size: 11.5px; text-decoration: none; color: var(--text); }

/* Сворачиваемая группа в левом меню («Рынки события») */
.rail .group.fold { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.rail .group.fold::before { content: '▾'; font-size: 10px; }
.rail .group.fold.closed::before { content: '▸'; }
.rail .group.fold .n { margin-left: auto; font: 400 10.5px var(--mono); color: var(--faint); letter-spacing: 0; }
.rail .group.fold:hover { color: var(--text); }

/* Вторая строка формы: путь (как в plm-web) и «✕» возврата в родительскую форму */
.trail { display: flex; align-items: center; gap: 10px; position: sticky; top: calc(-1 * var(--gap)); z-index: 5; flex: 0 0 auto;
         margin: calc(-1 * var(--gap)) calc(-1 * var(--gap)) var(--gap); padding: 6px var(--gap); background: var(--bg); border-bottom: 1px solid var(--line); }
/* путь формы — золотым (как акцент polydata): звенья-ссылки, текущая форма жирнее, разделители тусклее */
.trail-path { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gold); font-size: 12.5px; }
.trail-path a { color: var(--gold); text-decoration: none; opacity: .85; }
.trail-path a:hover { opacity: 1; text-decoration: underline; }
.trail-path b { color: var(--gold); font-weight: 600; }
.trail-path .sep { margin: 0 6px; color: var(--gold); opacity: .45; }
.trail-x { flex: 0 0 auto; width: 26px; height: 26px; line-height: 24px; text-align: center; border: 1px solid var(--line-strong); color: var(--muted); text-decoration: none; font-size: 13px; }
.trail-x:hover { color: var(--text); border-color: var(--muted); background: var(--surface-2); }

/* «Рынок»: строка показателей, радар и алерты (вертикальный сплиттер), тон (горизонтальный сплиттер); форма не прокручивается */
.main:has(.mk-layout) { overflow: hidden; display: flex; flex-direction: column; }
.mk-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mk-layout > .kpi-row { flex: 0 0 auto; }
.mk-mid { flex: 1 1 auto; min-height: 200px; display: flex; margin-top: 8px; }
.mk-mid > .mk-radar { flex: 1 1 auto; min-width: 380px; }
.mk-mid > .mk-alerts { min-width: 240px; }
.mk-tone { min-height: 130px; }
.mk-tone .tone.fit-scroll { align-content: start; }
.vsplit { flex: 0 0 10px; cursor: col-resize; position: relative; touch-action: none; }
.hsplit { flex: 0 0 10px; cursor: row-resize; position: relative; touch-action: none; }
.vsplit::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--line-strong); transition: background .15s; }
.hsplit::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: var(--line-strong); transition: background .15s; }
.vsplit:hover::after, .vsplit.is-drag::after, .vsplit:focus-visible::after, .hsplit:hover::after, .hsplit.is-drag::after, .hsplit:focus-visible::after { background: var(--signal); }
body.mk-dragging { user-select: none; }
@media (max-width: 991px) {
  .main:has(.mk-layout) { overflow: auto; display: block; }
  .mk-layout { display: block; }
  .mk-mid { display: block; }
  .mk-mid > .mk-alerts, .mk-tone { flex: none !important; margin-top: 12px; }
  .vsplit, .hsplit { display: none; }
}

/* Монитор события: график сверху, под горизонтальным сплиттером три окна с вертикальными сплиттерами; форма не прокручивается */
.main:has(.mn-layout) { overflow: hidden; display: flex; flex-direction: column; }
.mn-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mn-layout > .mn-chart { flex: 1 1 auto; min-height: 220px; }
.mn-bottom { display: flex; min-height: 120px; }
.mn-bottom > .mn-chron { flex: 1 1 auto; min-width: 280px; }
.mn-bottom > .mn-concl, .mn-bottom > .mn-part { min-width: 180px; }
.mn-chart > .chart-wrap { overflow: hidden; }
@media (max-width: 991px) {
  .main:has(.mn-layout) { overflow: auto; display: block; }
  .mn-layout, .mn-bottom { display: block; }
  .mn-layout > .mn-chart { min-height: 360px; }
  .mn-bottom > .mn-concl, .mn-bottom > .mn-part, .mn-bottom { flex: none !important; margin-top: 12px; }
  .mn-layout .hsplit, .mn-layout .vsplit { display: none; }
}

/* Кнопка снятия масштаба: мигает на красном фоне в поле графика, пока окно приближено */
.chart-wrap { position: relative; }
.unzoom { position: absolute; top: 6px; right: 10px; z-index: 3; background: #c0392b; color: #fff; border: 0; border-radius: 4px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; animation: unzoom-blink 1s ease-in-out infinite; }
.unzoom[hidden] { display: none; }
@keyframes unzoom-blink { 50% { opacity: .45; } }

/* Итоговая строка таблицы: не прокручивается (прилипает к низу окна), фон отличается от строк */
table.t tfoot td { position: sticky; bottom: 0; background: var(--surface-2); border-top: 1px solid var(--line-strong); font-weight: 600; }

/* Сортируемые колонки: щелчок по заголовку, стрелка у выбранной */
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover, table.t th.sorted { color: var(--text); }
table.t th.sortable a { color: inherit; text-decoration: none; display: block; }
.pager .btn.off { opacity: .4; pointer-events: none; }

/* Сплиттер между карточкой меню и формами: узкая полоса на правой границе меню */
.rail-split { position: fixed; top: var(--top-h); bottom: var(--status-h); left: calc(var(--rail-w) - 4px); width: 8px; cursor: col-resize; z-index: 6; touch-action: none; }
.rail-split::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: transparent; transition: background .15s; }
.rail-split:hover::after, .rail-split.is-drag::after, .rail-split:focus-visible::after { background: var(--signal); }
@media (max-width: 760px) { .rail-split { display: none; } }

/* «События»: таблица результатов сверху, сплиттер, окно пересечения снизу; форма не прокручивается */
.main:has(.sr-layout) { overflow: hidden; display: flex; flex-direction: column; }
.sr-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sr-layout > .sr-top { flex: 1 1 auto; min-height: 200px; }
.sr-layout > .sr-bottom { flex: 0 0 240px; min-height: 120px; }
.sr-bottom > .fit-scroll { overflow: auto; }
@media (max-width: 991px) {
  .main:has(.sr-layout) { overflow: auto; display: block; }
  .sr-layout { display: block; }
  .sr-layout .hsplit { display: none; }
  .sr-layout > .sr-bottom { flex: none !important; margin-top: 12px; }
}

/* «Тон и сторонники»: тон и объём рядом (вертикальный сплиттер), калибровка снизу (горизонтальный); форма не прокручивается */
.main:has(.tn-layout) .subtabs { flex: 0 0 auto; }
.tn-layout { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: 8px; }
.tn-top { flex: 1 1 auto; min-height: 160px; display: flex; }
.tn-top > .tn-tone { flex: 1 1 auto; min-width: 300px; }
.tn-top > .tn-vol { flex: 0 0 50%; min-width: 280px; }
.tn-layout > .tn-calib { flex: 0 0 300px; min-height: 140px; }
.tn-tone .tone.fit-scroll { align-content: start; }
.tn-vol-body { position: relative; padding: 8px 12px 0; overflow: hidden !important; }
.tn-vol-body svg { display: block; width: 100%; height: 100%; }
.tn-legend { font-size: 11px; color: var(--muted); padding: 6px 12px; }
.tn-legend .lg { margin-right: 10px; cursor: pointer; user-select: none; white-space: nowrap; }
.tn-legend .lg i { display: inline-block; width: 9px; height: 9px; margin-right: 4px; }
.tn-legend .lg.off { opacity: .4; text-decoration: line-through; }
.tn-vol-body svg { cursor: crosshair; touch-action: none; }
@media (max-width: 991px) {
  .main:has(.tn-layout) { overflow: auto; display: block; }
  .tn-layout, .tn-top { display: block; }
  .tn-top > .tn-vol, .tn-layout > .tn-calib { flex: none !important; margin-top: 12px; }
  .tn-vol-body { height: 220px; }
  .tn-layout .hsplit, .tn-layout .vsplit { display: none; }
}

/* Кнопка «✕» в полях поискового образа */
.clr-wrap { position: relative; display: inline-flex; min-width: 0; }
.clr-wrap > input { padding-right: 24px; }
.clr { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; border: 0; background: transparent;
       color: var(--muted); font-size: 11px; line-height: 18px; text-align: center; cursor: pointer; border-radius: 3px; }
.clr:hover { color: var(--text); background: var(--hover); }
.clr[hidden] { display: none; }
.search { position: relative; }
.search .clr { right: 44px; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* Кнопки формата мониторинга у пункта меню */
.rail .fmts { margin-left: 8px; display: inline-flex; gap: 2px; }
.rail .fmt { font: 400 12px var(--mono); padding: 0 4px; line-height: 18px; color: var(--faint); border: 1px solid transparent; border-radius: 3px; }
.rail .fmt:hover { color: var(--text); border-color: var(--line-strong); }
.rail .fmt.on { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.rail a.tab.on .fmt { color: var(--on-signal); }
.rail a.tab.on .fmt.on { background: rgba(255, 255, 255, .18); border-color: var(--on-signal); }

/* Мониторинг: формат с переключателем — видна одна таблица, форма не прокручивается */
.mon-sw { display: none; }
.grid.mon-tabs { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 8px; }
.main:has(.mon-tabs) { overflow: hidden; display: flex; flex-direction: column; }
.mon-tabs > .mon-sw { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 0 0 auto; }
.mon-tab { height: var(--ctl-h); padding: 0 10px; background: var(--surface-2); border: 1px solid var(--line-strong); cursor: pointer; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mon-tab:hover { color: var(--text); }
.mon-tab.on { color: var(--on-signal); background: var(--signal-strong); border-color: var(--signal); }
.mon-tab.busy::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: -1px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.mon-tab .cnt { font: 500 11px var(--mono); margin-left: 4px; opacity: .85; }
.mon-sw .win-seg { margin-left: auto; }
.mon-tabs .win-head .win-seg { display: none; }
.mon-tabs > .win[hidden] { display: none; }
.win-head .chip { margin-left: 8px; }
@media (max-width: 991px) {
  .grid.mon-tabs { display: block; }
  .main:has(.mon-tabs) { overflow: auto; display: block; }
  .mon-tabs > .win[hidden] { display: block; }
  .mon-tabs > .mon-sw { display: none; }
}
table.t td.nw { white-space: nowrap; min-width: 340px; }

/* Досье кошелька: профиль — два графика рядом, форма не прокручивается */
.wl-prof { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: row; padding: 12px; }
.wl-cap { font: 500 11px var(--sans); color: var(--muted); margin-bottom: 6px; }
.mon-tab.off, .mon-tab:disabled { opacity: .5; cursor: default; }
table.t th.sortable { cursor: pointer; user-select: none; }
@media (max-width: 991px) { .wl-prof { display: block; } .wl-prof .vsplit { display: none; } .wl-bars { height: 120px; } .wl-pane { flex: none !important; margin-bottom: 12px; } }
.main > .kpi-row + .grid.mon-tabs { margin-top: 12px; }

.wl-pane { display: flex; flex-direction: column; min-height: 0; }
.wl-prof > .wl-pane { flex: 1 1 0; min-width: 160px; }
.wl-prof > .wl-pane:last-child { flex: 1 1 0; }
.wl-bars { flex: 1 1 auto; min-height: 30px; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.wl-bars > div { flex: 1; background: var(--signal); min-height: 1px; }
.wl-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 11px; padding-top: 4px; }
/* Досье кошелька: длинные заголовки колонок переносятся, колонка времени не сжимается */
#wl table.t th { white-space: normal; vertical-align: bottom; line-height: 1.25; }
#wl table.t th.r { min-width: 80px; max-width: 140px; }
#wl table.t td.mono { white-space: nowrap; }
/* Формат с переключателем: окна на всю ширину формы (у .grid выравнивание start сжимало их по содержимому) */
.grid.mon-tabs { align-items: stretch; }
.grid.mon-tabs > .win { width: 100%; }

/* Режим админа: кнопки раздела в шапке, активная подсвечена */
.adm-bar { display: inline-flex; gap: 4px; }
.top .btn.on, .adm-bar .btn.on { background: var(--signal-strong); color: var(--on-signal); border-color: var(--signal); }

/* Шапка: что не вмещается в строку, переносится на вторую; высота растёт, форма под ней сжимается */
.app { grid-template-rows: auto minmax(0, 1fr) var(--status-h); }
.top { flex-wrap: wrap; min-height: var(--top-h); padding-top: 5px; padding-bottom: 5px; row-gap: 6px; }
.top .meta { flex-wrap: wrap; row-gap: 6px; }

/* Цвет значка в легенде слоёв графика — тот же, что у самого слоя */
.layers .sw { display: inline-block; width: 12px; height: 0; border-top: 3px solid; margin: 0 1px 0 0; }
.layers .sw-price { border-color: var(--text); }
.layers .sw-trades { border-color: var(--c-vol); border-top-width: 8px; }
.layers .sw-chron { border-color: var(--muted); border-top-style: dotted; }
.layers .sw-bursts { border-color: var(--signal); border-top-style: dashed; }
.layers .sw-gdelt { border-color: var(--ok); }
.layers .sw-new { border-color: var(--c-new); border-top-width: 8px; }
.layers .sw-spot { border-color: var(--c-spot); border-top-style: dashed; }
.chart .vol-l { fill: var(--c-vol); font-size: 11px; }
.chart-wrap .tip .spot-t { color: var(--c-spot); }

/* M22: одна карточка на экране, форма не прокручивается, прокручивается содержимое карточки */
.seg.cards button { font-size: 14px; padding: 0 8px; }
.main:has(.m22-one) { overflow: hidden; display: flex; flex-direction: column; }
.grid.m22-one { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.m22-one > .win { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; width: 100%; }
.m22-one > .win[hidden] { display: none; }
.m22-one > .win > * { flex: 0 0 auto; }
.m22-one > .win > :not(.win-head):not(.win-foot):not(.kpis) { flex: 1 1 auto; min-height: 0; overflow: auto; }
.m22-one .scroll-x { overflow: visible; }
.m22-one table.t thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
@media (max-width: 991px) {
  .main:has(.m22-one) { overflow: auto; display: block; }
}
/* Таблица 2×2 не растягивается на всю форму: клетки остаются натурального размера */
.m22-one > .win[data-card="1"] { flex: 0 1 auto; width: 100%; max-width: 760px; align-self: flex-start; }
.subtabs .m22-tools { flex: 1 1 auto; padding-top: 8px; padding-bottom: 8px; }
.m22-tools > .seg.cards { margin-right: auto; }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover { color: var(--text); }
