html,
body {
  max-width: 100%;
  overflow-x: clip;
}

body > x-dc > div {
  max-width: 100%;
  overflow-x: clip;
}

.hero-secondary {
  max-width: 920px;
  margin: -10px 0 24px;
  color: #f2efe9;
  font-size: clamp(22px, 2.3vw, 32px);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.hero-qualification {
  display: inline-flex;
  align-items: center;
  margin: 0 0 20px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.hero-meta-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 24px !important;
  align-items: start;
}

.hero-meta-grid > div {
  min-width: 0;
}

.hero-meta-grid--wide {
  grid-column: 1 / -1;
}

.result-strip,
.decision-roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.result-strip > div,
.decision-roles > div {
  min-width: 0;
  padding: 22px;
  border: 1px solid #d8d3c9;
  border-radius: 8px;
  background: #fbfaf6;
}

.result-strip strong,
.decision-roles strong {
  display: block;
  margin-bottom: 8px;
  color: #0e211e;
  font-size: 15px;
  line-height: 21px;
}

.result-strip span,
.decision-roles span {
  display: block;
  color: #5a6b66;
  font-size: 14px;
  line-height: 21px;
}

.source-note {
  margin: 20px 0 0;
  color: #5a6b66;
  font-size: 12px;
  line-height: 18px;
}

.source-note a {
  font-weight: 600;
}

.footer-products {
  gap: 0 !important;
  border-top: 1px solid #2a4a42;
}

.footer-products a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #2a4a42;
  font-size: 14px;
  line-height: 20px;
}

.legal-page {
  min-height: 100vh;
  background: #f2efe9;
  color: #0e211e;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}

.legal-header,
.legal-footer {
  background: #0e211e;
  color: #fff;
}

.legal-header__inner,
.legal-footer__inner,
.legal-content {
  width: min(100% - 40px, 1080px);
  margin: 0 auto;
}

.legal-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 24px;
}

.legal-header img {
  display: block;
  height: 40px;
  width: auto;
}

.legal-header a,
.legal-footer a {
  color: #fff;
}

.legal-content {
  padding: 72px 0 88px;
}

.legal-content h1 {
  max-width: 880px;
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.legal-version {
  margin: 0 0 40px;
  color: #5a6b66;
  font-size: 14px;
}

.legal-content section {
  margin: 0 0 36px;
  padding: 28px 30px;
  border: 1px solid #d8d3c9;
  border-radius: 10px;
  background: #fbfaf6;
}

.legal-content h2 {
  margin: 0 0 16px;
  font-size: 23px;
  line-height: 1.25;
}

.legal-content h3 {
  margin: 22px 0 10px;
  font-size: 18px;
}

.legal-content p,
.legal-content li {
  font-size: 16px;
  line-height: 1.62;
}

.legal-content ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.legal-content a {
  color: #c2331b;
  font-weight: 600;
}

.legal-doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
}

.legal-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 30px;
  padding: 32px 0;
  color: #8a9793;
  font-size: 13px;
  line-height: 20px;
}

section[data-screen-label] {
  scroll-margin-top: 78px;
}

@media (min-width: 701px) {
  section[data-screen-label][style*="padding:128px 0"],
  section[data-screen-label][style*="padding: 128px 0"] {
    padding: 88px 0 !important;
  }

  section[data-screen-label][style*="padding:96px 0"],
  section[data-screen-label][style*="padding: 96px 0"] {
    padding: 76px 0 !important;
  }

  section[data-screen-label="Первый экран"] > div:last-child {
    padding-top: 72px !important;
    padding-bottom: 68px !important;
  }
}

