/* Главная использует общую палитру, не меняя таблицы внутренних разделов. */
.home-marketinfo { color: var(--site-text); }

.home-marketinfo .hm-intro { padding: 8px 0 28px; }

.home-marketinfo .hm-title {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 750;
  line-height: 1.18;
  letter-spacing: -0.035em;
}

.home-marketinfo .hm-description {
  margin: 0;
  color: var(--site-muted);
  font-size: 17px;
  line-height: 1.6;
}

.home-marketinfo .hm-status {
  margin: 0 0 16px;
  padding: 0;
  color: var(--site-muted);
  font-size: 14px;
}

.home-marketinfo .hm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
}

.home-marketinfo .hm-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--site-surface);
  border: 1px solid var(--site-border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgb(23 42 58 / 4%);
}

.home-marketinfo .hm-card__header { padding: 20px 20px 14px; }

.home-marketinfo .hm-card__header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.home-marketinfo .hm-updated,
.home-marketinfo .hm-comparison {
  margin: 8px 0 0;
  color: var(--site-muted);
  font-size: 12px;
  line-height: 1.5;
}

/* Прокрутка ограничена таблицей; ширина карточки остаётся в пределах сетки. */
.home-marketinfo .hm-table-wrap {
  min-width: 0;
  max-width: 100%;
  margin-inline: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.home-marketinfo .hm-table {
  width: 100%;
  min-width: 390px;
  margin: 0;
  table-layout: auto;
  border-collapse: collapse;
  color: var(--site-text);
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.home-marketinfo .hm-card--currency .hm-table { min-width: 480px; }
.home-marketinfo .hm-instrument-col { width: 28%; }
.home-marketinfo .hm-card--currency .hm-instrument-col { width: 24%; }

.home-marketinfo .hm-table th,
.home-marketinfo .hm-table td { padding: 9px 6px; vertical-align: middle; }

.home-marketinfo .hm-table thead th {
  color: #526978;
  background: #edf4f7;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.home-marketinfo .hm-table thead th:first-child {
  text-align: left;
  border-radius: 8px 0 0 8px;
}

.home-marketinfo .hm-table thead th:last-child { border-radius: 0 8px 8px 0; }

.home-marketinfo .hm-table tbody th,
.home-marketinfo .hm-table tbody td { border-bottom: 1px solid #edf1f3; }

.home-marketinfo .hm-table tbody th { font-weight: 400; text-align: left; }

.home-marketinfo .hm-table tbody tr:last-child th,
.home-marketinfo .hm-table tbody tr:last-child td { border-bottom: 0; }

.home-marketinfo .hm-table tbody tr:hover { background: #f7fafb; }

.home-marketinfo .hm-symbol {
  color: var(--site-text);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.home-marketinfo a.hm-symbol:hover {
  color: var(--site-accent);
  text-decoration: underline;
}

.home-marketinfo .hm-name {
  display: block;
  max-width: 10rem;
  margin-top: 2px;
  color: var(--site-muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* Числа не переносятся по цифрам, не обрезаются и не округляются стилями. */
.home-marketinfo .hm-number {
  text-align: right;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.home-marketinfo .hm-change { font-weight: 600; }
.home-marketinfo .hm-change--up { color: var(--site-positive); }
.home-marketinfo .hm-change--down { color: var(--site-negative); }
.home-marketinfo .hm-change--flat { color: var(--site-muted); }

.home-marketinfo .hm-notice {
  margin: 0 16px 14px;
  padding: 10px 12px;
  color: #775a16;
  background: #fffbef;
  border: 1px solid #eadbb0;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.home-marketinfo .hm-empty {
  margin: 0;
  padding: 24px 20px;
  color: var(--site-muted);
}

.home-marketinfo .hm-card__footer {
  margin-top: auto;
  padding: 12px 20px 14px;
  border-top: 1px solid #edf1f3;
}

.home-marketinfo .hm-card__footer .hm-comparison { margin: 0 0 4px; }

.home-marketinfo .hm-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--site-accent-hover);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.home-marketinfo .hm-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-marketinfo a:focus-visible,
.home-marketinfo button:focus-visible,
.home-marketinfo .hm-table-wrap:focus-visible {
  outline: 3px solid var(--site-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.home-marketinfo [data-page-data-notice] {
  color: var(--site-text);
  background: #fff;
  border: 1px solid var(--site-border);
  border-radius: 12px;
}

.home-marketinfo [data-page-data-notice] p { margin: 0; }

.home-marketinfo [data-page-data-retry] {
  min-height: 44px;
  color: var(--site-accent-hover);
  border-color: var(--site-accent);
  background: #fff;
}

.home-marketinfo [data-page-data-retry]:hover { background: var(--site-soft); }

/* Две колонки: валютам даём всю верхнюю строку. */
@media (min-width: 900px) {
  .home-marketinfo .hm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-marketinfo .hm-card--currency { grid-column: 1 / -1; }
}

/* Три колонки только при достаточной ширине. */
@media (min-width: 1400px) {
  .home-marketinfo .hm-grid {
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
  }

  .home-marketinfo .hm-card--currency { grid-column: auto; }
}

@media (max-width: 575.98px) {
  .home-marketinfo .hm-intro { padding: 0 0 24px; }
  .home-marketinfo .hm-description { font-size: 15px; }
  .home-marketinfo .hm-card__header { padding: 18px 16px 14px; }
  .home-marketinfo .hm-card__header h2 { font-size: 21px; }
  .home-marketinfo .hm-card__footer { padding: 12px 16px; }
  .home-marketinfo .hm-table-wrap { margin-inline: 10px; }
}