/* ARB Screener — чёрный + оранжевый торговый терминал.
   Цвета темы — переменные на :root (их переписывает редактор тем).
   Все размеры в rem: масштаб интерфейса меняется одной переменной --k (ставит app.js). */

@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/fonts/fira-sans-condensed-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(vendor/fonts/fira-sans-condensed-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(vendor/fonts/fira-sans-condensed-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 500; font-display: swap;
  src: url(vendor/fonts/fira-sans-condensed-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(vendor/fonts/fira-sans-condensed-cyrillic-600-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Fira Sans Condensed'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(vendor/fonts/fira-sans-condensed-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --k: 1;                 /* масштаб интерфейса */
  --bg: #000000;          /* холст графиков и фон приложения */
  --surface: #000000;     /* панели */
  --raise: #15130f;       /* меню, диалоги, подсказки */
  --hover: #1e1b16;
  --line: #2b2721;        /* волосяные разделители */
  --line-soft: #19170f;
  --text: #ede6dc;
  --muted: #968d80;
  --dim: #625a50;
  --accent: #ff1ab6;      /* сигнальный розовый (тема Black-Pink): активное, фокус, «живое» */
  --accent-ink: #120800;
  --accent-soft: rgba(255, 26, 182, .14);
  --up: #089981;
  --down: #f23645;
  --alert: #a66bff;
  --fair: #e5b93c;
  --ok: #19c37d;
  --warn: #ffb020;
  --err: #f23645;
  --grid: #14120f;
  --cross: #7d756a;
  --scale-text: #968d80;
  --scale-line: #2b2721;
  --well: color-mix(in srgb, var(--bg) 55%, var(--raise));   /* карточки настроек внутри диалога */

  --font: 'Fira Sans Condensed', 'Roboto Condensed', 'Arial Narrow', system-ui, sans-serif;
  --fs-xs: .75rem; --fs-s: .8125rem; --fs-m: .875rem; --fs-l: 1rem; --fs-xl: 1.25rem;
  --r-s: .1875rem; --r-m: .375rem; --r-l: .625rem;
  --top-h: 2.375rem; --status-h: 0px; --tools-w: 2.625rem; --watch-w: 19rem; --head-h: 2rem; --foot-h: 1.5rem;
  --mnav-h: 0px;
  --gutter-w: .5rem;      /* линия изменения ширины списка связок */
  --ctl-h: 2rem;          /* высота полей и кнопок в формах */
  color-scheme: dark;
}
html { font-size: calc(16px * var(--k)); }
/* нигде на странице щипок не увеличивает сайт (в том числе внутри прокручиваемых областей); у графика — свой touch-action */
* { touch-action: pan-x pan-y; }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 400 var(--fs-m)/1.4 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow: hidden;
  touch-action: pan-x pan-y; -webkit-tap-highlight-color: transparent;   /* страница не увеличивается щипком — щипок достаётся графику */
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
[hidden] { display: none !important; }
.num, input[type=number] { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--accent); color: var(--accent-ink); padding: .375rem .625rem; }
.skip:focus { left: .5rem; }
svg.i { width: 1.0625rem; height: 1.0625rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ─── каркас ─────────────────────────────────────────────── */
.app { display: grid; grid-template-rows: var(--top-h) minmax(0, 1fr) var(--mnav-h); height: 100vh; height: 100dvh;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.main { display: grid; grid-template-columns: var(--tools-w) var(--watch-w) var(--gutter-w) minmax(0, 1fr); min-height: 0; border-top: 1px solid var(--line); }
/* скрытые колонки убираем из сетки целиком, иначе графики попадают в колонку нулевой ширины */
.app.watch-hidden .main { grid-template-columns: var(--tools-w) minmax(0, 1fr); }
.app.watch-hidden .watch, .app.watch-hidden .gutter { display: none; }
.app.popout .main { grid-template-columns: minmax(0, 1fr); }
.app.popout .tools, .app.popout .watch, .app.popout .gutter, .app.popout .ws-tabs, .app.popout .only-main { display: none; }

.topbar { display: flex; align-items: center; gap: .375rem; padding: 0 .5rem 0 0; min-width: 0; }
.brand { display: flex; align-items: center; gap: .375rem; height: 100%; padding: 0 .75rem; flex: none; font-weight: 600; letter-spacing: .02em; font-size: var(--fs-l); }
.brand svg, .login-mark svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.top-left { display: flex; align-items: center; gap: .125rem; flex: none; }
.top-left .ibtn.on { color: var(--accent); }
.app.mobile .top-left, .app.popout .top-left { display: none; }
.ws-tabs { display: flex; align-items: stretch; height: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ws-tab { display: flex; align-items: center; gap: .375rem; padding: 0 .875rem; border: 0; background: none; color: var(--muted); white-space: nowrap; position: relative; font-size: var(--fs-m); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; flex: none; }
.ws-tab:hover { color: var(--text); background: var(--hover); }
.ws-tab[aria-selected=true] { color: var(--text); }
.ws-tab[aria-selected=true]::after { content: ''; position: absolute; left: .5rem; right: .5rem; bottom: 0; height: 2px; background: var(--accent); }
.ws-tab input { width: 8rem; background: var(--raise); border: 1px solid var(--accent); border-radius: var(--r-s); padding: 1px .25rem; }
.ws-add { width: 1.875rem; flex: none; position: sticky; right: 0; background: var(--bg); }   /* «+» всегда виден, даже когда вкладки прокручиваются */
.top-spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: .125rem; flex: none; }   /* кнопки справа не сжимаются — сжимается и прокручивается полоса вкладок */
@media (max-width: 1180px) { .top-actions .lbl.hide-narrow { display: none; } }

.ibtn { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-width: 1.75rem; height: 1.75rem; padding: 0 .375rem; border: 0; border-radius: var(--r-s); background: none; color: var(--muted); font-size: var(--fs-s); white-space: nowrap; }
.ibtn:hover { background: var(--hover); color: var(--text); }
.ibtn[aria-pressed=true], .ibtn.on { color: var(--accent); }
.ibtn.warn { color: var(--warn); }
.ibtn:disabled { opacity: .4; cursor: default; }
.ibtn .lbl { font-size: var(--fs-s); }
.sep { width: 1px; height: 1.125rem; background: var(--line); margin: 0 .1875rem; flex: none; }

/* ─── инструменты рисования ─────────────────────────────── */
.tools { display: flex; flex-direction: column; align-items: center; gap: .125rem; padding: .375rem 0; border-right: 1px solid var(--line); overflow-y: auto; scrollbar-width: none; }
.tools .ibtn { width: 2rem; height: 2rem; }
.tools .ibtn.on { background: var(--accent-soft); color: var(--accent); }
.tools .sep { width: 1.125rem; height: 1px; margin: .25rem 0; }

/* ─── вотчлист ──────────────────────────────────────────── */
.watch { display: flex; flex-direction: column; min-width: 0; min-height: 0; container-type: inline-size; }
.watch-head { display: flex; align-items: center; gap: .25rem; height: var(--head-h); padding: 0 .25rem 0 .75rem; border-bottom: 1px solid var(--line); flex: none; }
.watch-head .mob-only { display: none; }
.app.mobile .watch-head .mob-only { display: inline-flex; }
.watch-head h2 { font-size: var(--fs-m); font-weight: 500; margin: 0; flex: 1; }
.watch-cols { display: grid; grid-template-columns: minmax(4rem, 1fr) 5.5rem 4rem; gap: .25rem; padding: .1875rem .5rem .1875rem 1.25rem; font-size: var(--fs-xs); color: var(--dim); border-bottom: 1px solid var(--line-soft); flex: none; }
.watch-cols span:not(:first-child) { text-align: right; }
.watch-cols span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 1.5rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.cat { border-bottom: 1px solid var(--line-soft); }
.cat-head { display: flex; align-items: center; gap: .375rem; height: 1.75rem; padding: 0 .25rem 0 .375rem; color: var(--muted); font-size: var(--fs-s); font-weight: 500; user-select: none; cursor: default; }
.cat-head:hover { color: var(--text); }
.cat-caret { width: 1rem; height: 1rem; border: 0; padding: 0; background: none; color: inherit; display: grid; place-items: center; }
.cat-caret svg { width: .6875rem; height: .6875rem; transition: transform .12s; }
.cat.collapsed .cat-caret svg { transform: rotate(-90deg); }
.cat-dot { width: .5rem; height: .5rem; border-radius: 2px; flex: none; }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-name input { width: 100%; background: var(--raise); border: 1px solid var(--accent); border-radius: var(--r-s); padding: 0 .25rem; color: var(--text); }
.cat-count { color: var(--dim); font-size: var(--fs-xs); }
.cat.collapsed .cat-body { display: none; }
.cat.drop-into > .cat-head { background: var(--accent-soft); }
.row { display: grid; grid-template-columns: minmax(4rem, 1fr) 5.5rem 4rem; gap: .25rem; align-items: center; height: 1.875rem; padding: 0 .5rem 0 1.25rem; cursor: pointer; position: relative; border-left: 2px solid transparent; }
.row:hover { background: var(--hover); }
.row.active { border-left-color: var(--accent); background: var(--line-soft); }
.row.err .r-name { color: var(--err); }
.r-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-val, .r-chg { text-align: right; font-size: var(--fs-s); white-space: nowrap; overflow: hidden; }
.r-chg.up { color: var(--up); }
.r-chg.down { color: var(--down); }
.row.stale .r-val { color: var(--warn); }
.row.drop-before::before, .row.drop-after::after { content: ''; position: absolute; left: 1.125rem; right: .375rem; height: 2px; background: var(--accent); }
.row.drop-before::before { top: -1px; }
.row.drop-after::after { bottom: -1px; }
.row.dragging { opacity: .4; }
.watch-empty { padding: 1rem .75rem; color: var(--muted); font-size: var(--fs-s); }
@container (max-width: 13rem) {
  .row, .watch-cols { grid-template-columns: minmax(3.5rem, 1fr) 5.5rem !important; }
  .r-chg, .watch-cols span:nth-child(3) { display: none; }
}
.gutter { position: relative; cursor: col-resize; background: transparent; touch-action: none; }
.gutter::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); background: var(--line); transition: background-color .12s, width .12s; }
.gutter:hover::before, .gutter:focus-visible::before, .gutter.drag::before { width: 3px; background: var(--accent); }
.gutter:focus-visible { outline: none; }

/* ─── сетка панелей ─────────────────────────────────────── */
.grid-wrap { position: relative; min-width: 0; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; outline: none; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.grid-stack > .grid-stack-item > .ui-resizable-handle { background: none !important; transform: none !important; }
.grid-stack > .grid-stack-item > .ui-resizable-e { right: 0; width: 5px; top: .75rem; bottom: .75rem; }
.grid-stack > .grid-stack-item > .ui-resizable-w { left: 0; width: 5px; top: .75rem; bottom: .75rem; }
.grid-stack > .grid-stack-item > .ui-resizable-s { bottom: 0; height: 5px; left: .75rem; right: .75rem; }
.grid-stack > .grid-stack-item > .ui-resizable-se { right: 0; bottom: 0; width: 6px; height: 6px; }
.grid-stack > .grid-stack-item > .ui-resizable-sw { left: 0; bottom: 0; width: 6px; height: 6px; }
/* при наведении — тонкая оранжевая линия в зазоре: видно, что край можно тянуть */
.grid-stack > .grid-stack-item > .ui-resizable-e::after, .grid-stack > .grid-stack-item > .ui-resizable-w::after { content: ''; position: absolute; top: 0; bottom: 0; left: 1px; width: 2px; border-radius: 1px; }
.grid-stack > .grid-stack-item > .ui-resizable-s::after { content: ''; position: absolute; left: 0; right: 0; top: 1px; height: 2px; border-radius: 1px; }
.grid-stack > .grid-stack-item > .ui-resizable-handle:hover::after { background: var(--accent); }
.grid-stack { background: transparent; }
.grid-stack > .grid-stack-item > .grid-stack-item-content { inset: 3px; overflow: hidden; }
.grid-stack-placeholder > .placeholder-content { background: var(--accent-soft) !important; border: 1px dashed var(--accent); border-radius: var(--r-s); inset: 2px !important; }
.grid-stack > .grid-stack-item.locked > .ui-resizable-handle { display: none !important; }
.boot-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; }
.app:not([data-state=boot]) .boot-msg { display: none; }

.panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-s); container-type: inline-size; }
.panel.active { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: inset 0 2px 0 var(--accent); }
.grid-stack > .grid-stack-item > .grid-stack-item-content.panel.maxed { position: fixed; z-index: 40; inset: calc(var(--top-h) + env(safe-area-inset-top) + 1px) env(safe-area-inset-right) calc(var(--status-h) + var(--mnav-h) + env(safe-area-inset-bottom) + 1px) calc(var(--tools-w) + var(--watch-w) + var(--gutter-w)); }
.app.watch-hidden .grid-stack > .grid-stack-item > .grid-stack-item-content.panel.maxed { left: var(--tools-w); }
.app.popout .grid-stack > .grid-stack-item > .grid-stack-item-content.panel { position: fixed; inset: calc(var(--top-h) + 1px) 0 calc(var(--status-h) + 1px) 0; }
.pn-head { display: flex; align-items: center; height: var(--head-h); flex: none; border-bottom: 1px solid var(--line); cursor: grab; user-select: none; gap: .125rem; padding-right: .125rem; }
.panel.locked .pn-head { cursor: default; }
.pn-head:active { cursor: grabbing; }
.pn-tabs { display: flex; align-items: stretch; height: 100%; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.pn-tab { display: flex; align-items: center; gap: .25rem; padding: 0 .375rem 0 .625rem; border: 0; background: none; color: var(--muted); white-space: nowrap; font-size: var(--fs-s); position: relative; max-width: 14rem; min-width: 0; flex: 0 1 auto; overflow: hidden; cursor: pointer; }
.pn-tab .t-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pn-tab .t-x { flex: none; }
.pn-tab .t-x { width: 1.125rem; height: 1.125rem; display: grid; place-items: center; border-radius: 2px; opacity: 0; color: var(--dim); border: 0; background: none; padding: 0; }
.pn-tab .t-x:focus-visible { opacity: 1; }
.pn-tab .t-x svg { width: .75rem; height: .75rem; }
.pn-tab:hover .t-x, .pn-tab[aria-selected=true] .t-x { opacity: 1; }
.pn-tab .t-x:hover { background: var(--hover); color: var(--text); }
.pn-tab:hover { color: var(--text); }
.pn-tab[aria-selected=true] { color: var(--text); }
.pn-tab[aria-selected=true]::after { content: ''; position: absolute; left: .375rem; right: .375rem; bottom: 0; height: 2px; background: var(--text); }
.panel.active .pn-tab[aria-selected=true]::after { background: var(--accent); }
.pn-tools { display: flex; align-items: center; gap: 1px; flex: none; }
.pn-tools .ibtn { height: 1.625rem; min-width: 1.625rem; padding: 0 .25rem; }
.pn-tools .more { display: none; }
@container (max-width: 540px) { .pn-tools .more { display: inline-flex; } }
.app.mobile .pn-tools .more { display: inline-flex; }
.top-actions .mob { display: none; }
.app.mobile .top-actions .mob { display: inline-flex; }
.set-group > .set:first-child { border-top: 1px solid var(--line-soft); }
.lg-last.up { color: var(--up); }
.lg-last.down { color: var(--down); }
.tf-fav { display: flex; align-items: center; }
.tf-btn { font-size: var(--fs-s); padding: 0 .3125rem; }
.tf-btn[aria-pressed=true] { color: var(--accent); }
@container (max-width: 720px) { .tf-fav { display: none; } }
@container (max-width: 540px) { .pn-tools .opt { display: none; } }
@container (max-width: 380px) { .pn-tools .opt2 { display: none; } .pn-tab { max-width: 9rem; } }
.pn-body { position: relative; flex: 1; min-height: 0; container: pnbody / size; }
.panel.min .pn-body { display: none; }
.pn-pop { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: .5rem; color: var(--muted); }

/* ─── график ────────────────────────────────────────────── */
.cv { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) var(--foot-h); overflow: hidden; }
.cv[hidden] { display: none; }
.cv-chart { position: relative; min-width: 0; min-height: 0; overflow: hidden; container: cvchart / size; touch-action: pan-y; }   /* щипок и свайп вбок — графику, вверх-вниз — прокрутка окон */
.cv-foot { display: flex; align-items: center; gap: 1px; padding: 0 .25rem; border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--muted); min-width: 0; overflow: hidden; }
.cv-foot .ibtn { height: 1.25rem; min-width: 0; padding: 0 .3125rem; font-size: var(--fs-xs); }
.cv-foot .grow { flex: 1; }
/* маленькая панель: прячем подвал с диапазонами — графику нужнее место */
@container pnbody (max-height: 260px) { .cv { grid-template-rows: minmax(0, 1fr) 0; } .cv-foot { display: none; } }
@container pnbody (max-width: 420px) { .cv-foot .opt { display: none; } }

