.family-landing {
  --family-section-space: clamp(50px, 8vw, 110px);
  color: var(--ink);
  background: var(--cream);
}

.family-hero {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
  padding-block: clamp(32px, 4.5vw, 64px) clamp(48px, 6vw, 90px);
}

.family-hero h1 {
  font-size: clamp(36px, 3.8vw, 58px);
  line-height: 1.06;
}

.family-hero h1 span {
  display: block;
}

.family-hero h1 span,
.family-section-heading h2 span {
  color: var(--brand-dark);
}

.family-hero-intro,
.family-section-heading p,
.family-estimate-copy p {
  max-width: 48ch;
  font-size: clamp(14px, 1.25vw, 17px);
  line-height: 1.6;
  text-wrap: pretty;
}

.family-hero-place {
  margin-bottom: 11px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 700;
}

.family-hero-intro {
  margin-block: 17px 20px;
  color: var(--muted);
}

.family-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-hero-actions .button {
  gap: 12px;
  min-height: 47px;
  padding: 10px 14px;
}

.family-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(16px, 3vw, 30px);
  margin: 19px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.family-hero-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.family-hero-facts dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: clamp(17px, 1.65vw, 22px);
  font-weight: 700;
}

.family-hero-benefits {
  position: absolute;
  inset-block-end: var(--family-photo-inset);
  inset-inline-end: var(--family-photo-inset);
  display: grid;
  justify-items: end;
  gap: clamp(5px, .65vw, 9px);
  max-width: calc(100% - 2 * var(--family-photo-inset));
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

.family-hero-benefits li {
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  line-height: 1.25;
}

.family-hero-photo {
  --family-photo-inset: clamp(10px, 1.6vw, 22px);
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 22px;
  background: var(--warm);
}

.family-hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.32;
  max-height: 455px;
  object-fit: cover;
  object-position: 50% 54%;
}

.family-projects {
  padding-bottom: clamp(34px, 5vw, 68px);
}

body[data-page="family-homes"] .desktop-nav {
  gap: clamp(9px, 1.1vw, 17px);
}

body[data-page="family-homes"] .chat-label {
  display: none;
}

.family-landing .technology-section,
.family-landing .proof-section,
.family-landing .trust-section,
.family-landing .quiz-section,
.family-landing #contacts {
  padding-block: var(--family-section-space);
}

.family-landing .technology-section {
  background: var(--warm);
}

.family-landing .proof-section {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}

.family-landing .about-layout {
  gap: clamp(22px, 5vw, 70px);
}

.family-material-photo {
  margin: 0;
  overflow: hidden;
  border-radius: 17px;
  background: var(--white);
  border: 1px solid var(--line);
}

.family-material-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1.12;
  object-fit: cover;
  object-position: 50% 61%;
}

.family-material-photo figcaption {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

.family-landing .about-showrooms a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.family-landing .quiz-intro h2 {
  font-size: clamp(32px, 4.2vw, 54px);
}

.family-landing .quiz-card {
  min-height: 0;
}

.family-section-heading {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: end;
  margin-bottom: clamp(16px, 2.5vw, 30px);
}

.family-section-heading h2,
.family-estimate h2 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  text-wrap: balance;
}

.family-section-heading p,
.family-scope p {
  color: var(--muted);
}

.family-project-heading-side {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.family-project-nav {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.family-project-nav .round-button:disabled {
  opacity: .42;
  cursor: default;
}

.family-project-grid {
  --family-project-gap: clamp(12px, 2vw, 24px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--family-project-gap)) / 3);
  gap: var(--family-project-gap);
  overflow-x: auto;
  padding-bottom: 7px;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

.family-project-benefits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px clamp(12px, 2.5vw, 32px);
  margin: 13px 0 0;
  padding: 15px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.family-project-benefits li {
  display: flex;
  align-items: start;
  gap: 9px;
}

.family-project-benefits .ui-icon {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  color: var(--brand-dark);
}

.family-project-benefits strong {
  font-size: 14px;
}

.family-project-benefits p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.family-project {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.family-project-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--warm);
}

.family-project-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(12px, 1.6vw, 20px);
}

.family-project-title {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}

.family-project-title h3 {
  font-size: clamp(24px, 2.25vw, 32px);
}

.family-project-title strong {
  font-size: 15px;
  white-space: nowrap;
}

.family-project-body > p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.family-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 92px), 1fr));
  gap: 7px;
  margin-block: 14px 13px;
}

.family-plan-grid a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand-dark);
  background: var(--white);
}

.family-plan-grid a:hover,
.family-plan-grid a:focus-visible {
  border-color: var(--brand);
}

.family-plan-grid img {
  display: block;
  width: 100%;
  height: clamp(96px, 9vw, 126px);
  object-fit: contain;
}

.family-plan-grid span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 20px;
  font-size: 12px;
  font-weight: 650;
}

.family-plan-grid .ui-icon {
  width: 13px;
  height: 13px;
}

.family-project-body .family-project-price {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 3px 10px;
  align-items: baseline;
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.family-project-price strong {
  color: var(--ink);
  white-space: nowrap;
}

.family-project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
}

.family-project-open {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 7px 12px;
  border-radius: 9px;
  white-space: nowrap;
}

.family-project-contacts {
  display: flex;
  gap: 4px;
}

.family-project-contact {
  display: grid;
  width: 40px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--brand-dark);
}

.family-project-contact:hover {
  border-color: var(--brand);
  background: var(--cream);
}

.family-project-contact .ui-icon {
  width: 17px;
  height: 17px;
}

.family-project-contact--telegram {
  color: #146f99;
}

.family-project-contact--max {
  color: #5743a8;
  font-size: 11px;
  font-weight: 750;
}

