/* Карточки ЗПИФ, УК и БПИФ на телефоне - только раскладка.
 *
 * Облик карточек прежний (Manrope, свои цвета страниц): здесь не меняются ни
 * шрифты, ни цвета, только то, как таблицы и сетки ложатся на 375 px.
 * Переменные - те, что задают сами страницы (zpif-card.css, bond-page.css).
 * Подключают шаблоны scripts/zpif-card.tpl.html, uk-page.tpl.html,
 * fund-page.tpl.html. Создано 25.09.2026. */

@media (max-width: 767px) {
  /* ── ЗПИФ: «Расширенные параметры» - таблица на три пары колонок, которую
     надо было смахивать вбок, - становится списком «подпись - значение». */
  .details-scroll-hint { display: none !important; }
  .details-table { overflow: visible; }
  .details-table table, .details-table tbody { display: block; min-width: 0 !important; width: 100%; }
  .details-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .details-table th, .details-table td {
    display: block; width: auto !important; min-width: 0 !important; max-width: none !important;
    padding: 12px 16px; border-bottom: 1px solid var(--g100);
    white-space: normal; overflow-wrap: break-word; text-align: left;
  }
  .details-table th { font-size: 12px; }
  .details-table td { text-align: right; font-size: 13px; }

  /* ── ЗПИФ: график выплат - строка «статус и событие слева, дата и сумма
     справа» вместо четырёх колонок, уезжавших за край. */
  .payout-table { overflow: visible; }
  .payout-table table { display: block; min-width: 0 !important; }
  .payout-table thead { display: none; }
  .payout-table tbody { display: block; }
  .payout-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px;
    padding: 12px 16px; border-bottom: 1px solid var(--g100);
  }
  .payout-table td { display: block; padding: 0; border: 0; white-space: normal; }
  .payout-table td:nth-child(1) { grid-column: 1; grid-row: 1; }
  .payout-table td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--g700); }
  .payout-table td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  .payout-table td:nth-child(4) { grid-column: 2; grid-row: 2; text-align: right; color: var(--g500); }
  .payout-note { padding: 12px 16px; }

  /* ── УК: таблица фондов компании - строка из двух этажей: фонд и СЧА, под
     ними ISIN, выплаты и объекты. */
  .table-scroll { overflow: visible; border: 0; }
  .table-scroll table, .table-scroll tbody { display: block; min-width: 0 !important; }
  .table-scroll thead { display: none; }
  .table-scroll tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 4px;
    padding: 12px 0; border-bottom: 1px solid var(--g100);
  }
  .table-scroll td {
    display: block; position: static !important; padding: 0 !important; border: 0; white-space: normal;
    background: none !important; box-shadow: none !important; min-width: 0 !important; text-align: left;
  }
  .table-scroll td:nth-child(1) { grid-column: 1; grid-row: 1; font-size: 15px; }
  .table-scroll td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 700; }
  .table-scroll td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .table-scroll td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; color: var(--g500); font-size: 13px; }
  .table-scroll td:nth-child(5) { grid-column: 2; grid-row: 2; text-align: right; color: var(--g500); font-size: 13px; }
  .table-scroll tr:last-child { border-bottom: 0; }

  /* ── БПИФ и УК: плитки чисел по две в ряд; если их нечётно после главной,
     последняя растягивается - без пустой половины ряда. */
  .metrics > .metric:last-child:nth-child(even) { grid-column: 1 / -1; }
}