@media (max-width: 700px) {
  header > div {
    min-height: 0 !important;
    padding: 9px 16px !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
  }

  header img {
    height: 32px !important;
  }

  header > div > div {
    flex-wrap: nowrap !important;
    gap: 8px !important;
  }

  header > div > div > a[href="index.dc.html"],
  header a[href^="tel:"] {
    display: none !important;
  }

  header > div > div > a:last-child {
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
  }

  section[data-screen-label] {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
    scroll-margin-top: 58px;
  }

  section[data-screen-label="Первый экран"] > div:last-child {
    padding: 34px 20px 40px !important;
  }

  section.hero--home[data-screen-label="Первый экран"] {
    padding-top: 36px !important;
  }

  section.hero--optimization[data-screen-label="Первый экран"] {
    padding-top: 16px !important;
  }

  section[data-screen-label="Первый экран"] > div:last-child > span:nth-of-type(2) {
    display: none !important;
  }

  section[data-screen-label="Первый экран"] h1 {
    max-width: 100% !important;
    font-size: 34px !important;
    line-height: 1.08 !important;
    margin-bottom: 16px !important;
  }

  .hero-secondary {
    margin-top: -4px;
    margin-bottom: 16px;
    font-size: 21px;
    line-height: 1.28;
  }

  .hero-qualification {
    margin-bottom: 14px;
    padding: 7px 10px;
  }

  section[data-screen-label="Первый экран"] > div:last-child > p:not(.hero-secondary) {
    font-size: 16px !important;
    line-height: 1.48 !important;
  }

  section[data-screen-label="Первый экран"] > div:last-child > p:last-of-type {
    margin-bottom: 24px !important;
  }

  .hero-case-card {
    display: none !important;
  }

  .hero--actions-first > div:last-child {
    display: flex !important;
    flex-direction: column !important;
  }

  .hero--actions-first .hero-actions {
    order: 1;
    margin: 0 0 24px !important;
  }

  .hero--actions-first .hero-meta-grid {
    order: 2;
    margin-bottom: 0 !important;
  }

  .hero-actions--home {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
  }

  .hero-actions--home > a {
    box-sizing: border-box;
    justify-content: center;
    width: 100%;
  }

  section[data-screen-label="Первый экран"] > div:last-child > div[style*="border-top"] {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 12px 18px !important;
    padding: 16px 0 !important;
    margin-bottom: 24px !important;
  }

  .hero-meta-grid > div > div:last-child {
    max-width: none !important;
    font-size: 15px !important;
    line-height: 21px !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }

  .package-hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 20px 18px !important;
  }

  .result-strip,
  .decision-roles {
    grid-template-columns: 1fr;
  }

  [style*="min-width:520px"],
  [style*="min-width: 520px"] {
    min-width: 0 !important;
  }

  .schedule-section .schedule-row,
  section[data-screen-label="Расписание сезона"] > div > div:last-child > div,
  section[data-screen-label="Ближайшие даты"] > div > div:last-child > div {
    grid-template-columns: 84px minmax(0, 1fr) auto !important;
    gap: 6px 12px !important;
    align-items: start !important;
    padding: 18px 12px !important;
  }

  .schedule-section .schedule-date,
  section[data-screen-label="Расписание сезона"] > div > div:last-child > div > :nth-child(1),
  section[data-screen-label="Ближайшие даты"] > div > div:last-child > div > :nth-child(1) {
    grid-column: 1;
    grid-row: 1 / span 2;
    font-size: 16px !important;
    line-height: 22px !important;
  }

  .schedule-section .schedule-title,
  section[data-screen-label="Расписание сезона"] > div > div:last-child > div > :nth-child(2),
  section[data-screen-label="Ближайшие даты"] > div > div:last-child > div > :nth-child(2) {
    grid-column: 2 / 4;
    grid-row: 1;
    font-size: 15px !important;
    line-height: 21px !important;
  }

  .schedule-section .schedule-tag,
  section[data-screen-label="Расписание сезона"] > div > div:last-child > div > :nth-child(3),
  section[data-screen-label="Ближайшие даты"] > div > div:last-child > div > :nth-child(3) {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    font-size: 11px !important;
    line-height: 16px !important;
    white-space: normal !important;
  }

  .schedule-section .schedule-action,
  section[data-screen-label="Расписание сезона"] > div > div:last-child > div > :nth-child(4),
  section[data-screen-label="Ближайшие даты"] > div > div:last-child > div > :nth-child(4) {
    grid-column: 3;
    grid-row: 2;
    font-size: 13px !important;
    line-height: 18px !important;
  }

  .schedule-section .schedule-action[href="#hero"],
  section[data-screen-label="Расписание сезона"] a[href="#hero"],
  section[data-screen-label="Ближайшие даты"] a[href="#hero"] {
    font-size: 0 !important;
  }

  .schedule-section .schedule-action[href="#hero"]::after,
  section[data-screen-label="Расписание сезона"] a[href="#hero"]::after,
  section[data-screen-label="Ближайшие даты"] a[href="#hero"]::after {
    content: "Вы здесь";
    font-size: 13px;
    line-height: 18px;
  }

  .comparison-table,
  .package-calendar {
    max-width: 100%;
    overflow: hidden !important;
  }

  .comparison-grid {
    min-width: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .comparison-grid > :first-child {
    display: none;
  }

  .comparison-grid > :nth-child(2),
  .comparison-grid > :nth-child(3) {
    padding: 12px !important;
    font-size: 12px !important;
    line-height: 17px !important;
  }

  .comparison-grid > :nth-child(3n + 4) {
    grid-column: 1 / -1;
    padding: 13px 12px 5px !important;
    background: #fff !important;
    font-size: 13px !important;
    line-height: 18px !important;
    font-weight: 600 !important;
  }

  .comparison-grid > :nth-child(3n + 5),
  .comparison-grid > :nth-child(3n + 6) {
    padding: 7px 12px 13px !important;
    border-top: 0 !important;
    background: #fff !important;
    font-size: 13px !important;
    line-height: 18px !important;
  }

  .comparison-grid > :nth-child(3n + 6) {
    font-weight: 600 !important;
  }

  .package-calendar-grid {
    min-width: 0 !important;
    grid-template-columns: 105px minmax(0, 1fr) !important;
  }

  .package-calendar-grid > :nth-child(-n + 3) {
    display: none;
  }

  .package-calendar-grid > :nth-child(3n + 4) {
    grid-column: 1;
    padding: 14px 8px 6px 12px !important;
    font-size: 14px !important;
    line-height: 20px !important;
  }

  .package-calendar-grid > :nth-child(3n + 5) {
    grid-column: 2;
    padding: 14px 12px 6px 8px !important;
    font-size: 14px !important;
    line-height: 20px !important;
  }

  .package-calendar-grid > :nth-child(3n + 6) {
    grid-column: 1 / -1;
    padding: 2px 12px 14px !important;
    border-top: 0 !important;
    font-size: 12px !important;
    line-height: 18px !important;
  }

  .package-calendar-grid > :nth-child(3n + 6)::before {
    content: "Кому: ";
    font-weight: 600;
    color: #3f694b;
  }

  .legal-header__inner,
  .legal-footer__inner,
  .legal-content {
    width: min(100% - 32px, 1080px);
  }

  .legal-header__inner {
    min-height: 58px;
  }

  .legal-header img {
    height: 31px !important;
  }

  .legal-content {
    padding: 48px 0 64px;
  }

  .legal-content section {
    padding: 22px 20px;
  }
}
