/* Final approved responsive Residence implementation. Shared site primitives are reused where applicable; Residence-specific responsive rules are documented in RESIDENCES_LOCK.md. */
.residences-page .residence-photo {
  position: relative;
  aspect-ratio: 2 / 1;
}

.residences-page .residence-photo img {
  object-position: 50% 78%;
}

.residences-page .residence-opening {
  display: grid;
  grid-template-columns: 66% 34%;
  min-height: 340px;
}

.residences-page .residence-opening-divider {
  left: 66%;
}

.residences-page .residence-hero-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px 28px;
}

.residences-page .residence-opening-copy {
  display: grid;
  align-items: center;
  padding: var(--photo-frame-inset) 28px;
}

.residences-page .residence-opening-stack {
  display: contents;
}

.residences-page .residence-hero-titles h1 {
  margin: 0 0 42px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.residences-page .residence-hero-titles .hero-title {
  margin: 0;
  line-height: 0.95;
}

.residences-page .residence-comfort .chapter-image img {
  object-position: 50% 72%;
}

@media (width >= 1276px) {
  /* Size desktop photographs from their grid tracks, preserving caption rows. */
  .residences-page .residence-bathrooms > .chapter-image img,
  .residences-page .residence-windows > .chapter-image img,
  .residences-page .residence-comfort > .chapter-image img {
    height: auto;
    align-self: stretch;
  }
}

.residences-page .residence-opening-copy .intro-copy {
  grid-area: 1 / 1;
  font-family: "Inter Tight", Arial, sans-serif;
  font-size: 16.2px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.27;
  color: var(--ink);
}

.residences-page .residence-opening-action {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: start;
  margin-top: 0;
}

.residences-page .residence-chapter .chapter-body {
  margin-top: 42px;
}

.residences-page .residence-kitchens .chapter-image {
  grid-template-rows: minmax(0, 1fr);
  padding-bottom: var(--photo-frame-inset);
}

.residences-page .residence-kitchens {
  min-height: 1120px;
}

.residences-page .residence-kitchen-field {
  display: grid;
  grid-template-rows: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--photo-frame-inset);
  min-height: 0;
}

.residences-page .residence-kitchen-main,
.residences-page .residence-kitchen-detail {
  position: relative;
  min-height: 0;
}

.residences-page .residence-kitchen-main-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.residences-page .residence-kitchen-main figcaption,
.residences-page .residence-kitchen-detail figcaption {
  position: absolute;
  top: 100%;
  left: 0;
  height: var(--photo-frame-inset);
}

.residences-page .residence-kitchen-main img,
.residences-page .residence-kitchen-detail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.residences-page .residence-kitchen-main img {
  object-position: center;
}

.residences-page .residence-kitchen-detail img {
  object-position: center 70%;
}

.residences-page .residence-kitchen-annotation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--ink);
  pointer-events: none;
}

.residences-page .residence-kitchen-annotation path {
  stroke-width: 0.8px;
  opacity: 0.72;
  vector-effect: non-scaling-stroke;
}

.residences-page .residence-kitchen-callout {
  width: 100%;
  font-family: "Inter Tight", Arial, sans-serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
  color: var(--ink);
  opacity: 1;
}

.residences-page .residence-kitchen-callout strong {
  display: block;
  font-weight: inherit;
}

.residences-page .residence-kitchen-callout span {
  display: block;
}

.residences-page .residence-kitchens .chapter-copy h2 {
  margin-bottom: 0;
}

.residences-page .residence-kitchens .chapter-body {
  margin-top: 24px;
}

