/*
 * Sun Clinic — App Shell (режим установленного приложения / PWA).
 *
 * Активен ТОЛЬКО когда на <html> висит класс .pwa-app (его ставит app-shell.js
 * при display-mode: standalone или в превью-режиме). В обычном браузере файл
 * инертен — ни одного правила не применяется.
 *
 * Задача: спрятать «сайтовую» обвязку (шапка/меню/футер/куки) и показать
 * аккуратную оболочку-приложение: верхняя шапка (профиль + пациенты) и нижние
 * вкладки (Главная/Прайс/Врачи/Запись/ЛК).
 */

:root.pwa-app {
  --app-accent: #F25C19;
  --app-accent-strong: #d8490f;              /* press/hover акцента */
  --app-accent-soft: rgba(242, 92, 25, 0.10);
  --app-bg: #f3f1ee;
  --app-surface: #ffffff;
  --app-surface-2: #faf8f5;                  /* второй нейтральный слой (иконки, вторичные кнопки) */
  --app-text: #16181d;                       /* глубже — чётче на белом */
  /* #5a6b73 на белом ≈ 5.2:1 — проходит WCAG AA для мелкого текста. */
  --app-muted: #5a6b73;
  --app-line: #eceae5;
  --app-line-soft: #f1efeb;
  --app-header-h: 54px;
  --app-tabbar-h: 60px;
  --app-radius: 18px;
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Фирменный шрифт сайта (GothamPro уже загружен страницей) — вместо системного. */
  --app-font: "GothamPro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  /* Мягкая многослойная глубина вместо плоских рамок. */
  --app-shadow-card: 0 1px 2px rgba(18, 20, 26, 0.04), 0 12px 30px -16px rgba(18, 20, 26, 0.20);
  --app-shadow-bar: 0 6px 22px -14px rgba(18, 20, 26, 0.28);
  --app-shadow-pop: 0 18px 44px -18px rgba(18, 20, 26, 0.32);
  --app-ease: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out, без отскока */
}

/* ── Прячем сайтовую обвязку ─────────────────────────────────────────────── */
:root.pwa-app .vc-header,
:root.pwa-app footer.lidbox-footer,
:root.pwa-app .cookie-alert,
:root.pwa-app .footer-botton-nav,
:root.pwa-app .js-open-modal[data-name="callbackModal"],
:root.pwa-app .vc-page-title-wrapper,
:root.pwa-app .vc-page-head,
/* Плавающие маркетинговые виджеты сайта (появляются при загрузке, часто зелёные):
   «Записаться/Позвонить» и всплывашка подписки на канал МАКС. В приложении лишние. */
:root.pwa-app .cli-connect,
:root.pwa-app .v10-max-floating-popup {
  display: none !important;
}

/* Освобождаем место под фикс-бары. Учитываем «чёлку» и home-indicator iPhone. */
:root.pwa-app body.vc-body,
:root.pwa-app body {
  padding-top: calc(var(--app-header-h) + var(--app-safe-top)) !important;
  padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)) !important;
  background: var(--app-bg);
}

/* Воздух между шапкой и контентом страницы. Мы прячем заголовок-крошки
 * (.vc-page-head), из-за чего первый блок — на прайсе это строка поиска —
 * оказывался вплотную к шапке и «прилипал» к ней (заказчик 20.07.2026).
 * `.vc-main` есть на всех контентных страницах сайта, поэтому отступ выходит
 * одинаковым и на прайсе, и у врачей, и в услугах. */
:root.pwa-app .vc-main {
  padding-top: 12px;
}

/* В PWA нижняя вкладка «Запись» уже ведёт в тот же сценарий, поэтому ссылка
 * «К записи» в топбаре ЛК дублировала навигацию и растягивала пустую область. */
:root.pwa-app #app .cabinet__topbar .link-btn { display: none !important; }
:root.pwa-app #app .cabinet__topbar {
  height: 48px !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* SPA записи/ЛК держат СВОЙ прилипший нижний бар (кнопка «Продолжить»).
 * Наши вкладки его перекрывали — поднимаем его ровно над вкладками, а место
 * под ним добавляем к прокрутке SPA, чтобы контент не уходил под бар. */
:root.pwa-app .mobile-flow__cta-bar {
  bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)) !important;
}
:root.pwa-app .mobile-flow,
:root.pwa-app .mobile-flow__body {
  padding-bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)) !important;
}

