/* Окно поверх страницы (okno.js): встречи, программы, специалисты, статьи, направления. Бумага, как у всего сайта. */
html.okno-open { overflow: hidden; }
dialog.okno { width: min(940px, calc(100vw - 48px)); max-width: none; max-height: min(calc(100svh - 32px), 900px); margin: auto; padding: 0; border: 0; border-radius: 6px; overflow: hidden; color: #22392d; background: #f6f8f5 var(--tex); box-shadow: 0 30px 80px -30px rgba(16, 41, 30, .65); font: 16px/1.55 'Manrope', system-ui, sans-serif; transition: transform .2s; }
dialog.okno[open] { display: flex; flex-direction: column; }
/* Крестик — в своей полосе над содержимым: на картинку не залезает ни при каком размере и прокрутке. */
.okno-verh { flex: none; display: flex; justify-content: flex-end; align-items: center; height: 56px; padding: 6px 8px 0; position: relative; }
/* Прокручивается только тело, и только когда содержимое не влезает; полоса прокрутки — под полосой крестика. */
.okno-body { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 0 40px 36px; }
.okno-body > * { flex: none; }
/* Картинка сверху ужимается раньше, чем появляется прокрутка. */
.okno-body > .okno-cover.wide { flex: 0 1 auto; min-height: 110px; height: auto; }
dialog.okno[open] { animation: okno-in .32s cubic-bezier(.22, .61, .36, 1); }
@keyframes okno-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
dialog.okno::backdrop { background: rgba(16, 41, 30, .5); backdrop-filter: blur(2px); }
.okno-close { position: static; z-index: 2; width: 44px; height: 44px; margin: 0; border: 1px solid #cbd6d0; border-radius: 50%; background: #f6f8f5; color: #22392d; font: 28px/1 Georgia, serif; cursor: pointer; }
.okno-close:hover { border-color: #2f5a45; }
.okno-tag { display: inline-block; margin-bottom: 6px; font-size: 13px; font-weight: 600; letter-spacing: 0; color: #2f5a45; }
.okno-title { margin: 0 0 14px; font: 400 clamp(28px, 3.2vw, 40px)/1.08 'Prata', Georgia, serif; color: #22392d; }
.okno h3 { margin: 18px 0 8px; font: 400 21px/1.2 'Prata', Georgia, serif; }
.okno p { margin: 0 0 12px; }
.okno-lead { font-size: 18px; color: #4f4740; }
.okno-meta { font-size: 13px; color: #5a6b63; }
.okno-price { font: 400 24px/1.2 'Prata', Georgia, serif; }
.okno-cover { display: block; width: 100%; max-height: min(300px, 30svh); object-fit: cover; margin: 6px 0 14px; border-radius: 4px; }
.okno-cover.wide { max-height: 340px; margin: 0 0 18px; }
.okno-form { display: grid; gap: 10px; margin-top: 12px; }
.okno-form label { display: grid; gap: 4px; font-size: 14px; }
.okno-form input, .okno-form textarea { min-height: 44px; padding: 10px 12px; border: 1px solid #cbd6d0; border-radius: 4px; background: #fff; font: inherit; }
.okno-form textarea { min-height: 76px; }
.okno-form .okno-check { display: flex; gap: 10px; align-items: flex-start; }
.okno-form .okno-check input { min-height: 0; width: 20px; height: 20px; margin-top: 2px; }
.okno-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border: 1px solid #22392d; border-radius: 999px; background: #22392d; color: #fff; font: 600 15px/1.2 'Manrope', system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.okno-button.secondary { background: #f6f8f5; color: #22392d; }
.okno-button:disabled { opacity: .6; }
.okno-link { display: inline-flex; align-items: center; min-height: 44px; color: #2f5a45; font-weight: 600; }
.okno-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.okno-notice { padding: 14px 16px; background: #e3e9e1; border-radius: 6px; }
.okno-fail { color: #a63b26; }
.okno-person { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.okno-person img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.okno-prose img { max-width: 100%; height: auto; }
[data-okno] { cursor: pointer; }
/* Телефон: лист снизу во всю ширину; закрыть — крестик или потянуть вниз */
@media (max-width: 760px) {
  dialog.okno { width: 100vw; max-height: 92svh; margin: auto 0 0; padding: 0; border-radius: 16px 16px 0 0; }
  .okno-verh { height: 52px; padding: 4px 6px 0; }
  .okno-body { padding: 0 16px 28px; }
  dialog.okno[open] { animation: okno-up .3s cubic-bezier(.22, .61, .36, 1); }
  @keyframes okno-up { from { transform: translateY(40%); } }
  .okno-verh::before { content: ""; position: absolute; left: 50%; top: 8px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #cbd6d0; }

  .okno-person { grid-template-columns: 1fr; gap: 18px; }
  .okno-person img { max-width: 220px; }
  .okno-cover, .okno-cover.wide { max-height: 220px; }
  .okno-body > .okno-cover.wide { min-height: 80px; }
}
/* Морф карточка → окно (okno.js): 300 мс, своё появление окна в это время выключено */
dialog.okno.morph { animation: none; }
::view-transition-group(okno) { animation-duration: .3s; animation-timing-function: cubic-bezier(.22, .61, .36, 1); }
::view-transition-old(okno), ::view-transition-new(okno) { height: 100%; object-fit: cover; overflow: hidden; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .3s; }

/* Низкий экран (телефон боком): компактнее, картинка ужимается сильнее — прокрутка только для длинного. */
@media (max-height: 500px) {
  .okno-verh { height: 48px; padding-top: 4px; }
  .okno-body { padding-bottom: 16px; }
  .okno-body > .okno-cover.wide { min-height: 72px; margin-bottom: 10px; }
  .okno-title { font-size: 24px; margin-bottom: 8px; }
  .okno p { margin-bottom: 8px; }
  .okno-cover { max-height: 30svh; }
}
/* Окно встречи и программы (одна схема): строка фактов, текст, одна главная кнопка «Записаться» с формой на месте. */
.okno-fakty { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; margin: 0 0 14px; font-size: 15px; line-height: 1.4; color: #4f4740; }
.okno-fakty > span:not(:last-child)::after { content: "·"; margin: 0 10px; color: #a8742a; }   /* точка — в конце строки, а не в начале следующей */
.okno-ved { display: inline-flex; align-items: center; gap: 8px; }
.okno-ved-foto { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; background: #e3e9e1; color: #22392d; font: 14px/1 Georgia, serif; flex: none; }
.okno-tekst p { max-width: 64ch; }
.okno-zapis { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 14px; }
.okno-zapis[hidden], .okno-form[hidden] { display: none; }
.okno-body > .okno-notice { margin-top: 12px; }
.okno-notice p:last-child { margin-bottom: 0; }
.okno-body > .okno-form { margin-top: 14px; max-width: 520px; }
/* Телефон: кнопка записи видна сразу — полоса прилипает к низу окна */
@media (max-width: 760px) {
  .okno-zapis { position: sticky; bottom: 0; z-index: 2; margin: 14px -16px -28px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #f6f8f5; border-top: 1px solid #cbd6d0; }
  .okno-fakty { font-size: 14px; }
}
/* Окна уравновешены (слово Сергея 23.11: «не куча букв слева, а справа пустота»).
   Шире 760: если сверху картинка — две колонки: слева картинка ~45% на высоту текста, справа заголовок, факты, текст, кнопки.
   Без картинки (статья) — текст колонкой ~65 знаков по центру окна. Уже 760 — как было: картинка сверху. */
@media (min-width: 761px) {
  .okno-body:has(> .okno-cover.wide) { display: grid; grid-template-columns: 45% minmax(0, 1fr); column-gap: 36px; row-gap: 0; align-content: start; }
  .okno-body:has(> .okno-cover.wide) > * { grid-column: 2; }
  .okno-body:has(> .okno-cover.wide) > .okno-cover.wide { grid-column: 1; grid-row: 1 / span 12; align-self: stretch; contain: size; width: 100%; height: 100%; min-height: 280px; max-height: none; margin: 0; border-radius: 6px; object-fit: cover; }
  .okno-body:has(> .okno-cover.wide) > .okno-tag { margin-top: 2px; }
  .okno-body:has(> .okno-cover.wide) .okno-tekst p { max-width: none; }
  .okno-body:not(:has(> .okno-cover.wide)) > :not(.okno-person) { width: min(100%, 66ch); margin-left: auto; margin-right: auto; }
}
@media (min-width: 761px) and (max-height: 500px) {
  .okno-body:has(> .okno-cover.wide) > .okno-cover.wide { min-height: 160px; }
}
/* Специалист: текст по вертикали в середине рядом с фото — без пустоты справа под текстом */
@media (min-width: 761px) { .okno-person { align-items: center; } }
/* Окно специалиста уже: фото и короткий текст рядом, без пустого поля справа */
@media (min-width: 761px) { dialog.okno:has(.okno-person) { width: min(760px, calc(100vw - 48px)); } }
/* Статья (длинный текст): картинка не тянется на всю длину — 3:4 у начала текста и прилипает при прокрутке */
@media (min-width: 761px) { .okno-body:has(> .okno-prose):has(> .okno-cover.wide) > .okno-cover.wide { align-self: start; height: auto; min-height: 0; aspect-ratio: 3 / 4; contain: none; position: sticky; top: 0; } }
/* Типографика окон: факты — межстрочный 1,55; текст — не шире ~66 знаков */
.okno-fakty { line-height: 1.55; }
.okno-tekst p, .okno-prose p, .okno-prose li { max-width: 60ch; }
.okno-prose .spisok-tire { padding-left: 1.2em; list-style: "— "; }
/* Окно отзыва: одна кавычка, текст ~60 знаков в строке, имя и роль */
.okno-otzyv { margin: 0 auto; max-width: 62ch; }
.okno-kavychka { display: block; height: 34px; font: 400 64px/1 'Prata', Georgia, serif; color: #2f5a45; }
.okno-otzyv blockquote { margin: 0; font-size: 17px; line-height: 1.6; }
.okno-otzyv figcaption { margin-top: 16px; padding-top: 12px; border-top: 1px solid #cbd6d0; }
.okno-otzyv figcaption b { display: block; }
.okno-otzyv figcaption span { color: #5a6b63; font-size: 14px; }