.residences-page .chapter-body a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.residences-page .residence-opening-copy .intro-copy a[href="/luxury-apartments-lancaster-pa/"]:any-link {
  color: var(--ink);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.residences-page .residence-range-intro {
  display: grid;
  grid-template-columns: 37% 63%;
  padding-right: 28px;
}

.residences-page .residence-range-intro .chapter-number {
  grid-column: 1 / -1;
}

.residences-page .residence-range-intro h2 {
  grid-column: 1;
  grid-row: 2 / 4;
  margin: 42px 0 0;
}

.residences-page .residence-range .chapter-body {
  grid-column: 2;
  margin-top: 42px;
  width: 700px;
  max-width: 700px;
}

.residences-page .residence-range-intro > .chapter-action {
  grid-column: 2;
  justify-self: start;
}

.residences-page .residence-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  background-color: var(--paper);
}

.residences-page .residence-plans > div {
  display: grid;
  grid-template-rows: 42px 340px auto auto;
  align-content: start;
  justify-items: center;
  padding: 42px 28px 56px;
}

.residences-page .residence-plan-image {
  display: block;
  height: auto;
  object-fit: contain;
  align-self: start;
  mix-blend-mode: multiply;
}

.residences-page .residence-plan-frame {
  display: contents;
}

.residences-page .residence-plans > div:first-child .residence-plan-image {
  width: 206px;
}

.residences-page .residence-plans > div:nth-child(2) .residence-plan-image {
  width: 229px;
}

.residences-page .residence-plans > div:nth-child(3) .residence-plan-image {
  width: 300px;
}

.residences-page .residence-plans p {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.18;
  letter-spacing: -0.025em;
  text-align: center;
}

.residences-page .residence-plans h3 {
  margin: 0;
  font-family: "Inter Tight", Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.18;
  text-align: center;
}

.residences-page .residence-plans .chapter-action {
  justify-self: center;
  margin-left: 0;
  text-align: center;
}

@media (width >= 900px) {
  .residences-page .residence-opening-copy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .residences-page .residence-opening-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .residences-page .residence-opening-action {
    align-self: flex-start;
    margin-top: 0;
  }

  .residences-page .residence-kitchens {
    overflow: clip;
  }

  .residences-page .residence-kitchens > .chapter-copy {
    position: sticky;
    top: 88px;
    align-self: start;
  }

  .residences-page .residence-plans > div {
    min-width: 0;
  }

  .residences-page .residence-plan-frame {
    display: block;
    width: min(300px, 100%);
    min-width: 0;
    justify-self: center;
  }

  .residences-page .residence-plan-frame .residence-plan-image {
    margin-inline: auto;
  }

  .residences-page .residence-plans > div:first-child .residence-plan-image {
    width: 68.6667%;
  }

  .residences-page .residence-plans > div:nth-child(2) .residence-plan-image {
    width: 76.3333%;
  }

  .residences-page .residence-plans > div:nth-child(3) .residence-plan-image {
    width: 100%;
  }

  .residences-page .residence-plans .chapter-action {
    max-width: 100%;
  }

  .residences-page .residence-plans .chapter-action-label {
    white-space: nowrap;
  }
}

@media (900px <= width < 1040px) {
  .residences-page .residence-opening-copy {
    padding-top: 32px;
    padding-bottom: 32px;
  }

  .residences-page .residence-plans .chapter-action {
    padding-inline: 4px;
    font-size: 11px;
    letter-spacing: 0;
  }

  .residences-page .residence-bathrooms .chapter-image img {
    object-position: 66% center;
  }

  .residences-page .residence-bathrooms .chapter-copy h2,
  .residences-page .residence-windows .chapter-copy h2 {
    margin-bottom: 0;
  }

  .residences-page .residence-bathrooms .chapter-body,
  .residences-page .residence-windows .chapter-body {
    margin-top: 48px;
  }

  .residences-page .residence-comfort .chapter-copy h2 {
    margin-bottom: 0;
  }

  .residences-page .residence-comfort .chapter-body {
    margin-top: 48px;
  }

  .residences-page .residence-range-intro {
    grid-template-columns: minmax(0, 0.40fr) minmax(0, 0.60fr);
  }

  .residences-page .residence-range-intro > .chapter-body,
  .residences-page .residence-range-intro > .chapter-action {
    min-width: 0;
  }

  .residences-page .residence-range .chapter-body {
    width: 100%;
    max-width: none;
  }
}

