/* v1.0.256: changes scoped to exactly two requested sections.
   The original theme contains numerous legacy !important rules; targeted
   overrides here are necessary to replace fixed rows and forced widths. */

/* 1. Five choosing-point cards: content-sized heights; preserve order and portrait. */
@media (min-width: 941px) {
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five {
    grid-template-rows: repeat(3, auto) !important;
    align-items: stretch !important;
    row-gap: 18px !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    grid-template-rows: auto auto auto !important;
    align-content: start !important;
    padding: 19px 21px 20px !important;
    row-gap: 3px !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card > .hl-choose-diagram-card__num {
    margin-bottom: 3px !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card > h3 {
    margin: 0 0 8px !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card > p {
    margin: 0 !important; align-self: start !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card--e {
    height: auto !important; min-height: 0 !important; max-height: none !important;
  }
}
@media (max-width: 940px) {
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    grid-template-rows: auto auto auto !important;
    padding: 17px 19px 19px !important;
    row-gap: 3px !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card > h3 {
    text-align: center !important; margin: 0 0 9px !important;
  }
  #main-content#main-content.hl-choose-page .hl-choose-advisor-diagram--five > .hl-choose-diagram-card > p {
    margin: 0 !important;
  }
}

/* 3. Young-patients concerns: same editable team photo as a decorative
   full-bleed background; the four existing cards are the foreground. */
#main-content#main-content.hl-young-page .hl-young-problem {
  position: relative; isolation: isolate; overflow: clip;
  background: linear-gradient(108deg, #F9F0F2 0%, #FFFDFC 58%, #FFFDFC 100%);
}
#main-content#main-content.hl-young-page .hl-young-problem::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  /* The photograph is a discrete, fully opaque background layer, NOT masked or faded. */
  inset: auto;
  left: clamp(75px, calc(20vw - 160px), 235px);
  top: 54%;
  width: clamp(500px, 41vw, 700px);
  height: auto;
  aspect-ratio: 3 / 2;
  background-color: transparent;
  background-image: var(--hl-young-team-photo);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-position: center center;
  border-radius: 20px;
  transform: translateY(-50%);
  opacity: 1;
  -webkit-mask-image: none;
  mask-image: none;
}
#main-content#main-content.hl-young-page .hl-young-problem > .hl-container {
  position: relative; z-index: 1;
  width: min(calc(100% - 40px), 1280px); max-width: 1280px;
}
#main-content#main-content.hl-young-page .hl-young-problem__grid--four {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto !important;
  width: min(100%, 805px) !important; max-width: 805px !important;
  gap: 20px 22px !important; margin-inline: auto !important;
  padding: 0 !important; min-height: 0 !important;
  align-items: stretch !important; justify-content: center !important;
}
#main-content#main-content.hl-young-page .hl-young-problem__grid--four > article.hl-young-problem__combined:nth-child(n) {
  grid-column: auto !important; grid-row: auto !important;
  width: 100% !important; min-width: 0 !important;
  max-width: none !important; transform: none !important;
  position: relative; z-index: 2;
}
/* v258: shift the four cards as one group together with the photograph.
   Reserve at least 36px at the right viewport edge on narrower desktops. */
@media (min-width: 1051px) {
  #main-content#main-content.hl-young-page .hl-young-problem__grid--four {
    transform: translateX(min(205px, calc((100vw - 805px) / 2 - 36px)));
  }
}
/* Remove left-anchored title accents and list indents in this section only. */
#main-content#main-content.hl-young-page .hl-young-problem__grid--four > article.hl-young-problem__combined h3 {
  border-left: 0 !important;
  padding-left: 0 !important;
  text-align: center !important;
  width: 100%;
}
#main-content#main-content.hl-young-page .hl-young-problem__grid--four .hl-young-problem__combined-content {
  align-items: center !important;
  text-align: center;
  padding-inline: 20px !important;
}
#main-content#main-content.hl-young-page .hl-young-problem__grid--four > article.hl-young-problem__combined .hl-young-problem__combined-content ul {
  text-align: center !important;
  width: 100%;
  max-width: 320px;
  padding: 0 !important;
  margin: 0 auto !important;
}
#main-content#main-content.hl-young-page .hl-young-problem__grid--four > article.hl-young-problem__combined .hl-young-problem__combined-content li {
  text-align: center !important;
}
#main-content#main-content.hl-young-page .hl-young-problem__photo-note {
  position: absolute; left: 12px; bottom: 0; z-index: 1;
  font-size: 12px; color: #6C7278;
}
@media (min-width: 761px) and (max-width: 900px) {
  #main-content#main-content.hl-young-page .hl-young-problem::before {
    inset: 210px auto auto 50%; width: 370px; height: auto;
    aspect-ratio: 3 / 2;
    background-size: 100% 100%; background-position: center;
    transform: translateX(-50%);
    opacity: 1;
    -webkit-mask-image: none; mask-image: none;
  }
  #main-content#main-content.hl-young-page .hl-young-problem__grid--four {
    margin-top: clamp(300px, 38vw, 340px) !important;
  }
}
@media (min-width: 901px) and (max-width: 1279px) {
  /* At these widths, showing both full faces takes priority over a forced overlap. */
  #main-content#main-content.hl-young-page .hl-young-problem::before {
    inset: 200px auto auto 50%; width: 450px; height: auto;
    aspect-ratio: 3 / 2;
    background-size: 100% 100%; background-position: center;
    transform: translateX(-50%);
  }
  #main-content#main-content.hl-young-page .hl-young-problem__grid--four {
    margin-top: 320px !important; transform: none !important;
  }
}
@media (max-width: 760px) {
  #main-content#main-content.hl-young-page .hl-young-problem::before {
    inset: 230px auto auto 50%; width: min(90vw, 310px); height: auto;
    aspect-ratio: 3 / 2;
    background-size: 100% 100%; background-position: center;
    transform: translateX(-50%); opacity: 1;
    -webkit-mask-image: none; mask-image: none;
  }
  #main-content#main-content.hl-young-page .hl-young-problem__grid--four {
    grid-template-columns: minmax(0,1fr) !important;
    width: min(100%, 460px) !important; max-width: 460px !important;
    gap: 19px !important; margin-top: 245px !important;
  }
  #main-content#main-content.hl-young-page .hl-young-problem__photo-note {
    bottom: -21px; right: 0; left: auto;
  }
}
