/* VetGuardian — дизайн: фон #f9fdff, TT Days Sans, тёмно-синий текст */
/* Локальные файлы: положите tt-days-sans.woff2 (и при необходимости .woff) в /static/fonts/ — без них браузер возьмёт запасной стек из --font. Внешний CDN убран: давал net::ERR_CONNECTION_RESET. */
@font-face {
  font-family: "TT Days Sans";
  src:
    url("/fonts/tt-days-sans.woff2") format("woff2"),
    url("/fonts/tt-days-sans.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --text: #0c1929;
  --text-muted: #334155;
  --gray: #64748b;
  --gray-light: #cbd5e1;
  --sky: #38bdf8;
  --sky-dark: #0ea5e9;
  --sky-glow: rgba(14, 165, 233, 0.35);
  --pastel: #e0f2fe;
  --danger-green: #22c55e;
  --danger-yellow: #eab308;
  --danger-red: #ef4444;
  --radius: 12px;
  --radius-btn: 10px;
  --font: "TT Days Sans", "Segoe UI", sans-serif;
  --shadow: 0 4px 20px rgba(14, 165, 233, 0.12);
  --shadow-white: 0 0 30px rgba(255, 255, 255, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
}

body.body-locked {
  overflow: hidden;
}

/* Фон: белый базовый + медицинское изображение на фоне (кроме шапки) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: none;
  z-index: -2;
  pointer-events: none;
}

.scroll-bg-overlay {
  display: none;
}

/* Плавное появление секций при прокрутке */
.vg-scroll-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.vg-scroll-reveal.vg-scroll-reveal--visible {
  opacity: 1;
  transform: translateY(0);
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .vg-scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}

/* Шапка */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  background: #f9fdff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 0 0 24px 24px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.header-logo-link {
  display: block;
  margin-left: 24px;
}

.header-logo {
  height: 128px;
  width: auto;
  display: block;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-nav .nav-btn {
  padding: 16px 40px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}
.header-nav .nav-btn:hover {
  color: var(--sky-dark);
}

.header-nav .nav-cabinet {
  padding: 6px;
  overflow: visible;
}
.header-nav .nav-cabinet img {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: transform 0.25s ease;
  transform-origin: center center;
}
.header-nav .nav-cabinet:hover img,
.header-nav .nav-cabinet:focus-visible img {
  transform: scale(1.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Кнопка-гамбургер (скрыта на десктопе) */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: none;
  border-radius: var(--radius-btn);
  background: var(--pastel);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s ease;
}
.mobile-menu-btn:hover {
  background: #bfdbfe;
}
.mobile-menu-icon {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

/* Оверлей и выдвижная панель (на десктопе скрыты) */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.mobile-nav-panel {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 151;
  width: 280px;
  max-width: 85vw;
  background: #f9fdff;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  padding: 80px 20px 24px;
}
.mobile-nav-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--pastel);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mobile-nav-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav-link {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-btn);
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.mobile-nav-link:hover {
  background: var(--pastel);
  color: var(--sky-dark);
}

.btn-login {
  padding: 10px 20px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--sky-dark);
  background: var(--bg);
  color: var(--sky-dark);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 14px var(--sky-glow);
  transition: transform 0.2s ease, background 0.2s, color 0.2s;
}
.btn-login:hover {
  background: var(--text);
  color: #fff;
  transform: scale(1.05);
}

.btn-avatar {
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-btn);
  overflow: hidden;
  transition: transform 0.2s ease;
}
.btn-avatar:hover { transform: scale(1.08); }
.btn-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Hero */
.hero {
  padding-top: 150px;
  padding-bottom: 2.5rem;
}

.hero-banner {
  width: 100%;
  margin-top: -44px;
  background: transparent;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}

.hero-banner-img {
  display: block;
  width: 100%;
  height: auto;
}

.hero-banner picture {
  display: block;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,23,42,0.92) 0%, rgba(15,23,42,0.65) 40%, transparent 70%);
}

.hero-banner-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 3rem 0 4.5rem;
  max-width: 640px;
}

