/* tg-trader admin — dark, dense, data-first (design.md §12 base + components). */
:root {
  --bg:#0d1117; --panel:#161b22; --panel-2:#11161d;
  --line:#21262d; --line-strong:#30363d;
  --fg:#c9d1d9; --muted:#8b949e; --dim:#6e7681;
  --pos:#3fb950; --neg:#f85149; --zero:#8b949e; --warn:#d29922;
  --pos-soft:#56d364; --neg-soft:#e5747a;
  --is:#388bfd; --oos:#db8a2b;
  --mom:#58a6ff; --mrv:#bc8cff;
  --accent:#1f6feb; --accent-hover:#2a7bff;
  --r-sm:6px; --r-md:8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}
* { box-sizing:border-box; }
body {
  margin:0; padding:0; background:var(--bg); color:var(--fg);
  font:14px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color:var(--mom); text-decoration:none; }
a:hover { text-decoration:underline; }
h1 { font-size:20px; font-weight:600; margin:0 0 6px; }
h2 { font-size:15px; font-weight:600; margin:28px 0 8px; }
h2 .n { color:var(--muted); font-weight:400; }
.meta { color:var(--muted); font-size:13px; margin-bottom:4px; max-width:70em; }
.meta b { color:var(--fg); font-weight:600; }
.sub, .legend { color:var(--dim); font-size:12px; margin:0 0 10px; }
code { font-family:var(--mono); color:var(--fg); }

/* layout: top bar + content column */
.topbar {
  display:flex; align-items:center; gap:18px;
  padding:10px 24px; background:var(--panel);
  border-bottom:1px solid var(--line-strong);
}
.brand { font-weight:600; letter-spacing:.02em; color:var(--fg); }
.nav { display:flex; gap:14px; flex:1; }
.nav a { color:var(--muted); font-size:13px; padding:2px 0; }
.nav a:hover { color:var(--fg); text-decoration:none; }
.nav a.active { color:var(--fg); border-bottom:2px solid var(--accent); }
.topbar form { margin:0; }
main { padding:24px; max-width:1400px; }
/* The «Трейдинг» card carries the widest table (14-col active positions +
   editable «Канал» picker); give it more room than the default cap — and a
   narrower gutter than the rest of the site — so it fits a laptop window
   without the horizontal scroll (see .pos-tbl). Narrow viewports still fall
   back to the table-wrap's scroll. */
/* «Сигналы» попадают сюда же и по той же причине: девять колонок, из которых
   «Уровни» — список цен произвольной длины. Замер 04.09.2026 на худших реальных
   строках: min-content таблицы 1220 px против 1352 px, которые оставляет дефолтный
   кап — на 1400 она влезает, но БЕЗ ЗАПАСА, и любая новая колонка снова выдавит
   крайнюю за скролл. При 1760 запас уходит в «Уровни», и это не пустое место:
   на 1920 колонка получает 616 px вместо 357 и число многострочных строк падает
   вчетверо (12 из 40 против 36 из 40 на том же корпусе). */
main[data-nav="traders"], main[data-nav="signals"] { max-width:1760px; padding:24px 12px; }

/* flashes */
.flash { border-radius:var(--r-sm); padding:8px 12px; margin:0 0 14px;
  font-size:13px; border-left:2px solid var(--line-strong); background:var(--panel-2); }
