/* Слои мастера, оплаты и «Поделиться» (задача 5): классы .mst- .pay- .share-
   Размеры и цвета — из макетов desktop-17…20, phone-24, 27, 28. Где у текста в макете нет высоты строки,
   стоит line-height: normal, как там (у страницы по умолчанию 1.4). */

/* ---------- Вопросы мастеру: экран телефона (phone-24) и широкое окно компьютера (desktop-17, 18) ---------- */
/* Шапка и кнопки стоят на месте; если вопрос не помещается, прокручивается только середина */
.mst { display: flex; flex-direction: column; height: 100%; }
.mst-head { display: flex; flex: none; align-items: center; height: 52px; padding: 0 8px 0 4px; }
.mst-close {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--r-22);
  font-size: 15px;
  font-weight: 600;
  line-height: normal;
}
.mst-pos { margin-left: auto; padding-right: 12px; font-size: 15px; line-height: normal; color: var(--c-text-2); }
.mst-body { display: flex; flex: 1; flex-direction: column; gap: 14px; min-height: 0; padding: 26px 24px 0; overflow-y: auto; }
.mst-item { font-size: 16px; line-height: 22px; color: var(--c-text-2); }
.mst-facts { display: flex; flex-direction: column; gap: 4px; }
.mst-fact { font-size: 21px; line-height: 29px; }
.mst-fact b { font-weight: 700; }
.mst-src { margin-top: -8px; font-size: 15px; line-height: normal; color: var(--c-text-2); }
.mst-q { margin-top: 18px; font-size: 31px; font-weight: 700; line-height: 38px; letter-spacing: -.02em; text-wrap: pretty; }
/* Снизу 16 px: полосу «домой» уже отступил экран целиком (.layer-full .layer-body, safe-area) */
.mst-foot { display: flex; flex: none; flex-wrap: wrap; gap: 0 10px; padding: 0 16px 16px; }
.mst-dots { display: flex; flex: 0 0 100%; justify-content: center; gap: 6px; padding: 18px 0; }
.mst-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: #D3D7DC; }
.mst-dot.is-active { width: 22px; background: var(--c-dark); }
.mst-prev {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-18);
  background: var(--c-surface);
}
/* Бледная, как в макете (opacity .35), но прозрачны только фон и значок: кольцо фокуса на кнопке остаётся ярким */
.mst-prev[aria-disabled="true"] { background: color-mix(in srgb, var(--c-surface) 35%, transparent); cursor: default; }
.mst-prev[aria-disabled="true"] .ic { opacity: .35; }
.mst-next { flex: 1; min-height: 56px; border-radius: var(--r-18); font-size: 17px; }

@media (hover: hover) {
  .mst-close:hover, .mst-prev:not([aria-disabled="true"]):hover { background: var(--c-surface-hover); }
}

@media (min-width: 1024px) {
  /* Поля окна 960 × 640 (36 / 48 / 40) — внутри .mst, а не у тела слоя оболочки: щелчок по полям фокусирует
     .mst (tabindex="-1"), а не коробку окна вне .mst, и стрелки, которые слушает .mst, продолжают листать.
     Середина — по центру между шапкой и кнопками, а если не помещается, начинается сверху и прокручивается */
  .layer-wide .layer-body:has(> .mst) { padding: 0; }
  .mst { padding: 36px 48px 40px; }
  .mst-head { height: auto; padding: 0; }
  .mst-close { margin-left: auto; padding: 0 16px; background: var(--c-surface); }
  .mst-pos { margin-left: 0; padding-right: 0; font-size: 16px; }
  .mst-body { padding: 0; }
  .mst-item { margin-top: auto; font-size: 20px; line-height: normal; }
  .mst-facts { flex-direction: row; flex-wrap: wrap; gap: 28px; }
  .mst-fact { font-size: 26px; line-height: 34px; }
  .mst-src { margin-top: -6px; font-size: 17px; }
  .mst-q { margin: 22px 0 auto; font-size: 48px; line-height: 56px; letter-spacing: -.025em; text-wrap: balance; }
  .mst-foot { flex-wrap: nowrap; align-items: center; gap: 14px; padding: 0; }
  .mst-dots { flex: none; padding: 0; }
  .mst-dot { width: 10px; height: 10px; }
  .mst-dot.is-active { width: 26px; }
  .mst-prev { width: 60px; height: 60px; margin-left: auto; border-radius: var(--r-20); }
  .mst-next { flex: none; min-height: 60px; padding: 0 32px; border-radius: var(--r-20); font-size: 18px; }
}

/* ---------- Подробный отчёт: шторка телефона (phone-27, 28) и окно 480 компьютера (desktop-19, 20) ---------- */
.pay, .pay-main { display: flex; flex-direction: column; gap: 14px; }
.pay-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--c-ask-bg);
  color: var(--c-ask-text);
  font-size: 12px;
  font-weight: 600;
  line-height: normal;
}
/* Справа место под крестик оболочки */
.pay-head { display: flex; align-items: baseline; gap: 10px; padding-right: 40px; font-size: 24px; font-weight: 700; line-height: normal; }
.pay-title { letter-spacing: -.01em; }
.pay-price { margin-left: auto; white-space: nowrap; }
.pay-text { font-size: 15px; line-height: 21px; color: var(--c-muted-4); }
.pay-list { padding: 0 16px; border-radius: var(--r-20); background: var(--c-surface); }
/* Высота строки — без линии между строками, как в макете */
.pay-list > li { box-sizing: content-box; display: flex; align-items: center; gap: 10px; min-height: 54px; font-size: 15px; line-height: normal; }
.pay-list > li + li { border-top: 1px solid var(--c-border-2); }
.pay-list .ic { color: var(--c-ok); }
.pay-fine { font-size: 13px; line-height: 18px; color: var(--c-text-2); }
.pay-btn { min-height: 54px; }
/* После оплаты всё по центру; от текста до кнопки 20 px — в макете 10 зазора и 10 отступа кнопки */
.pay-paid { gap: 20px; padding: 16px 8px 4px; }
.pay-done { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.pay-done-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--c-ok-bg);
  color: var(--c-ok);
}
.pay-done-title { margin-top: 4px; font-size: 22px; font-weight: 700; line-height: normal; }
.pay-done-text { font-size: 14px; line-height: normal; color: var(--c-text-2); }

@media (min-width: 1024px) {
  .pay-head { padding-right: 44px; }
  .pay-title { letter-spacing: 0; }
  .pay-list > li { min-height: 52px; }
  .pay-fine { line-height: normal; }
  .pay-paid { padding: 12px 8px 0; }
}

/* ---------- «Поделиться»: ссылка для копирования. Макета нет — по образцу шторки оплаты ---------- */
.share { display: flex; flex-direction: column; gap: 14px; }
.share-title { padding-right: 40px; font-size: 24px; font-weight: 700; line-height: normal; letter-spacing: -.01em; }
.share-label { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 21px; color: var(--c-muted-4); }
/* Шрифт поля 16 px: меньший iOS увеличивает при фокусе, а поле получает фокус сразу при открытии */
.share-field {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-16);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 16px;
}
.share-hint { font-size: 13px; line-height: 18px; color: var(--c-text-2); }
/* Пустая подсказка не занимает места, но узел живой области остаётся в документе: иначе её не прочитают */
.share-hint:empty { margin-top: -14px; }

@media (min-width: 1024px) {
  .share-title { padding-right: 44px; }
}