.legend { position: absolute; left: calc(var(--axis-lw, 0px) + .5rem); top: .375rem; z-index: 3; pointer-events: none; font-size: var(--fs-s); line-height: 1.45; max-width: calc(100% - var(--axis-rw, 4.5rem) - var(--axis-lw, 0px) - var(--side-w, 0px) - 1.25rem); overflow-wrap: anywhere; text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg); }
.lg-top { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.lg-name { min-width: 0; font: 500 var(--fs-m)/1.3 var(--font); color: var(--text); pointer-events: auto; cursor: pointer; background: none; border: 0; padding: 0; text-shadow: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-name:hover { color: var(--accent); }
.lg-fold { pointer-events: auto; width: 1.125rem; height: 1.125rem; display: inline-grid; place-items: center; border: 0; border-radius: var(--r-s); background: color-mix(in srgb, var(--raise) 70%, transparent); color: var(--muted); padding: 0; }
.lg-fold:hover { color: var(--text); }
.lg-fold svg { width: .75rem; height: .75rem; transition: transform .12s; }
.legend.min .lg-fold svg { transform: rotate(-90deg); }
.legend.min .lg-ohlc, .legend.min .lg-legs, .legend.min .lg-ind { display: none; }
.lg-last { display: none; font-weight: 500; }
.legend.min .lg-last { display: inline; }
.lg-indb { font: inherit; background: none; border: 0; padding: 0; pointer-events: auto; cursor: pointer; text-shadow: inherit; }
.lg-indb:hover { text-decoration: underline; }
.lg-meta { color: var(--muted); }
.lg-ohlc { display: flex; gap: .5rem; flex-wrap: wrap; }
.lg-ohlc b { font-weight: 400; color: var(--muted); margin-right: 2px; }
.lg-ohlc .up { color: var(--up); }
.lg-ohlc .down { color: var(--down); }
.lg-legs { display: flex; gap: .625rem; flex-wrap: wrap; color: var(--muted); font-size: var(--fs-xs); }
.lg-leg.stale { color: var(--warn); }
.lg-leg.stale::before { content: '⏸ '; }
.lg-leg b { color: var(--text); font-weight: 400; }
.lg-err { color: var(--err); pointer-events: auto; max-width: 26rem; }
.lg-ind { color: var(--muted); font-size: var(--fs-xs); display: flex; gap: .625rem; flex-wrap: wrap; }
/* сжатый график: легенда ужимается, чтобы не закрывать свечи */
@container cvchart (max-height: 320px) { .lg-legs, .lg-ind { display: none; } }
@container cvchart (max-height: 220px) { .lg-ohlc > span:nth-child(-n+3) { display: none; } .lg-meta { display: none; } }
@container cvchart (max-height: 150px) { .lg-ohlc { display: none; } .lg-last { display: inline; } }
@container cvchart (max-width: 460px) { .lg-ohlc > span:nth-child(-n+3), .lg-meta { display: none; } }
.cv-msg { position: absolute; inset: 0; display: grid; place-items: center; z-index: 4; pointer-events: none; color: var(--muted); padding: 1.5rem; text-align: center; }
.cv-msg .box { pointer-events: auto; max-width: 28rem; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-l); padding: .875rem 1rem; color: var(--text); }
.cv-msg .box p { margin: 0 0 .5rem; color: var(--muted); }
.cv-msg .box h3 { margin: 0 0 .375rem; font-size: var(--fs-l); font-weight: 500; }
.cv-loading { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); color: var(--muted); z-index: 4; pointer-events: none; font-size: var(--fs-s); }
.tf-typer { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 6; background: var(--raise); border: 1px solid var(--accent); border-radius: var(--r-l); padding: .5rem .875rem; min-width: 7.5rem; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.tf-typer b { font-size: 1.375rem; font-weight: 500; display: block; }
.tf-typer small { color: var(--muted); }
/* компактно, как таблица Pine в TradingView: мелкий шрифт, плотные строки, фон полупрозрачный — свечи видны сквозь неё */
.fair-table { position: absolute; right: calc(var(--axis-rw, 4.5rem) + .375rem); top: .375rem; z-index: 3; border-collapse: separate; border-spacing: 0; font-size: .625rem; line-height: 1.2; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--line-soft); border-radius: var(--r-s); pointer-events: auto; cursor: pointer; user-select: none; }
.fair-table td { padding: 0 .3125rem; white-space: nowrap; }
.fair-table tr + tr td { border-top: 1px solid rgba(128,128,128,.14); }
.fair-table td:first-child { color: var(--muted); }
.fair-table td:last-child { text-align: right; color: var(--text); }
/* свёрнуто (по умолчанию): одна строка «Fair 970.41 │ % год. +0.08» */
.fair-table.min { display: block; }
.fair-table.min tbody { display: flex; align-items: baseline; }
.fair-table.min tr.opt { display: none; }
.fair-table.min tr:not(.opt) { display: flex; }
.fair-table.min tr:not(.opt) td { border-top: 0; padding: .0625rem .25rem; }
.fair-table.min tr:last-child { border-left: 1px solid rgba(128,128,128,.25); }
@container cvchart (max-height: 300px) { .fair-table tr:nth-child(-n+3) { display: none; } }
@container cvchart (max-width: 520px), cvchart (max-height: 190px) { .fair-table { display: none; } }
.fair-hint { position: absolute; right: calc(var(--axis-rw, 4.5rem) + .5rem); top: .5rem; max-width: calc(100% - var(--axis-rw, 4.5rem) - 1rem); z-index: 3; background: var(--raise); border: 1px solid var(--fair); color: var(--text); border-radius: var(--r-s); padding: .375rem .625rem; font-size: var(--fs-s); pointer-events: auto; }
.fair-hint button { margin-left: .5rem; }
@container cvchart (max-width: 520px) { .fair-hint { display: none; } }
.sel-bar { position: absolute; z-index: 7; display: flex; align-items: center; gap: .125rem; padding: .125rem; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-m); box-shadow: 0 6px 24px rgba(0,0,0,.5); }
.sel-bar input[type=color] { width: 1.5rem; height: 1.5rem; border: 0; padding: 0; background: none; }
.sel-bar select { width: auto; min-height: 1.5rem; padding: 0 .25rem; }

