/* ==========================================================================
   /tools/kogda-delat-test-na-beremennost — через сколько тест покажет беременность
   Блоки статьи и результата — общие с «Семейной выплатой» (sv-*), элементы формы —
   общие для инструментов (tool-form.css, tf-*): оба подключаются через CSS_DEPS.
   Здесь — коралловый акцент раздела «Беременность», даты, шкала по дням, таблицы.
   Шкала: зоны — один тон от светлого к тёмному (проверено validate_palette.js --ordinal),
   тексты — тёмно-коралловым #8a370f / #b24d1c (контраст на белом 8,0 и 5,3).
   ========================================================================== */
.pt-page {
  --tf-accent: #b24d1c;
  --tf-accent-soft: #fbe6d9;
  --tf-line: #efdccf;
  --tf-field: #fffaf6;
  --pt-ink-2: #6b5548;
  --pt-deep: #8a370f;
  --pt-track: #f6efe9;
  --pt-z0: #c4b8ad;
  --pt-z1: #e99360;
  --pt-z2: #c9581f;
  --pt-z3: #8a370f;
}

.pt-page [hidden] {
  display: none !important;
}

/* Фон шапки на компьютере: утренняя ванная, тест и календарь справа; текст по центру — под ним светлее */
.pt-page .sv-hero {
  background:
    radial-gradient(ellipse 60% 75% at 50% 50%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.55) 60%, rgba(251, 230, 217, 0.2) 100%),
    url("/assets/images/kogda-delat-test-na-beremennost-hero-bg.webp") center / cover no-repeat,
    linear-gradient(180deg, #ffffff 0%, #fbe6d9 100%) !important;
  border-bottom-color: #efdccf !important;
}

.pt-page .sv-hero .mb-hero-title span::after {
  background: linear-gradient(90deg, rgba(251, 230, 217, 0.9), rgba(178, 77, 28, 0.3));
}

/* три плашки первого экрана на телефоне — подпись всегда в одну строку */
.pt-page .th-pill {
  white-space: nowrap;
}

/* ---------- Форма ---------- */
.pt-form fieldset {
  box-sizing: border-box;
}

.pt-methods,
.pt-tests {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pt-tests {
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
}

/* «20–25 мМЕ/мл» не разрывать ни после «–», ни после «/» */
.pt-tests label {
  white-space: nowrap;
}

/* 640–899: пять кнопок теста в одну строку не помещаются — 3 + 2 */
@media (min-width: 640px) and (max-width: 899px) {
  .pt-tests {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .pt-tests label {
    grid-column: span 2;
  }
  .pt-tests label:nth-of-type(n+4) {
    grid-column: span 3;
  }
}

/* «Ложноположительным» в H2 на 320 px шире колонки — переносим по слогам, а без словаря переносов хотя бы рвём слово */
.pt-page .sv-article h2 {
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}

/* «Ещё по теме» — 4 карточки: по 4 в ряд или 2 × 2, без одинокой четвёртой */
@media (min-width: 640px) {
  .pt-page .sv-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .pt-page .sv-related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ЭКО: свежий перенос / криоперенос / не знаю */
.pt-kinds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pt-sub {
  margin-top: 16px;
}

.pt-page .pt-gap {
  margin-top: 14px;
}

.pt-input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--tf-line);
  border-radius: 12px;
  background: #fff;
  font: 600 16px/1 "Nunito", sans-serif;
  color: var(--main-bg-color);
  -webkit-appearance: none;
  appearance: none;
}

.pt-input::-webkit-date-and-time-value {
  text-align: left;
}

.pt-input::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}

.pt-input:focus {
  outline: none;
  border-color: var(--tf-accent);
  box-shadow: 0 0 0 4px var(--tf-accent-soft);
}

.pt-input[aria-invalid="true"] {
  border-color: #c2412f;
}

.pt-page #pt-test-note:empty {
  display: none;
}

/* ---------- Выпадающий список (длина цикла) ---------- */
.pt-select {
  position: relative;
}

.pt-select select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  border: 1.5px solid var(--tf-line);
  border-radius: 12px;
  background: var(--tf-field);
  font: 600 16px/1 "Nunito", sans-serif;
  color: var(--main-bg-color);
  -webkit-appearance: none;
  appearance: none;
}

.pt-select .tf-combo-btn {
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 12px;
  background: #fff;
}

.pt-select .tf-combo-value {
  font: 600 16px/1.2 "Nunito", sans-serif;
  color: var(--main-bg-color);
}

.pt-select .tf-combo-list li {
  font-variant-numeric: tabular-nums;
}

.pt-select .tf-combo-panel {
  max-height: 300px;
}