.hero-banner-title {
  font-size: clamp(4.4rem, 8vw, 6.4rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-transform: uppercase;
}

.hero-banner-subtitle {
  margin-top: 1.5rem;
  font-size: 1.8rem;
  font-weight: 600;
  color: #f9fafb;
  max-width: 28rem;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
.hero-actions .btn-start {
  display: inline-block;
  padding: 26px 76px;
  font-size: 1.7rem;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  background: var(--sky-dark);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 0 30px var(--sky-glow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-actions .btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px var(--sky-glow);
}

.hero-offline-hint {
  margin: 1.1rem 0 0;
  padding: 0;
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-align: left;
  align-self: flex-start;
  max-width: min(36rem, 100%);
  margin-right: auto;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(6px);
  animation: heroOfflineHintIn 0.85s ease 0.4s forwards;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.35em;
  row-gap: 0.15em;
}

.hero-offline-hint-text {
  flex: 0 1 auto;
}

@media (max-width: 991px) {
  .hero-offline-hint {
    margin-left: -0.35rem;
  }
}

@media (min-width: 992px) {
  .hero-offline-hint {
    flex-wrap: nowrap;
    white-space: nowrap;
    max-width: none;
    width: auto;
    margin-left: -0.45rem;
  }

  .hero-offline-link {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@keyframes heroOfflineHintIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-offline-link {
  display: inline;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-weight: 700;
  color: #0ea5e9;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.hero-offline-link:hover {
  color: #38bdf8;
}

/* Модальное окно: установка PWA */
.pwa-install-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 25, 41, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.pwa-install-modal-overlay.open {
  display: flex;
  opacity: 1;
}

.pwa-install-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28);
  padding: 22px 22px 20px;
  border: 1px solid var(--gray-light);
}

.pwa-install-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.pwa-install-modal-close:hover {
  background: #e2e8f0;
}

.pwa-install-modal-title {
  margin: 0 36px 16px 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--text);
}

.pwa-install-modal-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pwa-install-modal-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.pwa-install-modal-list img {
  flex-shrink: 0;
  margin-top: 2px;
  object-fit: contain;
}

.pwa-install-modal-note {
  margin: 16px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-cta {
  margin-top: 2rem;
  text-align: center;
}
.hero-cta .btn-start {
  display: inline-block;
  padding: 18px 48px;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font);
  color: #fff;
  background: var(--sky-dark);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 0 30px var(--sky-glow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-cta .btn-start:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px var(--sky-glow);
}

/* Модальное окно опросника */
.anamnesis-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 25, 41, 0.4);
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.anamnesis-overlay.open {
  display: flex;
  opacity: 1;
}

.anamnesis-panel {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
  position: relative;
}

.anamnesis-panel .stage-title {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  padding: 24px 24px 0;
  margin-bottom: 16px;
  text-align: center;
  text-transform: uppercase;
}

.anamnesis-panel .progress-wrap {
  padding: 0 24px 16px;
}
.anamnesis-panel .progress-bar {
  height: 8px;
  background: var(--gray-light);
  border-radius: 4px;
  overflow: hidden;
}
.anamnesis-panel .progress-fill {
  height: 100%;
  width: 0%;
  background: var(--sky-dark);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.anamnesis-panel .panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
}
.anamnesis-panel textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gray-light);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  resize: vertical;
  min-height: 120px;
}

/* Радио и чекбоксы в опроснике */
.form-group .label,
.form-group label {
  font-weight: 700;
  color: var(--text);
  font-size: 1.1rem;
}

.form-group-grid .group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.form-group-grid .group-label {
  flex: 0 0 55%;
  font-size: 0.98rem;
}
.form-group-grid .group-controls {
  flex: 0 0 45%;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.form-group-grid .group-controls label {
  font-weight: 500;
  font-size: 0.95rem;
}
.radio-inline {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.radio-inline label {
  font-weight: 500;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--gray-light);
  background: #f9fafb;
}
.radio-inline input[type="radio"],
.radio-inline input[type="checkbox"],
.symptom-table input[type="radio"] {
  accent-color: var(--sky-dark);
  width: 22px;
  height: 22px;
  margin-right: 8px;
  cursor: pointer;
}
.symptom-table label {
  cursor: pointer;
  font-weight: 500;
  font-size: 0.98rem;
}

/* голубой фон выбранных опций */
.radio-inline label:has(input[type="radio"]:checked),
.radio-inline label:has(input[type="checkbox"]:checked) {
  background: var(--pastel);
  border-color: var(--sky-dark);
}

/* Опросник анамнеза: лапки paw / chosen_paw как в быстром тесте */
.anamnesis-panel #questionnaireForm .radio-inline label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: 16px;
  padding: 12px 14px;
}
.anamnesis-panel #questionnaireForm .radio-inline input[type="radio"],
.anamnesis-panel #questionnaireForm .radio-inline input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: url("/pictures/technical/paw.png") center / contain no-repeat;
  cursor: pointer;
  accent-color: transparent;
}
.anamnesis-panel #questionnaireForm .radio-inline input[type="radio"]:checked,
.anamnesis-panel #questionnaireForm .radio-inline input[type="checkbox"]:checked {
  background-image: url("/pictures/technical/chosen_paw.png");
  box-shadow: none;
}
.anamnesis-panel #questionnaireForm .radio-inline label:hover input:not(:checked) {
  background-image: url("/pictures/technical/chosen_paw.png");
}
.anamnesis-panel #questionnaireForm .symptom-table input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  display: block;
  background: url("/pictures/technical/paw.png") center / contain no-repeat;
  cursor: pointer;
}
.anamnesis-panel #questionnaireForm .symptom-table input[type="radio"]:checked {
  background-image: url("/pictures/technical/chosen_paw.png");
}
.anamnesis-panel #questionnaireForm .symptom-table td:not(:first-child) {
  text-align: center;
  vertical-align: middle;
}

/* Подвопросы раны — скрыты по умолчанию */
.wound-sub { display: none; margin-top: 12px; padding-left: 8px; border-left: 3px solid var(--sky); }
.wound-sub.visible { display: block; }