/* Bottom-sheet записи (выбор специальности, врача по ФИО, филиала). Шторка не
 * fixed — она прижата к низу подложки `inset: 0`, а наши вкладки с бо́льшим
 * z-index рисуются поверх и съедали нижнюю часть списка (жалоба заказчика
 * 20.07.2026: при поиске врача по ФИО панель закрывала карточку с кнопкой
 * «Выбрать»). Укорачиваем подложку — шторка сама сядет ровно над вкладками.
 * Нижний safe-area-отступ внутри шторки при этом лишний: его площадь уже
 * занята панелью, иначе внизу зияет пустая полоса. */
:root.pwa-app .sheet-backdrop {
  bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)) !important;
}

/* В PWA возврат выполняет единая стрелка в верхней шапке. Внутренние
   breadcrumb личного кабинета не показываем на любых размерах экрана. */
:root.pwa-app .cabinet .breadcrumb { display: none !important; }
:root.pwa-app .sheet {
  max-height: min(86vh, 820px, 100%) !important;
  padding-bottom: 16px !important;
}

/* Полноэкранный модал детали услуги (Прайс, .sc-price-modal) открывается на
 * top:0 — фикс-шапка накрывала его заголовок/крестик, а вкладки — низ.
 * Вписываем модал ровно между нашей шапкой и вкладками. */
:root.pwa-app .sc-price-modal {
  top: calc(var(--app-header-h) + var(--app-safe-top)) !important;
  bottom: calc(var(--app-tabbar-h) + var(--app-safe-bottom)) !important;
  height: auto !important;
}
/* Внутренняя панель модала считает свою высоту от полного экрана и вылезала за
 * вкладки — низ описания и кнопки «Записаться/Позвонить» уходили под панель.
 * Ограничиваем её видимой областью между шапкой и вкладками. */
:root.pwa-app .sc-price-modal__dialog {
  max-height: calc(100vh - var(--app-header-h) - var(--app-tabbar-h) - var(--app-safe-top) - var(--app-safe-bottom) - 36px) !important;
}

/* ── Верхняя шапка приложения ────────────────────────────────────────────── */
.sun-app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: calc(var(--app-header-h) + var(--app-safe-top));
  padding: var(--app-safe-top) 14px 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--app-surface);
  border-bottom: 1px solid var(--app-line-soft);
  box-shadow: var(--app-shadow-bar);
  z-index: 2147482000;
  font-family: var(--app-font);
  /* iOS: см. пояснение у .sun-app-tabbar — промоушен в слой композитора. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.sun-app-header__brand {
  display: flex; align-items: center; gap: 9px;
  letter-spacing: -0.01em;
  font-weight: 700; font-size: 0.92rem; color: var(--app-text);
  white-space: nowrap; min-width: 0;
  text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sun-app-header__brand:active { opacity: 0.7; }
.sun-app-header__brand img { width: 26px; height: 26px; border-radius: 7px; flex: 0 0 auto; }
.sun-app-header__brand span { overflow: hidden; text-overflow: ellipsis; }
.sun-app-header__spacer { flex: 1; min-width: 8px; }

/* Кнопка «Назад» — в установленном приложении браузерной кнопки нет. Показывается
 * только на вложенных страницах (см. canGoBack в app-shell.js); на корнях вкладок
 * скрыта через [hidden], поэтому бренд не «прыгает» по горизонтали без нужды. */