/* шторка на телефоне лежит в body, вне .pt-page — акцент страницы задаём ей самой */
.pt-combo-panel {
  --tf-accent: #b24d1c;
  --tf-accent-soft: #fbe6d9;
  --tf-line: #efdccf;
}

.pt-combo-panel .tf-combo-list li.is-active {
  background: #fdf1ea;
}

.pt-page .pt-error {
  margin: 10px 0 12px !important;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fdecea;
  font: 700 14px/1.4 "Nunito", sans-serif !important;
  color: #9b2c22;
}

.pt-page .pt-error:focus {
  outline: none;
}

/* ---------- Результат ---------- */
.pt-card,
.pt-extra {
  padding: 20px 22px;
  border: 1px solid var(--tf-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.pt-page .pt-term {
  margin: 0 0 8px !important;
  font: 700 13.5px/1.45 "Nunito", sans-serif !important;
  color: var(--pt-ink-2);
}

.pt-page .pt-title {
  margin: 0 !important;
  font: 800 22px/1.25 "Montserrat", sans-serif !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  color: var(--main-bg-color);
}

.pt-page .pt-title:focus {
  outline: none;
}

.pt-page .pt-extra .sv-block-title {
  margin: 0 0 10px !important;
  text-transform: none;
}

.pt-page .pt-extra p {
  margin: 10px 0 0 !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: var(--dark-text-color);
}

/* даты: метка с точкой цвета зоны шкалы, дата, подпись строкой ниже */
.pt-page .pt-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.pt-page .pt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
  margin: 0 !important;
  padding: 12px 14px !important;
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  background: var(--tf-field);
  list-style: none;
}

.pt-row.is-now {
  border-color: var(--tf-accent);
  background: var(--tf-accent-soft);
}

.pt-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 700 14px/1.3 "Montserrat", sans-serif;
  color: var(--main-bg-color);
}

.pt-row-label::before {
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pt-z0);
}

.pt-row-first .pt-row-label::before { background: var(--pt-z1); }
.pt-row-likely .pt-row-label::before { background: var(--pt-z2); }
.pt-row-reliable .pt-row-label::before { background: var(--pt-z3); }
.pt-row-delay .pt-row-label::before,
.pt-row-clinic .pt-row-label::before { background: none; box-shadow: inset 0 0 0 2px var(--pt-ink-2); }

.pt-row-date {
  font: 800 18px/1.25 "Montserrat", sans-serif;
  white-space: nowrap;
  color: var(--pt-deep);
}

.pt-row-sub {
  flex-basis: 100%;
  font: 600 13px/1.4 "Nunito", sans-serif;
  color: var(--pt-ink-2);
}

/* «Сегодня»: крупный шанс на выбранном тесте */
.pt-tile {
  display: inline-block;
  margin-top: 6px;
  padding: 12px 16px;
  border: 1px solid var(--tf-line);
  border-radius: 14px;
  background: var(--tf-field);
}

.pt-tile span {
  display: block;
  font: 600 12.5px/1.3 "Nunito", sans-serif;
  color: var(--pt-ink-2);
}

.pt-tile b {
  display: block;
  margin-top: 4px;
  font: 800 26px/1.15 "Montserrat", sans-serif;
  letter-spacing: -0.01em;
  color: var(--pt-deep);
}

.pt-page .pt-today-line {
  margin: 0 0 6px !important;
  font: 700 14px/1.45 "Nunito", sans-serif !important;
  color: var(--pt-ink-2) !important;
}

.pt-page .pt-today-text {
  font-weight: 700;
  color: var(--main-bg-color) !important;
}

/* «Если тест отрицательный, повторите…» — мягкая подложка без полос и курсива */
.pt-page .pt-retest {
  margin-top: 14px !important;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--tf-accent-soft);
  font-weight: 700;
  color: var(--pt-deep) !important;
}

/* ---------- Шкала по дням ---------- */
.pt-scale {
  max-width: 760px;
  margin: 0;
}

.pt-page .pt-scale figcaption {
  margin: 0 0 10px;
  font: 600 13.5px/1.45 "Nunito", sans-serif;
  color: var(--pt-ink-2);
}

.pt-plot {
  position: relative;
  padding-top: 22px;
}

/* «сегодня» над столбиком: сдвиг на долю своей ширины не даёт подписи вылезти за края */
.pt-today-mark {
  position: absolute;
  top: 0;
  left: var(--x);
  transform: translateX(calc(var(--x) * -1));
  font: 800 12.5px/1.2 "Montserrat", sans-serif;
  white-space: nowrap;
  color: var(--pt-deep);
}

.pt-page .pt-bars {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 2px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
}