/* Кнопки Далее / Завершить в панели */
.panel-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 16px 24px;
  gap: 12px;
}
.panel-actions.panel-actions--with-back {
  justify-content: space-between;
}
.panel-actions .btn-back {
  padding: 14px 28px;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--gray);
  background: #fff;
  color: var(--text);
  transition: transform 0.2s ease, background 0.2s, border-color 0.2s;
}
.panel-actions .btn-back:hover {
  background: var(--pastel);
  border-color: var(--sky-dark);
  transform: scale(1.02);
}
.panel-actions .btn-next,
.panel-actions .btn-finish {
  padding: 16px 36px;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.panel-actions .btn-next {
  background: var(--gray-light);
  color: var(--text);
  border: 1px solid var(--gray);
}
.panel-actions .btn-next:hover { transform: scale(1.03); }
.panel-actions .btn-finish {
  background: var(--sky-dark);
  color: #fff;
  border: none;
  box-shadow: 0 0 16px var(--sky-glow);
}
.panel-actions .btn-finish:hover { transform: scale(1.03); }

/* Загрузка в панели */
.anamnesis-loading {
  text-align: center;
  padding: 48px 24px;
}
.anamnesis-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-light);
  border-top-color: var(--sky-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Результат в панели */
.anamnesis-result .result-level { margin-bottom: 20px; }

/* Юридико-медицинский дисклеймер над итоговой справкой */
.result-medical-disclaimer {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #075985;
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 1px solid #7dd3fc;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.12);
}

.anamnesis-result .ai-report-frame {
  border: 2px solid var(--sky-dark);
  box-shadow: 0 0 20px var(--sky-glow);
  margin-bottom: 20px;
}
.anamnesis-result .btn-close-save {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 32px;
  background: var(--sky-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 0 20px var(--sky-glow);
  transition: transform 0.2s ease;
}
.anamnesis-result .btn-close-save:hover { transform: scale(1.03); }

/* Кнопка закрытия опросника */
.anamnesis-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(15, 23, 42, 0.4);
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.anamnesis-close-btn:hover {
  transform: scale(1.05);
  background: rgba(15, 23, 42, 0.9);
}

/* Секции главной (история и т.д.) — без нижнего «зазора» под подвалом */
.main-content { padding-bottom: 0; }

.pet-info-section {
  margin-top: 2.5rem;
  padding: 0 32px 2.5rem;
  scroll-margin-top: 180px;
}

.pet-info-title {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2.25rem;
  text-align: center;
  text-transform: uppercase;
}

.pet-info-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 5.5rem;
  justify-content: center;
  max-width: 1200px;
  margin: 0 auto;
}

.pet-info-panels {
  max-width: 1200px;
  margin: 2.5rem auto 0;
}
.pet-info-panels .article-panel {
  display: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  padding: 24px 20px 28px;
}
.pet-info-panels .article-panel.active {
  display: block;
}

.pet-info-card {
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 320px;
  flex: 1 1 30%;
}

.pet-info-card img {
  width: 380px;
  height: 380px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 12px;
}

.pet-info-card-label {
  margin-top: 0.9rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: none;
  color: #374151;
  padding: 8px 20px;
  border-radius: 999px;
  border: 2px solid #374151;
  background: #ffffff;
  transition: transform 0.22s ease, color 0.22s ease, background-color 0.22s ease, border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.pet-info-explore-btn {
  margin-top: 1rem;
  padding: 14px 40px;
  border-radius: 999px;
  border: none;
  background: var(--pastel);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.pet-info-explore-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
  background: #bfdbfe;
}

@media (max-width: 900px) {
  .pet-info-card {
    flex: 1 1 45%;
  }
  .pet-info-card img {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 600px) {
  .pet-info-card {
    flex: 1 1 100%;
  }
  .pet-info-card img {
    width: 240px;
    height: 240px;
  }
}

.pet-info-card:hover img {
  transform: scale(1.08);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.3);
}

.pet-info-card:hover .pet-info-card-label,
.pet-info-card:focus-visible .pet-info-card-label {
  transform: scale(1.06);
  color: #ffffff;
  background: #7dd3fc;
  border-color: #38bdf8;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.35);
}

/* Раздел «Статьи» — панели теперь внутри .pet-info-cards, стили заданы выше */

.article-panel {
  display: none;
}
.article-panel.active {
  display: block;
}

/* --- Карточки пород в разделе «О собаках» --- */
.breed-list-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: 20px;
}

@media (max-width: 400px) {
  .breed-list-view {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
.breed-card {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.breed-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}
.breed-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.breed-card-body {
  padding: 12px 16px 16px;
}
.breed-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #374151;
}

/* --- Статья по породе --- */
.breed-article-view {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
}
.breed-article-view.active {
  display: block;
}
.breed-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 10px;
}
.breed-breadcrumb .link-button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
}
.breed-breadcrumb .link-button:hover {
  text-decoration: underline;
}
.breadcrumb-current {
  color: #6b7280;
}
.breed-article-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.breed-article-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 6px;
}
.breed-article-image-wrap {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.28);
  align-self: stretch;
}
.breed-article-image {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: initial;
  display: block;
}

.breed-article-tabs {
  display: flex;
  gap: 10px;
  margin: 16px 0 12px;
  justify-content: center;
}
.breed-tab {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #e5e7eb;
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.breed-tab:hover {
  background: #e0f2fe;
  color: #334155;
  border-color: #bfdbfe;
}
.breed-tab.active {
  background: #d1d5db;
  color: #374151;
  border-color: #cbd5e1;
}
.breed-article-sections {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
  padding: 20px 22px 22px;
}
.breed-section {
  display: none;
}
.breed-section.active {
  display: block;
}
.breed-section h4 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.breed-section-body {
  font-size: 0.98rem;
  line-height: 1.7;
}
.breed-section-body p {
  margin-bottom: 8px;
}

/* Тексты статей из БД/Excel: табы, переносы, списки, **жирный**, *курсив* */
.article-rich-content {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text);
}
.article-rich-block {
  margin: 0 0 1rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-rich-content > .article-rich-block:last-child {
  margin-bottom: 0;
}
.article-rich-list {
  margin: 0 0 1rem 0;
  padding-left: 1.35rem;
  list-style: disc;
  white-space: pre-wrap;
}
.article-rich-list li {
  margin-bottom: 0.45rem;
}
.article-rich-list li.article-rich-li {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.article-rich-list li:last-child {
  margin-bottom: 0;
}
.article-rich-content strong {
  font-weight: 700;
}
.article-rich-content em {
  font-style: italic;
}
.behavior-section .article-rich-content {
  margin-top: 4px;
}

.breed-health-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
  margin-top: 8px;
}
.breed-health-text {
  font-size: 0.98rem;
  line-height: 1.7;
}
.breed-health-chart .chart-block {
  height: 380px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Карточки возрастов и статьи по возрасту --- */
.age-list-view {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 20px 26px;
  justify-content: center;
  justify-items: center;
  margin-bottom: 10px;
}
.age-card {
  width: 100%;
  max-width: 260px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.age-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}
.age-card-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
}
.age-card-body {
  padding: 10px 14px 14px;
}
.age-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
}

