/* ver5 — правки по UX-аудиту */
/* 1. Шапка: полное меню уже с 1024px */
@media (min-width: 1024px) and (max-width: 1180px) {
  .v5 .site-header { grid-template-columns: minmax(150px, 190px) 1fr auto; }
  .v5 .main-nav { display: flex; flex-wrap: nowrap; gap: 14px; font-size: 13.5px; }
  .v5 .main-nav a { padding: 6px 2px; white-space: nowrap; }
  .v5 .menu-button { display: none; }
  .v5 .phone-link { display: none; }
}
/* 2. Логотипы партнёров — единая высота и подложка */
.v5 .partner-card { display: flex; align-items: center; justify-content: center; background: #fff; min-height: 132px; padding: 24px; }
.v5 .partner-logo { height: 56px !important; width: auto !important; max-width: 82% !important; object-fit: contain; }
/* 3. Обращение главврача — свёрнуто на десктопе */
.v5-clamped { max-height: 320px; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent); mask-image: linear-gradient(to bottom, #000 62%, transparent); }
.v5-more-btn { margin-top: 4px; align-self: flex-start; }
.v5-more-btn[hidden] { display: none; }
/* 4. Модальная запись */
.v5-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; }
.v5-modal[hidden] { display: none; }
.v5-modal-backdrop { position: absolute; inset: 0; background: rgba(23, 33, 43, 0.55); }
.v5-modal-panel { position: relative; background: #fff; max-width: 440px; width: 100%; padding: 32px 28px; box-shadow: 0 24px 64px rgba(23, 33, 43, 0.35); max-height: calc(100vh - 32px); overflow: auto; }
.v5-modal-panel h2 { margin: 4px 0 10px; font-size: 26px; }
.v5-modal-close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; line-height: 1; color: #526170; cursor: pointer; }
.v5-modal-close:hover { color: #17212b; }
.v5-modal-note { margin: 0 0 16px; padding: 10px 12px; background: #eaf2f8; color: #154f84; font-size: 13.5px; line-height: 1.5; }
.v5-booking-form { display: flex; flex-direction: column; gap: 8px; }
.v5-booking-form label { font-size: 13px; font-weight: 600; color: #526170; }
.v5-booking-form input { min-height: 46px; border: 1px solid #d8e2ea; padding: 8px 12px; font-size: 16px; font-family: inherit; }
.v5-booking-form input:focus-visible { outline: 2px solid #4e87bb; outline-offset: 1px; }
.v5-booking-form button { margin-top: 10px; }
.v5-booking-form .v5-consent-check { grid-template-columns: 18px minmax(0, 1fr); gap: 10px; min-width: 0; margin: 6px 0 0; font-weight: 400; line-height: 1.45; }
.v5-booking-form .v5-consent-check input { width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; padding: 0; accent-color: #1e64a3; }
.v5-booking-form .v5-consent-check span { min-width: 0; }
.v5-booking-form .v5-consent-check a,
.v5-booking-form .v5-consent-note a { color: #1e64a3; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.v5-booking-form .v5-consent-note { min-width: 0; margin: 0 0 2px 28px; color: #647382; font-size: 12px; line-height: 1.45; }
/* 5. Прайс: sticky-навигация по разделам на мобильном + кнопка наверх */
.v5-price-nav { display: none; position: sticky; top: calc(var(--header-height) + 2px); z-index: 60; background: #fff; border-bottom: 1px solid #d8e2ea; padding: 10px 16px; }
.v5-price-nav select { width: 100%; min-height: 46px; font-size: 16px; border: 1px solid #d8e2ea; background: #fff; padding: 8px 10px; font-family: inherit; color: #17212b; }
@media (max-width: 1023px) { .v5-price-nav { display: block; } }
.v5 .price-section { scroll-margin-top: calc(var(--header-height) + 76px); }
.v5-top-btn { position: fixed; right: 16px; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 90; width: 48px; height: 48px; border-radius: 50%; border: 0; background: #1e64a3; color: #fff; font-size: 22px; cursor: pointer; box-shadow: 0 8px 24px rgba(23, 33, 43, 0.3); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.v5-top-btn.show { opacity: 1; pointer-events: auto; }
.v5-top-btn:hover { background: #154f84; }
@media (min-width: 1024px) { .v5-top-btn { bottom: 28px; } }

/* 5a. Принципы: длинные заголовки всегда остаются внутри карточки. */
.v5 .goal-principle {
  min-width: 0;
}

.v5 .goal-principle h3 {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  line-height: 1.16;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* 6. Каталог врачей */
.v5-doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 24px; margin-top: 28px; }
.v5-doc-card { background: #fff; border: 1px solid #d8e2ea; display: flex; flex-direction: column; }
.v5-doc-card > a { display: block; }
.v5-doc-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; display: block; }
.v5-doc-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.v5-doc-body h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.v5-doc-body h3 a { color: #17212b; text-decoration: none; }
.v5-doc-body h3 a:hover { color: #1e64a3; }
.v5-doc-spec { margin: 0; font-size: 13.5px; line-height: 1.5; color: #526170; flex: 1; }
.v5-doc-link { font-size: 14px; font-weight: 600; }
.v5-catalog-note { margin: 8px 0 0; }
.v5-all-link { display: inline-block; margin-top: 10px; font-weight: 600; }
.v5-filter-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 7. Мобильная UX-адаптация интерактивных блоков */
.v5-mobile-curation-link,
.v5-mobile-carousel-controls {
  display: none;
}

.v5 .footer-group {
  min-width: 0;
  color: #fff;
}

.v5 .footer-group summary {
  list-style: none;
  margin-bottom: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.v5 .footer-group summary::-webkit-details-marker {
  display: none;
}

.v5 .footer-links {
  display: grid;
  align-content: start;
  gap: 10px;
}

@media (max-width: 860px) {
  /* На touch-экране схемы без одновременной видимости карточек не несут пользы. */
  .v5 .goal-puzzle-stage,
  .v5 .ecosystem-stage-lab,
  .v5 .ecosystem-route-layer {
    display: none !important;
  }

  .v5 .goal-puzzle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .v5 .goal-principle,
  .v5 .goal-principle:nth-of-type(n) {
    position: static;
    width: auto;
    min-height: 0;
    padding: 20px;
    opacity: 1 !important;
    transform: none !important;
  }

  .v5 .goal-principle h3 {
    font-size: clamp(17px, 3.5vw, 22px);
  }

  .v5 .v5-mobile-curation-link {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 46px minmax(0, 1fr) 22px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 2px 12px;
    min-height: 72px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }

  .v5 .v5-mobile-curation-link > span {
    display: grid;
    grid-row: 1 / 3;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #a9d7fb;
  }

  .v5 .v5-mobile-curation-link > span svg {
    width: 23px;
    height: 23px;
  }

  .v5 .v5-mobile-curation-link strong {
    grid-column: 2;
    align-self: end;
    font-size: 16px;
  }

  .v5 .v5-mobile-curation-link small {
    grid-column: 2;
    align-self: start;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.35;
  }

  .v5 .v5-mobile-curation-link > svg {
    grid-column: 3;
    grid-row: 1 / 3;
    width: 20px;
    height: 20px;
  }

  .v5 .ecosystem-lab {
    display: block;
    min-height: 0 !important;
  }

  .v5 .benefit-list {
    position: static !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 0 !important;
    padding: 0 !important;
    background: transparent !important;
  }

  .v5 .benefit-list > li,
  .v5 .benefit-list > li:nth-child(n) {
    position: static !important;
    width: auto !important;
    min-width: 0;
  }

  .v5 .benefit-list > li > a,
  .v5 .benefit-list > li:nth-child(n) > a {
    position: static !important;
    display: grid !important;
    grid-template-columns: 70px minmax(0, 1fr) 18px !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 68px !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07) !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .v5 .benefit-list .benefit-symbol {
    position: static !important;
    display: grid !important;
    grid-template-columns: auto auto;
    gap: 8px;
    width: 70px !important;
    height: 44px !important;
    place-content: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    opacity: 1 !important;
    transform: none !important;
  }

  .v5 .benefit-list .benefit-symbol b,
  .v5 .benefit-list .benefit-symbol svg {
    position: static !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .v5 .benefit-list .benefit-symbol b {
    font-size: 11px;
  }

  .v5 .benefit-list .benefit-symbol svg {
    width: 17px;
    height: 17px;
  }

  .v5 .benefit-list a > strong {
    min-width: 0;
    font-size: 14px !important;
    line-height: 1.35 !important;
    overflow-wrap: anywhere;
  }

  .v5 .benefit-list a > small {
    display: none !important;
  }

  .v5 .benefit-list a::after {
    content: "›";
    color: rgba(255, 255, 255, 0.62);
    font-size: 25px;
    line-height: 1;
  }
}

@media (max-width: 760px) {
  .v5 .welcome-copy blockquote.v5-clamped {
    max-height: 280px;
  }

  .v5 .v5-mobile-carousel-controls {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: -10px 0 14px;
  }

  .v5 .v5-mobile-carousel-controls button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: #fff;
    color: var(--color-primary-dark);
    cursor: pointer;
  }

  .v5 .v5-mobile-carousel-controls button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
  }

  .v5 .v5-mobile-carousel-controls button:disabled {
    cursor: default;
    opacity: 0.35;
  }

  .v5 .v5-mobile-carousel-controls svg {
    width: 18px;
    height: 18px;
  }

  .v5 .partner-grid,
  .v5 .article-grid {
    display: grid !important;
    grid-template-columns: none !important;
    grid-template-rows: 1fr;
    grid-auto-flow: column;
    grid-auto-columns: calc(100% - 24px);
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-padding-inline: 1px;
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .v5 .partner-grid::-webkit-scrollbar,
  .v5 .article-grid::-webkit-scrollbar {
    display: none;
  }

  .v5 .partner-grid .partner-card,
  .v5 .article-grid .article-card,
  .v5 .article-grid .article-card:first-child {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100%;
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .v5 .partner-grid .partner-card {
    min-height: 152px;
  }

  .v5 .article-grid .article-card,
  .v5 .article-grid .article-card:first-child {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto 1fr;
  }

  .v5 .article-grid .article-image,
  .v5 .article-grid .article-card:first-child .article-image {
    min-height: 0 !important;
    aspect-ratio: 16 / 10;
  }

  .v5 .article-grid .article-card > div {
    padding: 20px;
  }
}

@media (max-width: 620px) {
  .v5 .site-footer {
    padding-top: 42px;
  }

  .v5 .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .v5 .footer-about {
    grid-column: auto;
    padding-bottom: 22px;
  }

  .v5 .footer-group {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }

  .v5 .footer-group:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .v5 .footer-group summary {
    position: relative;
    min-height: 50px;
    margin: 0;
    padding: 15px 42px 14px 0;
  }

  .v5 .footer-group summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 22px;
    font-weight: 400;
    transform: translateY(-50%);
  }

  .v5 .footer-group[open] summary::after {
    content: "−";
  }

  .v5 .footer-group summary:focus-visible {
    outline: 2px solid #a9d7fb;
    outline-offset: 2px;
  }

  .v5 .footer-links {
    gap: 0;
    padding: 0 0 10px;
  }

  .v5 .footer-grid .footer-links a:not(.brand) {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 6px 0;
  }

  .v5 .footer-bottom {
    margin-top: 28px;
  }

  .v5 .filter-tabs[aria-label="Специальности врачей"] {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    gap: 8px;
    margin-right: calc((100vw - 100%) / -2);
    margin-bottom: 22px;
    padding-right: 18px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-width: none;
  }

  .v5 .filter-tabs[aria-label="Специальности врачей"]::-webkit-scrollbar {
    display: none;
  }

  .v5 .filter-tabs[aria-label="Специальности врачей"] button,
  .v5 .filter-tabs[aria-label="Специальности врачей"] button:nth-child(n) {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    scroll-snap-align: start;
  }

  .v5 .v5-doctor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
  }

  .v5 .v5-doc-card {
    min-width: 0;
  }

  .v5 .v5-doc-card > a:first-child {
    aspect-ratio: 4 / 5;
    overflow: hidden;
  }

  .v5 .v5-doc-card img {
    height: 100%;
    aspect-ratio: auto;
  }

  .v5 .v5-doc-body {
    gap: 6px;
    padding: 11px 10px 13px;
  }

  .v5 .v5-doc-body h3 {
    min-width: 0;
    font-size: clamp(13px, 3.7vw, 16px);
    line-height: 1.26;
    overflow-wrap: anywhere;
  }

  .v5 .v5-doc-spec {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11.5px;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .v5 .v5-doc-link {
    font-size: 12px;
  }
}

@media (max-width: 1023px) {
  .v5.new-4 .menu-button {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 430px) {
  .v5 .goal-puzzle {
    grid-template-columns: minmax(0, 1fr);
  }

  .v5 .goal-principle,
  .v5 .goal-principle:nth-of-type(n) {
    padding: 18px;
  }

  .v5 .partner-grid,
  .v5 .article-grid {
    grid-auto-columns: calc(100% - 18px);
  }
}

.v5 .legal-license-links {
  margin-top: 28px;
}

.v5 .legal-license-links a {
  min-width: 0;
}

.v5 .legal-license-links span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* 11. Юридические загрузки и обновлённые медицинские тексты. */
.v5 .legal-policy-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.v5 .legal-policy-downloads .button {
  min-width: 0;
  overflow-wrap: anywhere;
}

.v5 .v5-medical-warning {
  margin: clamp(24px, 4vw, 36px) 0;
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(33, 106, 169, 0.24);
  border-radius: 18px;
  background: #eef5fa;
}

.v5 .content-copy .v5-medical-warning h2 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2.2vw, 26px);
}

.v5 .v5-medical-warning p {
  margin: 0;
}

.v5 .v5-iv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.v5 .v5-iv-card {
  min-width: 0;
  padding: clamp(18px, 2.5vw, 24px);
  border: 1px solid #d8e2ea;
  border-radius: 16px;
  background: #f8fbfd;
}

.v5 .content-copy .v5-iv-card h3 {
  max-width: 100%;
  margin: 0 0 10px;
  color: #17212b;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.v5 .v5-iv-card p {
  margin: 0;
}

@media (max-width: 720px) {
  .v5 .legal-policy-downloads,
  .v5 .legal-policy-downloads .button {
    width: 100%;
  }

  .v5 .v5-iv-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 359px) {
  .v5 .v5-doctor-grid {
    gap: 8px;
  }

  .v5 .v5-doc-body {
    padding-inline: 8px;
  }

  .v5 .v5-doc-body h3 {
    font-size: 12px;
  }
}


/* Final corrections 2026-09-10 */
.v5 .doctor-accreditation {
  margin-top: clamp(32px, 5vw, 56px);
  padding-top: clamp(28px, 4vw, 42px);
  border-top: 1px solid rgba(30, 100, 163, 0.2);
}

.v5 .doctor-accreditation h2 {
  margin: 0 0 20px;
}

.v5 .doctor-accreditation-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.v5 .doctor-accreditation-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid rgba(30, 100, 163, 0.12);
}

.v5 .doctor-accreditation-list li:last-child {
  border-bottom: 0;
}

.v5 .doctor-accreditation-list li > span:first-child {
  color: var(--color-ink, #17212b);
  font-weight: 600;
}

.v5 .doctor-accreditation-list li > span:last-child {
  color: var(--color-ink-muted, #526170);
  text-align: right;
}

.v5 .foreign-partner-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 460px);
  margin-top: 28px;
  padding: 18px 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(18, 57, 91, 0.16);
}

.v5 .foreign-partner-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.v5 .vtb-partnership-section {
  background: #f4f8fb;
}

.v5 .vtb-partnership-card .eyebrow {
  margin-bottom: 8px;
}

@media (max-width: 620px) {
  .v5 .doctor-accreditation-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .v5 .doctor-accreditation-list li > span:last-child {
    text-align: left;
  }

  .v5 .foreign-partner-logo {
    margin-top: 22px;
    padding: 14px 16px;
  }
}

/* User-supplied photo for principle detail pages; preserve the complete frame. */
.v5 .principle-detail-photo,
.v5 .detail-page-photo {
  max-width: 960px;
  margin: 40px auto 0;
}

.v5 .principle-detail-photo picture,
.v5 .principle-detail-photo img,
.v5 .detail-page-photo picture,
.v5 .detail-page-photo img {
  display: block;
  width: 100%;
}

.v5 .principle-detail-photo img,
.v5 .detail-page-photo img {
  height: auto;
}

.v5 .principle-detail-photo + .principle-detail-content {
  padding-top: 64px;
}

.v5 .detail-page-photo + .legal-info-section {
  padding-top: 64px;
}

.v5 .foreign-page-photo + .section {
  padding-top: 64px;
}

.v5 .dms-intro-photo,
.v5 .dms-intro-photo img {
  display: block;
  width: 100%;
}

.v5 .dms-intro-photo {
  margin-bottom: 32px;
}

.v5 .dms-intro-photo img {
  height: auto;
  border-radius: 12px;
}

@media (max-width: 620px) {
  .v5 .principle-detail-photo,
  .v5 .detail-page-photo {
    margin-top: 24px;
  }

  .v5 .principle-detail-photo + .principle-detail-content {
    padding-top: 40px;
  }

  .v5 .detail-page-photo + .legal-info-section {
    padding-top: 40px;
  }

  .v5 .foreign-page-photo + .section {
    padding-top: 40px;
  }

  .v5 .dms-intro-photo {
    margin-bottom: 24px;
  }
}
