/* Тепловые карты cfpro.ru, два варианта на выбор: .hmA «Терминал» и .hmB «Витрина».
   Цвета шкалы - кандидаты в токены --cf-heat-* дизайн-системы. */

.hm { --hm-gap: 3px; font-family: var(--font-sans, "Public Sans", system-ui, sans-serif); font-variant-numeric: tabular-nums; }
.hm *, .hm *::before, .hm *::after { box-sizing: border-box; }

/* ---------- A «Терминал»: тёмная доска в любой теме ---------- */
.hmA { --hm-board: #0b0f16; --hm-zero: #262c36; --hm-up: #17a673; --hm-down: #d9483b;
  --hm-lab: rgba(255,255,255,.64); --hm-seg: rgba(255,255,255,.07); --hm-seg-on: rgba(255,255,255,.16); }
:root[data-theme="dark"] .hmA { --hm-board: #070a0f; --hm-zero: #232933; }
.hmA .hm-board { background: var(--hm-board); border-radius: 16px; padding: 8px; color: #fff; }
.hmA .hm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 8px 6px 14px; }
.hmA .hm-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.hmA .hm-more { color: rgba(255,255,255,.72); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.hmA .hm-more:hover { color: #fff; }
.hmA .hm-stamp, .hmA .hm-legend, .hmA .hm-count { color: rgba(255,255,255,.6); }
.hmA .hm-t { border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); align-items: center; justify-content: center; text-align: center; }
.hmA .hm-t:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.hmA .hm-g { color: var(--hm-lab); }
.hmA .hm-g em { color: #fff; padding: 1px 7px; border-radius: 999px; }

/* ---------- B «Витрина»: карта в панели сайта, белый текст ---------- */
.hmB { --hm-zero: #3c424e; --hm-up: #15a05c; --hm-down: #e0443e;
  --hm-seg: var(--cf-surface-2); --hm-seg-on: var(--cf-surface); }
:root[data-theme="dark"] .hmB { --hm-zero: #2c323c; --hm-seg-on: var(--cf-surface-3); }
.hmB .hm-board { background: var(--cf-surface); border: 1px solid var(--cf-line); border-radius: 16px; padding: 16px; color: var(--cf-ink); }
.hmB .hm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 10px; }
.hmB .hm-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.hmB .hm-more { color: var(--cf-accent); font-size: 14px; font-weight: 600; text-decoration: none; }
.hmB .hm-stamp, .hmB .hm-legend, .hmB .hm-count { color: var(--cf-ink-3); }
.hmB .hm-t { border-radius: 6px; align-items: flex-start; justify-content: flex-end; padding: 0 8px 7px; }
.hmB .hm-t.c { align-items: center; justify-content: center; padding: 0 2px; text-align: center; }
.hmB .hm-t.k { padding: 0 3px 3px; }
.hmB .hm-t:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 1px; }
.hmB .hm-g { color: var(--cf-ink); cursor: pointer; }
.hmB .hm-g:hover span { color: var(--cf-accent); }
.hmB .hm-g em.up { color: var(--cf-up); } .hmB .hm-g em.down { color: var(--cf-down); } .hmB .hm-g em.mut { color: var(--cf-ink-3); }
.hmB .hm-strip { position: relative; margin: 0 0 10px; }
.hmB .hm-sectors { display: flex; gap: 6px; overflow-x: auto; padding: 1px 0 2px; scrollbar-width: none;
  --fl: 0px; --fr: 0px; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent 100%); }
.hmB .hm-sectors::-webkit-scrollbar { display: none; }
.hmB .hm-strip.is-l .hm-sectors { --fl: 56px; } .hmB .hm-strip.is-r .hm-sectors { --fr: 56px; }
/* Стрелки - для мыши; на касании листают пальцем */
.hmB .hm-nav { position: absolute; top: 1px; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--cf-line-strong); background: var(--cf-surface); color: var(--cf-ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, .12); opacity: 0; visibility: hidden; transform: scale(.9);
  transition: opacity .16s cubic-bezier(.2, .8, .2, 1), transform .16s cubic-bezier(.2, .8, .2, 1), visibility 0s .16s, background-color .12s; }
.hmB .hm-nav.prev { left: 0; } .hmB .hm-nav.next { right: 0; }
.hmB .hm-strip.is-l .hm-nav.prev, .hmB .hm-strip.is-r .hm-nav.next { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.hmB .hm-nav:hover { background: var(--cf-surface-2); }
.hmB .hm-nav:active { transform: scale(.94); }
@media (pointer: coarse) { .hmB .hm-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .hmB .hm-nav { transition: none; } }
.hmB .hm-sectors button:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: -2px; }
.hmB .hm-sectors button { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; cursor: pointer;
  border-radius: 999px; border: 1px solid var(--cf-line-strong); background: var(--cf-surface); color: var(--cf-ink); font: 500 13.5px var(--font-sans, system-ui); }