.pt-page .pt-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 118px;
  margin: 0 !important;
  padding: 0 0 20px !important;
  list-style: none;
}

/* дорожка столбика — на всю высоту, 100 % */
.pt-bar::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 20px;
  left: 0;
  border-radius: 4px 4px 0 0;
  background: var(--pt-track);
}

.pt-bar-fill {
  position: relative;
  display: block;
  height: var(--h);
  min-height: 2px;
  border-radius: 4px 4px 0 0;
  background: var(--pt-z0);
}

.pt-z1 .pt-bar-fill, .pt-sw.pt-z1 { background: var(--pt-z1); }
.pt-z2 .pt-bar-fill, .pt-sw.pt-z2 { background: var(--pt-z2); }
.pt-z3 .pt-bar-fill, .pt-sw.pt-z3 { background: var(--pt-z3); }

.pt-bar.is-today::before {
  background: var(--tf-accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--pt-deep);
}

.pt-bar-n {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  font: 600 11px/20px "Nunito", sans-serif;
  text-align: center;
  color: var(--pt-ink-2);
  font-variant-numeric: tabular-nums;
}

.pt-bar.is-today .pt-bar-n {
  font-weight: 800;
  color: var(--pt-deep);
}

.pt-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* подсказка при наведении: значение столбика (то же есть в таблице статьи) */
@media (hover: hover) {
  .pt-bar::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--main-bg-color);
    font: 700 12px/1.2 "Nunito", sans-serif;
    white-space: nowrap;
    color: #fff;
    opacity: 0;
    transform: translateX(-50%);
    pointer-events: none;
    transition: opacity 0.12s;
  }
  .pt-bar.is-start::after {
    left: 0;
    transform: none;
  }
  .pt-bar.is-end::after {
    right: 0;
    left: auto;
    transform: none;
  }
  .pt-bar:hover::after {
    opacity: 1;
  }
}

.pt-page .pt-axis {
  margin: 2px 0 0 !important;
  font: 600 12px/1.3 "Nunito", sans-serif !important;
  text-align: center;
  color: var(--pt-ink-2);
}

.pt-page .pt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 0 !important;
  padding: 0 !important;
  list-style: none;
}

.pt-page .pt-legend li {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: var(--pt-ink-2);
}

.pt-sw {
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* ---------- Списки ---------- */
.pt-page .pt-list {
  margin: 8px 0 12px !important;
  padding: 0 !important;
}

.pt-page .pt-list li {
  position: relative;
  margin: 0 0 8px !important;
  padding-left: 16px !important;
  font-size: 14.5px !important;
  line-height: 1.55 !important;
  list-style: none;
  color: var(--dark-text-color);
}

.pt-page .pt-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tf-accent);
}

.pt-page .pt-notes {
  margin: 14px 0 0 !important;
}

.pt-page .pt-notes li:last-child,
.pt-page .pt-extra .pt-list li:last-child {
  margin-bottom: 0 !important;
}

/* список в статье — тем же кеглем, что абзацы вокруг (MPF_GLOBAL: 20px, на узких 18px) */
.pt-page .sv-article .pt-list li {
  font-size: 20px !important;
  line-height: 1.7 !important;
}

.pt-page .pt-disclaimer {
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #5b6672;
}