.family-custom-project {
  background: var(--warm);
}

.family-custom-project figure {
  position: relative;
  margin: 0;
}

.family-custom-project figcaption {
  position: absolute;
  bottom: 8px;
  left: 8px;
  max-width: calc(100% - 16px);
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--ink);
  background: var(--cream);
  font-size: 11px;
}

.family-custom-project h3 {
  font-size: clamp(22px, 2vw, 29px);
  line-height: 1.15;
}

.family-custom-project p {
  margin-block: 8px 12px;
}

.family-custom-project .family-project-actions {
  margin-top: auto;
}

body[data-page="family-homes"] .project-dialog #project-modal-image {
  max-height: 310px;
  margin-top: 12px;
  object-fit: cover;
}

.family-project-views {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.family-project-views:empty {
  display: none;
}

.family-project-views img {
  display: block;
  width: 76px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
}

.family-project-breakdown {
  margin-block: 15px;
}

.family-project-breakdown h4 {
  margin-bottom: 5px;
}

.family-project-breakdown dl {
  margin: 0;
}

.family-project-breakdown dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 7px 15px;
  padding-block: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.family-project-breakdown dl > div[hidden] {
  display: none;
}

.family-project-breakdown dt small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.family-project-breakdown dd {
  margin: 0;
  white-space: nowrap;
  font-weight: 700;
}

.family-project-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.family-project-dialog-actions .button {
  min-height: 44px;
  justify-content: center;
  padding: 8px 12px;
  gap: 7px;
  line-height: 1.3;
  text-align: center;
}

.family-packages {
  padding-block: var(--family-section-space);
  background: var(--warm);
}

.family-price-scroll {
  overflow-x: auto;
  scrollbar-width: thin;
}

.family-price-table {
  width: 100%;
  min-width: 410px;
  table-layout: fixed;
  border: 1px solid var(--line);
  border-spacing: 0;
  border-radius: 13px;
  overflow: hidden;
  background: var(--white);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.family-price-table caption {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}

.family-price-table th,
.family-price-table td {
  padding: 11px clamp(6px, 1.7vw, 20px);
  text-align: right;
}

.family-price-table th:first-child {
  width: 40%;
  text-align: left;
}

.family-price-table thead th {
  background: var(--cream);
  font-size: 14px;
}

.family-price-table tbody th,
.family-price-table tbody td {
  border-top: 1px solid var(--line);
}

.family-price-table tbody th span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.family-price-table td {
  font-weight: 700;
  white-space: nowrap;
}

.family-scope {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin-top: 18px;
}

.family-scope h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.family-scope p {
  font-size: 14px;
  line-height: 1.5;
}

.family-estimate {
  display: grid;
  grid-template-columns: 1.15fr minmax(0, 1fr);
  gap: clamp(20px, 6vw, 74px);
  align-items: center;
  margin-block: var(--family-section-space);
  padding: clamp(17px, 4vw, 55px);
  border-radius: 20px;
  color: var(--white);
  background: var(--brand-dark);
}

.family-estimate h2 span {
  color: var(--white);
}

.family-estimate-copy p {
  margin-top: 12px;
}

.family-estimate-copy .family-showroom {
  padding-top: 13px;
  border-top: 1px solid currentColor;
  font-size: 13px;
}

.family-showroom a {
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
}

.family-form-panel {
  padding: clamp(14px, 2.2vw, 27px);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
}

.family-lead-form {
  gap: 11px;
  margin: 0;
}

.family-lead-form label {
  font-size: 13px;
}

.family-lead-form input:not([type="checkbox"]):not([type="hidden"]) {
  font-size: 16px;
}

.family-optional {
  margin-left: 4px;
  color: var(--muted);
  font-weight: 400;
  font-size: 11px;
}

.family-lead-form > .button {
  gap: 8px;
  min-height: 48px;
  padding-inline: 14px;
  line-height: 1.25;
  text-align: left;
}

.family-lead-form > .button .ui-icon {
  flex-shrink: 0;
}

.family-lead-form .form-message:empty {
  display: none;
}

@media (max-width: 1000px) {
  .family-project-grid {
    grid-auto-columns: calc((100% - var(--family-project-gap)) / 2);
  }
}

@media (max-width: 760px) {
  .family-hero,
  .family-section-heading,
  .family-estimate {
    grid-template-columns: minmax(0, 1fr);
  }

  .family-hero h1 {
    font-size: clamp(34px, 7.4vw, 48px);
  }

  .family-hero-intro {
    margin-block: 12px 14px;
  }

  .family-hero-facts {
    margin-top: 14px;
    padding-top: 10px;
  }

  .family-hero-photo img {
    aspect-ratio: 16 / 10;
  }

  .family-hero-benefits {
    font-size: 12px;
  }

  .family-hero-benefits li {
    padding: 4px 8px;
  }

  .family-material-photo img {
    aspect-ratio: 16 / 11;
  }

  .family-section-heading {
    gap: 8px;
  }

  .family-project-photo {
    aspect-ratio: 16 / 8;
  }

  .family-plan-grid img {
    height: 114px;
  }

  .family-price-table th,
  .family-price-table td {
    padding: 8px 5px;
    font-size: 12px;
  }

  .family-price-table tbody th span {
    font-size: 11px;
  }

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

  .family-project-dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  }

  .family-project-dialog-actions .button {
    padding-inline: 8px;
    font-size: 12px;
  }

  .family-project-dialog-actions .ui-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 620px) {
  .family-project-grid {
    grid-auto-columns: 100%;
  }

  .family-project-benefits {
    grid-template-columns: minmax(0, 1fr);
  }
}