@media (900px <= width < 1024px) {
  .residences-page .residence-opening-action {
    position: relative;
    top: -10px;
  }
}

@media (width < 900px) {
  .residences-page .residence-windows .chapter-image img {
    object-position: 85% center;
  }

  .residences-page .residence-opening-copy {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .residences-page .residence-opening-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 40px;
  }

  .residences-page .residence-opening-action {
    align-self: flex-start;
    margin-top: 0;
  }

  .residences-page .residence-kitchens {
    min-height: 0;
  }

  .residences-page .residence-kitchens .chapter-image {
    grid-template-rows: auto;
  }

  .residences-page .residence-kitchen-field {
    height: auto;
    aspect-ratio: 464.8 / 1024;
    align-self: start;
  }

  .residences-page .residence-plans > div {
    min-width: 0;
    grid-template-rows: 42px auto auto auto;
  }

  .residences-page .residence-plan-frame {
    display: flex;
    width: min(300px, 100%);
    min-width: 0;
    aspect-ratio: 300 / 348;
    justify-self: center;
    align-items: flex-start;
  }

  .residences-page .residence-plan-frame .residence-plan-image {
    margin-inline: auto;
  }

  .residences-page .residence-plans > div:first-child .residence-plan-image {
    width: 68.6667%;
  }

  .residences-page .residence-plans > div:nth-child(2) .residence-plan-image {
    width: 76.3333%;
  }

  .residences-page .residence-plans > div:nth-child(3) .residence-plan-image {
    width: 100%;
  }

  .residences-page .residence-plans .chapter-action {
    max-width: 100%;
    min-width: 0;
  }
}

@media (601px <= width < 900px) {
  .residences-page .residence-kitchens {
    overflow: clip;
  }

  .residences-page .residence-kitchens > .chapter-copy {
    position: sticky;
    top: 88px;
    align-self: start;
  }

  .residences-page .residence-bathrooms .chapter-copy h2,
  .residences-page .residence-windows .chapter-copy h2,
  .residences-page .residence-comfort .chapter-copy h2 {
    margin-bottom: 0;
  }

  .residences-page .residence-bathrooms .chapter-body,
  .residences-page .residence-windows .chapter-body,
  .residences-page .residence-comfort .chapter-body {
    margin-top: 48px;
  }

  .residences-page .residence-range-intro {
    grid-template-columns: minmax(0, 0.40fr) minmax(0, 0.60fr);
  }

  .residences-page .residence-range-intro > .chapter-body,
  .residences-page .residence-range-intro > .chapter-action {
    min-width: 0;
  }

  .residences-page .residence-range .chapter-body {
    width: 100%;
    max-width: none;
  }
}

@media (700px <= width < 900px) {
  .residences-page .residence-plans .chapter-action {
    max-width: none;
    padding-inline: 4px;
    font-size: 11px;
    letter-spacing: 0;
  }
}

@media (700px <= width < 900px) and (height <= 500px) {
  .residences-page .residence-plans .chapter-action-label {
    white-space: nowrap;
  }
}

@media (601px <= width < 900px) and (height > 500px),
       (601px <= width < 700px) and (height <= 500px) {
  .residences-page .residence-plans .chapter-action {
    max-width: 100%;
  }

  .residences-page .residence-plans .chapter-action-label {
    white-space: normal;
    line-height: 1.5;
    text-decoration-line: underline;
    text-decoration-color: var(--ink);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-thickness var(--hover-time) ease-out, text-decoration-color var(--hover-time) ease-out;
  }

  .residences-page .residence-plans .chapter-action-label::after {
    content: none;
  }

  .residences-page .residence-plans .chapter-action:hover .chapter-action-label,
  .residences-page .residence-plans .chapter-action:focus-visible .chapter-action-label {
    text-decoration-thickness: 2px;
    text-decoration-color: color-mix(in srgb, var(--ink) 72%, black);
  }
}

