/* workspace.css — «Рабочий стол» (18.10.2026): свои окна на сетке gridstack */
.ws-content { max-width: none; padding-left: 16px; padding-right: 16px; }
.ws-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; text-align: left; margin-bottom: 14px; }
.ws-hero h1 { margin: 0; }
.ws-hcard { border: 1px solid var(--mx-gold-line); background: var(--mx-surface); border-radius: 14px; padding: 12px 18px; display: flex; gap: 22px; font-size: 14px; color: var(--text-secondary); }
.ws-hcard b { display: block; font-family: 'Unbounded', sans-serif; font-size: 20px; color: var(--text-color); }
.ws-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.ws-btn { display: inline-flex; gap: 8px; align-items: center; padding: 10px 15px; border-radius: 10px; font: 600 14px 'Onest', sans-serif; cursor: pointer;
  border: 1px solid var(--mx-gold-line); background: var(--mx-surface); color: var(--text-color); }
.ws-btn:hover { background: var(--mx-gold-wash); }
.ws-btn.main { background: linear-gradient(135deg, #f5d97a, #d4af37); color: #111; border: 0; }
.ws-btn.danger { border-color: rgba(239,68,68,.45); }
.ws-count { font-size: 14px; color: var(--text-secondary); margin-right: auto; }
.ws-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 70px 20px; color: var(--text-secondary); font-size: 15px; }
.ws-empty i { font-size: 40px; color: var(--gold, #d4af37); } .ws-empty b { font-size: 20px; color: var(--text-color); }

/* окно */
.grid-stack { min-height: 200px; }
.grid-stack-item-content.ws-w { --acc: #d4af37; --fs: 15px; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--acc) 45%, transparent); background: rgba(14,14,18,var(--bga, .82)); font-size: var(--fs); }
body.light .grid-stack-item-content.ws-w { background: rgba(255,255,255,var(--bga, .9)); }
.ws-wh { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--mx-line); cursor: move; user-select: none; }
.ws-locked .ws-wh { cursor: default; }
.ws-wh i.ic { color: var(--acc); }
.ws-wh b { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-wh button { background: none; border: 0; color: var(--text-secondary); cursor: pointer; padding: 4px 6px; border-radius: 6px; font-size: 14px; }
.ws-wh button:hover { color: var(--text-color); background: var(--mx-surface-2); }
.ws-wb { flex: 1; min-height: 0; padding: 10px 12px; overflow: auto; position: relative; }
.ws-wb.flush { padding: 0; overflow: hidden; }
.ws-nodata { color: var(--text-secondary); font-size: 14px; padding: 8px 0; }
.ws-big { font-family: 'Unbounded', sans-serif; font-size: calc(var(--fs) * 2); font-weight: 700; line-height: 1.1; }
.ws-sub { color: var(--text-secondary); font-size: calc(var(--fs) * .85); }
.up { color: var(--up, #22c55e); } .dn { color: var(--dn, #ef4444); }
.ws-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--mx-line); }
.ws-row:last-child { border-bottom: 0; } .ws-row img { width: 18px; height: 18px; border-radius: 50%; vertical-align: -4px; margin-right: 6px; }
.ws-bar2 { height: 10px; border-radius: 6px; overflow: hidden; display: flex; margin: 8px 0; background: var(--mx-surface-2); }
.ws-bar2 i { display: block; height: 100%; }
.ws-news a { display: block; color: var(--text-color); text-decoration: none; padding: 7px 0; border-bottom: 1px solid var(--mx-line); line-height: 1.4; }
.ws-news a:hover { color: var(--acc); } .ws-news small { display: block; color: var(--text-secondary); font-size: 12px; }
.ws-note { width: 100%; height: 100%; resize: none; border: 0; outline: 0; background: transparent; color: var(--text-color); font: inherit; }
.ws-tick { display: flex; height: 100%; align-items: center; overflow: hidden; white-space: nowrap; }
.ws-tick-in { display: inline-flex; gap: 26px; animation: wsTick var(--dur, 60s) linear infinite; padding-left: 100%; }
.ws-tick-in span { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; } .ws-tick-in img { width: 18px; height: 18px; border-radius: 50%; }
@keyframes wsTick { to { transform: translateX(-100%); } }
.ws-gauge { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 4px; }
.ws-gauge svg { width: min(100%, 260px); }
.ws-ind svg { width: 100%; height: 60px; display: block; margin-top: 8px; }

/* окна выбора и настроек */
.ws-modal { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ws-modal[hidden] { display: none; }
.ws-dlg { width: min(760px, 100%); max-height: 86vh; overflow: auto; background: #121216; border: 1px solid var(--mx-gold-line); border-radius: 16px; padding: 16px 18px; }
body.light .ws-dlg { background: #fff; }
.ws-dlg-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 18px; }
.ws-dlg-h button { background: none; border: 0; color: var(--text-color); font-size: 20px; cursor: pointer; }
.ws-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ws-cat button { text-align: left; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--mx-line); background: var(--mx-surface); color: var(--text-color); font: 14px 'Onest', sans-serif; }
.ws-cat button:hover { border-color: var(--mx-gold-line); background: var(--mx-gold-wash); }
.ws-cat i { color: var(--gold, #d4af37); font-size: 18px; margin-top: 2px; } .ws-cat b { display: block; font-size: 15px; } .ws-cat small { color: var(--text-secondary); }
.ws-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.ws-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.ws-form input, .ws-form select { padding: 9px 10px; border-radius: 9px; border: 1px solid var(--mx-line-strong); background: var(--mx-surface); color: var(--text-color); font: 15px 'Onest', sans-serif; }
.ws-form input[type=color] { padding: 2px; height: 40px; }
.ws-form .full { grid-column: 1 / -1; }
.ws-form .ws-acts { grid-column: 1 / -1; display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 760px) { .ws-hero { flex-direction: column; align-items: flex-start; } .ws-form { grid-template-columns: 1fr; } }
.ws-empty[hidden] { display: none; }
/* тонкие окна (бегущая строка): шапка прячется и всплывает при наведении поверх содержимого */
.ws-w.slim { position: relative; } .ws-w.slim .ws-wh { position: absolute; inset: 0 0 auto auto; z-index: 2; border: 0; border-radius: 0 0 0 10px; background: rgba(14,14,18,.92); opacity: 0; transition: opacity .15s; }
.ws-w.slim:hover .ws-wh { opacity: 1; } .ws-w.slim .ws-wh b { display: none; }
/* окно на весь экран (кнопка ⤢, выход — Esc) */
.grid-stack-item-content.ws-w.ws-full { position: fixed !important; inset: 12px !important; z-index: 100000; background: #0c0c10; box-shadow: 0 0 0 100vmax rgba(0,0,0,.6); }
body.light .grid-stack-item-content.ws-w.ws-full { background: #fff; }
/* монеты, по которым можно кликнуть — переключают связанные окна */
.ws-w [data-sym] { cursor: pointer; } .ws-w .ws-row[data-sym]:hover { background: var(--mx-gold-wash); }
.ws-has-full .top-bar, .ws-has-full .mrk-hello, .ws-has-full .mrk-btn, .ws-has-full .mrk-panel { display: none !important; }
.ws-wb.flush > .ws-nodata { padding: 12px; }
/* вкладки столов */
.ws-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ws-tab { padding: 8px 14px; border-radius: 10px 10px 4px 4px; border: 1px solid var(--mx-line-strong); background: var(--mx-surface); color: var(--text-secondary); font: 600 14px 'Onest', sans-serif; cursor: pointer; }
.ws-tab small { opacity: .6; margin-left: 4px; } .ws-tab.on { color: var(--text-color); border-color: var(--mx-gold-line); background: var(--mx-gold-wash); }
.ws-tab.add, .ws-tab.del { padding: 8px 11px; } .ws-tab.del:hover { border-color: rgba(239,68,68,.5); color: #ef4444; }
.ws-count { margin-right: 6px; } .ws-sync { font-size: 13px; color: var(--text-secondary); margin-right: auto; }
.ws-cat button[hidden] { display: none; }
/* 21.10: страх и жадность — цифра, «раньше» и полоска 30 дней */
.ws-gauge svg { max-height: 55%; }
.ws-fg-now { display: flex; align-items: baseline; gap: 10px; } .ws-fg-now b { font-size: calc(var(--fs) * 1.05); }
.ws-fg-agos { display: flex; gap: 8px; width: 100%; justify-content: center; }
.ws-fg-ago { flex: 1; max-width: 110px; text-align: center; padding: 5px 4px; border-radius: 9px; background: var(--mx-surface-2); line-height: 1.2; }
.ws-fg-ago span, .ws-fg-ago small { display: block; font-size: 12px; color: var(--text-secondary); } .ws-fg-ago b { font-size: calc(var(--fs) * 1.15); }
.ws-fg-strip { display: flex; align-items: flex-end; gap: 2px; width: 100%; height: 34px; margin-top: 4px; }
.ws-fg-strip i { flex: 1; border-radius: 2px 2px 0 0; min-width: 2px; }
/* 21.10: выпадающие списки в настройках — системный список был белым с белым текстом */
.ws-form select { color-scheme: dark; }
.ws-form select option { background: #17171c; color: #f1f1f4; }
body.light .ws-form select { color-scheme: light; }
body.light .ws-form select option { background: #fff; color: #111; }
/* 21.10: прибор страха и жадности тянется по высоте окна */
.ws-gauge svg { flex: 1 1 auto; min-height: 40px; max-height: none; width: 100%; max-width: 300px; }
/* 21.10: прокрутка окна видна только при наведении, зона растягивания — узкая и только у углов и низа */
.ws-wb { scrollbar-width: none; } .ws-wb::-webkit-scrollbar { width: 0; height: 0; }
.ws-w:hover .ws-wb { scrollbar-width: thin; } .ws-w:hover .ws-wb::-webkit-scrollbar { width: 8px; }
.ws-w .ws-wb::-webkit-scrollbar-thumb { background: rgba(128,128,128,.45); border-radius: 4px; }
.grid-stack-item > .ui-resizable-s { height: 6px; bottom: 0; left: 24px; right: 24px; width: auto; }
.grid-stack-item > .ui-resizable-se, .grid-stack-item > .ui-resizable-sw { width: 16px; height: 16px; }
/* 21.10: котировки */
.ws-qs { font-variant-numeric: tabular-nums; }
.ws-qh { font-size: calc(var(--fs) * .78); text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); padding: 8px 2px 4px; border-bottom: 1px solid var(--mx-line); }
.ws-qh:first-child { padding-top: 0; } .ws-qh small { text-transform: none; letter-spacing: 0; opacity: .7; } .ws-qh .up { font-size: 9px; vertical-align: 2px; }
.ws-q { display: grid; grid-template-columns: 1fr auto 74px; gap: 8px; align-items: center; padding: 5px 4px; border-radius: 6px; transition: background .6s; }
.ws-q span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .ws-q b { font-weight: 600; text-align: right; } .ws-q em { font-style: normal; text-align: right; font-weight: 600; }
.ws-q.ws-q-up { animation: wsQup .9s; } .ws-q.ws-q-dn { animation: wsQdn .9s; }
@keyframes wsQup { from { background: rgba(34,197,94,.28); } to { background: transparent; } }
@keyframes wsQdn { from { background: rgba(239,68,68,.28); } to { background: transparent; } }
/* 21.10: режим «во весь экран» — только окна */
.ws-zen-out { display: none; }
body.ws-zen .top-bar, body.ws-zen .ticker-wrap, body.ws-zen .ws-hero, body.ws-zen .ws-tabs, body.ws-zen .ws-bar, body.ws-zen .page-footer,
body.ws-zen .scroll-progress-bar, body.ws-zen .scroll-percent-badge, body.ws-zen .scroll-top-btn, body.ws-zen .custom-scrollbar-track,
body.ws-zen .mrk-hello, body.ws-zen .mrk-btn, body.ws-zen .mrk-panel { display: none !important; }
body.ws-zen .page-content.ws-content { padding-top: 8px !important; margin-top: 0 !important; }
body.ws-zen .ws-zen-out { display: inline-flex; gap: 8px; align-items: center; position: fixed; top: 10px; right: 14px; z-index: 9500; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--mx-gold-line); background: rgba(14,14,18,.88); color: var(--text-color); font: 600 14px 'Onest', sans-serif; cursor: pointer; opacity: .35; transition: opacity .15s; }
body.ws-zen .ws-zen-out:hover { opacity: 1; }
body.light.ws-zen .ws-zen-out { background: rgba(255,255,255,.92); }
/* 21.10: страх и жадность — размеры от окна (container query) */
.ws-fg { height: 100%; container-type: size; }
.ws-fg-in { height: 100%; display: flex; flex-direction: column; gap: 6px; }
.ws-fg-g { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ws-fg-g svg { flex: 1 1 auto; min-height: 0; width: 100%; }
.ws-fg-now { display: flex; align-items: baseline; gap: .4em; line-height: 1; }
.ws-fg-now span { font: 700 clamp(16px, 15cqmin, 80px) 'Unbounded', sans-serif; }
.ws-fg-now b { font-size: clamp(11px, 5.5cqmin, 26px); }
.ws-fg-side { display: flex; flex-direction: column; gap: 6px; }
.ws-fg-ago { max-width: none; } .ws-fg-ago b { font-size: clamp(12px, 6cqmin, 26px); } .ws-fg-ago span, .ws-fg-ago small { font-size: clamp(10px, 3.6cqmin, 14px); }
.ws-fg-strip { height: clamp(14px, 12cqh, 60px); }
@container (min-aspect-ratio: 8/5) {
  .ws-fg-in { flex-direction: row; align-items: stretch; }
  .ws-fg-g { flex: 1 1 50%; } .ws-fg-side { flex: 1 1 50%; justify-content: center; }
  .ws-fg-strip { height: clamp(14px, 22cqh, 80px); }
}
@container (max-height: 230px) and (max-aspect-ratio: 8/5) { .ws-fg-strip { display: none; } }
@container (max-height: 105px) { .ws-fg-side { display: none; } }
@container (max-height: 170px) and (max-aspect-ratio: 8/5) { .ws-fg-side { display: none; } }
/* 21.10: тепловая карта ликвидаций в окне (liq-heat.js) */
.ws-lh { display: grid; grid-template-columns: minmax(0, 1fr) 64px; gap: 4px; height: 100%; padding: 6px; box-sizing: border-box; }
.ws-lh canvas { display: block; width: 100%; height: 100%; min-height: 0; border-radius: 6px; }
.ws-lh canvas + canvas { height: calc(100% - 22px); background: rgba(255,255,255,.02); }
/* 21.10: окно «График» на движке страницы «График» — цвета движка (на странице «График» их задаёт body.ch-page) */
body {
  --ch-bg: #0f1215; --ch-surface: #151a1f; --ch-surface2: #1a2027; --ch-plate: #1b2128;
  --ch-line: rgba(160, 190, 220, .12); --ch-line2: rgba(160, 190, 220, .24);
  --ch-ink: #5cb8ff; --ch-ink-wash: rgba(92, 184, 255, .09); --ch-ink-line: rgba(92, 184, 255, .4); --ch-on-ink: #06121d;
  --ch-mark: #ff9a4d; --ch-mark-wash: rgba(255, 154, 77, .1); --ch-mark-line: rgba(255, 154, 77, .45);
  --ch-up: #34d399; --ch-dn: #f87171; --ch-mono: 'IBM Plex Mono', ui-monospace, monospace; --ch-cond: 'IBM Plex Sans Condensed', 'Onest', sans-serif;
}
body.light {
  --ch-bg: #f3f1ec; --ch-surface: #fbfaf7; --ch-surface2: #f1eee7; --ch-plate: #ffffff;
  --ch-line: rgba(30, 50, 80, .12); --ch-line2: rgba(30, 50, 80, .24);
  --ch-ink: #1f6fc4; --ch-ink-wash: rgba(31, 111, 196, .08); --ch-ink-line: rgba(31, 111, 196, .4); --ch-on-ink: #fff;
  --ch-mark: #c2570c; --ch-up: #059669; --ch-dn: #dc2626;
}
.ws-ch { display: flex; flex-direction: column; height: 100%; }
.ws-cht { position: relative; display: flex; align-items: center; gap: 2px; padding: 3px 6px; border-bottom: 1px solid var(--mx-line); flex-wrap: wrap; }
.ws-cht > button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.ws-cht > button:hover { color: var(--text-color); background: var(--mx-surface-2); } .ws-cht > button.on { color: var(--ch-ink); background: var(--ch-ink-wash); }
.ws-chsep { width: 1px; height: 18px; background: var(--mx-line); margin: 0 4px; }
.ws-chall { position: absolute; top: 100%; left: 6px; z-index: 40; width: min(560px, calc(100% - 12px)); max-height: 60vh; overflow: auto; padding: 8px; border-radius: 10px; background: var(--ch-plate); border: 1px solid var(--ch-line2); box-shadow: 0 12px 34px rgba(0,0,0,.45); display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.ws-chall[hidden] { display: none; }
.ws-chg small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); margin: 2px 4px 4px; }
.ws-chg button { display: flex; width: 100%; gap: 8px; align-items: center; padding: 5px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--text-color); cursor: pointer; font: 500 13px 'Onest', sans-serif; text-align: left; }
.ws-chg button i { width: 14px; color: var(--text-secondary); } .ws-chg button:hover, .ws-chg button.on { background: var(--ch-ink-wash); color: var(--ch-ink); }
.ws-chp { flex: 1; min-height: 0; position: relative; }
.ws-chp.ch-plot { height: auto; }
.ws-chp .ch-legend { font-size: 11.5px; }
.ws-bg-light .ch-legend, .ws-bg-light .ch-legend .ch-ohlc b { color: #333 !important; text-shadow: none !important; }
.ws-bg-light .ch-legend span, .ws-bg-light .ch-legend .ch-ohlc, .ws-bg-light .ch-legend em { text-shadow: none !important; color: #333 !important; }
.ws-bg-light .ch-autob { background: #fff; border-color: rgba(0,0,0,.1); }