/* Шахматное расположение второй строки возрастов:
   1–3 карточки в первом ряду, 4-я и 5-я — во втором, смещены к центру */
.age-list-view .age-card:nth-child(4) {
  grid-column: 1 / span 2;
  grid-row: 2;
}
.age-list-view .age-card:nth-child(5) {
  grid-column: 2 / span 2;
  grid-row: 2;
}

.age-article-view {
  display: none;
  max-width: 1080px;
  margin: 1.5rem auto 0;
}
.age-article-view.active {
  display: block;
}
.age-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 10px;
}
.age-breadcrumb .link-button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
}
.age-breadcrumb .link-button:hover {
  text-decoration: underline;
}

.age-article-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.age-article-title {
  font-size: 1.8rem;
  font-weight: 800;
}
.age-article-image-wrap {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.28);
  align-self: stretch;
}
.age-article-image {
  width: 100%;
  height: auto;
  display: block;
}

.age-article-tabs {
  display: flex;
  gap: 10px;
  margin: 14px 0 10px;
  justify-content: center;
}
.age-tab {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #e5e7eb;
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.age-tab:hover {
  background: #e0f2fe;
  color: #334155;
  border-color: #bfdbfe;
}
.age-tab.active {
  background: #d1d5db;
  color: #374151;
  border-color: #cbd5e1;
}

.age-article-sections {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
  padding: 20px 22px 22px;
}
.age-section {
  display: none;
}
.age-section.active {
  display: block;
}
.age-section h4 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.age-section-body {
  font-size: 0.98rem;
  line-height: 1.7;
}
.age-section-body p {
  margin-bottom: 8px;
}

.age-health-text {
  font-size: 0.98rem;
  line-height: 1.7;
  margin-top: 8px;
}

/* Текст «частые проблемы» + график ниже */
.age-problems-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
  margin-top: 8px;
}
.age-problems-chart .chart-block {
  height: 420px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

/* --- Карточки поведения и статья по поведению --- */
.behavior-list-view {
  display: block;
}

.behavior-carousel-wrap {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  gap: 14px;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 18px;
}

.behavior-carousel-viewport {
  overflow: hidden;
  padding-top: 10px;
}

.behavior-carousel-track {
  display: flex;
  align-items: stretch;
  gap: 20px;
  transition: transform 0.35s ease;
}

.behavior-card {
  flex: 0 0 calc((100% - 40px) / 3);
  max-width: calc((100% - 40px) / 3);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 18px;
  box-shadow: none;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.behavior-card:hover {
  transform: translateY(-4px);
  box-shadow: none;
}

.behavior-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.behavior-card-body {
  padding: 12px 16px 16px;
}

.behavior-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #374151;
}

.behavior-scroll-arrow {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  color: #6b7280;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.behavior-scroll-arrow:hover {
  background: #e0f2fe;
  color: #0ea5e9;
  transform: scale(1.05);
}

.behavior-article-view {
  display: none;
  max-width: 1080px;
  margin: 0 auto;
}

.behavior-article-view.active {
  display: block;
}

.behavior-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

.behavior-breadcrumb .link-button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #2563eb;
  cursor: pointer;
}

.behavior-breadcrumb .link-button:hover {
  text-decoration: underline;
}

.behavior-article-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.behavior-article-image-wrap {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.28);
  align-self: stretch;
  margin-bottom: 16px;
}

.behavior-article-image {
  width: 100%;
  height: auto;
  display: block;
}

.behavior-article-sections {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
  padding: 20px 22px 22px;
}

.behavior-section {
  margin-bottom: 14px;
}

.behavior-section:last-child {
  margin-bottom: 0;
}

.behavior-section h4 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.behavior-section p {
  font-size: 0.98rem;
  line-height: 1.7;
}

.behavior-chart-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--gray);
}

.chart-note {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--gray);
}

@media (max-width: 900px) {
  .behavior-card {
    flex: 0 0 calc((100% - 20px) / 2);
    max-width: calc((100% - 20px) / 2);
  }
}

@media (max-width: 640px) {
  .behavior-carousel-wrap {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 8px;
  }
  .behavior-card {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .behavior-card-img {
    height: 140px;
  }
}

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.article-header h3 {
  font-size: 1.4rem;
}
.article-header select {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--gray-light);
  font-family: var(--font);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 2fr);
  gap: 24px;
}

.article-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-text {
  font-size: 0.95rem;
  line-height: 1.6;
}