/* ─── состояние связи (в быстром баре) ─────────────────── */
.dot { width: .4375rem; height: .4375rem; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.err { background: var(--err); animation: blink 1s steps(2) infinite; }
.dot.demo { background: var(--accent); }
@keyframes blink { 50% { opacity: .25; } }
.st-btn { gap: .375rem; }
.st-btn .lbl { color: var(--muted); }
.st-btn.warn .lbl { color: var(--warn); }
.menu .st-leg { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: var(--fs-s); cursor: default; }
.menu .st-leg b { color: var(--text); font-weight: 400; }
.menu .st-leg.stale { color: var(--warn); }

/* ─── нижняя навигация (телефон) ─────────────────────────── */
.mnav { display: none; }

/* ─── слой: меню, диалоги, подсказки ────────────────────── */
.layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.layer > * { pointer-events: auto; }
.menu { position: fixed; min-width: 12rem; max-width: 21rem; max-height: 72vh; overflow-y: auto; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-l); padding: .25rem; box-shadow: 0 10px 34px rgba(0,0,0,.6); font-size: var(--fs-m); overscroll-behavior: contain; }
.menu button, .menu .mi { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .375rem .625rem; border: 0; border-radius: var(--r-m); background: none; color: var(--text); text-align: left; white-space: nowrap; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button.on { color: var(--accent); }
.menu button .kbd { margin-left: auto; color: var(--dim); font-size: var(--fs-xs); padding-left: 1rem; }
.menu button.danger { color: var(--down); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: .25rem .375rem; }
.menu .mh { padding: .375rem .625rem .125rem; color: var(--dim); font-size: var(--fs-xs); }
.menu .star { margin-left: auto; color: var(--dim); }
.menu .star.on { color: var(--accent); }

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 1rem; overscroll-behavior: contain; animation: fade-in .12s ease-out; }
@keyframes fade-in { from { opacity: 0; } }
.dlg { width: min(36rem, 100%); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: 0 24px 70px rgba(0,0,0,.7); overflow: hidden; }
.dlg.wide { width: min(46rem, 100%); }
.dlg-head { display: flex; align-items: center; gap: .5rem; padding: .875rem .75rem .875rem 1.25rem; border-bottom: 1px solid var(--line); flex: none; }
.dlg-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-head .sub { color: var(--muted); font-size: var(--fs-s); font-weight: 400; margin-left: .5rem; }
.dlg-tabs { display: flex; gap: .125rem; padding: 0 .75rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; flex: none; }
.dlg-tabs button { border: 0; background: none; color: var(--muted); padding: .5rem .75rem; position: relative; white-space: nowrap; }
.dlg-tabs button[aria-selected=true] { color: var(--text); }
.dlg-tabs button[aria-selected=true]::after { content: ''; position: absolute; left: .375rem; right: .375rem; bottom: -1px; height: 2px; background: var(--accent); }
.dlg-body { padding: 1rem 1.25rem; overflow-y: auto; display: grid; gap: .75rem; align-content: start; overscroll-behavior: contain; min-height: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .75rem 1.25rem; border-top: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.dlg-foot .left { margin-right: auto; }

/* диалог-«лист» с навигацией слева: общие настройки, настройки графика */
.dlg.sheet { width: min(62rem, 100%); height: min(46rem, calc(100dvh - 2rem)); }
.sheet-body { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); flex: 1; min-height: 0; }
.sheet-nav { display: flex; flex-direction: column; gap: .125rem; padding: .75rem .5rem; border-right: 1px solid var(--line); overflow-y: auto; background: color-mix(in srgb, var(--raise) 70%, var(--bg)); }
.sheet-nav button { display: flex; align-items: center; gap: .625rem; padding: .5rem .75rem; border: 0; border-radius: var(--r-m); background: none; color: var(--muted); text-align: left; white-space: nowrap; }
.sheet-nav button:hover { background: var(--hover); color: var(--text); }
.sheet-nav button[aria-selected=true] { background: var(--accent-soft); color: var(--text); }
.sheet-nav button[aria-selected=true] svg { color: var(--accent); }
.sheet-main { overflow-y: auto; padding: 1.25rem 1.5rem 2rem; display: grid; gap: 1.5rem; align-content: start; overscroll-behavior: contain; }