.sun-app-back {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  margin-right: 2px;
  display: grid; place-items: center;
  border: 0; border-radius: 11px;
  background: var(--app-surface-2);
  color: var(--app-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.16s var(--app-ease), background 0.16s var(--app-ease);
}
.sun-app-back[hidden] { display: none; }
.sun-app-back svg { width: 19px; height: 19px; }
.sun-app-back:active { transform: scale(0.92); background: var(--app-line); }

/* ── Экран защиты запуска ─────────────────────────────────────────────── */
:root.pwa-lock-pending body > :not(.sun-app-lock) { visibility: hidden !important; }
.sun-app-lock {
  position: fixed; inset: 0; z-index: 2147483647;
  box-sizing: border-box; display: grid; place-items: center;
  padding: calc(18px + var(--app-safe-top)) 20px calc(16px + var(--app-safe-bottom));
  overflow-y: auto; background: linear-gradient(160deg, #fffaf6 0%, #f5f1ed 58%, #ffede3 100%);
  font-family: var(--app-font); color: var(--app-text);
}
.sun-app-lock__card {
  width: min(400px, 100%); box-sizing: border-box; padding: 22px 28px 20px;
  border: 1px solid rgba(242,92,25,.12); border-radius: 30px; background: rgba(255,255,255,.97);
  box-shadow: 0 24px 70px rgba(72,42,25,.14); text-align: center;
}
.sun-app-lock__brand { display:flex;align-items:center;justify-content:center;gap:9px;margin:0 0 16px;color:#3f332c;font-size:.95rem;font-weight:800;letter-spacing:.01em; }
.sun-app-lock__brand-logo { width:38px;height:38px;display:block;object-fit:contain;border-radius:10px;filter:drop-shadow(0 4px 7px rgba(145,91,31,.18)); }
.sun-app-lock__kicker { margin: 0 0 6px; color: var(--app-accent); font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.sun-app-lock h1 { margin: 0; font-size: clamp(1.65rem, 7vw, 2rem); line-height: 1.13; letter-spacing: -.025em; }
.sun-app-lock__lead { margin: 9px auto 14px; max-width: 34ch; color: var(--app-muted); font-size: .87rem; line-height: 1.4; }
.sun-app-lock__actions { display: grid; gap: 12px; }
.sun-app-lock button, .sun-app-lock input { box-sizing: border-box; width: 100%; min-height: 48px; border-radius: 13px; font: inherit; }
.sun-app-lock button { border: 0; padding: 0 16px; cursor: pointer; font-weight: 750; }
.sun-app-lock button:disabled { opacity: .55; cursor: wait; }
.sun-app-lock__bio { background: linear-gradient(180deg, #ff6a2c, var(--app-accent)); color: #fff; box-shadow: 0 8px 20px rgba(242,92,25,.2); }
.sun-app-lock__pinpad { display:grid;gap:8px; }
.sun-app-lock__dots { min-height:24px;display:flex;align-items:center;justify-content:center;gap:14px;margin:2px 0 0; }
.sun-app-lock__dots span { width:12px;height:12px;border-radius:50%;background:#e8e5e1;box-shadow:inset 0 0 0 1px rgba(60,49,42,.04);transition:transform .14s ease,background .14s ease; }
.sun-app-lock__dots span.is-filled { background:var(--app-accent);transform:scale(1.08); }
.sun-app-lock__pin-hint { min-height:18px;margin:0;color:var(--app-muted);font-size:.76rem;line-height:1.35; }
.sun-app-lock__keys { display:grid;grid-template-columns:repeat(3,1fr);gap:2px 18px;margin:2px auto 0;width:min(300px,100%); }
.sun-app-lock .sun-app-lock__key { width:100%;height:58px;min-height:58px;padding:0;border-radius:18px;background:transparent;color:var(--app-text);font-size:1.55rem;font-weight:600;box-shadow:none;-webkit-tap-highlight-color:transparent;transition:background .12s ease,transform .08s ease; }
.sun-app-lock .sun-app-lock__key:active { background:#fff0e8;transform:scale(.92); }
.sun-app-lock .sun-app-lock__key:disabled { opacity:.22;cursor:default; }
.sun-app-lock .sun-app-lock__key--icon { color:var(--app-accent); }
.sun-app-lock__key svg { width:29px;height:29px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle; }
.sun-app-lock__biometric-icon {
  position:relative;display:inline-grid;place-items:center;width:36px;height:36px;
  color:var(--app-accent);vertical-align:middle;isolation:isolate;
}
.sun-app-lock__biometric-icon svg {
  position:absolute;inset:0;width:36px;height:36px;fill:none;stroke:currentColor;
  stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;
  filter:drop-shadow(0 2px 5px rgba(242,92,25,.12));
}
.sun-app-lock__biometric-fingerprint { fill:currentColor !important;stroke:none !important; }
.sun-app-lock__biometric-face { animation:sun-bio-face 5.2s ease-in-out infinite; }
.sun-app-lock__biometric-fingerprint { animation:sun-bio-fingerprint 5.2s ease-in-out infinite; }
.sun-app-lock__biometric-scan {
  position:absolute;z-index:2;left:5px;right:5px;top:7px;height:1.5px;border-radius:2px;
  background:linear-gradient(90deg,transparent,currentColor 20%,currentColor 80%,transparent);
  box-shadow:0 0 7px rgba(242,92,25,.55);opacity:0;
  animation:sun-bio-scan 5.2s ease-in-out infinite;
}
@keyframes sun-bio-face {
  0%,39% { opacity:1;transform:scale(1); }
  47%,91% { opacity:0;transform:scale(.82) rotate(-4deg); }
  98%,100% { opacity:1;transform:scale(1); }
}
@keyframes sun-bio-fingerprint {
  0%,39% { opacity:0;transform:scale(.82) rotate(4deg); }
  47%,91% { opacity:1;transform:scale(1); }
  98%,100% { opacity:0;transform:scale(.82); }
}
@keyframes sun-bio-scan {
  0%,7% { opacity:0;transform:translateY(0); }
  12%,31% { opacity:.75; }
  37% { opacity:0;transform:translateY(20px); }
  47%,55% { opacity:0;transform:translateY(0); }
  60%,80% { opacity:.7; }
  88%,100% { opacity:0;transform:translateY(20px); }
}
@media (prefers-reduced-motion: reduce) {
  .sun-app-lock__biometric-face { animation:none;opacity:1; }
  .sun-app-lock__biometric-fingerprint,.sun-app-lock__biometric-scan { animation:none;opacity:0; }
}
.sun-app-lock .sun-app-lock__submit { min-height:46px;margin-top:3px;border-radius:14px;background:linear-gradient(180deg,#ff6c2e,var(--app-accent));color:#fff;box-shadow:0 8px 20px rgba(242,92,25,.18); }
.sun-app-lock .sun-app-lock__submit:disabled { opacity:.32;box-shadow:none;cursor:default; }
.sun-app-lock__error { margin: 13px 0 0; padding: 10px 12px; border-radius: 11px; background: #fff0ed; color: #a43729; font-size: .88rem; line-height: 1.4; }
.sun-app-lock__error[hidden] { display: none; }
.sun-app-lock__bio-note { margin: 2px 8px 0; color: #6b625b; font-size: .82rem; line-height: 1.4; }
.sun-app-lock__bio-note a { color: var(--app-accent); font-weight: 750; text-underline-offset: 2px; }
@media (max-height: 690px) {
  .sun-app-lock { place-items:start center;padding-top:calc(8px + var(--app-safe-top)); }
  .sun-app-lock__card { padding-top:16px;padding-bottom:14px; }
  .sun-app-lock__brand { margin-bottom:9px; }
  .sun-app-lock__lead { margin-bottom:8px; }
  .sun-app-lock .sun-app-lock__key { height:51px;min-height:51px; }
}

/* Профиль-чип (кнопка, открывает выпадашку пациентов) */
.sun-app-profile {
  display: flex; align-items: center; gap: 8px;
  max-width: 58vw;
  min-height: 44px;
  box-sizing: border-box;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--app-line);
  border-radius: 999px;
  background: var(--app-surface-2);
  font: inherit; cursor: pointer;
  color: var(--app-text);
  transition: transform 0.16s var(--app-ease), background 0.16s var(--app-ease);
  -webkit-tap-highlight-color: transparent;
}
.sun-app-profile:active { transform: scale(0.97); }
.sun-app-profile__avatar {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #ff7a3d, var(--app-accent));
  color: #fff;
  font-weight: 700; font-size: 0.82rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.sun-app-profile__meta { min-width: 0; display: grid; text-align: left; line-height: 1.1; }
.sun-app-profile__name {
  font-size: 0.84rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sun-app-profile__hint { font-size: 0.68rem; color: var(--app-muted); }
.sun-app-profile__chevron { flex: 0 0 auto; color: var(--app-muted); }

/* Гость — яркая кнопка-призыв «Войти» (была еле заметной серой плашкой). */
.sun-app-profile--guest {
  background: linear-gradient(180deg, #ff6a2c, var(--app-accent));
  border-color: transparent;
  color: #fff;
  gap: 7px;
  padding: 9px 17px;
  box-shadow: 0 6px 16px -6px rgba(242, 92, 25, 0.55);
}
.sun-app-profile--guest:active { transform: scale(0.97); }
.sun-app-profile__login { flex: 0 0 auto; }
.sun-app-profile__cta { font-size: 0.94rem; font-weight: 700; white-space: nowrap; }

/* Выпадашка выбора пациента (семейный доступ) */
.sun-app-switcher {
  position: fixed;
  top: calc(var(--app-header-h) + var(--app-safe-top) + 8px);
  right: 12px;
  width: min(326px, calc(100vw - 24px));
  background: var(--app-surface);
  border: 1px solid var(--app-line);
  border-radius: 18px;
  box-shadow: var(--app-shadow-pop);
  z-index: 2147482050;
  overflow: hidden;
  transform-origin: top right;
  font-family: var(--app-font);
}
.sun-app-switcher:not([hidden]) { animation: sunAppPop 0.2s var(--app-ease) both; }
.sun-app-switcher[hidden] { display: none; }
.sun-app-switcher__title {
  padding: 13px 15px 7px;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  color: var(--app-muted);
}
.sun-app-switcher__item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 12px 15px;
  border: 0; border-top: 1px solid var(--app-line-soft);
  background: var(--app-surface);
  font: inherit; text-align: left; color: var(--app-text);
  cursor: pointer;
  transition: background 0.14s var(--app-ease);
  -webkit-tap-highlight-color: transparent;
}
.sun-app-switcher__item:active { background: #f5f3f0; }
.sun-app-switcher__item.is-current { background: var(--app-accent-soft); }
.sun-app-switcher__ava {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 50%; display: grid; place-items: center;
  background: #edf0f2; color: #46545c; font-weight: 700; font-size: 0.8rem;
}
.sun-app-switcher__item.is-current .sun-app-switcher__ava {
  background: linear-gradient(145deg, #ff7a3d, var(--app-accent)); color: #fff;
}
.sun-app-switcher__meta { min-width: 0; display: grid; gap: 1px; line-height: 1.2; }
.sun-app-switcher__name { font-size: 0.9rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sun-app-switcher__sub { font-size: 0.74rem; color: var(--app-muted); }
.sun-app-switcher__check { margin-left: auto; color: var(--app-accent); }
.sun-app-switcher__contacts {
  display: grid; gap: 3px;
  padding: 10px 15px;
  border-top: 1px solid var(--app-line-soft);
  background: var(--app-surface-2);
  color: var(--app-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}
/* Пункт «Выйти» — отделён более заметной линией, иконка нейтральная. */
.sun-app-switcher__logout { border-top: 6px solid var(--app-surface-2); }
.sun-app-switcher__logout .sun-app-switcher__ava { background: #f0eeeb; color: var(--app-muted); }

/* Затемнение под выпадашкой */
.sun-app-scrim {
  position: fixed; inset: 0;
  background: rgba(16, 18, 24, 0.16);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
  z-index: 2147482040;
  animation: sunAppFade 0.18s ease both;
}
.sun-app-scrim[hidden] { display: none; }

/* ── Нижние вкладки ──────────────────────────────────────────────────────── */
.sun-app-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--app-tabbar-h) + var(--app-safe-bottom));
  padding-bottom: var(--app-safe-bottom);
  display: flex;
  background: var(--app-surface);
  border-top: 1px solid var(--app-line-soft);
  box-shadow: 0 -6px 22px -14px rgba(18, 20, 26, 0.28);
  z-index: 2147482000;
  font-family: var(--app-font);
  /* iOS: панель «уплывала» к середине экрана ВО ВРЕМЯ инерционной прокрутки и
   * возвращалась на место после остановки (жалоба заказчика 20.07.2026, iPhone).
   * WebKit при инерции обсчитывает position:fixed асинхронно от прокрутки, и
   * элемент дрейфует. Промоушен в отдельный слой композитора прибивает панель
   * к экрану — она перестаёт зависеть от перерисовки основного слоя.
   * Безопасно: внутри панели и шапки НЕТ вложенных position:fixed (свитчер
   * пациентов и затемнение висят на <body>) — иначе transform стал бы для них
   * containing block и сломал бы их позиционирование. */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.sun-app-tab {
  flex: 1 1 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--app-muted);
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.005em;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.16s var(--app-ease), transform 0.16s var(--app-ease);
}
.sun-app-tab__ico {
  display: grid; place-items: center;
  width: 40px; height: 28px; border-radius: 999px;
  transition: background 0.18s var(--app-ease);
}
.sun-app-tab svg { width: 24px; height: 24px; display: block; }
.sun-app-tab span { line-height: 1; }
.sun-app-tab.is-active { color: var(--app-accent); }
.sun-app-tab.is-active .sun-app-tab__ico { background: var(--app-accent-soft); }
.sun-app-tab:active { transform: scale(0.9); }

/* ── Куратор «Главная» (рисуется app-shell.js) ───────────────────────────── */
.sun-app-home {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px 8px;
  font-family: var(--app-font);
  color: var(--app-text);
}
.sun-app-quick {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}
.sun-app-quick h1 {
  margin: 2px 2px 0;
  font-size: 1.18rem;
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sun-app-quick a {
  color: var(--app-text);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.sun-app-quick__primary {
  min-height: 68px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 16px;
  color: #fff !important;
  background: linear-gradient(145deg, #ff7536, var(--app-accent));
  box-shadow: 0 14px 30px -16px rgba(197, 63, 7, 0.72);
}
.sun-app-quick__primary .sun-app-quick__ico { background: rgba(255,255,255,.17); color: #fff; }
.sun-app-quick__primary small {
  color: #fff;
  opacity: .92;
  text-shadow: 0 1px 1px rgba(122, 35, 0, .16);
}
.sun-app-quick__arrow { font-size: 1.8rem; line-height: 1; opacity: .9; }
.sun-app-quick__secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.sun-app-quick__secondary a {
  min-height: 72px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--app-line-soft);
  border-radius: 15px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow-card);
}
.sun-app-quick__ico {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--app-accent-soft);
  color: var(--app-accent);
}
.sun-app-quick__ico svg { width: 21px; height: 21px; }
.sun-app-quick strong,
.sun-app-quick small { display: block; }
.sun-app-quick strong { font-size: .86rem; line-height: 1.22; letter-spacing: -.012em; }
.sun-app-quick small { margin-top: 4px; color: #526168; font-size: .72rem; line-height: 1.32; }
/* Правило должно идти после общего small, иначе описание основной кнопки
 * наследует серый цвет и теряется на оранжевом фоне. */
.sun-app-quick__primary small { color: #fff; opacity: .94; }
.sun-app-quick a:active { transform: scale(.985); }
.sun-app-quick a:focus-visible,
.sun-app-home__details summary:focus-visible,
.sun-app-dot:focus-visible {
  outline: 3px solid rgba(242, 92, 25, .34);
  outline-offset: 2px;
}
.sun-app-section-title {
  margin: 0 2px 9px;
  color: var(--app-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.sun-app-home__card {
  background: var(--app-surface);
  border: 1px solid var(--app-line-soft);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-card);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.sun-app-home__card h2 {
  margin: 0 0 8px;
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700;
  color: var(--app-muted);
}
.sun-app-home__details { padding-top: 0; padding-bottom: 0; }
.sun-app-home__details summary {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.sun-app-home__details summary::-webkit-details-marker { display: none; }
.sun-app-details__chev { color: var(--app-muted); font-size: 1.15rem; transition: transform .18s var(--app-ease); }
.sun-app-home__details[open] .sun-app-details__chev { transform: rotate(180deg); }
.sun-app-contact {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 0;
  color: var(--app-text); text-decoration: none;
  border-top: 1px solid var(--app-line-soft);
  transition: transform 0.14s var(--app-ease);
  -webkit-tap-highlight-color: transparent;
}
.sun-app-contact:active { transform: scale(0.99); }
.sun-app-home__card .sun-app-contact:first-of-type { border-top: 0; padding-top: 2px; }
.sun-app-contact__ico {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 11px; display: grid; place-items: center;
  background: var(--app-accent-soft); color: var(--app-accent);
}
.sun-app-contact__meta { min-width: 0; display: grid; gap: 1px; line-height: 1.25; }
.sun-app-contact__label { font-size: 0.74rem; color: var(--app-muted); }
.sun-app-contact__value { font-size: 0.98rem; font-weight: 700; letter-spacing: -0.01em; }
/* Вторичная кнопка — акцент бережём для первичных действий, не размываем. */
.sun-app-home__director {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: calc(100% - 12px); box-sizing: border-box;
  min-height: 46px; margin: 14px 6px 16px;
  padding: 10px 14px;
  border: 1px solid var(--app-line); border-radius: 13px;
  background: var(--app-surface-2); color: var(--app-text);
  font: inherit; font-weight: 600; font-size: 0.9rem;
  text-decoration: none; cursor: pointer;
  transition: transform 0.14s var(--app-ease), background 0.14s var(--app-ease);
  -webkit-tap-highlight-color: transparent;
}
.sun-app-home__director svg { color: var(--app-accent); }
.sun-app-home__director:active { transform: scale(0.985); background: #f4f1ec; }

/* Форма обращения к руководителю. */
:root.sun-app-dialog-open { overflow: hidden !important; }
.sun-app-director-modal { position: fixed; inset: 0; z-index: 2147483600; font-family: var(--app-font); }
.sun-app-director-modal__backdrop { position: absolute; inset: 0; background: rgba(25, 28, 30, .48); backdrop-filter: blur(2px); }
.sun-app-director-modal__card {
  position: absolute; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom));
  max-width: 560px; max-height: calc(100dvh - 20px); margin: auto; overflow-y: auto;
  box-sizing: border-box; padding: 20px; border-radius: 24px; background: #fff;
  color: var(--app-text); box-shadow: 0 24px 64px rgba(20, 22, 24, .28);
  -webkit-overflow-scrolling: touch;
}
.sun-app-director-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sun-app-director-modal__eyebrow { color: var(--app-accent); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.sun-app-director-modal h2 { margin: 4px 0 0; font-size: 1.45rem; line-height: 1.12; letter-spacing: -.025em; }
.sun-app-director-modal__close {
  width: 44px; height: 44px; flex: 0 0 44px; margin: -7px -7px 0 0; border: 0; border-radius: 50%;
  background: var(--app-surface-2); color: #46545c; font: 300 30px/1 var(--app-font); cursor: pointer;
}
.sun-app-director-modal__lead { margin: 10px 0 17px; color: var(--app-muted); font-size: .9rem; line-height: 1.42; }
.sun-app-director-form { display: grid; gap: 14px; }
.sun-app-director-form > label:not(.sun-app-director-form__consent):not(.sun-app-director-form__trap) { display: grid; gap: 6px; font-size: .82rem; font-weight: 650; }
.sun-app-director-form input[type="text"], .sun-app-director-form textarea {
  width: 100%; min-height: 48px; box-sizing: border-box; padding: 12px 13px; border: 1px solid #cdd3d5;
  border-radius: 13px; background: #fff; color: var(--app-text); font: 400 16px/1.35 var(--app-font); outline: none;
}
.sun-app-director-form textarea { resize: vertical; min-height: 118px; }
.sun-app-director-form input:focus, .sun-app-director-form textarea:focus { border-color: var(--app-accent); box-shadow: 0 0 0 3px rgba(242, 92, 25, .13); }
.sun-app-director-form small { justify-self: end; margin-top: -3px; color: var(--app-muted); font-size: .72rem; font-weight: 400; }
.sun-app-director-form small b { font-weight: 500; }
.sun-app-director-form__consent {
  display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start;
  min-height: 44px; padding: 2px 0; cursor: pointer; user-select: none;
  font-size: .78rem; line-height: 1.4; color: #536169;
}
/* Собственный checkbox: глобальные стили основного сайта скрывали нативную
 * отметку checked внутри PWA, хотя поле фактически переключалось. */
.sun-app-director-form__consent input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 2px solid #b9c1c4 !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  opacity: 1 !important;
  cursor: pointer;
}
.sun-app-director-form__consent input[type="checkbox"]:checked {
  border-color: var(--app-accent) !important;
  background: var(--app-accent) !important;
}
.sun-app-director-form__consent input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 7px;
  height: 12px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.sun-app-director-form__consent input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(242, 92, 25, .24) !important;
  outline-offset: 2px;
}
.sun-app-director-form__consent a { color: #a94316; }
.sun-app-director-form__trap { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.sun-app-director-form__error { padding: 10px 12px; border-radius: 11px; background: #fff0ed; color: #9e2d1f; font-size: .82rem; line-height: 1.4; }
.sun-app-director-form__submit, .sun-app-director-success button {
  min-height: 50px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #ff6a2c, var(--app-accent));
  color: #fff; font: 700 .95rem/1 var(--app-font); box-shadow: 0 8px 20px -10px rgba(242, 92, 25, .65); cursor: pointer;
}
.sun-app-director-form__submit:disabled { opacity: .62; cursor: default; }
.sun-app-director-success { padding: 22px 2px 4px; text-align: center; }
.sun-app-director-success > span { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #e6f5ec; color: #22834d; font-size: 30px; }
.sun-app-director-success p { margin: 10px 0 22px; color: var(--app-muted); line-height: 1.45; }
.sun-app-director-success button { width: 100%; }
@media (min-width: 600px) { .sun-app-director-modal__card { top: 50%; bottom: auto; transform: translateY(-50%); } }

/* Карточка предложения включить push-уведомления (для залогиненных на «Главной»). */
.sun-app-push {
  background: var(--app-surface);
  border: 1px solid var(--app-line-soft);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow-card);
  padding: 16px 18px;
  margin-bottom: 14px;
  font-family: var(--app-font);
}
.sun-app-push__top { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 12px; }
.sun-app-push__ico {
  width: 40px; height: 40px; flex: 0 0 40px;
  border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(150deg, #ff7a3d, var(--app-accent)); color: #fff;
  box-shadow: 0 6px 14px -8px rgba(242, 92, 25, 0.7);
}
.sun-app-push__body { min-width: 0; display: grid; gap: 3px; }
.sun-app-push__body strong { font-size: 0.98rem; letter-spacing: -0.01em; color: var(--app-text); }
.sun-app-push__body span { font-size: 0.84rem; color: #46545c; line-height: 1.35; }
.sun-app-push__actions { display: flex; gap: 8px; }
.sun-app-push__btn {
  min-height: 42px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--app-line);
  background: var(--app-surface-2); color: var(--app-text);
  font: inherit; font-weight: 600; font-size: 0.86rem;
  white-space: nowrap; cursor: pointer;
  transition: transform 0.14s var(--app-ease);
  -webkit-tap-highlight-color: transparent;
}
.sun-app-push__btn:active { transform: scale(0.97); }
.sun-app-push__btn--primary {
  flex: 1; border-color: transparent; color: #fff;
  background: linear-gradient(180deg, #ff6a2c, var(--app-accent));
  box-shadow: 0 6px 14px -6px rgba(242, 92, 25, 0.5);
}
.sun-app-push__btn:disabled { opacity: 0.6; cursor: default; }
.sun-app-push--done { border-color: rgba(242, 92, 25, 0.28); }

/* Промо-слайдер «Главной» — как на сайте: полноширинные слайды (один на экран),
 * заголовок + текст поверх картинки, свайп, точки-пагинация. */
.sun-app-promos {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  margin: 0 -14px 10px;       /* в край экрана (у .sun-app-home паддинг 14px) */
  scrollbar-width: none;
}
.sun-app-promos::-webkit-scrollbar { display: none; }
.sun-app-promo {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: center;
  background: var(--app-surface);
  text-decoration: none;
}
/* Пропорция ровно как у мобильных слайдов сайта (780×1200) — картинка целиком. */
.sun-app-promo img {
  width: 100%;
  height: min(72vh, 460px);
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Заголовок + описание поверх светлого верха картинки (как на сайте). */
.sun-app-promo__cap {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 18px 20px 40px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.78) 52%, rgba(255, 255, 255, 0) 100%);
}
.sun-app-promo__cap h3 {
  margin: 0 0 5px;
  font-size: 1.28rem; font-weight: 700; line-height: 1.14;
  letter-spacing: -0.02em; text-wrap: balance;
  color: var(--app-text);
}
.sun-app-promo__cap p {
  margin: 0;
  font-size: 0.84rem; line-height: 1.38;
  color: #39474e; text-wrap: pretty;
}
/* Точки-пагинация */
.sun-app-dots {
  display: flex; justify-content: center; gap: 6px;
  margin: -4px 0 10px;
}
.sun-app-dot {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sun-app-dot::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: #c2bcb1;
  transition: width 0.2s ease, background 0.2s ease, border-radius 0.2s ease;
}
.sun-app-dot.is-active::before { background: var(--app-accent); width: 22px; border-radius: 4px; }

.sun-app-network {
  position: fixed;
  top: calc(var(--app-header-h) + var(--app-safe-top));
  left: 10px;
  right: 10px;
  z-index: 2147481990;
  padding: 9px 12px;
  border-radius: 0 0 12px 12px;
  background: #fff0d8;
  color: #714100;
  box-shadow: 0 8px 20px -14px rgba(40, 27, 10, .45);
  font-family: var(--app-font);
  font-size: .78rem;
  font-weight: 600;
  text-align: center;
}
.sun-app-network[hidden] { display: none; }

/* Появление шапки/вкладок */
@media (prefers-reduced-motion: no-preference) {
  .sun-app-header, .sun-app-tabbar { animation: sunAppFade 0.2s ease both; }
}
@keyframes sunAppFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sunAppPop {
  from { opacity: 0; transform: scale(0.94) translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Уважаем «уменьшить движение»: убираем анимации/трансформы. */
@media (prefers-reduced-motion: reduce) {
  :root.pwa-app * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .sun-app-switcher:not([hidden]) { animation: none; }
}

/* ── Результаты поиска по всему прайсу ────────────────────────────────────
 * ВНИМАНИЕ: правила НАМЕРЕННО без префикса :root.pwa-app — блок работает и в
 * обычном браузере. Штатный поиск на /price/ фильтрует только названия
 * разделов, поэтому запрос по услуге («Антитела») давал пустой экран
 * (жалоба заказчика 20.07.2026). Разметку рисует initPriceSearch в app-shell.js.
 */
.sun-price-hits {
  margin: 14px 0 4px;
  display: grid;
  gap: 8px;
}
.sun-price-hits__title,
.sun-price-hits__empty {
  margin: 0 0 2px;
  font-size: 0.92rem;
  color: #5a6b73;
  line-height: 1.45;
}
.sun-price-hit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 4px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(18, 20, 26, 0.04), 0 10px 26px -18px rgba(18, 20, 26, 0.22);
}
.sun-price-hit__name {
  font-size: 0.95rem;
  line-height: 1.35;
  color: #16181d;
}
.sun-price-hit__cat {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: #5a6b73;
}
.sun-price-hit__price {
  font-weight: 700;
  white-space: nowrap;
  color: #16181d;
}
.sun-app-lock__progress{min-height:28px;display:flex;align-items:center;justify-content:center;gap:9px;color:#6b625b;font-size:14px;font-weight:650}
.sun-app-lock__progress[hidden]{display:none}
.sun-app-lock__spinner{width:18px;height:18px;border:2px solid rgba(242,92,25,.25);border-top-color:#f25c19;border-radius:50%;animation:sun-lock-spin .75s linear infinite}
.sun-app-lock.is-busy .sun-app-lock__actions{opacity:.72}
@keyframes sun-lock-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.sun-app-lock__spinner{animation-duration:1.5s}}