.article-text-animated {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.article-text-animated.show {
  opacity: 1;
  transform: translateY(0);
}
.article-text h4 {
  margin: 0 0 8px;
  font-size: 1.3rem;
}
.article-text p {
  margin-bottom: 8px;
}

.article-charts {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chart-block {
  background: #ffffff;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.chart-animated {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.chart-animated.show {
  opacity: 1;
  transform: translateY(0);
}
.chart-block h4 {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.chart-sources {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--gray);
}
.chart-sources-label {
  font-weight: 600;
}
.chart-sources-list {
  font-weight: 400;
}
.chart-sources-list ul {
  margin: 0;
  padding-left: 18px;
}

/* Кнопки выбора в разделах статей */
.selector-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.selector-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  background: var(--sky-dark);
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.35);
}
.selector-btn:hover {
  background: #0284c7;
}
.selector-select {
  width: 100%;
  padding: 12px 48px 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--gray-light);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.selector-select option {
  font-family: var(--font);
}
.selector-wrap-breed::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--sky-dark);
  pointer-events: none;
}
.selector-wrap-age::after,
.selector-wrap-behavior::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--sky-dark);
  pointer-events: none;
}

.article-tabs {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-right: 12px;
}
.article-tabs button {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--sky-dark);
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.article-tabs button:hover {
  background: #0284c7;
}
.article-tabs button.active {
  background: #0369a1;
}

.article-list {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-right: 12px;
}

/* Больше пространства и высота под график поведения */
.article-panel#articleByBehavior .chart-block {
  min-height: 320px;
}
.article-list button {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--sky-dark);
  color: #ffffff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.article-list button:hover {
  background: #0284c7;
}
.article-list button.active {
  background: #0369a1;
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

.history-section {
  display: none !important;
}
.clinics-section {
  position: relative;
  z-index: 2;
  isolation: isolate;
  margin-top: 2rem;
  margin-bottom: 0;
  padding: 2.5rem 20px 1.25rem;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
}

.clinics-section h2 {
  text-align: center;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.clinics-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  align-items: flex-start;
}

.yandex-map-container {
  flex: 2 1 320px;
  min-height: 360px;
  margin-bottom: 0;
}

.city-select-wrap {
  flex: 1 1 240px;
}

/* Фикс высоты холстов графиков, чтобы расстояния между пилюлями не расползались на широких мониторах */
.article-panel .chart-block canvas {
  height: 320px !important;
}

@media (max-width: 768px) {
  .breed-health-chart .chart-block,
  .age-problems-chart .chart-block {
    height: auto !important;
    min-height: 260px;
  }
  .article-panel .chart-block canvas {
    height: 260px !important;
  }
  .article-panel#articleByBehavior .chart-block {
    min-height: 260px;
  }
}

@media (max-width: 480px) {
  .breed-health-chart .chart-block,
  .age-problems-chart .chart-block {
    height: auto;
    min-height: 240px;
  }
  .article-panel .chart-block canvas {
    height: 240px !important;
  }
  .article-panel#articleByBehavior .chart-block {
    min-height: 240px;
  }
}

/* Подвал: ниже клиник по слою (z-index), с отриц. margin — серый в нижних скруглениях белой карточки */
.footer-info-wrap {
  position: relative;
  z-index: 1;
  background: hsl(220, 8%, 34%);
  padding: 42px 32px 28px;
  margin-top: -24px;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.35);
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px 40px;
  align-items: start;
}

.footer-col--brand {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-brand-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.footer-logo {
  width: 56px;
  height: auto;
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.footer-brand-text {
  min-width: 0;
}

.footer-brand-name {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.footer-brand-desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: rgba(248, 250, 252, 0.88);
  max-width: 300px;
}

.footer-col-title {
  margin: 0 0 14px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(248, 250, 252, 0.9);
}

.footer-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.footer-nav-btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.92);
  font-family: var(--font);
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.footer-nav-btn:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-about-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.88);
}

.footer-about-text a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}