/* секции и строки настроек */
.sec { display: grid; gap: .5rem; }
.sec-title { margin: 0; font-size: var(--fs-l); font-weight: 500; }
.sec-desc { margin: -.25rem 0 .125rem; color: var(--muted); font-size: var(--fs-s); max-width: 44rem; }
.group { background: var(--well); border: 1px solid var(--line); border-radius: var(--r-l); }
.set { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .5rem 1.25rem; padding: .75rem 1rem; border-top: 1px solid var(--line-soft); min-height: 3.25rem; }
.set:first-child { border-top: 0; }
.set.col { grid-template-columns: minmax(0, 1fr); }
.set-text { display: grid; gap: .125rem; min-width: 0; }
.set-label { font-weight: 500; }
.set-desc { color: var(--muted); font-size: var(--fs-s); }
.set-ctl { display: flex; align-items: center; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.set.col .set-ctl { justify-content: flex-start; }
.set-ctl input[type=text], .set-ctl input[type=number], .set-ctl input[type=password], .set-ctl select, .set-ctl input[type=date], .set-ctl input[type=datetime-local] { width: auto; min-width: 7rem; }
.set.col .set-ctl input[type=text], .set.col .set-ctl input[type=password], .set.col .set-ctl textarea, .set.col .set-ctl select { width: 100%; }
.set-ctl .w-s { width: 5.5rem !important; min-width: 0 !important; }
.set-ctl .w-m { width: 9rem !important; }
.set-ctl .w-l { width: 16rem !important; }
.unit { display: inline-flex; align-items: center; }
.unit input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.unit span { display: inline-flex; align-items: center; height: var(--ctl-h); padding: 0 .5rem; border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r-s) var(--r-s) 0; color: var(--muted); font-size: var(--fs-s); background: var(--raise); }
.set-sub { display: grid; gap: .5rem; padding: 0 1rem .75rem 1rem; }