/* ---------- Таблицы статьи ---------- */
.pt-table-wrap {
  margin: 16px 0 12px;
  overflow-x: auto;
  border: 1px solid var(--tf-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.pt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.pt-table th,
.pt-table td {
  padding: 10px 12px;
  text-align: right;
  border-bottom: 1px solid #f3e8df;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pt-table thead th {
  font: 700 12.5px/1.3 "Montserrat", sans-serif;
  color: #5e4a3e;
  background: #fbf3ed;
  white-space: normal;
}

.pt-table th:first-child,
.pt-table td:first-child {
  text-align: left;
}

.pt-table tbody th {
  font-weight: 700;
  color: var(--main-bg-color);
}

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

/* подпись таблицы — для скринридера, на экране её роль играет заголовок раздела */
.pt-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.pt-table .pt-t {
  text-align: left;
  white-space: normal;
}

/* «Пятидневный (бластоциста)» — переносим, иначе таблица ЭКО на 640 px шире колонки */
.pt-table-ivf tbody th {
  white-space: normal;
}

/* подписи, которые нужны только в карточках на телефоне; «меньше 1 %» там короче — «<1 %» */
.pt-m,
.pt-narrow {
  display: none;
}

.pt-page .pt-table-note {
  margin-top: -2px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  color: #5b6672;
}

/* Ссылки в тексте статьи: тёмное золото, контраст 5,5:1 (как у ХГЧ) */
.pt-page .sv-article a {
  color: #7a6000;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(122, 96, 0, 0.35);
  text-underline-offset: 3px;
}

.pt-page .sv-article a:hover {
  color: var(--main-bg-color);
  text-decoration-color: currentColor;
}

/* Примечание под источниками: строка с иконкой «i», как у маткапитала и ХГЧ */
.pt-page .sr-sources-note {
  display: flex;
  gap: 10px;
  margin: 18px 0 0 !important;
  padding: 16px 0 0 !important;
  border: 0 !important;
  border-top: 1px dashed #e6dfc6 !important;
  border-radius: 0 !important;
  background: none !important;
  font-style: normal !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  color: #6b6555;
}

.pt-page .sr-sources-note::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  background: var(--gold-color);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (width < 1100px) {
  .pt-page .sv-article .pt-list li {
    font-size: 18px !important;
  }
}

@media (max-width: 900px) {
  .pt-table th,
  .pt-table td {
    padding: 10px 8px;
  }
}

/* 640–767: шесть колонок таблицы по дням не помещаются с «меньше 1 %» — там уже «<1 %», как в карточках */
@media (max-width: 767px) {
  .pt-table .pt-narrow {
    display: inline;
  }
  .pt-table .pt-wide {
    display: none;
  }
}

/* заголовок на компьютере сразу в две строки — без сдвига вёрстки, когда догрузится Montserrat */
@media (min-width: 640px) {
  .pt-page .mb-hero-title span {
    display: block;
    color: var(--tf-accent); /* золотой общий #bda000 на светлом фоне шапки — контраст 1,7–2,5:1 */
  }
}

/* ---------- Телефон ---------- */
@media (max-width: 639px) {
  .pt-form {
    padding: 0 !important;
  }
  .pt-form .sv-form-sub {
    margin-bottom: 14px !important;
  }
  .pt-methods,
  .pt-tests,
  .pt-kinds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pt-tests label {
    padding-right: 6px;
    padding-left: 6px;
  }
  /* нечётное число кнопок: последняя («Не знаю») — на всю ширину */
  .pt-tests label:last-of-type,
  .pt-kinds label:last-of-type {
    grid-column: 1 / -1;
  }
  .pt-card {
    padding: 18px 16px;
  }
  .pt-extra {
    padding: 0;
    border: 0;
    background: none;
  }
  .pt-page .pt-rows {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .pt-row-date {
    font-size: 17px;
  }
  .pt-page section.sv-article,
  .pt-page section.sv-related,
  .pt-page section.faq-section,
  .pt-page section.sv-results {
    padding: 0 !important;
    margin: 0 0 30px !important;
  }
  .pt-page section.sr-sources-block {
    margin: 0 0 30px !important;
  }
  .pt-page .sv-results {
    gap: 12px;
  }
  .pt-page .calc-share {
    margin: 14px 0 26px;
  }
  .pt-page .sv-results > .th-flat {
    margin-top: 16px !important;
  }
  .pt-page .pt-bar {
    height: 104px;
  }
  /* таблицы статьи — карточками: заголовок и подпись строкой, ниже значения по типам теста */
  .pt-table,
  .pt-table tbody {
    display: block;
  }
  .pt-table thead {
    display: none;
  }
  .pt-table tr {
    display: grid;
    grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
    gap: 2px 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #f3e8df;
  }
  .pt-table tr:last-child {
    border-bottom: 0;
  }
  .pt-table td,
  .pt-table tbody th {
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    text-align: left !important;
    white-space: normal !important;
  }
  .pt-table .pt-m,
  .pt-table .pt-narrow {
    display: inline;
  }
  .pt-table .pt-wide {
    display: none;
  }
  .pt-table .pt-c-head {
    grid-column: 1 / -1;
    font: 700 14.5px/1.3 "Montserrat", sans-serif;
    color: var(--main-bg-color);
  }
  .pt-table .pt-c-sub {
    grid-column: 1 / -1;
    margin-bottom: 6px;
    font: 600 12.5px/1.35 "Nunito", sans-serif;
    color: var(--pt-ink-2);
  }
  /* подпись типа теста бывает в две строки — числа всё равно на одной линии, по низу */
  .pt-table .pt-c-val {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    font: 800 17px/1.2 "Montserrat", sans-serif;
    color: var(--pt-deep);
  }
  /* подпись типа теста — строкой над числом */
  .pt-table .pt-c-val > .pt-m {
    display: block;
    margin-bottom: 2px;
    font: 700 11.5px/1.25 "Nunito", sans-serif;
    color: var(--pt-ink-2);
  }
}