.footer-about-text a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-bottom {
  max-width: 1100px;
  margin: 28px auto 0;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 14px;
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.88rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Планшеты и узкие окна: сетки и контент без изменения десктопного макета */
@media (max-width: 900px) {
  .age-list-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: stretch;
  }
  .age-list-view .age-card:nth-child(4),
  .age-list-view .age-card:nth-child(5) {
    grid-column: auto;
    grid-row: auto;
  }
  .age-card {
    max-width: none;
  }
  .breed-list-view {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 520px) {
  .age-list-view {
    grid-template-columns: 1fr;
  }
  .breed-list-view {
    grid-template-columns: 1fr;
  }
}

/* Дополнительная адаптивность под планшеты и телефоны */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }
  .header {
    padding: 10px 16px;
  }
  .header-logo {
    height: 80px;
  }
  .header-nav {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
  .mobile-nav-overlay,
  .mobile-nav-panel {
    display: block;
  }
  body.mobile-nav-open .mobile-nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  body.mobile-nav-open .mobile-nav-panel {
    transform: translateX(0);
  }
  body.mobile-nav-open {
    overflow: hidden;
  }
  .hero-banner-inner {
    padding: 0 1.5rem;
    align-items: flex-start;
    justify-content: center;
    max-width: 100%;
  }
  /* Чтобы текст и кнопка "Начать анализ" не обрезались из-за высоты баннера */
  .hero-banner {
    min-height: 420px;
  }
  .hero-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    z-index: 0;
  }
  .hero-actions {
    margin-top: 1.5rem;
  }
  .hero-banner-title {
    font-size: 2.8rem;
  }
  .hero-banner-subtitle {
    font-size: 1.2rem;
  }
  .hero-actions .btn-start {
    padding: 14px 32px;
    font-size: 1.2rem;
  }
  .pet-info-section {
    padding-left: 16px;
    padding-right: 16px;
  }
  .pet-info-cards {
    gap: 3rem;
  }
  .pet-info-card img {
    width: 280px;
    height: 280px;
  }
  .breed-breadcrumb,
  .age-breadcrumb,
  .behavior-breadcrumb {
    flex-wrap: wrap;
  }
  .breed-article-tabs,
  .age-article-tabs {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .breed-article-title {
    font-size: 1.5rem;
  }
  .age-article-title,
  .behavior-article-title {
    font-size: 1.45rem;
  }
  .chart-block h4 {
    font-size: 1.25rem;
  }
  .anamnesis-overlay {
    padding: 12px;
  }
  .anamnesis-panel {
    max-height: min(90vh, 100dvh);
  }
  .anamnesis-panel .stage-title {
    font-size: 1.35rem;
    padding-left: 12px;
    padding-right: 52px;
  }
  .anamnesis-panel .panel-body {
    padding-left: 12px;
    padding-right: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .anamnesis-panel .block-step {
    overflow-x: auto;
    max-width: 100%;
  }
  .anamnesis-panel .symptom-table {
    min-width: 480px;
  }
  .panel-actions {
    flex-wrap: wrap;
    padding-left: 12px;
    padding-right: 12px;
  }
  .clinics-section {
    padding-left: 16px;
    padding-right: 16px;
  }
  .yandex-map-container {
    min-height: 280px;
  }
  .footer-info-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 8px 10px;
  }
  .header-logo {
    height: 64px;
  }
  .hero {
    padding-top: 110px;
  }
  .hero-banner {
    border-radius: 20px;
  }
  .hero-banner-inner {
    padding: 10px 0.5rem 14px 1rem;
    justify-content: center;
    /* Ограничиваем ширину слоя текста, чтобы правая часть баннера с собакой не перекрывалась */
    max-width: 60%;
    gap: 0;
  }
  /* На телефонах дополнительно фиксируем высоту, чтобы кнопка была видна */
  .hero-banner {
    min-height: 400px;
  }
  .hero-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
    z-index: 0;
  }
  .hero-actions {
    margin-top: 0.9rem;
  }
  .hero-banner-title {
    font-size: 1.6rem;
    line-height: 1.05;
    white-space: nowrap;
  }
  .hero-banner-subtitle {
    font-size: 0.95rem;
    margin-top: 0.5rem;
  }
  .hero-actions .btn-start {
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 11px 18px;
    font-size: 1rem;
    white-space: nowrap;
  }
  /* На узких экранах: каждая кнопка и её панель в одной колонке, панель прямо под кнопкой */
  .pet-info-item {
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
    min-width: 0;
    align-items: center;
  }
  .pet-info-cards {
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: center;
    max-width: 100%;
    padding: 0 8px;
  }
  .pet-info-cards .article-panel {
    margin-top: 0.5rem;
    padding: 16px 12px 20px;
    width: 100%;
    box-sizing: border-box;
  }
  .pet-info-card {
    flex: 1 1 48%;
    min-width: 0;
    max-width: 48%;
  }
  .pet-info-card img {
    width: 92px;
    height: 92px;
  }
  .pet-info-card-label {
    font-size: 0.92rem;
    padding: 6px 12px;
    margin-top: 6px;
  }
  .selector-select {
    font-size: 0.9rem;
    padding: 10px 40px 10px 16px;
  }
  .chart-block {
    padding: 10px 10px;
  }
  .pet-info-title {
    font-size: 1.75rem;
  }
  .breed-article-title {
    font-size: 1.35rem;
  }
  .age-article-title,
  .behavior-article-title {
    font-size: 1.3rem;
  }
}

/* --- Быстрый опрос: Проверь питомца --- */
.quick-check-section {
  margin-top: 3.5rem;
  padding: 0 20px 24px;
  scroll-margin-top: 220px;
}

.quick-check-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.quick-check-header {
  max-width: 1200px;
  margin: 0 auto 1.25rem;
}

.quick-check-title {
  text-align: left;
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.quick-check-sub {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.quick-check-sub-line {
  flex: 0 0 6px;
  height: 100%;
  min-height: 70px;
  border-radius: 8px;
  background: var(--sky-dark);
  margin-top: 4px;
}

.quick-check-sub-text {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--text);
  font-weight: 600;
}

.quick-check-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #d1d5db; /* как у карточек пород */
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  padding: 0;
  display: flex;
  gap: 0;
  align-items: stretch;
  max-width: 100%;
}

.quick-check-left {
  flex: 0 0 280px; /* фиксируем ширину как в "идеальном" варианте */
  min-width: 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.quick-check-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* заполняем поле без внутренних отступов */
  object-position: center bottom; /* чтобы не "съедать" правый край */
  display: block;
}

.quick-check-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 22px;
  /* В прошлый раз проблема была по вертикали (выпирало на фото).
     По горизонтали не обрезаем, чтобы текст вопросов/ответов не срезался справа. */
  overflow-y: hidden;
  overflow-x: visible;
}

.quick-check-swap {
  min-height: 420px;
  max-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s ease, opacity 0.22s ease;
  will-change: transform, opacity;
}

.quick-check-result {
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 420px;
}

.quick-check-qtext {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quick-check-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.quick-check-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.quick-check-option:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.8);
}

.quick-check-option input {
  display: none;
}

.quick-check-dot {
  width: 26px;
  height: 26px;
  border-radius: 0;
  border: none;
  background: url("/pictures/technical/paw.png") center / contain no-repeat;
  flex: 0 0 auto;
  margin-top: 0;
}

.quick-check-option:hover input:not(:checked) + .quick-check-dot {
  background-image: url("/pictures/technical/chosen_paw.png");
}