/* переключатель */
.switch { position: relative; width: 2.375rem; height: 1.375rem; flex: none; border: 0; border-radius: 1rem; background: var(--line); padding: 0; transition: background-color .15s; }
.switch::after { content: ''; position: absolute; left: .1875rem; top: .1875rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--muted); transition: transform .15s, background-color .15s; }
.switch[aria-checked=true] { background: var(--accent); }
.switch[aria-checked=true]::after { transform: translateX(1rem); background: var(--accent-ink); }
.switch:disabled { opacity: .45; cursor: default; }
/* сегментный выбор */
.seg { display: inline-flex; padding: .125rem; gap: .125rem; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); flex-wrap: wrap; }
.seg button { border: 0; border-radius: .25rem; background: none; color: var(--muted); padding: .3125rem .625rem; white-space: nowrap; font-size: var(--fs-s); min-height: 1.625rem; }
.seg button:hover { color: var(--text); }
.seg button[aria-checked=true] { background: var(--accent-soft); color: var(--accent); }
/* цвет */
.cpick { position: relative; width: 2rem; height: 2rem; border-radius: var(--r-m); border: 1px solid var(--line); overflow: hidden; flex: none; }
.cpick input { position: absolute; inset: -.5rem; width: 3rem; height: 3rem; border: 0; padding: 0; cursor: pointer; opacity: 0; }
.cpick i { position: absolute; inset: 0; }
.cpick:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); }
.cgrid .set { border-top: 0; border-bottom: 1px solid var(--line-soft); min-height: 2.875rem; padding: .5rem 1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.chip { display: inline-flex; align-items: center; gap: .375rem; padding: .3125rem .625rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--bg); color: var(--text); font-size: var(--fs-s); }
.chip[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip .x { color: var(--dim); border: 0; background: none; padding: 0; display: grid; place-items: center; }
.chip .x:hover { color: var(--down); }
.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .625rem; padding: .75rem 1rem; }
.theme-card { display: grid; gap: .5rem; padding: .625rem; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg); text-align: left; color: var(--text); }
.theme-card[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-prev { height: 3.5rem; border-radius: var(--r-m); display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 3px; padding: .375rem; align-items: end; }
.theme-prev i { display: block; border-radius: 1px; }

/* поля и кнопки */
.field { display: grid; gap: .25rem; }
.field > span, .fl { color: var(--muted); font-size: var(--fs-s); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .75rem; }
.inline { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hint { color: var(--muted); font-size: var(--fs-s); margin: 0; }
.hint.err { color: var(--err); }
.hint.ok { color: var(--ok); }
input[type=text], input[type=number], input[type=url], input[type=password], input[type=search], input[type=datetime-local], input[type=date], select, textarea {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: .3125rem .5rem; min-height: var(--ctl-h); width: 100%; color: var(--text); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input.bad, textarea.bad { border-color: var(--err); }
textarea { resize: vertical; min-height: 3.5rem; }
.formula { font-size: var(--fs-l); letter-spacing: .01em; }
input[type=checkbox] { accent-color: var(--accent); width: 1rem; height: 1rem; margin: 0; }
input[type=color] { width: 2rem; height: 1.75rem; padding: 0 2px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); cursor: pointer; }
input[type=range] { accent-color: var(--accent); }
.chk { display: inline-flex; align-items: center; gap: .4375rem; cursor: pointer; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .375rem; min-height: var(--ctl-h); padding: 0 .875rem; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--hover); color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.btn-accent:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { color: var(--down); }
.btn-ghost { background: none; }
.btn-s { min-height: 1.625rem; padding: 0 .625rem; font-size: var(--fs-s); }
.btn:disabled { opacity: .5; cursor: default; }
.legs-tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.legs-tbl td, .legs-tbl th { padding: .375rem .5rem; border-bottom: 1px solid var(--line-soft); text-align: left; }
.legs-tbl tr:last-child td { border-bottom: 0; }
.legs-tbl th { color: var(--dim); font-weight: 400; }
.legs-tbl .arrow { color: var(--dim); }
.list { display: grid; gap: 1px; }
.list > .li { content-visibility: auto; contain-intrinsic-size: auto 2.75rem; }
.li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .625rem; align-items: center; padding: .5rem .75rem; border-radius: var(--r-m); background: var(--bg); }
.group > .li { background: none; border-radius: 0; border-top: 1px solid var(--line-soft); }
.group > .li:first-child { border-top: 0; }
.li.off { opacity: .55; }
.li .li-main { min-width: 0; }
.li .li-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .li-sub { color: var(--muted); font-size: var(--fs-s); }
.li-actions { display: flex; gap: .125rem; align-items: center; }
.swatches { display: flex; gap: .25rem; flex-wrap: wrap; }
.sw { width: 1.25rem; height: 1.25rem; border-radius: var(--r-s); border: 1px solid var(--line); padding: 0; }
.sw.on { outline: 2px solid var(--text); outline-offset: 1px; }
.kbd-list { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; font-size: var(--fs-s); padding: .75rem 1rem; }
.kbd-list kbd { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-s); padding: 0 .375rem; }
.empty { padding: 1rem; color: var(--muted); font-size: var(--fs-s); }

.toasts { position: fixed; right: .75rem; top: calc(var(--top-h) + .625rem); z-index: 120; display: grid; gap: .5rem; width: min(23rem, calc(100vw - 1.5rem)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--raise); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-l); padding: .625rem .75rem; box-shadow: 0 12px 34px rgba(0,0,0,.6); display: grid; grid-template-columns: 1fr auto; gap: .125rem .5rem; animation: toast-in .16s ease-out; }
.toast.alert { border-left-color: var(--alert); }
.toast.err { border-left-color: var(--err); }
.toast.ok { border-left-color: var(--ok); }
.toast b { font-weight: 500; }
.toast p { margin: 0; color: var(--muted); font-size: var(--fs-s); grid-column: 1; white-space: pre-line; }
.toast .ibtn { grid-row: 1 / span 2; grid-column: 2; align-self: start; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: 0; } }
.drawer { position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top) + 1px); right: 0; bottom: calc(var(--status-h) + var(--mnav-h) + env(safe-area-inset-bottom) + 1px); width: min(26rem, 100vw); background: var(--raise); border-left: 1px solid var(--line); display: flex; flex-direction: column; z-index: 90; box-shadow: -12px 0 40px rgba(0,0,0,.5); }
.tip { position: fixed; z-index: 130; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-s); padding: .1875rem .4375rem; font-size: var(--fs-xs); color: var(--text); pointer-events: none; white-space: nowrap; }

/* ─── вход и регистрация ────────────────────────────────── */
.login { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.25rem; overflow-y: auto;
  background: radial-gradient(900px 520px at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
              radial-gradient(700px 420px at 100% 110%, rgba(42,171,238,.10), transparent 60%), var(--bg); }
.login-card { width: min(25rem, 100%); display: grid; gap: 1.25rem; padding: 2rem 1.75rem 1.75rem; border-radius: 1.25rem;
  background: color-mix(in srgb, var(--raise) 82%, transparent); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.04); backdrop-filter: blur(14px); }