@media (width < 730px) and (height > 500px),
       (width < 700px) and (height <= 500px) {
  .residences-page .residence-opening {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .residences-page .residence-opening-divider {
    background: transparent;
  }

  .residences-page .residence-hero-titles {
    padding: 40px 28px 16px;
  }

  .residences-page .residence-opening-copy {
    padding: 16px 28px 40px;
  }
}

@media (width < 700px) {
  .residences-page .residence-plans > div {
    padding-right: 8px;
    padding-left: 8px;
  }

  .residences-page .residence-plans .chapter-action-label {
    min-width: 0;
    white-space: normal;
  }
}

@media (width <= 899px) {
  .residences-page .residence-opening-copy .intro-copy {
    font-family: inherit;
    font-size: 13px;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: 1.43;
    color: inherit;
  }
}

@media (768px <= width <= 899px) {
  .residences-page .residence-opening-copy .intro-copy {
    font-size: 12px;
  }
}

@media (767px <= width < 768px) and (height <= 500px) {
  .residences-page .residence-kitchens .chapter-body {
    margin-top: 32px;
  }

  .residences-page .residence-bathrooms .chapter-copy h2,
  .residences-page .residence-windows .chapter-copy h2,
  .residences-page .residence-comfort .chapter-copy h2 {
    margin-top: 48px;
  }

  .residences-page .residence-range-intro h2,
  .residences-page .residence-range .chapter-body {
    margin-top: 24px;
  }
}

@media (width < 601px) {
  .residences-page .residence-plans {
    grid-template-columns: minmax(0, 1fr);
  }

  .residences-page .residence-plans > div {
    padding: 32px 28px 44px;
  }

  .residences-page .residence-plans .chapter-action-label {
    white-space: nowrap;
  }
}

@media (566px <= width < 601px) {
  .residences-page .residence-bathrooms .chapter-copy,
  .residences-page .residence-comfort .chapter-copy {
    padding-bottom: 28px;
  }
}

@media (600px <= width < 601px) {
  .residences-page .residence-hero-titles .hero-title {
    line-height: 0.98;
  }

  .residences-page .residence-range-intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 42px 28px 50px;
  }

  .residences-page .residence-range-intro h2 {
    width: 100%;
    margin: 24px 0 0;
  }

  .residences-page .residence-range .chapter-body {
    width: 100%;
    max-width: none;
    margin: 28px 0 0;
  }

  .residences-page .residence-range-intro > .chapter-action {
    align-self: flex-start;
    margin: 20px 0 0 -8px;
  }
}

@media (width < 600px) {
  .residences-page {
    --mobile-field-padding: clamp(20px, 6vw, 30px);
    --mobile-photo-frame: clamp(16px, 4.5vw, 22px);
    --mobile-caption-body-gap: 28px;
  }

  .residences-page .residence-hero-titles .hero-title {
    line-height: 1.02;
  }

  .residences-page .residence-opening-copy .intro-copy {
    font-size: 14px;
    line-height: 1.46;
  }
}