.quick-check-option input:checked + .quick-check-dot {
  background-image: url("/pictures/technical/chosen_paw.png");
  box-shadow: none;
}

.quick-check-option-text {
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.quick-check-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

/* «Назад» слева, «Далее» справа; на первом шаге «Назад» скрыт — «Далее» остаётся справа */
.quick-check-back {
  margin-right: auto;
}

.quick-check-btn {
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid var(--gray-light);
  background: #ffffff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.quick-check-btn:hover {
  transform: scale(1.02);
  border-color: var(--sky-dark);
}

.quick-check-next {
  border-color: transparent;
  background: var(--sky-dark);
  color: #fff;
  box-shadow: 0 0 16px var(--sky-glow);
}

.quick-check-back[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.quick-check-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 420px;
  max-height: 420px;
}

.quick-check-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 5px solid rgba(125, 211, 252, 0.35);
  border-top-color: var(--sky-dark);
  animation: quickSpin 0.85s linear infinite;
}

@keyframes quickSpin {
  to {
    transform: rotate(360deg);
  }
}

.quick-check-ai-brief {
  background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 100%);
  border: 1px solid #7dd3fc;
  border-radius: 18px;
  padding: 14px 16px;
  color: #075985;
  box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.08);
  font-weight: 600;
  margin-bottom: 16px;
  line-height: 1.55;
  /* Если справка длинная — не раздуваем блок, а показываем скролл */
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 175px;
  font-size: 0.98rem;
  /* Чтобы при длинном тексте скролл выглядел аккуратно */
  scrollbar-gutter: stable;
}

.quick-check-chart-wrap {
  background: #ffffff;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 12px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0; /* чтобы Chart.js мог корректно вписаться при скролле справки */
}

.quick-check-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
}