.flash.ok  { border-left-color:var(--pos); color:var(--pos-soft); }
.flash.err { border-left-color:var(--neg); color:var(--neg-soft); background:#2a210f; }

/* tables (design.md §6) */
.table-wrap { border:1px solid var(--line); border-radius:var(--r-md);
  background:var(--panel-2); overflow:auto; }
/* a nested detail table (e.g. «Сводная» → per-channel positions) sizes to its own
   content instead of stretching to the full card width, so its columns pack left rather
   than gaping apart; overflow:auto still scrolls it when it is wider than the cell. */
.table-wrap--inline { width:fit-content; max-width:100%; }
.table-wrap--inline table { width:auto; }
table { border-collapse:collapse; width:100%; font-size:12.5px; }
thead th { position:sticky; top:0; z-index:2; background:var(--panel);
  color:var(--muted); font-weight:600; text-align:right; white-space:nowrap;
  padding:6px 10px; border-bottom:1px solid var(--line-strong); }
tbody td { padding:5px 10px; border-bottom:1px solid var(--line);
  white-space:nowrap; text-align:right; vertical-align:middle; }
tbody tr:hover td { background:var(--panel); }
tr.active-row td { background:#16243b; }
tr.active-row td:first-child { box-shadow:inset 3px 0 0 var(--is); }
td.t, th.t { text-align:left; }
/* Totals row, pinned at the TOP of the body in every table that has one («Сводная»,
   both position tables, each channel disclosure): a long list must not make the reader
   scroll to its own total. Footer-like emphasis, with a thicker rule BELOW to separate
   it from the data rows. No tfoot rules live here — nothing renders one any more. */
tr.sum-total td { font-weight:600; border-bottom:2px solid var(--line-strong); }
tr.sum-total td.t { color:var(--muted); }
/* sortable column header: reads as the muted header text, accents on hover */
th .sort-link { color:inherit; white-space:nowrap; }
th .sort-link:hover { color:var(--accent); }
th .sort-link .arrow { font-size:10px; }
th .sort-link .arrow.off { color:var(--dim); }
.num { font-family:var(--mono); font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; }
.muted { color:var(--dim); }
.key { font-weight:600; }
/* «Символ / сторона» — one cell, two facts: the ticker is meaningless without the
   side, and splitting them cost a column in the widest table on the site. */
.sym { display:inline-flex; gap:7px; align-items:baseline; }
/* Two timestamps stacked in one cell («Закрыта / открыта»): the close leads (it is
   the feed's order), the open sits under it as reference. Overrides the default
   single-line row rhythm — used only where a column carries a genuine pair. */
.stack { line-height:1.25; }
.stack .b { font-size:11px; color:var(--dim); }

/* Таблицы позиций («Активные» / «Закрытые» / раскрывашка канала в «Сводной») —
   самые широкие на сайте: 14 колонок активных позиций не влезали в карточку на
   ноутбучном окне (~1390 px) и уезжали в горизонтальный скролл. Плотный режим
   (мельче шрифт, паддинги, бейджи + узкий select канала) снимает ~260 px и
   укладывает таблицу в карточку; на узких окнах скролл остаётся как запас. */
.pos-tbl { font-size:12px; }
.pos-tbl thead th, .pos-tbl tbody td { padding:5px 6px; }
.pos-tbl .badge { font-size:10px; letter-spacing:.02em; padding:1px 5px; }
.pos-tbl .chan-pick select.cell-input { max-width:16em; }
/* «Сменить» ужат до иконки — подпись повторялась в каждой строке; ширину забрал select. */
.chan-pick .chan-apply { padding:3px 7px; line-height:1.25; }
/* У закрытых колонок меньше и запас ширины есть — канал показываем шире (названия
   каналов длинные, а в закрытой таблице это единственный текстовый признак источника). */
.pos-tbl--closed .chan-pick select.cell-input { max-width:20em; }
/* Колонка-поглотитель: table{width:100%} размазывает лишнюю ширину по ВСЕМ
   колонкам (у закрытых позиций содержимое узкое → всё разъезжается, а даты
   отрывались от своей шапки). width:100% на одной колонке отдаёт весь запас ей
   одной, остальные пакуются по содержимому. */
.pos-tbl th.grow { width:100%; }

/* badges */
.badge { display:inline-block; text-transform:uppercase; font-size:11px;
  letter-spacing:.04em; padding:1px 6px; border-radius:var(--r-sm);
  border:1px solid var(--line-strong); }
.badge--ok    { color:var(--pos); border-color:var(--pos); }
.badge--bad   { color:var(--neg); border-color:var(--neg); }
.badge--warn  { color:var(--warn); border-color:var(--warn); }
.badge--muted { color:var(--muted); }
.badge--dim   { color:var(--dim); }
.mark.good { color:var(--pos); } .mark.bad { color:var(--neg); }

/* cards / key-value */
.card { border:1px solid var(--line); border-radius:var(--r-md);
  background:var(--panel-2); padding:14px 16px; margin:0 0 16px; max-width:680px; }
.kv { display:grid; grid-template-columns:max-content 1fr; gap:4px 16px; font-size:13px; }
.kv dt { color:var(--muted); }
.kv dd { margin:0; color:var(--fg); }

/* forms */
.controls { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:12px 0; }
form.inline { display:inline; margin:0; }
label { font-size:12px; color:var(--muted); display:block; margin:8px 0 2px; }
input[type=text], input[type=password], input[type=number], select {
  background:var(--panel-2); color:var(--fg);
  border:1px solid var(--line-strong); border-radius:var(--r-sm);
  padding:6px 10px; font-size:13px; font-family:inherit; min-width:220px; }
input:focus, select:focus { outline:none; border-color:var(--accent); }
/* compact input for editable table cells (per-channel trading params) */
input.cell-input { min-width:0; width:6.5em; padding:3px 6px; font-size:12px; text-align:right; }
/* compact <select> for a table cell (channel «Модель»): the input.cell-input rule above
   doesn't reach <select>, and the .chan-pick variant is scoped to that wrapper, so without
   this the select would inherit the 220px form min-width and blow out the column. */
select.cell-input { min-width:0; width:auto; max-width:9em; padding:3px 6px; font-size:12px; }
/* editable «Канал» cell: compact select + «Сменить» button on one line. Own display
   rule (not form.inline) so the flex layout actually applies; margin:0 replaces the
   form default; vertical-align keeps it centred in the row. */
.chan-pick { display:inline-flex; gap:4px; align-items:center; margin:0; vertical-align:middle; max-width:100%; }
.chan-pick select.cell-input { min-width:0; width:auto; max-width:10em; padding:3px 6px; font-size:12px;
  text-overflow:ellipsis; }
.form-row { display:flex; flex-wrap:wrap; gap:14px; align-items:flex-end; }
.form-field { display:flex; flex-direction:column; }
.hint { color:var(--dim); font-size:12px; margin-top:6px; }
/* channel hints editor (в раскрывашке «Отслеживаемые»): the project has no other
   <textarea>, and the global input rule lists only input[type=…]/select, so without an
   explicit rule the field renders as a light system box on the dark theme. Tokens from
   design.md §12 (--panel-2 is named the textarea surface). */
.hints-form { margin-top:12px; max-width:640px; }
/* «Книга позиций» (reference-trader-plan.md M5): its own form beside the hints editor, same
   box. The select keeps the global 220px floor but must not push past a phone's width. */
.ref-form { margin-top:12px; max-width:640px; }
.ref-pick { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.ref-pick select { max-width:100%; }
.code-out { width:100%; resize:vertical; padding:8px 10px; box-sizing:border-box;
  background:var(--panel-2); color:var(--fg); border:1px solid var(--line-strong);
  border-radius:var(--r-md); font:12.5px/1.5 var(--mono); font-variant-numeric:tabular-nums; }
.code-out:focus { outline:none; border-color:var(--accent); }

/* buttons */
button, .btn { background:var(--panel); color:var(--fg); border:1px solid var(--line-strong);
  border-radius:var(--r-sm); padding:6px 12px; font-size:13px; cursor:pointer; font-family:inherit; }
button:hover, .btn:hover { background:var(--line); }
button.primary { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
button.primary:hover { background:var(--accent-hover); }
button.danger { color:var(--neg); border-color:var(--neg); }
button.danger:hover { background:#2a210f; }
button.small { padding:3px 8px; font-size:12px; }

/* callout */
.callout-warn { color:var(--warn); font-size:12px; line-height:1.6; white-space:pre-wrap;
  border-left:2px solid var(--warn); padding:8px 12px; background:#2a210f;
  border-radius:0 var(--r-sm) var(--r-sm) 0; font-family:var(--mono); margin:8px 0; }

/* login */
.login-wrap { max-width:340px; margin:8vh auto 0; }
.login-wrap input { width:100%; min-width:0; }
.login-wrap button { width:100%; margin-top:14px; }

/* expandable dialog rows (Диалоги) — click a row to reveal a detail spoiler.
   The caret lives in a real <button> (caret-btn): the keyboard/AT-facing
   control that owns aria-expanded; the row click is a mouse convenience and
   carries no ARIA role. */
tr.dlg-row { cursor:pointer; }
tr.dlg-row.expanded td { background:#16243b; }
tr.dlg-row.expanded td:first-child { box-shadow:inset 3px 0 0 var(--is); }
.caret-btn { background:none; border:0; padding:0; margin:0; cursor:pointer;
  color:inherit; font:inherit; line-height:1; vertical-align:baseline; }
.caret-btn:focus-visible { outline:2px solid var(--accent); outline-offset:1px;
  border-radius:var(--r-sm); }
.caret { display:inline-block; width:1em; margin-right:4px; color:var(--dim);
  font-size:10px; transition:transform .12s ease; }
tr.dlg-row.expanded .caret { transform:rotate(90deg); color:var(--mom); }
/* Direct child only (`> td`): the detail's left-accent/padding/background must style the
   single spanning detail cell, NOT leak onto the cells of any table nested inside it
   (e.g. «Сводная» → per-channel positions), which would draw a blue inset line down every
   nested column and left-align its numbers. */
tr.dlg-detail > td { text-align:left; white-space:normal;
  background:var(--panel-2); padding:10px 14px 12px 22px;
  box-shadow:inset 3px 0 0 var(--is); }
tr.dlg-detail:hover > td { background:var(--panel-2); }
/* Сводка модификаторов под названием канала в строке привязки: одна строка мелким,
   чтобы состояние читалось не разворачивая. Печатается только когда карточка есть. */
.chan-mods-sum { font-size:11.5px; margin-top:2px; }
.chan-mods-sum .badge { vertical-align:baseline; }
/* Карточки модификаторов внутри той раскрывашки. Не .card: тот блок — панель страницы
   (max-width 680, отступ 16 снизу), а здесь карточек может быть несколько подряд внутри
   ячейки таблицы, и им нужен свой ритм. Левая полоса — тот же приём, что у .dlg-detail:
   она отделяет «правило» от полей привязки, не рисуя ещё одну рамку в рамке. */
.mod-cards { display:flex; flex-direction:column; gap:8px; margin:8px 0 0; }
.mod-card { border:1px solid var(--line); border-radius:var(--r-md); background:var(--panel-2);
  padding:8px 12px 10px; max-width:680px; box-shadow:inset 3px 0 0 var(--pos); }
/* Выключенная карточка: полоса гаснет, содержимое приглушается. Не opacity на всю
   карточку — она утащила бы за собой и кнопку «Удалить», и заголовок, то есть ровно то,
   чем оператор возвращает карточку в строй. */
.mod-card--off { box-shadow:inset 3px 0 0 var(--line-strong); }
.mod-card--off .chk-row, .mod-card--off .form-row { opacity:.55; }
.mod-card-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.mod-card-name { font-size:13px; color:var(--fg); }
/* Действия карточки прижаты вправо: их две, и обе необратимее всего, что рядом. */
.mod-card-actions { margin-left:auto; display:flex; gap:6px; align-items:center; }
/* Три денежных поля карточки в один ряд: с общей формовой шириной 220px третье
   переносится и карточка читается как два несвязанных блока. Числа тут короткие. */
.mod-card .form-field input { min-width:0; width:11em; }
.mod-card .hint { margin-top:8px; }
.mod-cards .mod-empty { margin:0; }
/* Выбор типа в форме добавления: .cell-input режет select до 9em ради узкой колонки
   таблицы, а здесь он стоит в обычной строке и обрезал бы название типа многоточием. */
.mod-add { margin:8px 0 0; }
.mod-add select.cell-input { max-width:none; width:auto; }
.kv--detail { max-width:560px; }
.kv--detail dd .badge { vertical-align:baseline; }

/* two-column detail: technical fields beside the neural-run result (Все сообщения).
   Columns wrap on narrow viewports. */
.detail-cols { display:flex; flex-wrap:wrap; gap:28px; align-items:flex-start; }
.detail-cols > section { flex:1 1 320px; min-width:0; }
.detail-cols > section h2:first-child { margin-top:0; }

/* «Прогоны» run-detail: outcome + one-line «почему», audit-metric tiles, error banner.
   Reuses the detail-cols/kv/prov skeleton; only the tiles/head/banner are new. */
.run-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 12px; margin:0 0 10px; }
.run-why { color:var(--fg); font-size:13px; }
.run-tiles { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.run-tile { flex:0 1 auto; min-width:88px; padding:6px 10px; background:var(--panel-2);
  border:1px solid var(--line); border-radius:var(--r-sm); }
.run-tile-k { display:block; color:var(--dim); font-size:11px; text-transform:uppercase;
  letter-spacing:.02em; margin-bottom:2px; }
.run-tile-v { display:block; font-size:15px; color:var(--fg); }
.run-error { border-left:3px solid var(--neg); background:var(--panel-2);
  padding:6px 10px; border-radius:0 var(--r-sm) var(--r-sm) 0; margin:0 0 10px; }

/* watch toggle (★) — narrow trailing column; the cell carries data-no-toggle so
   clicking the star never expands the spoiler (see static/app.js). */
.watch-th { text-align:center; width:1%; }
td.watch-cell { text-align:center; width:1%; }
.watch-btn { background:none; border:none; padding:2px 8px; line-height:1;
  font-size:15px; color:var(--dim); cursor:pointer; border-radius:var(--r-sm); }
.watch-btn:hover { color:var(--warn); background:var(--line); }
.watch-btn.on { color:var(--warn); }

/* signal toggle (Прогон column) */
.signal-toggle { background:none; border:1px solid var(--line-strong); color:var(--dim);
  padding:2px 8px; font-size:12px; border-radius:var(--r-sm); cursor:pointer; font-family:inherit; }
.signal-toggle.on { color:var(--pos); border-color:var(--pos); }
.signal-toggle:hover { background:var(--line); }

/* native <dialog> modal (backfill) */
dialog.modal { background:var(--panel); color:var(--fg); border:1px solid var(--line-strong);
  border-radius:var(--r-md); padding:18px 20px; max-width:440px; width:90%; }
dialog.modal::backdrop { background:rgba(0,0,0,.5); }
dialog.modal h2 { margin-top:0; }
dialog.modal label { display:block; }
/* «Создать сигнал»: в ряд встают цена входа, стоп и тейки — стандартные 440px их ломают.
   [hidden] перебивается .form-row{display:flex}, поэтому скрытие полей по виду держится
   явным правилом, а не на поведении атрибута по умолчанию. */
dialog.modal--wide { max-width:640px; }
#opsig [hidden] { display:none !important; }
#opsig .opsig-traders > div { font-size:13px; margin:2px 0; }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; }
label.radio { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--fg);
  margin-right:14px; }
label.radio input { min-width:0; }
/* compact signal-type acceptance checkboxes: per-channel «Приём» cell (О·З·Д·С±Т) and
   the trader-defaults seed row. Overrides the block `label` rule so several sit inline. */
label.chk { display:inline-flex; align-items:center; gap:3px; margin:0 6px 0 0;
  font-size:12px; color:var(--muted); white-space:nowrap; cursor:pointer; }
label.chk input { min-width:0; margin:0; }
.chk-row { display:flex; flex-wrap:wrap; gap:6px 12px; margin-top:2px; }

/* pagination */
.pager { display:flex; gap:8px; align-items:center; margin:14px 0; font-size:13px; }

/* trader-card section tabs (Трейдинг → карточка): a horizontal switcher in place
   of stacked sections. Progressive enhancement — the bar is hidden until app.js
   adds .js-tabs (without JS every panel stacks; see the <noscript> in the
   template). Styled like the top nav: an underline-rail with one active tab. */
.tabs { display:none; }
.tabbed.js-tabs .tabs {
  display:flex; flex-wrap:wrap; gap:2px;
  border-bottom:1px solid var(--line-strong); margin:18px 0 0;
}
.tab {
  background:none; border:0; border-bottom:2px solid transparent; border-radius:0;
  color:var(--muted); font-size:13px; font-weight:600; line-height:1;
  padding:9px 14px; margin-bottom:-1px; cursor:pointer;
  display:inline-flex; align-items:center; gap:7px;
}
.tab:hover { background:var(--panel); color:var(--fg); }
.tab[aria-selected="true"] { color:var(--fg); border-bottom-color:var(--accent); }
.tab:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; border-radius:var(--r-sm); }
.tab-count {
  font-size:11px; font-weight:600; color:var(--muted);
  background:var(--panel); border:1px solid var(--line-strong); border-radius:999px;
  padding:0 6px; min-width:1.7em; text-align:center;
}
.tab[aria-selected="true"] .tab-count { color:var(--fg); border-color:var(--line-strong); }
/* When tabs are live the panel owns the top spacing, so drop the first heading's
   margin (h2 default is 28px top, which would double the gap under the bar). */
.tabbed.js-tabs .tab-panel { padding-top:16px; }
.tabbed.js-tabs .tab-panel > :first-child { margin-top:0; }

/* «Все сообщения» auto-refresh toggle (newest view only). inline-flex + center +
   gap align the checkbox with its «авто» label text; it also overrides the global
   block-level label default above (the .controls flex row already lays it out). */
.live-toggle { display:inline-flex; align-items:center; gap:5px; margin:0;
  color:var(--muted); font-size:12px; cursor:pointer; }
.live-toggle input { margin:0; cursor:pointer; }
.live-status { font-size:12px; color:var(--dim); min-width:8ch; }

/* messages (Все сообщения) — deleted rows are struck through, not hidden. */
tr.dlg-row.deleted .msg-text { text-decoration:line-through; color:var(--dim); }
/* The text preview is the only wrapping column. Every other tbody td is nowrap
   (date/channel/status), so without this a long one-line preview forces the table
   past its container and shoves the Статус column off-screen. overflow-wrap:anywhere
   also lets the column shrink (breaking long URLs) so the table fits width:100%. */
.msg-text { white-space:normal; overflow-wrap:anywhere; }

/* runs (Прогоны) — the «Сообщение» snippet is the only wrapping column (same
   reason as .msg-text above): the journal has 10 columns and every other tbody
   td is nowrap, so a one-line snippet would force the table past the viewport.
   Wrapping + a width cap lets the column shrink so the table fits width:100%. */
td.run-msg { white-space:normal; overflow-wrap:anywhere; max-width:30ch; }

/* «Сигналы» → «Уровни» — САМАЯ широкая колонка, чьё содержимое ничем не ограничено:
   «вх … · ст … · тп …» с пятью целями вырастает до 60+ символов и в замере на корпусе
   прода занимала 446 px из 1470 px таблицы, то есть одна строка задавала ширину всем
   остальным — а сама колонка в 9 строках из 10 пустая («—»). Таблица от этого не
   влезала в карточку (max-width 1400 → 1352 px) НИКОГДА, и Статус / Источник /
   Причина ревью уезжали в горизонтальный скролл.
   Разрешение переноса делает колонку сжимаемой (та же механика, что у .msg-text), и
   auto-layout отдаёт ей ровно остаток ширины: на окне 1440 px таблица влезает целиком
   (скролла нет, колонка 324 px), 672 строки из 691 остаются однострочными. Каппинга по
   ширине тут намеренно НЕТ — ellipsis на списке целей врал бы, показывая сделку короче,
   чем она есть. Перенос идёт по пробелам, а метка приклеена к своему первому числу
   через &nbsp; в sigLevels, поэтому «вх» не может остаться в конце строки без цены.
   min-width — пол сжатия, и он намеренно широкий. Без пола на окне уже ~1180 px колонка
   садится на min-content (одно число в строку, строка в 189 px высотой) и таблица ВСЁ
   РАВНО уезжает в скролл — то есть платим высотой и ничего не выигрываем по ширине.
   Пол в 40ch держит типовую строку «вх · ст · тп» в ОДНУ строку (на том же корпусе при
   контейнере 1200 px: 659 строк из 691 однострочные, самая высокая 50 px, скролл 190 px
   против 367 px без правки), а на широком окне он ниже естественных 324 px и не мешает. */
td.sig-lv { white-space:normal; min-width:40ch; }

/* …но «Уровни» были не единственной такой колонкой, и одной их правки не хватило.
   Замер 04.09.2026 на худших РЕАЛЬНЫХ значениях каждой колонки (а не на суточном
   срезе, где они не встретились разом) дал min-content таблицы 1396 px при
   контейнере 1352 px — то есть таблица не влезала НИ ПРИ КАКОЙ ширине окна, и на
   1920 px «Причина ревью» всё ещё уезжала за скролл на 45 px. Остаток перебора
   держали две колонки, унаследовавшие общий tbody td{white-space:nowrap}:
     • «Источник» — до ТРЁХ бейджей в строке («оба» + «нет фото» + «не на Bybit»),
       212 px, хотя типовая строка это один бейдж в 96 px;
     • «Причина ревью» — фраза из словаря, самая длинная «картинка + текст неполны»,
       171 px против 122 px при переносе.
   Обе по смыслу переносимы без потерь: первая — СПИСОК меток, вторая — фраза из
   двух-трёх слов, и обе дублируются в title и в раскрытой строке. Ellipsis тут был бы
   хуже переноса ровно по той же причине, что и у «Уровней»: обрезанное «картинка +…»
   читается как другая причина. После правки min-content таблицы 1220 px, и на 1280 px
   и шире скролла нет вовсе (было: 181 px на 1280, 127 px на 1333, 45 px на 1920).
   На 1152 px скролл остаётся — там упирается пол сжатия «Уровней», и это осознанный
   размен из комментария выше, а не недоделка. */
td.sig-src, td.sig-rsn { white-space:normal; }

/* .ell is the OTHER answer to the same problem, for a column that must stay ONE line:
   the cap is applied to an inner block, not to the cell. In an auto-layout table a
   max-width on a nowrap td is ignored — the cell's min-content width is the whole string —
   so the ellipsis has to live on a block-level child, which is what this is. Used by the
   «Сигналы» channel column, whose forum-topic titles («Супергруппа → Тема») otherwise push
   the ninth column past the viewport. The full text stays in the element's title. */
.ell { display:block; max-width:28ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.msg-full { white-space:pre-wrap; word-break:break-word; max-width:70em;
  margin:0 0 6px; color:var(--fg); }
.media-item { margin:4px 0; }
.msg-thumb { max-width:220px; max-height:220px; border-radius:var(--r-sm);
  border:1px solid var(--line-strong); display:block; }

/* signals — raw LLM JSON spoiler */
details summary { cursor:pointer; font-size:12px; color:var(--muted); margin:6px 0; }
/* signals — provenance spoiler: secondary run metadata collapsed under the
   extracted fields (auto-opened on extraction errors). Hairline sets it apart. */
details.prov { border-top:1px solid var(--line); margin-top:12px; padding-top:2px; }
.raw-json { white-space:pre-wrap; word-break:break-word; max-width:70em; font-family:var(--mono);
  font-size:12px; color:var(--muted); background:var(--bg); border:1px solid var(--line);
  border-radius:var(--r-sm); padding:8px 10px; margin:6px 0; max-height:320px; overflow:auto; }

/* trader card «Каналы» — the batch draft (channel-batch-save-spec.md). A changed row carries
   the tr.selected accent stripe (design.md §7), in the warning colour: it is not a selection
   but an unsaved draft, and it must stay visible on an expanded row too. */
.chan-batch { margin:8px 0; }
.chan-batch-status { font-size:12px; }
tr.dlg-row.chan-dirty td:first-child,
tr.dlg-row.chan-dirty.expanded td:first-child { box-shadow:inset 3px 0 0 var(--warn); }
tr.dlg-row.chan-detach td { opacity:.55; }
tr.dlg-row.chan-detach td:last-child { opacity:1; }
.chan-row-msg { font-size:11.5px; margin-top:2px; white-space:normal; }
.mod-card--draft { box-shadow:inset 3px 0 0 var(--warn); }
.mod-card--removed { box-shadow:inset 3px 0 0 var(--neg); }
.mod-card--removed .chk-row, .mod-card--removed .form-row, .mod-card--removed .hint { opacity:.45; }
table.chan-busy { opacity:.6; }
.chan-batch-list { margin:8px 0 0; padding-left:18px; font-size:13px; }
.chan-batch-list ul { margin:4px 0 8px; padding-left:18px; color:var(--dim); }

/* trader card «Сводная по дням» — период-переключатель и график (миграция 0054).
   Ссылки-таблетки вместо селекта: выбор живёт в query (?dperiod=), поэтому переживает
   перезагрузку и работает без JS, как psort/csort/ssort. */
.daily-periods { gap:6px; align-items:baseline; margin:6px 0 12px; }
.chip {
  display:inline-block; font-size:12px; line-height:1; padding:5px 10px;
  border:1px solid var(--line-strong); border-radius:999px; color:var(--muted);
  background:var(--panel-2);
}
a.chip:hover { color:var(--fg); border-color:var(--fg); text-decoration:none; }
.chip--on { color:var(--fg); border-color:var(--accent); background:var(--panel); font-weight:600; }

/* График: инлайновый SVG, отрисованный сервером. viewBox тянется по ширине карточки —
   отдельной верстки под телефон не нужно. Цвета — токены темы, чтобы столбец «плюс» был
   того же зелёного, что и плюсовой PnL в таблицах. */
.chart { margin:0 0 14px; padding:0; }
.chart-svg { display:block; width:100%; height:auto; background:var(--panel-2);
  border:1px solid var(--line); border-radius:var(--r-sm); }
.chart-zero { stroke:var(--line-strong); stroke-width:1; }
.chart-bar--pos { fill:var(--pos); }
.chart-bar--neg { fill:var(--neg); }
.chart-bar:hover { fill:var(--fg); }
.chart-line { fill:none; stroke:var(--mom); stroke-width:1.5; stroke-linejoin:round; }
.chart-ax { fill:var(--dim); font-size:10px; font-family:var(--mono); }
.chart-ax--l { text-anchor:end; }
.chart-ax--r { text-anchor:start; }
.chart-ax--x { text-anchor:middle; }
.chart-empty { fill:var(--muted); font-size:12px; text-anchor:middle; }
.chart-key { display:inline-block; width:10px; height:10px; border-radius:2px;
  vertical-align:middle; margin-right:3px; }
.chart-key--pos { background:var(--pos); }
.chart-key--line { background:var(--mom); height:3px; border-radius:1px; }
.chart-bar--zero { fill:var(--line-strong); }

/* ── эмулятор ─────────────────────────────────────────────────────────────────────── */
.pos { color:var(--pos); } .neg { color:var(--neg); } .zero { color:var(--zero); }
.liq-badge { display:inline-block; margin-left:8px; padding:1px 6px; border-radius:3px; font-size:11px;
  font-weight:600; color:#fff; background:var(--neg); text-transform:none; vertical-align:1px; }
.login-wrap { max-width:320px; margin:10vh auto; }
.login-wrap button { margin-top:14px; width:100%; }
.cards { display:flex; flex-wrap:wrap; gap:14px; margin:10px 0 4px; }
.cards .card { min-width:200px; }
.big { font-size:22px; font-weight:600; font-family:var(--mono); font-variant-numeric:tabular-nums; }
.epochs a { margin-right:10px; } .epochs a.active { color:var(--fg); font-weight:600; }
.chart { background:var(--panel-2); border:1px solid var(--line); border-radius:6px; display:block; max-width:100%; height:auto; }
.chart polyline { fill:none; stroke:var(--accent); stroke-width:1.5; }
.chart line.liq { stroke:var(--neg); stroke-width:1; stroke-dasharray:4 3; }
.chart-meta { color:var(--dim); font-size:12px; margin:4px 0 0; }
.secret { font-family:var(--mono); font-size:14px; padding:8px 10px; background:var(--panel-2);
  border:1px solid var(--line-strong); border-radius:4px; user-select:all; word-break:break-all; }
tr.approx td { background:#2a210f; }
.actions { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:14px; margin:12px 0; }
.actions .card h3 { font-size:13px; margin:0 0 8px; }
.actions .card form { margin:0; }
.payload { font-family:var(--mono); font-size:11.5px; color:var(--muted); white-space:normal; word-break:break-word; max-width:70em; }
.big-sub { font-size:14px; }
.gap-top { margin-top:8px; }
.narrow { max-width:640px; }