.login-mark { display: flex; align-items: center; gap: .625rem; font-size: 1.125rem; font-weight: 600; letter-spacing: .01em; }
.login-mark svg { width: 1.75rem; height: 1.75rem; padding: .3125rem; border-radius: .5rem; background: var(--accent-soft); }
.login-view { display: grid; gap: .875rem; }
.login-title { margin: 0; font-size: 1.625rem; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.login-lead { margin: -.25rem 0 .25rem; color: var(--muted); font-size: var(--fs-l); line-height: 1.45; text-wrap: pretty; }
.btn-xl { min-height: 3rem; border-radius: .75rem; font-size: var(--fs-l); font-weight: 500; gap: .625rem; }
.btn-tg { background: #2aabee; border-color: #2aabee; color: #fff; text-decoration: none; box-shadow: 0 8px 24px rgba(42,171,238,.25); }
.btn-tg:hover { filter: brightness(1.07); border-color: #2aabee; }
.btn-tg[aria-disabled=true] { opacity: .5; pointer-events: none; box-shadow: none; }
.tg-ico { width: 1.375rem; height: 1.375rem; fill: currentColor; flex: none; }
.login-alt { margin: 0; text-align: center; color: var(--muted); font-size: var(--fs-s); }
.login-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: var(--fs-s); text-decoration: none; cursor: pointer; }
.login-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.login-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.login-or { display: flex; align-items: center; gap: .75rem; color: var(--dim); font-size: var(--fs-xs); }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.login-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: .625rem; }
.login-steps li { counter-increment: s; display: grid; grid-template-columns: 1.75rem 1fr; align-items: center; gap: .625rem; color: var(--text); }
.login-steps li::before { content: counter(s); display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: var(--fs-s); }
.login-spin { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 3px solid var(--line); border-top-color: #2aabee; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-err { margin: 0; min-height: 1.2em; color: var(--err); font-size: var(--fs-s); text-align: center; }
.login-err:empty { display: none; }
.login-note { margin: 0; color: var(--dim); font-size: var(--fs-xs); text-align: center; }
.login input { min-height: 2.75rem; border-radius: .625rem; }
.app.tg-app .login-card, html.tg-app .login-card { box-shadow: none; }
@media (max-width: 480px) { .login { padding: .75rem; place-items: stretch; } .login-card { align-self: center; padding: 1.5rem 1.25rem; } .login-title { font-size: 1.375rem; } }

/* ─── сенсорные экраны ──────────────────────────────────── */
@media (pointer: coarse) {
  :root { --ctl-h: 2.5rem; }
  .ibtn { min-width: 2.25rem; height: 2.25rem; }
  .menu button, .menu .mi { padding: .625rem .75rem; }
  .row { height: 2.5rem; }
  .cat-head { height: 2.25rem; }
  .seg button { min-height: 2.125rem; }
}

/* ─── телефон: одна колонка, нижняя навигация, листы снизу ─ */
.app.mobile { --top-h: 2.875rem; --mnav-h: 3.5rem; --tools-w: 0px; --head-h: 2.5rem; --foot-h: 2rem; }
.app.mobile .main { grid-template-columns: minmax(0, 1fr); border-bottom: 0; }
.app.mobile .tools, .app.mobile .gutter, .app.mobile .watch { display: none; }
.app.mobile .brand span { display: none; }
.app.mobile .brand { padding: 0 .5rem 0 .75rem; }
.app.mobile .top-actions .desk { display: none; }
.app.mobile.show-watch .watch { display: flex; position: fixed; z-index: 80; left: 0; right: 0; top: calc(var(--top-h) + env(safe-area-inset-top)); bottom: calc(var(--status-h) + var(--mnav-h) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.app.mobile .grid-wrap { scrollbar-gutter: auto; }
.app.mobile .grid-stack { display: flex; flex-direction: column; gap: .5rem; padding: .375rem; height: auto !important; min-height: 0 !important; }
.app.mobile .grid-stack > .grid-stack-item { position: relative !important; top: auto !important; left: auto !important; right: auto !important; width: 100% !important; height: var(--m-panel-h, 60dvh) !important; flex: none; }
.app.mobile .grid-stack > .grid-stack-item > .grid-stack-item-content { inset: 0; }
.app.mobile .grid-stack > .grid-stack-item > .ui-resizable-handle { display: none !important; }
.app.mobile .pn-head { cursor: default; }
.app.mobile .pn-tools .desk { display: none; }
.app.mobile .grid-stack > .grid-stack-item > .grid-stack-item-content.panel.maxed { left: 0; right: 0; }
.app.mobile .mnav { display: flex; align-items: stretch; justify-content: space-around; border-top: 1px solid var(--line); background: var(--surface); }
.mnav button { flex: 1; display: grid; place-items: center; align-content: center; gap: .125rem; border: 0; background: none; color: var(--muted); font-size: var(--fs-xs); position: relative; }
.mnav button svg { width: 1.375rem; height: 1.375rem; }
.mnav button[aria-pressed=true] { color: var(--accent); }
.mnav .badge { position: absolute; top: .375rem; left: calc(50% + .375rem); min-width: 1rem; height: 1rem; padding: 0 .25rem; border-radius: .5rem; background: var(--accent); color: var(--accent-ink); font-size: .625rem; line-height: 1rem; }

@media (max-width: 760px) {
  .scrim { padding: 0; place-items: end stretch; }
  .dlg, .dlg.wide, .dlg.sheet { width: 100%; max-height: 94dvh; border-radius: var(--r-l) var(--r-l) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .18s ease-out; }
  .dlg.sheet { height: 94dvh; }
  .sheet-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sheet-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: .5rem; scrollbar-width: none; }
  .sheet-nav button { flex: none; padding: .4375rem .75rem; }
  /* лента вкладок листается вбок — край затухает, чтобы это было видно */
  .sheet-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent); padding-right: 2rem; }
  .sheet-main { padding: 1rem 1rem 2rem; }
  .set { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .set-ctl { justify-content: flex-start; }
  .set:has(> .set-ctl > .switch:only-child) { grid-template-columns: minmax(0, 1fr) auto; }
  .set:has(> .set-ctl > .switch:only-child) .set-ctl { justify-content: flex-end; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .menu { min-width: min(18rem, calc(100vw - 1rem)); }
  .drawer { width: 100vw; border-left: 0; }
  .toasts { left: .5rem; right: .5rem; width: auto; top: calc(var(--top-h) + env(safe-area-inset-top) + .5rem); }
}
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
.login-err.ok { color: var(--ok); }

/* ─── пустое окно: как обычное, только без графика ─────── */
.pn-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .625rem; padding: 1.5rem; text-align: center; color: var(--muted); }
.pn-empty b { color: var(--text); font-size: var(--fs-l); font-weight: 500; }
.pn-empty > span { max-width: 26rem; font-size: var(--fs-s); line-height: 1.45; }
.pn-empty-ico { width: 3rem; height: 3rem; border-radius: .875rem; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.pn-empty-ico svg { width: 1.5rem; height: 1.5rem; }
.pn-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .25rem; }
.pn-empty-acts .btn svg { width: .9375rem; height: .9375rem; }
@container pnbody (max-height: 200px) { .pn-empty > span, .pn-empty-ico { display: none; } }

/* ─── перетаскивание: связка из списка на окно, обмен окон местами ─ */
.panel.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px; }
.panel.swap-target { outline: 2px solid var(--accent); outline-offset: -3px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
body.dragging-bundle .grid-wrap { background: color-mix(in srgb, var(--accent) 4%, transparent); }

/* ─── поиск инструмента ─────────────────────────────────── */
.dlg.sym-dlg { width: min(40rem, 100%); }
.sym-dlg .dlg-body { gap: .625rem; }
.sym-q { font-size: var(--fs-l); min-height: 2.75rem !important; }
.sym-list { display: grid; gap: 1px; max-height: min(55vh, 28rem); overflow-y: auto; margin: 0 -.5rem; }
.sym-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto auto; align-items: center; gap: .75rem; padding: .5rem .75rem; border: 0; border-radius: var(--r-m); background: none; color: var(--text); text-align: left; }
.sym-row:hover, .sym-row:focus-visible { background: var(--hover); outline: none; }
.sym-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-s); }
.sym-kind { color: var(--accent); font-size: var(--fs-xs); background: var(--accent-soft); border-radius: 1rem; padding: .0625rem .5rem; }
.sym-cc { color: var(--dim); font-size: var(--fs-xs); min-width: 3.25rem; text-align: right; }
@media (max-width: 480px) { .sym-row { grid-template-columns: 5.5rem minmax(0, 1fr) auto; } .sym-cc { display: none; } }