@media (width <= 600px) {
  .residences-page .residence-chapter {
    --mobile-field-padding: clamp(20px, 6vw, 30px);
    --mobile-photo-frame: clamp(16px, 4.5vw, 22px);
    --mobile-caption-body-gap: 28px;
    min-height: 0;
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .residences-page .residence-kitchens {
    overflow: visible;
  }

  .residences-page .residence-kitchens > .chapter-copy {
    position: static;
  }

  .residences-page .residence-chapter .chapter-copy {
    display: contents;
  }

  .residences-page .residence-chapter .chapter-number,
  .residences-page .residence-chapter .chapter-copy h2,
  .residences-page .residence-chapter .chapter-body,
  .residences-page .residence-chapter .chapter-image,
  .residences-page .residence-chapter .chapter-divider {
    grid-column: 1;
  }

  .residences-page .residence-chapter .chapter-number {
    order: 1;
    margin: clamp(38px, 10vw, 50px) var(--mobile-field-padding) 0;
  }

  .residences-page .residence-chapter .chapter-copy h2 {
    order: 2;
    margin: clamp(32px, 8vw, 42px) var(--mobile-field-padding) clamp(18px, 5vw, 24px);
    font-size: clamp(38px, 10vw, 48px);
  }

  .residences-page .residence-chapter .chapter-divider {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    order: 3;
    width: 100%;
    height: 0;
    background: transparent;
    transform: scaleX(0);
    transform-origin: left center;
  }

  .residences-page .residence-chapter .chapter-divider.is-drawn {
    transform: scaleX(1);
  }

  .residences-page .residence-chapter .chapter-image {
    order: 4;
    align-self: stretch;
    align-content: stretch;
    height: auto;
    gap: 0;
    padding: var(--mobile-photo-frame) 0 0;
  }

  .residences-page .residence-chapter:not(.residence-kitchens) .chapter-image {
    grid-template-rows: auto var(--mobile-photo-frame);
  }

  .residences-page .residence-chapter:not(.residence-kitchens) .chapter-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .residences-page .residence-chapter .chapter-image figcaption {
    min-width: 0;
    padding-right: var(--mobile-photo-frame);
    padding-left: var(--mobile-photo-frame);
    line-height: 1.2;
  }

  .residences-page .residence-kitchens .chapter-image {
    grid-template-rows: auto;
    padding-bottom: var(--photo-frame-inset);
  }

  .residences-page .residence-chapter .chapter-body {
    order: 5;
    max-width: none;
    margin: var(--mobile-caption-body-gap) var(--mobile-field-padding) 0;
    font-size: 14px;
    line-height: 1.46;
  }

  .residences-page .residence-kitchens .chapter-body {
    margin-top: calc(var(--mobile-caption-body-gap) - (var(--photo-frame-inset) - var(--mobile-photo-frame)) / 2);
  }

  .residences-page .residence-bathrooms .chapter-image img {
    object-position: 68% center;
  }

  .residences-page .residence-kitchens .chapter-body,
  .residences-page .residence-bathrooms .chapter-body,
  .residences-page .residence-windows .chapter-body,
  .residences-page .residence-comfort .chapter-body {
    padding-bottom: 28px;
  }
}

@media (width < 600px) {
  .residences-page .residence-range-intro {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 42px var(--mobile-field-padding) 25px;
  }

  .residences-page .residence-range-intro .chapter-number {
    margin: 0;
  }

  .residences-page .residence-range-intro h2 {
    width: 100%;
    margin: 24px 0 0;
  }

  .residences-page .residence-range .chapter-body {
    width: 100%;
    max-width: none;
    margin: 28px 0 0;
  }

  .residences-page .residence-range-intro > .chapter-action {
    align-self: flex-start;
    margin: 20px 0 0 -8px;
  }
}

@media (width < 541px) {
  .residences-page .residence-kitchen-main img {
    object-position: 41% center;
  }

  .residences-page .residence-kitchen-main .residence-kitchen-annotation {
    transform: translateX(var(--kitchen-main-pan-x, 0px));
  }
}

@media (width < 540px) {
  .residences-page .residence-hero-titles h1 {
    font-size: min(10px, calc((100vw - 104px) / 31));
    white-space: normal;
  }
}

@media (width <= 540px) {
  .residences-page .residence-comfort .chapter-copy h2 {
    font-size: min(clamp(38px, 10vw, 48px), calc((100vw - 95px) / 7.8));
    white-space: nowrap;
  }

  .residences-page .residence-comfort .chapter-copy h2 br:first-of-type {
    display: none;
  }
}

@media (width <= 1024px) {
  .residences-page .residence-photo {
    aspect-ratio: auto;
  }

  .residences-page .residence-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }
}

