/*
 * /invoices/chinese-supplier/, /invoices/university-tuition/, /invoices/rent-abroad/ — инвойсы-сценарии
 * (SEO-волна 25.11.2026 (б), зона invoices-niches; генератор tools/invoice-niches.mjs).
 * Поверх assets/r26-invoices.css (inv-*) и assets/r26-corridors.css (cor-*): здесь только своё. Приставка ivn-.
 * Только токены r26 (тёмная тема — без атрибута, светлая — html[data-theme="light"]), логические свойства для RTL.
 * Телефон: 899 / 719 / 359 px; на 320 без боковой прокрутки — таблицы складываются в карточки.
 */

/* ══ Шаги в приложении ════════════════════════════════════════════════════ */
.ivn-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; counter-reset: none; }
.ivn-step { padding: 22px 24px; display: flex; gap: 16px; align-items: flex-start; min-width: 0; }
.ivn-step:last-child:nth-child(odd) { grid-column: 1 / -1; }
.ivn-step-n {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-size: 16px; font-weight: 800; color: var(--r-link); background: var(--r-brand-tint);
}
.ivn-step-t { margin: 0 0 6px; font-size: 17px; font-weight: 800; line-height: 1.3; color: var(--r-text); }
.ivn-step-d { margin: 0; font-size: 15px; line-height: 1.6; color: var(--r-text-2); }

/* Нечётная последняя карточка в сетках по две — на всю ширину (только на этих страницах). */
.ivn :is(.cor-prac-i, .cor-card):last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ══ Таблица стран (4 колонки) и общая таблица ════════════════════════════ */
.ivn-ctry thead th, .ivn-gen thead th, .ivn-ex thead th { font-size: 13px; color: var(--r-muted); background: var(--r-fill-1); }
.ivn-ctry tbody th { width: 16%; }
.ivn-ctry td:nth-child(2) { white-space: nowrap; font-weight: 700; color: var(--r-text); }
.ivn-ctry td:last-child { width: 40%; }
.ivn-ml { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ivn-ml b { color: var(--r-text); font-weight: 800; }
.ivn-ml span { color: var(--r-muted); }
.ivn-gen tbody th { width: 26%; }
.ivn-gen td:nth-child(2) { width: 24%; }

/* ══ Пример расчёта ═══════════════════════════════════════════════════════ */
.ivn-ex td { white-space: nowrap; }
.ivn-ex td b { color: var(--r-text); }
.ivn-ex-sum :is(th, td) { background: var(--r-fill-1); font-weight: 800; color: var(--r-text); }

/* ══ Красные флаги рядом с чек-листом ═════════════════════════════════════ */
.ivn-bad .inv-chk-i { color: var(--r-red); background: var(--r-red-line); }

@media (max-width: 899px) {
  .ivn-steps { grid-template-columns: minmax(0, 1fr); }
  .ivn-ex td { white-space: normal; }
}
@media (max-width: 719px) {
  .ivn-step { padding: 18px 20px; gap: 14px; }
  .ivn-step-n { width: 34px; height: 34px; font-size: 15px; }
  /* Таблицы → карточки: строка = карточка, подпись колонки — из data-l. */
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex), :is(.ivn-ctry, .ivn-gen, .ivn-ex) :is(tbody, tr, th, td) { display: block; width: auto; }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) tr { padding: 14px 16px; border-bottom: 1px solid var(--r-line); }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) tbody tr:last-child { border-bottom: 0; }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) :is(th, td) { padding: 0; border-bottom: 0; }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) tbody th { width: auto; font-size: 15px; padding-bottom: 6px; }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) td { width: auto; font-size: 14px; padding-top: 6px; white-space: normal; }
  :is(.ivn-ctry, .ivn-gen, .ivn-ex) td::before { content: attr(data-l); display: block; font-size: 12px; font-weight: 800; color: var(--r-muted); margin-bottom: 2px; }
  .ivn-ctry td:last-child, .ivn-ctry td:nth-child(2), .ivn-gen td:nth-child(2), .ivn-ctry tbody th, .ivn-gen tbody th { width: auto; }
  .ivn-ex td:empty { display: none; }
  .ivn-ex-sum :is(th, td) { background: transparent; }
  .ivn-ex-sum { background: var(--r-fill-1); }
}
@media (max-width: 359px) {
  .ivn-step { flex-direction: column; gap: 10px; }
}
