/* Тёмная тема: включается атрибутом data-theme="dark" на <html>. Переключатель — dark.js */
html[data-theme="dark"] {
  --bg: #0b1220; --card: #121a2b; --panel: #0f1727; --ink: #e6edf7; --muted: #94a3b8;
  --border: #223047; --grid-line: rgba(255,255,255,.06);
  --green: #4ade80; --red: #f87171; --blue: #7aa7ff;
  color-scheme: dark;
}
html[data-theme="dark"] body { background: #0b1220 !important; color: #e6edf7 !important; }
html[data-theme="dark"] { background: #0b1220; }

/* ---- каркас: карточки, панели, шапка, модалки ---- */
html[data-theme="dark"] .card, html[data-theme="dark"] .ac-card, html[data-theme="dark"] .sb-kpi, html[data-theme="dark"] .sb-panel,
html[data-theme="dark"] .kcard, html[data-theme="dark"] .kshelf, html[data-theme="dark"] .kdemo, html[data-theme="dark"] .kart,
html[data-theme="dark"] .an-sec, html[data-theme="dark"] .g-sc-card, html[data-theme="dark"] .modal, html[data-theme="dark"] .modal-card,
html[data-theme="dark"] .modal-backdrop > div, html[data-theme="dark"] .vvai-panel, html[data-theme="dark"] .dropdown, html[data-theme="dark"] .menu,
html[data-theme="dark"] .hdr-portfolio-menu, html[data-theme="dark"] .pf-menu, html[data-theme="dark"] .ac-side, html[data-theme="dark"] .ac-hero,
html[data-theme="dark"] [class*="-card"], html[data-theme="dark"] [class*="panel"] {
  background-color: #121a2b !important; color: #e6edf7; border-color: #223047 !important; box-shadow: 0 1px 2px rgba(0,0,0,.4) !important;
}
html[data-theme="dark"] header, html[data-theme="dark"] .header, html[data-theme="dark"] .hdr, html[data-theme="dark"] .topbar, html[data-theme="dark"] nav.main {
  background: #0f1727 !important; border-color: #223047 !important; box-shadow: none !important;
}
html[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,.6) !important; }
/* кнопки-фильтры и строки-разделители месяцев: нажатое/заголовок должны читаться (замечание читателя) */
html[data-theme="dark"] .in-chip { background: #121a2b; color: #9fb0c8; border-color: #2b3a55; }
html[data-theme="dark"] .in-chip.on { background: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
html[data-theme="dark"] .in-mh, html[data-theme="dark"] .cal-t tr.cal-mo td, html[data-theme="dark"] tr.op-month td { background: #1c2740 !important; color: #e6edf7 !important; }
html[data-theme="dark"] .cal-t tr.cal-mo td .cal-mo-s, html[data-theme="dark"] tr.op-month td .op-month-s { color: #7aa7ff !important; }
html[data-theme="dark"] .in-dd > button { background-color: #121a2b !important; color: #e6edf7 !important; border-color: #2b3a55 !important; }
html[data-theme="dark"] .in-dd-p { background: #121a2b !important; border-color: #2b3a55 !important; } html[data-theme="dark"] .in-dd-p label:hover { background: #1c2740; }
html[data-theme="dark"] hr { border-color: #223047 !important; }

/* ---- текст ---- */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4,
html[data-theme="dark"] .page-title, html[data-theme="dark"] .section-title, html[data-theme="dark"] .sb-panel-title, html[data-theme="dark"] .sb-kpi-value,
html[data-theme="dark"] strong, html[data-theme="dark"] b, html[data-theme="dark"] th, html[data-theme="dark"] td { color: #e6edf7; }
html[data-theme="dark"] .sb-kpi-title, html[data-theme="dark"] .sb-kpi-sub, html[data-theme="dark"] .ac-lab, html[data-theme="dark"] .ac-note,
html[data-theme="dark"] .muted, html[data-theme="dark"] small, html[data-theme="dark"] .hint, html[data-theme="dark"] .ksec-h .s { color: #94a3b8 !important; }
html[data-theme="dark"] a { color: #7aa7ff; }
html[data-theme="dark"] .nav-link, html[data-theme="dark"] .navbar a, html[data-theme="dark"] .header a { color: #cbd5e1; }
html[data-theme="dark"] .nav-dropdown { background: #121a2b !important; border-color: #223047 !important; box-shadow: 0 12px 32px rgba(0,0,0,.5) !important; }
html[data-theme="dark"] .nav-dropdown a:hover, html[data-theme="dark"] .nav-link:hover { background: #1c2740 !important; color: #fff !important; }
html[data-theme="dark"] .logo svg text, html[data-theme="dark"] .logo { color: #e6edf7; }
html[data-theme="dark"] .logo svg [fill="#0b1a33"], html[data-theme="dark"] .logo svg [fill="#0f172a"], html[data-theme="dark"] .logo svg [fill="#111827"] { fill: #e6edf7; }
html[data-theme="dark"] .nav-item.active .nav-link, html[data-theme="dark"] .nav-link.active, html[data-theme="dark"] .nav-link.on { background: #1c2740 !important; color: #fff !important; }
html[data-theme="dark"] .hdr-portfolio, html[data-theme="dark"] #hdrPortfolioBox, html[data-theme="dark"] #hdrPortfolioBox > * { background: #172236 !important; color: #e6edf7 !important; border-color: #2b3a55 !important; }

/* ---- таблицы ---- */
html[data-theme="dark"] table { color: #e6edf7; }
html[data-theme="dark"] td, html[data-theme="dark"] tr, html[data-theme="dark"] tbody { background-color: transparent !important; }
html[data-theme="dark"] th { color: #94a3b8 !important; background: transparent !important; border-color: #223047 !important; }
html[data-theme="dark"] td { border-color: #1b2639 !important; }
html[data-theme="dark"] tr:hover td, html[data-theme="dark"] tbody tr:hover { background: #172236 !important; }
html[data-theme="dark"] thead, html[data-theme="dark"] thead tr { background: transparent !important; }

/* ---- формы и кнопки ---- */
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea, html[data-theme="dark"] .pf-in, html[data-theme="dark"] .ksel {
  background-color: #0f1727 !important; color: #e6edf7 !important; border-color: #2b3a55 !important;
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #64748b; }
html[data-theme="dark"] .btn { background-color: #172236; color: #e6edf7; border-color: #2b3a55; }
html[data-theme="dark"] .btn:hover { background-color: #1c2a44; }
html[data-theme="dark"] .btn-primary, html[data-theme="dark"] .btn.primary { background-color: #2563eb !important; color: #fff !important; border-color: #2563eb !important; }
html[data-theme="dark"] .cchip, html[data-theme="dark"] .chip, html[data-theme="dark"] .tag, html[data-theme="dark"] .ac-chip, html[data-theme="dark"] .pf-badge, html[data-theme="dark"] .u-badge {
  background: #1c2740 !important; color: #cbd5e1 !important; border-color: #2b3a55 !important;
}
html[data-theme="dark"] .cchip-on, html[data-theme="dark"] .cchip.on, html[data-theme="dark"] .chip.on { background: #e6edf7 !important; color: #0b1220 !important; }
html[data-theme="dark"] .ac-range button { color: #94a3b8; }
html[data-theme="dark"] .ac-range button.on { background: #1c2740; color: #7aa7ff; }
html[data-theme="dark"] .eye-btn { color: #94a3b8; }

/* ---- полосы, кольца, плитки ---- */
html[data-theme="dark"] .g-row .tr, html[data-theme="dark"] .bar-track, html[data-theme="dark"] .progress, html[data-theme="dark"] .goalBar, html[data-theme="dark"] .track { background: #1c2740 !important; }
html[data-theme="dark"] .vv-net, html[data-theme="dark"] .sb-kpi-ico { background: #1c2740 !important; }
html[data-theme="dark"] .vv-help { background: #1c2740; color: #94a3b8; }
html[data-theme="dark"] .vv-term { border-bottom-color: #3b4a66; }
html[data-theme="dark"] .vv-hint { background: #1c2740; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
html[data-theme="dark"] .vv-hint.up:after { border-bottom-color: #1c2740; } html[data-theme="dark"] .vv-hint.down:after { border-top-color: #1c2740; }
html[data-theme="dark"] img.logo, html[data-theme="dark"] .ticker-logo, html[data-theme="dark"] .ac-logo { background: #fff; border-radius: 10px; }

/* ---- inline-цвета из JS: перекрашиваем по значению ----
   текст: тёмные оттенки -> светлые */
html[data-theme="dark"] [style*="color:#0b1a33"], html[data-theme="dark"] [style*="color:#0f172a"], html[data-theme="dark"] [style*="color:#1f2a41"],
html[data-theme="dark"] [style*="color:#1f2937"], html[data-theme="dark"] [style*="color:#111"], html[data-theme="dark"] [style*="color:#000"],
html[data-theme="dark"] [style*="color:#334155"], html[data-theme="dark"] [style*="color:#1e293b"], html[data-theme="dark"] [style*="color:#0f1727"] { color: #e6edf7 !important; }
html[data-theme="dark"] [style*="color:#475569"], html[data-theme="dark"] [style*="color:#4b5563"], html[data-theme="dark"] [style*="color:#41506b"],
html[data-theme="dark"] [style*="color:#5b6a7d"], html[data-theme="dark"] [style*="color:#5b6b8a"], html[data-theme="dark"] [style*="color:#64748b"],
html[data-theme="dark"] [style*="color:#374151"], html[data-theme="dark"] [style*="color:#34435a"] { color: #b6c2d3 !important; }
html[data-theme="dark"] [style*="color:#6b7a8f"], html[data-theme="dark"] [style*="color:#8a97a8"], html[data-theme="dark"] [style*="color:#94a3b8"],
html[data-theme="dark"] [style*="color:#a0acbb"], html[data-theme="dark"] [style*="color:#6b7280"], html[data-theme="dark"] [style*="color:#9ca3af"] { color: #8fa0b8 !important; }
/* акценты чуть ярче, чтобы читались на тёмном */
html[data-theme="dark"] [style*="color:#2563eb"], html[data-theme="dark"] [style*="color:#2f6bff"] { color: #7aa7ff !important; }
html[data-theme="dark"] [style*="color:#1d4ed8"] { color: #93c5fd !important; }
html[data-theme="dark"] [style*="color:#16a34a"], html[data-theme="dark"] [style*="color:#15803d"] { color: #4ade80 !important; }
html[data-theme="dark"] [style*="color:#dc2626"], html[data-theme="dark"] [style*="color:#b91c1c"], html[data-theme="dark"] [style*="color:#ef4444"] { color: #f87171 !important; }
html[data-theme="dark"] [style*="color:#b45309"], html[data-theme="dark"] [style*="color:#d97706"], html[data-theme="dark"] [style*="color:#a16207"] { color: #fbbf24 !important; }
html[data-theme="dark"] [style*="color:#7c3aed"], html[data-theme="dark"] [style*="color:#6366f1"] { color: #a78bfa !important; }
/* светлые фоны -> тёмные */
html[data-theme="dark"] [style*="background:#fff"], html[data-theme="dark"] [style*="background:#ffffff"], html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background:#f7f8fa"], html[data-theme="dark"] [style*="background:#f7f9fc"], html[data-theme="dark"] [style*="background:#f8fafc"],
html[data-theme="dark"] [style*="background:#f5f7fa"], html[data-theme="dark"] [style*="background:#f2f6fd"], html[data-theme="dark"] [style*="background:#f6f8fa"] { background-color: #172236 !important; background-image: none !important; }
html[data-theme="dark"] [style*="background:#eef1f5"], html[data-theme="dark"] [style*="background:#eef0f4"], html[data-theme="dark"] [style*="background:#f1f5f9"],
html[data-theme="dark"] [style*="background:#f0f2f5"], html[data-theme="dark"] [style*="background:#eef2f7"], html[data-theme="dark"] [style*="background:#eef1f6"],
html[data-theme="dark"] [style*="background:#e8ebf0"], html[data-theme="dark"] [style*="background:#e6ebf2"], html[data-theme="dark"] [style*="background:#e2e6ea"],
html[data-theme="dark"] [style*="background:#eef3ff"], html[data-theme="dark"] [style*="background:#eaf1ff"], html[data-theme="dark"] [style*="background:#eef2ff"],
html[data-theme="dark"] [style*="background:#f0f4fe"], html[data-theme="dark"] [style*="background:#eff6ff"], html[data-theme="dark"] [style*="background:#f6f8fc"], html[data-theme="dark"] [style*="background:#f6f7f9"], html[data-theme="dark"] [style*="background:#f3f6fb"] { background-color: #1c2740 !important; background-image: none !important; color: #dbe4f3; }
html[data-theme="dark"] [style*="background:#fff4e5"], html[data-theme="dark"] [style*="background:#fef3c7"], html[data-theme="dark"] [style*="background:#fffbeb"] { background-color: #3a2a12 !important; }
html[data-theme="dark"] [style*="background:#fef2f2"], html[data-theme="dark"] [style*="background:#fee2e2"] { background-color: #3a1a1a !important; }
html[data-theme="dark"] [style*="background:#f0fdf4"], html[data-theme="dark"] [style*="background:#dcfce7"], html[data-theme="dark"] [style*="background:#ecfdf5"] { background-color: #12301f !important; }
/* рамки */
html[data-theme="dark"] [style*="solid #e2e6ea"], html[data-theme="dark"] [style*="solid #eef0f4"], html[data-theme="dark"] [style*="solid #e6ebf2"],
html[data-theme="dark"] [style*="solid #e9ecf0"], html[data-theme="dark"] [style*="solid #cbd5e1"], html[data-theme="dark"] [style*="solid #eef1f5"],
html[data-theme="dark"] [style*="solid #e5e7eb"], html[data-theme="dark"] [style*="solid #d1d5db"], html[data-theme="dark"] [style*="solid #f0f2f5"], html[data-theme="dark"] [style*="solid #e2e8f0"],
html[data-theme="dark"] [style*="solid #d8e3fb"], html[data-theme="dark"] [style*="solid #bfdbfe"], html[data-theme="dark"] [style*="solid #e3e9f2"] { border-color: #2c4a80 !important; }

/* ---- отдельные экраны ---- */
html[data-theme="dark"] .khero { box-shadow: 0 0 0 1px #223047 !important; }
html[data-theme="dark"] .kquote { background: #172236 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .kshelf-row::-webkit-scrollbar-thumb { background: #2b3a55; }
html[data-theme="dark"] .ac-me, html[data-theme="dark"] .ac-nav a { color: #cbd5e1; }
html[data-theme="dark"] .ac-nav a.on, html[data-theme="dark"] .ac-nav .on { background: #1c2740 !important; color: #7aa7ff !important; }
html[data-theme="dark"] .ac-danger { border-color: #7f1d1d !important; }
html[data-theme="dark"] .vvai-fab { box-shadow: 0 8px 24px rgba(0,0,0,.5); }
html[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; } html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2b3a55; border-radius: 5px; } html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f1727; }

/* кнопка темы в шапке */
.vv-theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid #e2e6ea; background: #fff; color: #5b6a7d; cursor: pointer; margin-right: 8px; flex: none; }
.vv-theme-btn:hover { color: #2563eb; border-color: #2563eb; }
html[data-theme="dark"] .vv-theme-btn { background: #172236; border-color: #2b3a55; color: #fbbf24; }

/* ---- цвета, выставленные через element.style (браузер хранит их как rgb) ---- */
html[data-theme="dark"] [style*="color: rgb(11, 26, 51)"], html[data-theme="dark"] [style*="color: rgb(15, 23, 42)"], html[data-theme="dark"] [style*="color: rgb(31, 42, 65)"], html[data-theme="dark"] [style*="color: rgb(31, 41, 55)"], html[data-theme="dark"] [style*="color: rgb(51, 65, 85)"], html[data-theme="dark"] [style*="color: rgb(30, 41, 59)"], html[data-theme="dark"] [style*="color: rgb(17, 24, 39)"] { color: #e6edf7 !important; }
html[data-theme="dark"] [style*="color: rgb(71, 85, 105)"], html[data-theme="dark"] [style*="color: rgb(75, 85, 99)"], html[data-theme="dark"] [style*="color: rgb(65, 80, 107)"], html[data-theme="dark"] [style*="color: rgb(91, 106, 125)"], html[data-theme="dark"] [style*="color: rgb(91, 107, 138)"], html[data-theme="dark"] [style*="color: rgb(100, 116, 139)"], html[data-theme="dark"] [style*="color: rgb(55, 65, 81)"], html[data-theme="dark"] [style*="color: rgb(52, 67, 90)"] { color: #b6c2d3 !important; }
html[data-theme="dark"] [style*="color: rgb(107, 122, 143)"], html[data-theme="dark"] [style*="color: rgb(138, 151, 168)"], html[data-theme="dark"] [style*="color: rgb(148, 163, 184)"], html[data-theme="dark"] [style*="color: rgb(160, 172, 187)"], html[data-theme="dark"] [style*="color: rgb(107, 114, 128)"], html[data-theme="dark"] [style*="color: rgb(156, 163, 175)"] { color: #8fa0b8 !important; }
html[data-theme="dark"] [style*="color: rgb(37, 99, 235)"] { color: #7aa7ff !important; }
html[data-theme="dark"] [style*="color: rgb(47, 107, 255)"] { color: #7aa7ff !important; }
html[data-theme="dark"] [style*="color: rgb(29, 78, 216)"] { color: #93c5fd !important; }
html[data-theme="dark"] [style*="color: rgb(22, 163, 74)"] { color: #4ade80 !important; }
html[data-theme="dark"] [style*="color: rgb(21, 128, 61)"] { color: #4ade80 !important; }
html[data-theme="dark"] [style*="color: rgb(220, 38, 38)"] { color: #f87171 !important; }
html[data-theme="dark"] [style*="color: rgb(185, 28, 28)"] { color: #fca5a5 !important; }
html[data-theme="dark"] [style*="color: rgb(239, 68, 68)"] { color: #f87171 !important; }
html[data-theme="dark"] [style*="color: rgb(180, 83, 9)"] { color: #fbbf24 !important; }
html[data-theme="dark"] [style*="color: rgb(217, 119, 6)"] { color: #fbbf24 !important; }
html[data-theme="dark"] [style*="background: rgb(255, 255, 255)"], html[data-theme="dark"] [style*="background-color: rgb(255, 255, 255)"], html[data-theme="dark"] [style*="background: rgb(247, 248, 250)"], html[data-theme="dark"] [style*="background-color: rgb(247, 248, 250)"], html[data-theme="dark"] [style*="background: rgb(247, 249, 252)"], html[data-theme="dark"] [style*="background-color: rgb(247, 249, 252)"], html[data-theme="dark"] [style*="background: rgb(248, 250, 252)"], html[data-theme="dark"] [style*="background-color: rgb(248, 250, 252)"], html[data-theme="dark"] [style*="background: rgb(245, 247, 250)"], html[data-theme="dark"] [style*="background-color: rgb(245, 247, 250)"], html[data-theme="dark"] [style*="background: rgb(242, 246, 253)"], html[data-theme="dark"] [style*="background-color: rgb(242, 246, 253)"], html[data-theme="dark"] [style*="background: rgb(246, 248, 250)"], html[data-theme="dark"] [style*="background-color: rgb(246, 248, 250)"], html[data-theme="dark"] [style*="background: rgb(249, 250, 251)"], html[data-theme="dark"] [style*="background-color: rgb(249, 250, 251)"], html[data-theme="dark"] [style*="background: rgb(250, 250, 250)"], html[data-theme="dark"] [style*="background-color: rgb(250, 250, 250)"], html[data-theme="dark"] [style*="background: rgb(245, 245, 245)"], html[data-theme="dark"] [style*="background-color: rgb(245, 245, 245)"] { background-color: #172236 !important; }
html[data-theme="dark"] [style*="background: rgb(238, 241, 245)"], html[data-theme="dark"] [style*="background-color: rgb(238, 241, 245)"], html[data-theme="dark"] [style*="background: rgb(238, 240, 244)"], html[data-theme="dark"] [style*="background-color: rgb(238, 240, 244)"], html[data-theme="dark"] [style*="background: rgb(241, 245, 249)"], html[data-theme="dark"] [style*="background-color: rgb(241, 245, 249)"], html[data-theme="dark"] [style*="background: rgb(240, 242, 245)"], html[data-theme="dark"] [style*="background-color: rgb(240, 242, 245)"], html[data-theme="dark"] [style*="background: rgb(238, 242, 247)"], html[data-theme="dark"] [style*="background-color: rgb(238, 242, 247)"], html[data-theme="dark"] [style*="background: rgb(238, 241, 246)"], html[data-theme="dark"] [style*="background-color: rgb(238, 241, 246)"], html[data-theme="dark"] [style*="background: rgb(232, 235, 240)"], html[data-theme="dark"] [style*="background-color: rgb(232, 235, 240)"], html[data-theme="dark"] [style*="background: rgb(230, 235, 242)"], html[data-theme="dark"] [style*="background-color: rgb(230, 235, 242)"], html[data-theme="dark"] [style*="background: rgb(226, 230, 234)"], html[data-theme="dark"] [style*="background-color: rgb(226, 230, 234)"], html[data-theme="dark"] [style*="background: rgb(238, 243, 255)"], html[data-theme="dark"] [style*="background-color: rgb(238, 243, 255)"], html[data-theme="dark"] [style*="background: rgb(234, 241, 255)"], html[data-theme="dark"] [style*="background-color: rgb(234, 241, 255)"], html[data-theme="dark"] [style*="background: rgb(238, 242, 255)"], html[data-theme="dark"] [style*="background-color: rgb(238, 242, 255)"], html[data-theme="dark"] [style*="background: rgb(243, 244, 246)"], html[data-theme="dark"] [style*="background-color: rgb(243, 244, 246)"], html[data-theme="dark"] [style*="background: rgb(244, 246, 251)"], html[data-theme="dark"] [style*="background-color: rgb(244, 246, 251)"], html[data-theme="dark"] [style*="background: rgb(229, 231, 235)"], html[data-theme="dark"] [style*="background-color: rgb(229, 231, 235)"], html[data-theme="dark"] [style*="background: rgb(242, 246, 254)"], html[data-theme="dark"] [style*="background-color: rgb(242, 246, 254)"] { background-color: #1c2740 !important; }
html[data-theme="dark"] [style*="background:#f3f4f6"], html[data-theme="dark"] [style*="background:#f4f6fb"], html[data-theme="dark"] [style*="background:#f5f5f5"], html[data-theme="dark"] [style*="background:#fafafa"], html[data-theme="dark"] [style*="background:#f9fafb"], html[data-theme="dark"] [style*="background:#f2f6fe"], html[data-theme="dark"] [style*="background:#e5e7eb"] { background-color: #1c2740 !important; background-image: none !important; }

/* ---- найденное при проверке страниц ---- */
html[data-theme="dark"] .vv-tile, html[data-theme="dark"] .vv-note, html[data-theme="dark"] .vvai-ctx, html[data-theme="dark"] .vvai-in, html[data-theme="dark"] .vvai-msg, html[data-theme="dark"] .ring-card, html[data-theme="dark"] .mover { background-color: #172236 !important; color: #e6edf7 !important; border-color: #223047 !important; }
html[data-theme="dark"] .vv-bar-track, html[data-theme="dark"] .bar, html[data-theme="dark"] .track, html[data-theme="dark"] #ringSwitch { background-color: #1c2740 !important; }
html[data-theme="dark"] #ringSwitch button, html[data-theme="dark"] .seg button, html[data-theme="dark"] .tabs button { color: #94a3b8; }
html[data-theme="dark"] #ringSwitch button.on, html[data-theme="dark"] #ringSwitch .on, html[data-theme="dark"] .seg .on, html[data-theme="dark"] .tabs .on { background: #2b3a55 !important; color: #fff !important; }


/* ---- найдено сканом страниц ---- */
html[data-theme="dark"] .big, html[data-theme="dark"] .ring-legend-item, html[data-theme="dark"] .code, html[data-theme="dark"] .vv-bar-legend, html[data-theme="dark"] .vv-bar-legend span, html[data-theme="dark"] .rub, html[data-theme="dark"] .vv-pill, html[data-theme="dark"] .an-row .n, html[data-theme="dark"] span.n, html[data-theme="dark"] .ac-km-v, html[data-theme="dark"] .ac-v, html[data-theme="dark"] .ac-price, html[data-theme="dark"] .ac-pay-big, html[data-theme="dark"] .ac-pay-when, html[data-theme="dark"] .ac-line, html[data-theme="dark"] .ac-pay-sub, html[data-theme="dark"] .ac-rate-verdict, html[data-theme="dark"] .ac-rate-n, html[data-theme="dark"] .ac-name { color: #e6edf7 !important; }
html[data-theme="dark"] .an-kpi, html[data-theme="dark"] .an-note, html[data-theme="dark"] .ac-tile, html[data-theme="dark"] .ac-pay, html[data-theme="dark"] .ac-tag, html[data-theme="dark"] .ac-pf, html[data-theme="dark"] .ac-icon-wrap { background-color: #172236 !important; background-image: none !important; color: #e6edf7; border-color: #223047 !important; }
html[data-theme="dark"] span.b, html[data-theme="dark"] .ac-bar, html[data-theme="dark"] .ac-rate-bar, html[data-theme="dark"] .an-bar { background-color: #1c2740 !important; }
html[data-theme="dark"] .ac-card-t { background-color: transparent !important; }
html[data-theme="dark"] .ac-icon { background: #fff !important; }
html[data-theme="dark"] [style*="background:#f0f4fe"], html[data-theme="dark"] [style*="background:#f0f4ff"] { background-color: #1c2740 !important; }
html[data-theme="dark"] .vv-theme-btn { background: transparent; border-color: transparent; }
.vv-theme-btn { position: fixed; left: 16px; bottom: 16px; z-index: 900; width: 38px; height: 38px; margin: 0; border-radius: 50%; border: 1px solid #e2e6ea; background: #fff; box-shadow: 0 6px 18px rgba(15,23,42,.14); }
html[data-theme="dark"] .vv-theme-btn { background: #172236; border-color: #2b3a55; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
@media (max-width: 900px) { .vv-theme-btn.vv-theme-btn--head { position: static; width: 34px; height: 34px; margin-left: auto; margin-right: 2px; box-shadow: none; border-radius: 10px; } }
@media print { .vv-theme-btn { display: none; } }

/* новый логотип VV: тёмная тема */
html[data-theme="dark"] .logo svg [fill="#1a2340"] { fill: #fff; }
html[data-theme="dark"] .logo svg [fill="#2b6bff"] { fill: #5b8cff; }
html[data-theme="dark"] .logo svg [fill="#8a93b0"] { fill: #7d8bb5; }

/* серо-синий текст подсказок из JS */
html[data-theme="dark"] [style*="color:#3f4a5c"], html[data-theme="dark"] [style*="color:#374151"] { color: #b8c4d6 !important; }

/* ---- окно «Спросить vvinvest» (ai-chat.js): явные цвета, не полагаемся на автозатемнение ---- */
html[data-theme="dark"] .vvai-panel { background: #0f1a2e !important; color: #e6edf7 !important; box-shadow: -12px 0 40px rgba(0,0,0,.5) !important; }
html[data-theme="dark"] .vvai-head, html[data-theme="dark"] .vvai-foot { border-color: #223047 !important; }
html[data-theme="dark"] .vvai-head b, html[data-theme="dark"] .vvai-hello h4, html[data-theme="dark"] .vvai-ctx b, html[data-theme="dark"] .vvai-chip { color: #e6edf7 !important; }
html[data-theme="dark"] .vvai-badge { background: #1e2a4d !important; color: #a5b4fc !important; }
html[data-theme="dark"] .vvai-ib { color: #94a3b8 !important; } html[data-theme="dark"] .vvai-ib:hover { background: #1c2740 !important; color: #e6edf7 !important; }
html[data-theme="dark"] .vvai-ctx { background: #14203a !important; color: #94a3b8 !important; border-color: #223047 !important; }
html[data-theme="dark"] .vvai-msg.a { background: #1c2740 !important; color: #e6edf7 !important; }
html[data-theme="dark"] .vvai-msg.u { background: #1e3a8a !important; color: #e6edf7 !important; }
html[data-theme="dark"] .vvai-msg b { background: linear-gradient(transparent 62%, rgba(129,140,248,.35) 62%) !important; }
html[data-theme="dark"] .vvai-cp { background: #1e2a4d !important; color: #c7d2fe !important; } html[data-theme="dark"] .vvai-cp.ok { background: #12301f !important; color: #86efac !important; }
html[data-theme="dark"] .vvai-hello { color: #cbd5e1 !important; }
html[data-theme="dark"] .vvai-chip { background: #14203a !important; border-color: #2c3f63 !important; } html[data-theme="dark"] .vvai-chip:hover { background: #1c2740 !important; border-color: #6366f1 !important; }
html[data-theme="dark"] .vvai-in { background: #14203a !important; } html[data-theme="dark"] .vvai-in textarea { color: #e6edf7 !important; } html[data-theme="dark"] .vvai-in textarea::placeholder { color: #64748b !important; }
html[data-theme="dark"] .vvai-wait, html[data-theme="dark"] .vvai-note { color: #94a3b8 !important; } html[data-theme="dark"] .vvai-note a { color: #7aa7ff !important; }
html[data-theme="dark"] .vvai-msg.a a { color: #7aa7ff !important; }
html[data-theme="dark"] .vvai-msg.a table, html[data-theme="dark"] .vvai-msg.a td, html[data-theme="dark"] .vvai-msg.a th { border-color: #2c3f63 !important; }
/* ИИ-разбор портфеля (окно) и кнопка AI в шапке: в тёмной теме — тёмное окно и светлый текст целиком, как у чата */
html[data-theme="dark"] .vvai-modal { background: rgba(0,0,0,.65) !important; }
html[data-theme="dark"] .vvai-modal .box { background: #0f1a2e !important; color: #cbd5e1 !important; box-shadow: 0 24px 64px rgba(0,0,0,.6) !important; }
html[data-theme="dark"] .vvai-modal h4, html[data-theme="dark"] .vvai-modal p b, html[data-theme="dark"] .vvai-rvhead b, html[data-theme="dark"] .vvai-rvh, html[data-theme="dark"] .vvai-rvp, html[data-theme="dark"] .vvai-rvp b, html[data-theme="dark"] .vvai-rvh b { color: #e6edf7 !important; }
html[data-theme="dark"] .vvai-rvp b, html[data-theme="dark"] .vvai-rvh b { background: linear-gradient(transparent 62%, rgba(129,140,248,.35) 62%) !important; }
html[data-theme="dark"] .vvai-so { background: #14203a !important; border-color: #2c3f63 !important; color: #cbd5e1 !important; }
html[data-theme="dark"] .vvai-so h5, html[data-theme="dark"] .vvai-so p { color: #e6edf7 !important; }
html[data-theme="dark"] .vvai-so .ai, html[data-theme="dark"] .vvai-so small { color: #94a3b8 !important; }
html[data-theme="dark"] .vvai-so textarea { background: #0f1a2e !important; color: #e6edf7 !important; border-color: #2c3f63 !important; }
html[data-theme="dark"] .vvai-err { background: #3b1111 !important; color: #fca5a5 !important; }
html[data-theme="dark"] .vvai-hbtn { background: #14203a !important; border-color: #2c3f63 !important; color: #a5b4fc !important; }
html[data-theme="dark"] .vvai-hbtn:hover { background: #1c2740 !important; border-color: #6366f1 !important; }

/* Оранжевые предупреждения: на тёмном фоне тёмно-коричневый текст не читался — делаем янтарный текст на тёмно-янтарной плашке */
html[data-theme="dark"] [style*="color:#78350f"], html[data-theme="dark"] [style*="color:#92400e"], html[data-theme="dark"] [style*="color:#8a5216"],
html[data-theme="dark"] [style*="color:#9a3412"], html[data-theme="dark"] [style*="color:#7c2d12"], html[data-theme="dark"] [style*="color:#8a6320"],
html[data-theme="dark"] [style*="color:#854d0e"], html[data-theme="dark"] [style*="color:#8a5a00"] { color: #fcd34d !important; }
html[data-theme="dark"] [style*="background:#fff7ed"], html[data-theme="dark"] [style*="background:#ffedd5"], html[data-theme="dark"] [style*="background:#fef9c3"],
html[data-theme="dark"] [style*="background:#fff8ed"], html[data-theme="dark"] [style*="background:#fff4e0"], html[data-theme="dark"] [style*="background:#fff7e6"],
html[data-theme="dark"] [style*="background:#fdf2e9"] { background-color: #3a2a12 !important; }
html[data-theme="dark"] [style*="solid #fcd9a4"], html[data-theme="dark"] [style*="solid #fdba74"], html[data-theme="dark"] [style*="solid #fde68a"],
html[data-theme="dark"] [style*="solid #f59e0b"], html[data-theme="dark"] [style*="solid #fbe3c0"], html[data-theme="dark"] [style*="solid #fcd34d"],
html[data-theme="dark"] [style*="solid #fed7aa"], html[data-theme="dark"] [style*="solid #fde4b4"] { border-color: #7a5a1e !important; }
/* то же для плашек и чипов, у которых цвета заданы в CSS-классах */
html[data-theme="dark"] .adm-freq.rare, html[data-theme="dark"] .adm-btn-warn, html[data-theme="dark"] .adm-tag.yel,
html[data-theme="dark"] #rebalBody .al-warn, html[data-theme="dark"] #taxCalc .tx-warn,
html[data-theme="dark"] .an-tag.warn, html[data-theme="dark"] .in-tag.warn, html[data-theme="dark"] .ac-tag-fc, html[data-theme="dark"] .c-warn, html[data-theme="dark"] .ctip-ico.gift,
html[data-theme="dark"] .vv-dr-chip.warn, html[data-theme="dark"] .ac-chip.warn, html[data-theme="dark"] .ac-chk .ic.no,
html[data-theme="dark"] .op-sell, html[data-theme="dark"] .cal-tag-est, html[data-theme="dark"] .scr .st.f,
html[data-theme="dark"] .pf-badge.veteran, html[data-theme="dark"] .u-badge.veteran, html[data-theme="dark"] .pf-badge.top, html[data-theme="dark"] .u-badge.top,
html[data-theme="dark"] .calc-note, html[data-theme="dark"] .u-me, html[data-theme="dark"] #vvtApiNote, html[data-theme="dark"] #vvtPriceWarn,
html[data-theme="dark"] #vvTestBar, html[data-theme="dark"] .in-ladder button.empty { background: #3a2a12 !important; color: #fcd34d !important; border-color: #7a5a1e !important; }
html[data-theme="dark"] #vvtPriceWarn b, html[data-theme="dark"] #vvTestBar a, html[data-theme="dark"] .in-ladder button.empty span, html[data-theme="dark"] .stk-pr .bad .h { color: #fcd34d !important; }
html[data-theme="dark"] .vv-note.warn { background: #3a2a12 !important; border-left-color: #d97706 !important; }
html[data-theme="dark"] .stk-pr .col.bad { background: #3a2a12 !important; border-color: #7a5a1e !important; }