@media (width <= 600px) {
  .residences-page .residence-chapter.residence-bathrooms .chapter-image {
    grid-template-rows: auto auto;
    align-self: start;
    height: auto;
    min-height: 0;
  }

  .residences-page .residence-chapter.residence-bathrooms .chapter-image img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
}

.residences-page .residence-bathroom-media {
  display: contents;
}

@media (601px <= width <= 768px) {
  .residences-page .residence-bathrooms {
    min-height: 0;
    height: auto;
  }

  .residences-page .residence-bathrooms .chapter-copy {
    padding-top: 24px;
    padding-bottom: 28px;
  }

  .residences-page .residence-bathrooms .chapter-copy h2 {
    margin-top: 24px;
  }

  .residences-page .residence-chapter.residence-bathrooms .chapter-image {
    grid-template-rows: auto auto;
    align-self: stretch;
    align-content: center;
    width: 100%;
    min-width: 0;
    height: auto;
    aspect-ratio: auto;
    padding-block: 16px;
  }

  .residences-page .residence-bathroom-media {
    display: block;
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
  }

  .residences-page .residence-chapter.residence-bathrooms .chapter-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: 100% center;
    scale: 1.18;
    transform-origin: center bottom;
    clip-path: none;
  }
}

@media (601px <= width < 768px) {
  .residences-page .residence-chapter .chapter-copy,
  .residences-page .residence-range-intro {
    padding-top: 24px;
  }

  .residences-page .residence-comfort .chapter-copy {
    padding-bottom: 28px;
  }

  .residences-page .residence-chapter .chapter-copy h2,
  .residences-page .residence-range-intro h2 {
    margin-top: 24px;
  }
}

@media (601px <= width < 700px) and (height > 500px) {
  /* Extend the shared lower-compact system; keep chapter-specific exceptions. */
  .residences-page :where(.residence-chapter) .chapter-image {
    grid-template-rows: minmax(0, 1fr) auto;
    align-self: stretch;
    height: 100%;
    min-height: calc(72.5vw - 56.8px);
    padding-block: 16px;
  }

  .residences-page :where(.residence-chapter) .chapter-image img {
    height: 100%;
    aspect-ratio: auto;
  }

  .residences-page :where(.residence-chapter) .chapter-copy,
  .residences-page .residence-range-intro {
    padding-bottom: clamp(8px, calc(162.76px - 23.81vw), 34px);
  }

  .residences-page .chapter-copy .chapter-action {
    margin-top: clamp(19px, calc(4.762vw - 6.95px), 24px);
  }
}

@media (601px <= width < 768px) and (height > 500px) {
  .residences-page .residence-kitchens > .chapter-copy {
    padding-bottom: 28px;
  }
}

@media (700px <= width < 768px) and (height > 500px) {
  .residences-page .residence-windows .chapter-image,
  .residences-page .residence-comfort .chapter-image {
    padding-bottom: 16px;
  }
}

@media (min-width: 541px) and (max-width: 600px) {
  .residences-page .residence-comfort .chapter-copy h2 {
    white-space: nowrap;
  }

  .residences-page .residence-comfort .chapter-copy h2 br:first-of-type {
    display: none;
  }
}