.hmB .hm-sectors button:hover { background: var(--cf-surface-2); }
.hmB .hm-sectors button[aria-pressed="true"] { background: var(--cf-accent-soft); border-color: transparent; color: var(--cf-accent); }
.hmB .hm-sectors i { font-style: normal; font-weight: 600; }
.hmB .hm-sectors .up { color: var(--cf-up); } .hmB .hm-sectors .down { color: var(--cf-down); }
.hmB .hm-crumb { margin: -2px 0 8px; font-size: 14px; color: var(--cf-ink-3); }
.hmB .hm-crumb:empty { display: none; }
.hmB .hm-crumb button { border: 0; background: none; padding: 0; font: 600 14px var(--font-sans, system-ui); color: var(--cf-accent); cursor: pointer; }
.hmB .hm-crumb b { color: var(--cf-ink); font-weight: 600; }

/* ---------- общее ---------- */
.hm-map { position: relative; width: 100%; user-select: none; }
.hm-t { position: absolute; display: flex; flex-direction: column; overflow: hidden; color: #fff; text-decoration: none; cursor: pointer;
  transition: filter 120ms ease; }
@media (hover: hover) and (pointer: fine) { .hm-t:hover { filter: brightness(1.15); } }
.hm .hm-t .hm-tk { font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; white-space: nowrap; }
.hm .hm-t .hm-nm { font-weight: 600; letter-spacing: -0.01em; line-height: 1.12; }
.hm .hm-t .hm-pc { font-weight: 600; line-height: 1.2; margin-top: .14em; opacity: .94; white-space: nowrap; }
.hm .hm-t .hm-co { font-weight: 500; line-height: 1.2; margin-top: .3em; opacity: .66; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hm-g { position: absolute; display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 20px; padding: 0 4px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; background: none; border: 0; font-family: inherit; }
.hm-g span { overflow: hidden; text-overflow: ellipsis; }
.hm-g em { flex: none; font-style: normal; font-size: 12px; font-weight: 600; }

.hm-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hm-seg); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.hm-seg button { height: 30px; padding: 0 13px; border: 0; border-radius: 999px; background: none; cursor: pointer; white-space: nowrap;
  font: 600 13.5px var(--font-sans, system-ui); color: inherit; opacity: .62; transition: background 150ms ease, opacity 150ms ease; }
.hm-seg button:hover { opacity: 1; }
.hm-seg button[aria-pressed="true"] { background: var(--hm-seg-on); opacity: 1; }
.hmB .hm-seg button[aria-pressed="true"] { box-shadow: var(--cf-shadow-thumb, 0 1px 2px rgba(0,0,0,.12)); }
.hm-sp { flex: 1; }
.hm-stamp, .hm-count { font-size: 13px; white-space: nowrap; }
.hm-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; }
.hm-legend span { display: inline-flex; gap: 2px; }
.hm-legend i { width: 20px; height: 12px; border-radius: 3px; }