/* ─── редактор связки ───────────────────────────────────── */
.formula-row { flex-wrap: nowrap !important; }
.formula-row .formula { flex: 1; min-width: 0; }
details.adv { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--well); }
details.adv > summary { cursor: pointer; padding: .75rem 1rem; color: var(--muted); font-size: var(--fs-s); list-style: none; }
details.adv > summary::before { content: '▸'; display: inline-block; width: 1rem; transition: transform .12s; }
details.adv[open] > summary::before { transform: rotate(90deg); }
details.adv > .group { border: 0; border-top: 1px solid var(--line-soft); border-radius: 0 0 var(--r-l) var(--r-l); }

/* ─── поиск инструмента как в TradingView ───────────────── */
.sym-qwrap { position: relative; }
.sym-qwrap > svg { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); width: 1.125rem; height: 1.125rem; color: var(--muted); pointer-events: none; }
.sym-qwrap .sym-q { padding-left: 2.5rem; border-radius: var(--r-m); }
.sym-kinds .chip { padding: .3125rem .875rem; }
.sym-build { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .625rem .875rem; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--r-m); background: var(--accent-soft); color: var(--text); text-align: left; }
.sym-build:hover { filter: brightness(1.12); }
.sym-build b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-b-t { color: var(--accent); font-size: var(--fs-s); white-space: nowrap; }
.sym-b-v { color: var(--muted); font-size: var(--fs-s); white-space: nowrap; }
.sym-build.bad { border-color: color-mix(in srgb, var(--err) 50%, var(--line)); background: color-mix(in srgb, var(--err) 8%, transparent); }
.sym-build.bad .sym-b-v { color: var(--err); white-space: normal; }
.lg-name { cursor: pointer; }
.lg-name:hover { text-decoration: underline; text-underline-offset: 3px; }

/* пароль: «глазик» показать/скрыть вводимое, статус пароля в «Аккаунте» */
.pw-wrap { position: relative; display: inline-flex; align-items: center; }
.pw-wrap > input { padding-right: 2.125rem; }
.login .pw-wrap { display: flex; }
.login .pw-wrap > input { width: 100%; }
.pw-eye { position: absolute; right: .25rem; top: 50%; transform: translateY(-50%); width: 1.75rem; height: 1.75rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-s); background: none; color: var(--muted); cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--text); background: var(--hover); outline: none; }
.pw-eye[aria-pressed=true] { color: var(--accent); }
.pw-eye svg { width: 1rem; height: 1rem; }
.pw-state { font-size: var(--fs-s); }
.pw-state.ok { color: var(--up); }
.pw-state.no { color: var(--muted); }
/* «У меня есть аккаунт — войти»: вторая по важности кнопка на первом экране */
.login-second { width: 100%; background: var(--raise); border-color: var(--line); color: var(--text); }
.login-second:hover { background: var(--hover); }

/* Шкалы на телефоне: вертикальное перетаскивание пальцем по ценовой шкале сжимает/растягивает цену (как в TradingView),
   по шкале времени — время. Браузеру эти жесты не отдаём, иначе он прокручивает страницу и шкала «не сжимается».
   Сама область графика по-прежнему прокручивает страницу вертикальным свайпом. */
.cv-chart .tv-lightweight-charts tr > td:first-child,
.cv-chart .tv-lightweight-charts tr > td:last-child,
.cv-chart .tv-lightweight-charts tr:last-child > td { touch-action: none; }

/* Перетаскивание окон, как карточки канбана: окно в руке приподнято и едет за курсором/пальцем,
   под ним — подсветка окна для обмена или пунктир места, куда оно встанет; остальные окна не двигаются. */
.grid-stack > .grid-stack-item.win-lift { z-index: 60; }
.grid-stack > .grid-stack-item.win-lift > .grid-stack-item-content { box-shadow: 0 12px 32px rgba(0,0,0,.5); outline: 1px solid var(--accent); outline-offset: -1px; }
body.win-dragging, body.win-dragging * { cursor: grabbing !important; user-select: none !important; }
body.win-dragging .cv-chart { pointer-events: none; }          /* перекрестие графиков не мельтешит под окном в руке */
.grid-stack.win-anim > .grid-stack-item:not(.win-noanim) { transition: left .2s cubic-bezier(.2,.8,.2,1), top .2s cubic-bezier(.2,.8,.2,1), width .2s cubic-bezier(.2,.8,.2,1), height .2s cubic-bezier(.2,.8,.2,1); }
.win-slot { position: absolute; left: 0; top: 0; z-index: 5; border: 2px dashed var(--accent); border-radius: var(--r-s); background: color-mix(in srgb, var(--accent) 8%, transparent); pointer-events: none; transition: transform .08s linear; }
.app.mobile .pn-head { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.app.mobile .grid-stack > .grid-stack-item.win-lift > .grid-stack-item-content { box-shadow: 0 16px 40px rgba(0,0,0,.6); }
@media (prefers-reduced-motion: reduce) { .grid-stack.win-anim > .grid-stack-item, .win-slot { transition: none !important; } }

/* поиск: разделы «Мои связки» и «Инструменты» */
.sym-head { padding: .5rem .75rem .25rem; font-size: var(--fs-xs); color: var(--dim); letter-spacing: .02em; }
.sym-row.sym-mine .sym-name { color: var(--muted); font-size: var(--fs-s); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-row.sym-mine .sym-kind { color: var(--text); background: var(--raise); }

/* строка «Цвет паритета» в меню графика */
.menu .mi-color { justify-content: space-between; gap: 1rem; cursor: default; }
.menu .mi-color .cpick { width: 1.5rem; height: 1.5rem; }

/* поиск: «+» у строки (собрать связку щелчками) и заголовки категорий в «Моих связках» */
.sym-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .25rem; }
.sym-plus { width: 2rem; height: 2rem; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--r-m); background: none; color: var(--muted); cursor: pointer; margin-right: .25rem; }
.sym-plus:hover, .sym-plus:focus-visible { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); outline: none; }
.sym-plus svg { width: 1rem; height: 1rem; }
.sym-cat { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem .25rem; font-size: var(--fs-s); color: var(--muted); font-weight: 600; }
.sym-cat i { width: .5rem; height: .5rem; border-radius: 2px; flex: none; }
.sym-cat span { margin-left: auto; color: var(--dim); font-weight: 400; font-size: var(--fs-xs); }