@media (width <= 600px) {
  .residences-page .residence-range-intro {
    padding-bottom: 25px;
  }

  .residences-page .residence-plans > div {
    padding-bottom: 20px;
  }

  .residences-page .residence-plans > div:first-child {
    padding-top: 16px;
  }

  .residences-page .residence-plans > div + div {
    padding-top: 35px;
  }

  .residences-page .residence-plan-frame {
    aspect-ratio: auto;
  }

  .residences-page .residence-plans p {
    margin-top: 10px;
  }

  .residences-page .residence-plans .chapter-action {
    margin-top: 10px;
  }
}
/* Residence-specific short-landscape layout. */
@media (min-width: 541px) and (max-width: 767px) and (max-height: 500px) {
  .residences-page .residence-photo { height: max(240px, calc(100dvh - 60px)); }
  .residences-page .residence-photo img { height: 100%; object-fit: cover; }
  .residences-page .residence-hero-titles { padding-block: 24px 12px; }
  .residences-page .residence-hero-titles h1 { margin-bottom: 24px; }
  .residences-page .residence-hero-titles .hero-title { font-size: clamp(32px, 5.1vw, 36px); }
  .residences-page .residence-opening-copy { padding-block: 12px 24px; }
  .residences-page .residence-opening-stack { gap: 24px; }
  .residences-page .residence-chapter .chapter-copy,
  .residences-page .residence-range-intro { padding-top: 16px; padding-bottom: 16px; }
  .residences-page .residence-chapter .chapter-copy h2,
  .residences-page .residence-range-intro h2 {
    margin-top: 16px;
    margin-bottom: 0;
    font-size: clamp(28px, 4.8vw, 32px);
  }
  .residences-page .residence-chapter .chapter-body,
  .residences-page .residence-range .chapter-body { margin-top: 20px; }
  .residences-page .residence-range-intro > .chapter-action { margin-top: 16px; }

  /* Keep the complete plan presentation together beneath its unchanged intro. */
  .residences-page .residence-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .residences-page .residence-plans > div,
  .residences-page .residence-plans > div:first-child,
  .residences-page .residence-plans > div + div {
    grid-template-rows: 38px 160px auto auto;
    gap: 8px;
    padding: 12px 8px;
  }
  .residences-page .residence-plan-frame {
    width: min(138px, 100%);
    height: 160px;
    aspect-ratio: auto;
  }
  .residences-page .residence-plan-frame .residence-plan-image { height: 100%; }
  .residences-page .residence-plans h3 { font-size: 16px; }
  .residences-page .residence-plans p { margin-top: 0; font-size: 14px; }
  .residences-page .residence-plans .chapter-action { margin-top: 0; }
  .residences-page .residence-plans .chapter-action-label { white-space: normal; }
}

@media (min-width: 601px) and (max-width: 767px) and (max-height: 500px) {
  /* Keep Kitchen media/SVG geometry and the Bathroom 4:3 zoom treatment intact. */
  .residences-page .residence-kitchens .chapter-copy { top: 60px; }
  .residences-page .residence-windows,
  .residences-page .residence-comfort {
    min-height: max(280px, calc(100dvh - 60px));
    align-items: stretch;
  }
  .residences-page .residence-windows .chapter-image,
  .residences-page .residence-comfort .chapter-image {
    grid-template-rows: minmax(0, 1fr) auto;
    align-self: stretch;
    align-content: normal;
    min-height: 0;
    height: 100%;
    padding-block: 16px;
  }
  .residences-page .residence-windows .chapter-image img,
  .residences-page .residence-comfort .chapter-image img { height: 100%; aspect-ratio: auto; }

  .residences-page .residence-comfort { grid-template-columns: 45% 55%; }
  .residences-page .residence-comfort .chapter-divider { left: 45%; }
  .residences-page .residence-comfort .chapter-copy { padding-block: 9px; }
  .residences-page .residence-comfort .chapter-copy h2 { margin-top: 12px; font-size: 28px; }
  .residences-page .residence-comfort .chapter-copy h2 br:first-of-type { display: none; }
  .residences-page .residence-comfort .chapter-body { margin-top: 12px; }
}

@media (min-width: 541px) and (max-width: 600px) and (max-height: 500px) {
  /* Retain the existing stacked chapter order and non-sticky Kitchen copy. */
  .residences-page .residence-chapter .chapter-number { margin-top: 24px; }
  .residences-page .residence-chapter .chapter-copy h2 {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 34px;
  }
  .residences-page .residence-chapter.residence-windows .chapter-image img,
  .residences-page .residence-chapter.residence-comfort .chapter-image img {
    height: max(260px, calc(100dvh - 60px));
    aspect-ratio: auto;
  }
}
