/* Общая шапка всех страниц — главной и разделов (одна разметка: headerHtml в server.mjs).
   Шапка и плашка «Показ» лежат поверх акварельной полосы страницы, полоса начинается от самого верха.
   При прокрутке (body.scrolled) и на страницах без полосы (body.no-art) шапка — бумажная.
   Высоты плашки и шапки меряет shapka.js и кладёт в --note и --hdr. */
.demo-note { position: fixed; top: 0; left: 0; right: 0; z-index: 41; margin: 0; padding: 5px 16px; text-align: center; font: 12px/1.3 'Manrope', system-ui, sans-serif; color: #4f4740; background: transparent; text-shadow: 0 0 8px #f6f8f5, 0 0 3px #f6f8f5, 0 0 1px #f6f8f5; pointer-events: none; transition: background-color .3s; }
header.site-header { position: fixed; top: var(--note, 24px); left: 0; right: 0; z-index: 40; display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; margin: 0; padding: 4px 5.6vw 10px; border: 0; background: transparent; -webkit-mask: none; mask: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-family: 'Manrope', system-ui, sans-serif; transition: background-color .3s; }
.site-header .brand { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 13px; letter-spacing: 0; white-space: nowrap; color: #22392d; text-decoration: none; }
.brand-ring { width: 44px; height: 48px; flex: none; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 66'><path d='M22.5 14.8A22 22 0 1 0 41.8 15.6' fill='none' stroke='%23173d35' stroke-width='5.2' stroke-linecap='round'/><path d='M12 4l1.6 4.4L18 10l-4.4 1.6L12 16l-1.6-4.4L6 10l4.4-1.6z' fill='%23e0674f'/></svg>") center/contain no-repeat; }
.brand-text { font: 400 26px/1 'Manrope', system-ui, sans-serif; color: #22392d; letter-spacing: -.01em; }
.brand-text small { display: block; margin-top: 4px; font-size: 12px; letter-spacing: 0; color: #4f4740; }
.site-header nav { display: flex; order: 0; width: auto; justify-content: flex-start; gap: 22px; font-size: .875rem; }
.site-header nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0; font-size: .875rem; color: #22392d; text-decoration: none; }
.site-header nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s cubic-bezier(.22, .61, .36, 1); }
.site-header nav a:hover::after { transform: scaleX(1); }
.site-header .brand-text, .site-header nav a { text-shadow: 0 0 12px #f6f8f5, 0 0 4px #f6f8f5, 0 0 2px #f6f8f5; }
/* бумажная шапка: при прокрутке и на страницах без полосы-картинки */
body.scrolled .demo-note, body.no-art .demo-note { background: #e3e9e1; text-shadow: none; }
body.scrolled header.site-header, body.no-art header.site-header { padding-bottom: 20px; background: radial-gradient(60% 140% at 8% 0, #dfe8dd99, transparent 60%), radial-gradient(50% 160% at 95% 0, #dfe5ec99, transparent 60%), #e6ece7 var(--tex); -webkit-mask: var(--torn-mask); mask: var(--torn-mask); }
body.scrolled .site-header .brand-text, body.scrolled .site-header nav a, body.no-art .site-header .brand-text, body.no-art .site-header nav a { text-shadow: none; }
body.no-art { padding-top: var(--hdr, 110px); }
@media (max-width: 1100px) { .site-header nav { display: none; } }
@media (max-width: 520px) {
  header.site-header { padding: 4px 16px 10px; gap: 12px; }
  .site-header .brand { gap: 8px; min-width: 0; }
  .brand-ring { width: 36px; height: 40px; }
  .brand-text { font-size: 22px; }
  .brand-text small { max-width: 9.5em; white-space: normal; font-size: 12px; line-height: 1.2; }
}
.demo-note a { pointer-events: auto; }
/* Помощник один — Лапка (виджет PsyAdmin под её именем и в стиле сайта, тема ниже). Вход — плавающая кнопка «Лапка»; своя круглая кнопка виджета не нужна */
[data-psy-widget] .psy-widget-trigger { display: none !important; }
/* Телефон: переключатель вида в плашке — пальцем, не меньше 44 точек */
@media (max-width: 760px) { .demo-note a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; } }
/* Шапка над полосой-картинкой раздела: мягкая бумажная подложка сверху, чтобы меню и логотип не тонули в рисунке */
.page-head::before { content: ""; position: absolute; inset: 0 0 auto; height: calc(var(--hdr, 110px) + 40px); background: linear-gradient(#f6f8f5f0 0, #f6f8f5c0 55%, #f6f8f500); pointer-events: none; }
.page-head > * { position: relative; }

/* ── Лапка: плавающая кнопка и окно помощника в стиле сайта ─────────────────
   Окно — виджет PsyAdmin (общий код, его не правим): здесь только тема поверх его классов и переменных.
   Бумага, зелёные чернила, заголовок Prata/Georgia, кнопки как «Записаться на консультацию»; облачка в палитре картины. */
.lapka-knopka { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 20px 8px 8px; border: 0; border-radius: 999px; background: #22392d; color: #fff; font: 600 15px/1 'Manrope', system-ui, sans-serif; box-shadow: 0 18px 40px -16px rgba(16, 41, 30, .8); cursor: pointer; transition: transform .3s, opacity .3s; }
.lapka-knopka img { width: 40px; height: 40px; border-radius: 50%; background: #e3e9e1; object-fit: cover; }
.lapka-knopka:hover { transform: translateY(-2px); }
.lapka-knopka:focus-visible { outline: 3px solid #a8742a; outline-offset: 3px; }

html body .psy-widget { --psy-widget-primary: #22392d; --psy-widget-primary-hover: #2f5a45; --psy-widget-primary-soft: #e3e9e1; --psy-widget-primary-border: #cbd6d0; --psy-widget-primary-focus: #d9c6a2; font-family: 'Manrope', system-ui, sans-serif; color: #22392d; }
html body .psy-widget .psy-widget-panel { background: #f6f8f5; border: 1px solid #cbd6d0; border-radius: 10px; box-shadow: 0 24px 60px -24px rgba(16, 41, 30, .55); color: #22392d; }
html body .psy-widget .psy-widget-head { background: #f6f8f5; border-bottom: 1px solid #cbd6d0; box-shadow: none; }
html body .psy-widget .psy-widget-head b { display: flex; align-items: center; gap: 10px; font: 400 22px/1.1 'Prata', Georgia, serif; color: #22392d; }
html body .psy-widget .psy-widget-head .lapka-ava { width: 38px; height: 38px; border-radius: 50%; background: #e3e9e1; object-fit: cover; flex: none; }
html body .psy-widget .psy-widget-head span { color: #5a6b63; font-size: 12px; }
/* крестик, «на весь экран» и микрофон — как у окон направлений: круг 44×44, бумага, тонкая рамка */
html body .psy-widget .psy-widget-close, html body .psy-widget .psy-widget-fullscreen, html body .psy-widget .psy-widget-mic { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0 !important; border: 1px solid #cbd6d0 !important; border-radius: 50%; background: #f6f8f5 !important; color: #22392d !important; box-shadow: none; }
html body .psy-widget .psy-widget-close { font: 26px/1 Georgia, serif; }
@media (hover: hover) and (pointer: fine) { html body .psy-widget .psy-widget-close:hover, html body .psy-widget .psy-widget-fullscreen:hover, html body .psy-widget .psy-widget-mic:hover { border-color: #2f5a45 !important; background: #f6f8f5 !important; color: #22392d !important; box-shadow: none; transform: none; } }
html body .psy-widget .psy-widget-mic[aria-pressed="true"], html body .psy-widget .psy-widget-mic[data-mode="mute"] { background: #22392d !important; border-color: #22392d !important; color: #fff !important; }
html body .psy-widget .psy-widget-voice-preview-stop { border-color: #cbd6d0; background: #f6f8f5; color: #22392d; }
html body .psy-widget .psy-widget-evaluation { background: #eef2ee; border-bottom: 1px solid #cbd6d0; }
html body .psy-widget .psy-widget-evaluation label { color: #2f5a45; }
html body .psy-widget .psy-widget-evaluation-select, html body .psy-widget .psy-widget-form input, html body .psy-widget .psy-widget-handoff input, html body .psy-widget .psy-widget-handoff textarea { border-color: #cbd6d0; border-radius: 6px; background: #fff; color: #22392d; }
/* облачка: Лапка — бумага с хвойным краем, человек — свинец Невы */
html body .psy-widget .psy-widget-message.assistant { background: #e3e9e1; color: #22392d; border-radius: 4px 14px 14px 14px; }
html body .psy-widget .psy-widget-message.user { background: #4f6878; color: #fff; border-radius: 14px 4px 14px 14px; }
html body .psy-widget .psy-widget-links a { color: #2f5a45; }
/* кнопки — как «Записаться на консультацию»: тёмно-зелёная пилюля; второстепенные — бумага с рамкой */
html body .psy-widget .psy-widget-form button:not(.psy-widget-mic), html body .psy-widget .psy-widget-handoff button, html body .psy-widget .psy-widget-booking, html body .psy-widget .psy-widget-links .psy-widget-action { border-radius: 999px; background: #22392d; color: #fff; border: 1px solid #22392d; font-weight: 600; }
html body .psy-widget .psy-widget-handoff-toggle, html body .psy-widget .psy-widget-booking-secondary, html body .psy-widget .psy-widget-followup-buttons > button, html body .psy-widget .psy-widget-followup-buttons > a { border-radius: 999px; border: 1px solid #cbd6d0; background: #f6f8f5; color: #22392d; font-weight: 600; }
html body .psy-widget .psy-widget-payment { border-radius: 999px; border: 1px solid #a8742a; background: #f6f8f5; color: #22392d; }
html body .psy-widget .psy-widget-payment small { color: #5a6b63; }
html body .psy-widget .psy-widget-handoff { background: #eef2ee; }
html body .psy-widget .psy-widget-form { background: #f6f8f5; border-top: 1px solid #cbd6d0; }
/* Компьютер: Лапка — плавающее окно поверх страницы справа внизу, над своей кнопкой; страница не сдвигается и не темнеет. */
@media (min-width: 761px) {
  html body .psy-widget:not([data-fullscreen="true"]) .psy-widget-panel { top: auto; left: auto; right: 22px; bottom: 90px; width: min(400px, calc(100vw - 44px)); height: min(600px, calc(100dvh - 110px)); max-height: none; }
}
/* Телефон: шторка снизу во всю ширину */
@media (max-width: 760px) {
  html body .psy-widget:not([data-fullscreen="true"]) .psy-widget-panel { left: 0; right: 0; bottom: 0; width: 100%; height: min(86dvh, 720px); border-radius: 16px 16px 0 0; border-bottom: 0; }
  .lapka-knopka { right: 16px; bottom: 16px; }
}
/* Лапка: «Остановить голос» — только пока звучит ответ; частые вопросы — подсказками, список — по «Ещё вопросы». */
html body .psy-widget:not([data-voice-playing="true"]) .psy-widget-voice-preview-stop { display: none; }
html body .psy-widget:not(.lapka-spisok) .psy-widget-evaluation { display: none; }
html body .psy-widget .psy-widget-head span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lapka-podskazki { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 16px 16px; }
.lapka-podskazki button { min-height: 44px; padding: 8px 14px; border: 1px solid #cbd6d0; border-radius: 999px; background: #f6f8f5; color: #22392d; font: 500 14px/1.25 'Manrope', system-ui, sans-serif; text-align: left; cursor: pointer; }
.lapka-podskazki button:hover { border-color: #2f5a45; }
.lapka-podskazki .lapka-esche { border-style: dashed; color: #2f5a45; }
/* «Остановить голос» — круглый значок 44×44 рядом с крестиком (текст не влезал и выталкивал крестик за край окна) */
html body .psy-widget .psy-widget-voice-preview-stop { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; font-size: 0; display: inline-grid; place-items: center; }
html body .psy-widget .psy-widget-voice-preview-stop::before { content: ""; width: 12px; height: 12px; border-radius: 2px; background: #22392d; }
html body .psy-widget .psy-widget-head > :first-child { min-width: 0; flex: 1 1 auto; }
html body .psy-widget .psy-widget-head { flex-wrap: nowrap; }
@media (max-width: 760px) { html body .psy-widget .psy-widget-head span { white-space: normal; } }

/* Окно оплаты (oplata.js) — на всех страницах, поэтому здесь, а не в styles.css главной. */
.payment-dialog { width: min(560px, calc(100vw - 32px)); max-width: none; border: 0; border-radius: 22px; padding: 18px 20px 20px; box-shadow: 0 24px 60px -28px rgba(25, 41, 68, .35); font-family: 'Manrope', system-ui, sans-serif; color: #22392d; background: #fbfcfa; }
.payment-dialog::backdrop { background: rgba(25, 41, 68, .55); }
.payment-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.payment-close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #e3e9e1; color: #22392d; font-size: 22px; cursor: pointer; }
.payment-title { margin: 0 0 4px; font: 400 22px/1.2 'Prata', Georgia, serif; }
.payment-price { margin: 0 0 10px; font-weight: 700; font-size: 18px; }
.payment-conditions { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: #4b5d55; }
.payment-consent { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: 14px; }
.payment-consent input { margin-top: 4px; width: 20px; height: 20px; }
.payment-consent a { text-decoration: underline; }
.payment-dialog .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 22px; border-radius: 999px; background: #22392d; color: #fff; text-decoration: none; font-weight: 600; }
.payment-dialog .button[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.payment-note { margin: 10px 0 0; font-size: 13px; color: #4b5d55; }