.hm-home { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
@media (max-width: 960px) { .hm-home { grid-template-columns: 1fr; } }
.hm-ofz { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-bottom: 12px; }
.hm-ofz > div { border-radius: 6px; padding: 10px 12px; color: #fff; }
.hm-ofz small { display: block; font-size: 12.5px; opacity: .78; }
.hm-ofz b { display: block; font-size: 20px; letter-spacing: -0.02em; margin: 2px 0; }
.hm-ofz span { font-size: 12.5px; opacity: .78; }
.hmA .hm-ofz > div { border-radius: 4px; }
.hmB .hm-ofz { gap: 0; border: 1px solid var(--cf-line); border-radius: 12px; overflow: hidden; }
.hmB .hm-ofz > div { border-radius: 0; background: var(--cf-surface); color: var(--cf-ink); border-left: 1px solid var(--cf-line); padding: 8px 14px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline; }
.hmB .hm-ofz small { grid-column: 1 / -1; }
.hmB .hm-ofz b { font-size: 17px; margin: 1px 0 0; }
.hmB .hm-ofz span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hmB .hm-ofz > div:first-child { border-left: 0; }
.hmB .hm-ofz small, .hmB .hm-ofz span { opacity: 1; color: var(--cf-ink-3); }
.hmB .hm-ofz b.up { color: var(--cf-up); } .hmB .hm-ofz b.down { color: var(--cf-down); } .hmB .hm-ofz b.mut { color: var(--cf-ink-2); }
@media (max-width: 700px) { .hm-ofz { grid-template-columns: 1fr 1fr; } .hm-ofz > div:last-child { grid-column: span 2; } .hmB .hm-ofz > div { border-top: 1px solid var(--cf-line); } }
.hm-cap { font-size: 13px; margin: 0 2px 8px; color: var(--cf-ink-3); }
/* ОФЗ в прежнем формате страницы облигаций: карточки на мягкой подложке */
.hm-ofz-h { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; margin: 0 2px 8px; color: var(--cf-ink); }
.hmB .hm-ofz.hm-ofz--old { gap: 10px; border: 0; border-radius: 0; overflow: visible; margin-bottom: 12px; }
.hmB .hm-ofz--old > div { display: block; border: 0; border-radius: 12px; padding: 8px 14px; color: var(--cf-ink); }
.hmB .hm-ofz--old small { color: var(--cf-ink); font-size: 13.5px; font-weight: 600; }
.hmB .hm-ofz--old b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 1px 0 2px; color: var(--cf-ink); }
.hmB .hm-ofz--old span { display: block; font-size: 12.5px; color: var(--cf-ink-3); }

/* Место под карты главной заранее: без него блок ниже прыгал после загрузки */
.hm-home-host { margin-top: 14px; min-height: 520px; }
.hm-err { padding: 40px 16px; text-align: center; color: var(--cf-ink-3); font-size: 14px; }

/* Плотная мини-карта главной: подписи секторов ниже и мельче */
.hm-dense .hm-g { height: 16px; font-size: 11px; padding: 0 3px; }
.hm-dense .hm-g em { font-size: 11px; }
.hm-dense .hm-board { padding: 14px; }

/* Подсказка */
.hm-tip { position: fixed; left: 0; top: 0; z-index: 1000; width: 280px; padding: 12px 14px; border-radius: 12px;
  background: var(--cf-tooltip-bg, #0a0b0d); color: var(--cf-tooltip-ink, #fff); box-shadow: var(--cf-shadow-tooltip, 0 12px 32px rgba(10,11,13,.24));
  font: 13px/1.35 var(--font-sans, system-ui); font-variant-numeric: tabular-nums; pointer-events: none;
  --hm-tip-up: #45d38f; --hm-tip-down: #ff7a70; --hm-tip-cell: rgba(255,255,255,.08); }
:root[data-theme="dark"] .hm-tip { --hm-tip-up: #0a7c4a; --hm-tip-down: #cf202f; --hm-tip-cell: rgba(10,11,13,.07); }
.hm-tip[hidden] { display: none; }
.tt-h { display: flex; align-items: baseline; gap: 8px; }
.tt-h b { font-size: 15px; letter-spacing: -0.01em; }
.tt-h span { opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-px { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.tt-px i { font-style: normal; font-size: 14px; font-weight: 600; }
.tt-per { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 10px; border-radius: 6px; overflow: hidden; }
.tt-per div { padding: 5px 6px; background: var(--hm-tip-cell); }
.tt-per small { display: block; font-size: 11px; opacity: .6; }
.tt-per span { font-weight: 600; font-size: 12px; }
.tt-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; }
.tt-dl dt { opacity: .66; }
.tt-dl dd { margin: 0; text-align: right; font-weight: 600; }
.tt-list { margin: 8px 0 0; padding: 0; list-style: none; }
.tt-list li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px solid var(--hm-tip-cell); }
.tt-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.tt-list li span:last-child { font-weight: 600; }
.hm-tip .up { color: var(--hm-tip-up); } .hm-tip .down { color: var(--hm-tip-down); } .hm-tip .mut { opacity: .6; }
.hm-rt { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }

/* Переключатель вариантов для просмотра: не часть будущей страницы */
.hm-switch { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 1100; display: flex; align-items: center; gap: 4px;
  padding: 5px; border-radius: 999px; background: #0b0f16; color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.3); font: 600 13px var(--font-sans, system-ui); }
.hm-switch span { padding: 0 8px 0 10px; opacity: .6; }
.hm-switch a { padding: 8px 14px; border-radius: 999px; color: #fff; text-decoration: none; opacity: .7; }
.hm-switch a:hover { opacity: 1; }
.hm-switch a[aria-current="true"] { background: #fff; color: #0b0f16; opacity: 1; }

@media (prefers-reduced-motion: reduce) { .hm-t, .hm-seg button { transition: none; } }
