/* Reuse the desktop photo/text rows on phones, including the narrowest widths. */
main.contact_ .contact .one {
  display: flex;
  align-items: stretch;
  padding: 0;
  margin-bottom: 12px;
  background: #f2f2f2;
}

main.contact_ .contact .one > img {
  display: none;
}

main.contact_ .contact .one > .phone {
  display: block !important;
  flex: 0 0 32%;
  min-width: 0;
  align-self: center;
}

main.contact_ .contact .one > .phone img {
  display: block !important;
  width: 100%;
  float: none;
}

main.contact_ .contact .one .text {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: auto !important;
  margin: 0;
  padding: 10px max(12px, calc(52px - 5vw)) 10px 10px;
  background: none;
}

main.contact_ .contact .one .text .innerBox {
  width: 100%;
  padding: 0;
  font-size: clamp(13px, 2.15vw, 16px);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

main.contact_ .contact .one .text :is(p, address) {
  margin: 3px 0;
  padding-left: 0;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: 0;
  background: none;
}

.ym-home-content {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 30px);
  width: min(90%, calc(95% - 54px));
  margin-inline-start: 5%;
}

.ym-home-content .ym-home-panel {
  padding-inline-end: 0;
}

@media (max-width: 480px) {
  .ym-home-content .ym-home-kicker {
    font-size: 9px;
    letter-spacing: .04em;
  }
}

@media (max-width: 389px) {
  .ym-home-content .ym-home-kicker {
    letter-spacing: 0;
  }

  .ym-home-content .ym-home-panel-heading {
    gap: 4px;
  }

  .ym-home-content h2 {
    font-size: 16px;
  }

  .ym-home-content .ym-home-all {
    font-size: 11px;
  }

  .ym-home-content .ym-content-empty {
    padding-inline: 8px;
  }
}

@media (min-width: 390px) and (max-width: 540px) {
  /* Keep each case together and alternate the sides as on desktop. */
  main.main_case .unit_al:not(.szal_al1) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    padding-top: 20px !important;
  }

  main.main_case .unit_al:not(.szal_al1) > .text {
    grid-area: 1 / 1;
    margin-bottom: 0;
    padding-top: 8px;
    min-width: 0;
  }

  main.main_case .unit_al:not(.szal_al1) > :is(a, img) {
    grid-area: 1 / 2;
    min-width: 0;
  }

  main.main_case :is(.al2, .al4).unit_al > .text {
    grid-column: 2;
  }

  main.main_case :is(.al2, .al4).unit_al > :is(a, img) {
    grid-column: 1;
  }

  main.main_case .unit_al:not(.szal_al1) img {
    float: none;
    margin: 0 !important;
    padding-top: 0 !important;
  }

  main.main_case .unit_al:not(.szal_al1) .text p {
    font-size: clamp(13px, 3.2vw, 16px);
    padding-inline: 4px;
    overflow-wrap: anywhere;
  }

  main.main_case .unit_al:not(.szal_al1) .text a {
    top: 0;
    margin-top: 6px;
    margin-bottom: 8px !important;
  }
}

@media (max-width: 540px) {
  /* At this width the case photos are in flow, so the desktop offset is unnecessary. */
  footer.jhxc {
    margin-top: 7%;
  }

  /* These original photos have no separate phone version. */
  main.case_intro .ym-show-original-photo img.vertical {
    display: block;
  }

  /* The phone collage includes the two photos restored in the following rows. */
  main.ssjn.case_intro .area1 img.phone {
    display: none !important;
  }

  .team .content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .team .content .one {
    height: auto !important;
  }

  .team .content .one .intro {
    padding-inline: clamp(10px, 3vw, 16px) !important;
  }

  .team .content .one .intro p {
    font-size: 13px !important;
  }
}

@media (min-width: 540px) {
  /* As on desktop, keep the two existing lists next to each other. */
  .honor_ms .pc_hidden .centerBox {
    display: grid;
    grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
    align-items: start;
    gap: 20px;
  }

  .honor_ms .pc_hidden .unit1 {
    margin-bottom: 0;
  }
}

@media (min-width: 430px) and (max-width: 540px) {
  main.case_intro .ym-case-pair {
    --ym-photo-column: 1;
    --ym-text-column: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    margin-bottom: 10px !important;
  }

  main.case_intro .ym-case-pair-right {
    --ym-photo-column: 2;
    --ym-text-column: 1;
  }

  main.case_intro .ym-case-pair > :is(a, img, .right) {
    grid-area: 1 / var(--ym-photo-column);
    min-width: 0;
  }

  main.case_intro .ym-case-pair > .text {
    grid-area: 1 / var(--ym-text-column);
    min-width: 0;
  }
}
/* Let the existing footer decoration contribute its own height to the page. */
body::after {
  height: env(safe-area-inset-bottom, 0px);
}

footer .footer_bg {
  position: relative;
  display: block;
}

/* Keep short article indexes ending at the footer within the viewport. */
body:has(> main.ym-content-listing) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body > main.ym-content-listing {
  flex: 1 0 auto;
}