/* ─── Виджеты в окнах: ставки, фандинг ─── */
.wg { position: absolute; inset: 0; display: flex; flex-direction: column; min-height: 0; background: var(--surface); container: wg / inline-size; }
.wg[hidden] { display: none; }
.wg-bar { display: flex; align-items: center; flex-wrap: nowrap; gap: .5rem; padding: .375rem .625rem; border-bottom: 1px solid var(--line-soft); flex: none; font-size: var(--fs-s); }
.wg-title { flex: 1 1 auto; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-time { flex: none; margin-left: auto; color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.wg-time.err { color: var(--warn); }
.wg-box { flex: 1; min-height: 0; overflow: auto; outline: none; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-gutter: stable; scrollbar-color: var(--line) transparent; }
.wg-msg { margin: 1.5rem 1rem; color: var(--muted); text-align: center; font-size: var(--fs-s); }
.wg-msg.err { color: var(--down); }
.wg-table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); font-variant-numeric: tabular-nums; }
.wg-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--muted); font-weight: 500; font-size: var(--fs-xs); padding: .375rem .625rem; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none; }
.wg-table td { padding: .3125rem .625rem; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.wg-table .l { text-align: left; }
.wg-table .r { text-align: right; }
.wg-table tbody tr:hover td, .wg-table tbody tr:focus-visible td { background: var(--hover); outline: none; }
.wg-table b { font-weight: 600; }
.wg-table .up, .wg-card .up { color: var(--up); }
.wg-table .down, .wg-card .down { color: var(--down); }
.wg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: .5rem; padding: .625rem; }
.wg-card { display: flex; flex-direction: column; gap: .25rem; padding: .625rem .75rem; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--raise); color: var(--text); font-size: var(--fs-s); min-width: 0; }
.wg-card-h { display: flex; align-items: center; gap: .375rem; min-width: 0; }
.wg-card-h b { font-weight: 600; }
.wg-card-h span:last-child { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-cc { flex: none; padding: 0 .3125rem; border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent); font-size: .625rem; font-weight: 600; letter-spacing: .04em; }
.wg-dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--warn); }
.wg-dot.up { background: var(--up); }
.wg-dot.down { background: var(--down); }
.wg-rate { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: .125rem 0; }
.wg-rate span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-rate b { font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-extra { display: flex; flex-wrap: nowrap; gap: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.wg-extra b { color: var(--text); font-weight: 500; }
.wg-row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.wg-row span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-row b { flex: none; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-row i { font-style: normal; color: var(--dim); font-size: var(--fs-xs); min-width: 5rem; text-align: right; }
.wg-note, .wg-src { color: var(--dim); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-card > .wg-note, .wg-card > .wg-src { margin-top: auto; }      /* подпись прижата к низу — карточки в ряду заканчиваются одинаково */
.wg-src { text-decoration: none; }
.wg-src:hover { color: var(--accent); }
.wg-sec { padding: 0 .625rem .625rem; }
.wg-sec h4 { margin: .25rem 0 .375rem; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.wg-sec .wg-row { padding: .25rem .125rem; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-s); }
.wg-sec .wg-row span { flex: 1; color: var(--text); }
.wg-sec .wg-table { margin: 0 -.625rem; width: calc(100% + 1.25rem); }
.wg-hint { margin: 0 .75rem .5rem; color: var(--dim); font-size: var(--fs-xs); line-height: 1.4; }
.pn-tab-wg .t-name { color: var(--accent); }
/* узкое окно и телефон: плотнее ячейки таблицы */
@container wg (max-width: 30rem) {
  .wg-table th, .wg-table td { padding-left: .3125rem; padding-right: .3125rem; }
  .wg-table th:first-child, .wg-table td:first-child { padding-left: .625rem; }
  .wg-table th:last-child, .wg-table td:last-child { padding-left: 0; padding-right: .5rem; }
}

/* поиск → «Мои связки»: категория сворачивается стрелкой, категорию и связку можно удалить */
.sym-item { grid-template-columns: minmax(0, 1fr) auto auto; }
.sym-cat { padding: .25rem .25rem .125rem .375rem; gap: .25rem; }
.sym-fold { flex: 1; min-width: 0; display: flex; align-items: center; gap: .5rem; padding: .25rem .375rem; border: 0; border-radius: var(--r-m); background: none; color: var(--muted); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.sym-fold:hover, .sym-fold:focus-visible { background: var(--hover); color: var(--text); outline: none; }
.sym-fold svg { width: .875rem; height: .875rem; flex: none; transition: transform .12s; }
.sym-cat.shut .sym-fold svg { transform: rotate(-90deg); }
.sym-fold i { width: .5rem; height: .5rem; border-radius: 2px; flex: none; }
.sym-cat-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sym-cat-c { margin-left: auto; color: var(--dim); font-weight: 400; font-size: var(--fs-xs); }
.sym-del:hover, .sym-del:focus-visible { background: var(--down); border-color: var(--down); color: #fff; }
.sym-cat .sym-del { width: 1.75rem; height: 1.75rem; border-color: transparent; }

/* поиск: компактные «+» и корзина (без рамок, мелкая иконка), название категории — слева */
.sym-plus { width: 1.5rem; height: 1.5rem; border: 0; margin-right: .125rem; border-radius: var(--r-s); color: var(--dim); }
.sym-plus svg { width: .8125rem; height: .8125rem; }
.sym-plus:hover, .sym-plus:focus-visible { color: var(--accent-ink); background: var(--accent); }
.sym-del:hover, .sym-del:focus-visible { background: var(--down); color: #fff; }
.sym-cat .sym-del { width: 1.5rem; height: 1.5rem; margin-right: .125rem; }
.sym-item { gap: 0; }
.sym-cat .sym-cat-n { margin-left: 0; color: inherit; font-weight: 600; font-size: var(--fs-s); }
.sym-cat .sym-cat-c { margin-left: auto; }

/* карточки виджетов перетаскиваются, как окна */
.wg-card { cursor: grab; position: relative; }
.wg-card.wg-lift { z-index: 5; pointer-events: none; box-shadow: 0 10px 28px rgba(0,0,0,.5); outline: 1px solid var(--accent); outline-offset: -1px; will-change: transform; }
.wg-card.wg-target { outline: 2px solid var(--accent); outline-offset: -2px; background: color-mix(in srgb, var(--accent) 8%, var(--raise)); }
.app.mobile .wg-card { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* поиск: «+», счётчик и корзина стоят в одних и тех же колонках у строк и у заголовков категорий */
.sym-item, .sym-cat { display: grid; grid-template-columns: minmax(0, 1fr) 1.75rem 1.75rem; align-items: center; gap: 0; padding: 0 .25rem 0 0; }
.sym-cat { padding-top: .125rem; }
.sym-item > .sym-plus, .sym-cat > .sym-plus, .sym-cat > .sym-del { justify-self: center; margin: 0; width: 1.5rem; height: 1.5rem; }
.sym-cat .sym-cat-c { margin: 0; justify-self: center; color: var(--dim); font-weight: 400; font-size: var(--fs-xs); }
.sym-cat .sym-fold { margin-left: .125rem; }
/* окно поиска не меняет размер, пока подгружается список и проверяется формула — ничего не «прыгает» */
.dlg.sym-dlg { height: min(42rem, calc(100dvh - 2rem)); }
.sym-dlg .dlg-body { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.sym-dlg .dlg-body > * { flex: none; }
.sym-dlg .sym-list { flex: 1; min-height: 0; max-height: none; align-content: start; scrollbar-gutter: stable; }

/* фандинг: «+» — добавить карточку, крестик — убрать */
.wg-add { display: grid; place-content: center; justify-items: center; gap: .25rem; min-height: 6rem; border: 1px dashed var(--line); border-radius: var(--r-m); background: none; color: var(--muted); font-size: var(--fs-s); cursor: pointer; }
.wg-add:hover, .wg-add:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.wg-add svg { width: 1.25rem; height: 1.25rem; }
.wg-x { margin-left: auto; flex: none; width: 1.25rem; height: 1.25rem; display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-s); background: none; color: var(--dim); cursor: pointer; opacity: 0; }
.wg-card:hover .wg-x, .wg-x:focus-visible, .app.mobile .wg-x { opacity: 1; }
.wg-x:hover { background: var(--hover); color: var(--text); }
.wg-x svg { width: .75rem; height: .75rem; }
.wg-plus { width: 1.375rem; height: 1.375rem; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: var(--r-s); background: none; color: var(--dim); cursor: pointer; }
.wg-plus:hover, .wg-plus:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
.wg-plus svg { width: .75rem; height: .75rem; }
.wg-card-h > span:not(.wg-dot):not(.wg-cc) { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* заголовки разделов поиска («Мои связки», «Инструменты») — заметнее */
.sym-head { font-size: var(--fs-s); font-weight: 700; color: var(--text); letter-spacing: 0; padding-top: .625rem; }