.quick-check-overlay {
  position: fixed;
  inset: 0;
  z-index: 280;
  display: none;
  background: rgba(12, 25, 41, 0.55);
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.quick-check-modal {
  width: min(94vw, 520px);
  max-height: 88dvh;
  background: #ffffff;
  border-radius: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quick-check-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.quick-check-modal-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 54px 12px 12px;
}

.quick-check-overlay .quick-check-loading {
  min-height: 0;
  max-height: none;
  height: 100%;
  justify-content: center;
}

.quick-check-overlay .quick-check-result {
  min-height: 0;
  max-height: none;
  height: 100%;
  overflow: auto;
  padding-bottom: 12px;
  box-sizing: border-box;
}

.quick-check-overlay .quick-check-ai-brief {
  font-size: 0.9rem;
  line-height: 1.45;
  max-height: none;
}

.quick-check-overlay .quick-check-chart-wrap {
  min-height: 260px;
  padding-bottom: 8px;
  overflow: visible;
}

.quick-check-overlay .quick-check-chart-wrap canvas {
  height: 260px !important;
}

.quick-check-overlay.open {
  display: flex;
}

body.quick-check-overlay-open {
  overflow: hidden;
}

.quick-check-swipe-out-next {
  transform: translateX(-28px);
  opacity: 0;
}

.quick-check-swipe-out-back {
  transform: translateX(28px);
  opacity: 0;
}

.quick-check-swipe-in {
  transform: translateX(28px);
  opacity: 0;
}

/* Планшеты: картинка сверху, контент ниже */
@media (max-width: 900px) {
  .quick-check-section {
    padding: 0 16px 20px;
  }
  .quick-check-card {
    flex-direction: row;
    left: auto;
    width: 100%;
  }
  .quick-check-left {
    flex: 0 0 190px;
    width: auto;
    min-width: 0;
  }
  .quick-check-img {
    height: 100%;
  }
  .quick-check-right {
    padding: 14px;
  }
  .quick-check-swap {
    min-height: 430px;
    max-height: none;
  }

  .quick-check-qtext {
    font-size: 1.15rem;
  }

  .quick-check-option-text {
    font-size: 0.95rem;
  }
  .quick-check-chart-wrap canvas {
    height: 280px !important;
  }
  .quick-check-loading {
    min-height: 430px;
    max-height: none;
  }
  .quick-check-result {
    min-height: 430px;
    max-height: none;
  }
}

@media (max-width: 480px) {
  .quick-check-header {
    margin-bottom: 1rem;
  }

  .quick-check-title {
    margin-bottom: 0.9rem;
  }

  .quick-check-sub {
    gap: 14px;
  }

  .quick-check-sub-line {
    min-height: 58px;
  }

  .quick-check-right {
    padding: 8px;
  }
  .quick-check-qtext {
    font-size: 0.93rem;
    margin-bottom: 10px;
  }
  .quick-check-left {
    flex: 0 0 165px;
  }
  .quick-check-actions {
    gap: 6px;
  }
  .quick-check-btn {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
  .quick-check-img {
    height: 100%;
    object-position: left bottom;
  }
  .quick-check-card {
    width: 100%;
    flex-direction: row;
  }
  .quick-check-swap {
    min-height: 310px;
    max-height: 310px;
    overflow-y: auto;
  }
  .quick-check-option-text {
    font-size: 0.92rem;
  }
  .quick-check-options {
    gap: 8px;
    margin-bottom: 8px;
  }
  .quick-check-option {
    padding: 10px 12px;
  }
  .quick-check-chart-wrap canvas {
    height: 200px !important;
  }
  .quick-check-loading {
    min-height: 310px;
    max-height: 310px;
    overflow-y: auto;
  }
  .quick-check-result {
    min-height: 310px;
    max-height: 310px;
    overflow-y: auto;
  }
}

/* iPhone SE2 / узкие телефоны с высокой высотой:
   иногда ширина CSS-пикселей попадает в диапазон <=768px и не срабатывает <=480px,
   поэтому делаем отдельный точечный адаптив по высоте */
@media (max-width: 768px) and (min-width: 481px) and (min-height: 700px) and (orientation: portrait) {
  /* Баннер: возвращаем пропорции ближе к десктопу, но без клиппинга текста */
  .hero-banner {
    min-height: 420px;
  }
  .hero-banner-inner {
    padding: 10px 0.5rem 14px 1rem;
    justify-content: center;
    max-width: 60%;
  }
  .hero-banner-img {
    object-position: right center;
  }
  .hero-banner-title {
    font-size: 1.7rem;
    line-height: 1.05;
    white-space: nowrap;
  }
  .hero-banner-subtitle {
    font-size: 0.95rem;
    margin-top: 0.5rem;
  }
  .hero-actions {
    margin-top: 0.9rem;
  }
  .hero-actions .btn-start {
    width: auto;
    padding: 11px 18px;
    font-size: 1rem;
    white-space: nowrap;
  }

  /* Графики "О собаках": делаем менее вытянутыми по высоте */
  .breed-health-chart .chart-block,
  .age-problems-chart .chart-block {
    height: auto;
    min-height: 240px;
  }
  .article-panel .chart-block canvas {
    height: 240px !important;
  }
  .article-panel#articleByBehavior .chart-block {
    min-height: 240px;
  }

  /* Quick-check: компактнее и чтобы контент не уезжал */
  .quick-check-swap,
  .quick-check-loading,
  .quick-check-result {
    min-height: 310px;
    max-height: 310px;
    overflow-y: auto;
  }
  .quick-check-chart-wrap canvas {
    height: 200px !important;
  }
  .quick-check-left {
    flex: 0 0 165px;
  }
  .quick-check-qtext {
    font-size: 0.93rem;
  }
  .quick-check-btn {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

/* Portrait-only fixes for phones/tablets:
   1) banner without cropping and less vertical stretch
   2) charts fully visible by width on narrow screens
   3) quick-check options fit without inner scrolling */
@media (max-width: 900px) and (orientation: portrait) {
  .hero-banner {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }

  .hero-banner-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    background: #0f172a;
    z-index: 0;
  }

  .hero-banner-inner {
    max-width: 62%;
  }

  .hero-banner-title {
    font-size: 1.42rem;
    line-height: 1.05;
  }

  .hero-banner-subtitle {
    font-size: 0.84rem;
    margin-top: 0.45rem;
  }

  .hero-actions .btn-start {
    padding: 8px 13px;
    font-size: 0.86rem;
  }

  .breed-health-chart .chart-block,
  .age-problems-chart .chart-block,
  .article-panel#articleByBehavior .chart-block {
    min-height: 170px;
    height: auto !important;
  }

  .article-panel .chart-block {
    padding-left: 4px;
    padding-right: 8px;
  }

  .article-panel .chart-block canvas {
    width: 100% !important;
    height: 170px !important;
    max-width: 100%;
  }

  .quick-check-card {
    align-items: stretch;
  }

  .quick-check-left {
    flex: 0 0 130px;
    align-self: stretch;
    min-height: 0;
    background: #e2e8f0;
  }

  .quick-check-right {
    padding: 8px;
    min-height: 0;
  }

  .quick-check-swap,
  .quick-check-loading,
  .quick-check-result {
    min-height: 260px;
    max-height: 260px;
    overflow: hidden;
    justify-content: flex-start;
    gap: 4px;
  }

  .quick-check-options {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    gap: 5px;
    margin-top: 12px;
    margin-bottom: 4px;
    padding-top: 10px;
    padding-bottom: 6px;
    scroll-padding-top: 8px;
  }

  .quick-check-actions {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 4px;
  }

  .quick-check-qtext {
    flex-shrink: 0;
    font-size: 0.82rem;
    line-height: 1.2;
    margin-bottom: 6px;
  }

  .quick-check-option {
    padding: 7px 9px;
    gap: 7px;
  }

  .quick-check-option-text {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .quick-check-dot {
    width: 22px;
    height: 22px;
    margin-top: 0;
  }

  .quick-check-btn {
    padding: 8px 10px;
    font-size: 0.82rem;
  }

  .quick-check-img {
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
  }

  .yandex-map-container {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .yandex-map-container[data-loaded="true"] {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (max-width: 480px) and (orientation: portrait) {
  .hero-banner {
    aspect-ratio: 4 / 3;
    border-radius: 20px;
  }

  .hero-banner-inner {
    max-width: 60%;
  }

  .hero-banner-title {
    font-size: 1.28rem;
  }

  .hero-banner-subtitle {
    font-size: 0.78rem;
  }

  .hero-actions .btn-start {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .breed-health-chart .chart-block,
  .age-problems-chart .chart-block,
  .article-panel#articleByBehavior .chart-block {
    min-height: 150px;
  }

  .article-panel .chart-block {
    padding-left: 2px;
  }

  .article-panel .chart-block canvas {
    height: 150px !important;
  }

  .quick-check-left {
    flex: 0 0 118px;
  }

  .quick-check-swap,
  .quick-check-loading,
  .quick-check-result {
    min-height: 240px;
    max-height: 240px;
  }

  .quick-check-btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .yandex-map-container {
    aspect-ratio: 4 / 3;
  }

  .yandex-map-container[data-loaded="true"] {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}
