/* Keep each explanation and its images on shared top and left edges. */
.page-story__benefit--gallery { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 40px; align-items: start; padding-block: 40px; }
.page-story__benefit--gallery > .page-story__copy { margin: 0; }
.page-story__benefit--gallery h2 { font-size: clamp(26px, 2.3vw, 36px); scroll-margin-top: 110px; }
.page-story__benefit--gallery p { font-size: 17px; }
.page-gallery { min-width: 0; width: 100%; max-width: none; }
.page-gallery__stage { position: relative; }
.page-gallery__slides { display: grid; isolation: isolate; }
.page-gallery__slide { grid-area: 1 / 1; margin: 0; opacity: 0; transition: opacity 420ms ease; }
.page-gallery__slide.is-active { opacity: 1; z-index: 1; }
.page-gallery__slide.is-leaving { opacity: 1; z-index: 0; }
.page-gallery__slide[hidden] { display: none; }
.page-gallery__image { aspect-ratio: var(--gallery-ratio); }
.page-gallery__image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.page-gallery__caption { display: flex; gap: 10px; align-items: baseline; padding-block: 12px; min-height: 66px; box-sizing: border-box; color: #62708e; font-size: 13px; line-height: 1.5; }
.page-gallery__kind { color: #080b11; font-weight: 700; white-space: nowrap; }
.page-gallery__choices { display: flex; gap: 10px; min-width: 0; flex-wrap: wrap; }
.page-gallery button, .page-gallery-grid button { border: 0; background: transparent; color: #62708e; font: 600 13px/1.4 Raleway, sans-serif; cursor: pointer; }
.page-gallery__choices button { display: flex; flex-direction: column; align-items: stretch; position: relative; flex: 1 1 60px; max-width: 96px; padding: 0 0 8px; text-align: left; }
.page-gallery__choices img { flex: none; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; opacity: .75; margin-bottom: 7px; transition: opacity 180ms; }
.page-gallery__choices button:hover img, .page-gallery__choices button[aria-pressed="true"] img { opacity: 1; }
.page-gallery button:hover, .page-gallery button[aria-pressed="true"], .page-gallery-grid button:hover { color: #0565ff; }
.page-gallery__choices button[aria-pressed="true"]::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: #dce8ff; }
.page-gallery__progress { display: none; }
.page-gallery__choices button[aria-pressed="true"] .page-gallery__progress { display: block; position: absolute; inset: auto 0 0; height: 2px; background: #0565ff; transform-origin: left; z-index: 1; }
.page-gallery.is-playing button[aria-pressed="true"] .page-gallery__progress { animation: gallery-progress 3s linear forwards; }
.page-gallery button:focus-visible, .page-gallery-grid button:focus-visible { outline: 2px solid #0565ff; outline-offset: 4px; }
/* The capsule groups only the two image actions, matching the app's floating controls. */
.page-gallery__actions { position: absolute; z-index: 2; top: 12px; right: 12px; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 999px; background: #fff; box-shadow: 0 3px 16px #080b1114; }
.page-gallery__actions button { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; color: #535761; }
.page-gallery__actions button:hover { background: #f1f3f6; color: #080b11; }
.page-gallery__actions .material-icons { font-size: 22px; }
.page-story__benefit--gallery-grid { display: block; }
.page-story__benefit--gallery-grid > .page-story__copy { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 40px; margin-bottom: 24px; }
.page-story__benefit--gallery-grid h2 { margin-bottom: 0; }
.page-gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 12px; }
.page-gallery-grid button { display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 0; text-align: left; border-radius: 0; }
.page-gallery-grid img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; margin-bottom: 8px; }
@keyframes gallery-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (max-width: 1100px) {
  .page-story__benefit--gallery, .page-story__benefit--gallery-grid > .page-story__copy { gap: 28px; }
  .page-gallery__choices { gap: 8px; }
  .page-gallery__choices button { font-size: 12px; }
}
@media (max-width: 760px) {
  .page-story__benefit--gallery { padding-block: 32px; display: block; }
  .page-story__benefit--gallery > .page-story__copy { display: block; margin-bottom: 20px; }
  .page-story__benefit--gallery h2 { margin-bottom: 14px; }
  .page-gallery__caption { min-height: 0; }
  .page-gallery__actions { top: 8px; right: 8px; }
  .page-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .page-gallery__slide, .page-gallery__choices img { transition: none; }
  .page-gallery.is-playing button[aria-pressed="true"] .page-gallery__progress { animation: none; }
}

.page-gallery-lightbox { position: fixed; inset: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; box-sizing: border-box; padding: 18px 24px; border: 0; border-radius: 0; background: rgba(0,0,0,.94); color: white; }
.page-gallery-lightbox[open] { display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 16px; }
.page-gallery-lightbox::backdrop { background: rgba(0,0,0,.8); }
.page-gallery-lightbox__header { display: flex; align-items: center; gap: 14px; }
.page-gallery-lightbox__title { margin-right: auto; font-size: 15px; }
.page-gallery-lightbox button, .page-gallery-lightbox a { color: #fff; background: #262626; border: 0; border-radius: 8px; padding: 10px 14px; font: 600 14px/1.4 Raleway, sans-serif; cursor: pointer; }
.page-gallery-lightbox button:focus-visible, .page-gallery-lightbox a:focus-visible { outline: 2px solid #60a5ff; outline-offset: 3px; }
.page-gallery-lightbox__body { min-height: 0; display: grid; grid-template-columns: 44px minmax(0,1fr) 44px; gap: 12px; align-items: center; }
.page-gallery-lightbox__viewport { height: 100%; overflow: auto; min-width: 0; }
.page-gallery-lightbox__viewport img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.page-gallery-lightbox__viewport.is-zoomed img { width: 200%; height: 200%; max-width: none; cursor: zoom-out; }
.page-gallery-lightbox__icon { width: 44px; height: 44px; padding: 12px !important; }
.page-gallery-lightbox__icon img { display: block; width: 20px; height: 20px; filter: brightness(0) invert(1); }
.page-gallery-lightbox__strip { display: flex; justify-content: center; gap: 8px; overflow-x: auto; padding: 4px; }
.page-gallery-lightbox__strip button { padding: 2px; border-radius: 0; flex: 0 0 54px; height: 54px; background: transparent; border: 2px solid transparent; }
.page-gallery-lightbox__strip button[aria-pressed="true"] { border-color: #0565ff; }
.page-gallery-lightbox__strip img { width: 100%; height: 100%; object-fit: cover; }
html:has(.page-gallery-lightbox[open]) { overflow: hidden; }
@media (max-width: 760px) {
  .page-gallery-lightbox { padding: 12px; gap: 10px; }
  .page-gallery-lightbox__header { flex-wrap: wrap; gap: 8px; }
  .page-gallery-lightbox__title { flex: 1 1 60%; }
  .page-gallery-lightbox__body { grid-template-columns: 36px minmax(0,1fr) 36px; gap: 4px; }
  .page-gallery-lightbox__icon { width: 36px; height: 40px; padding: 8px !important; }
  .page-gallery-lightbox__strip { justify-content: safe center; }
}

/* Hero scene changes stay inside the existing browser; its original UI stays fixed. */
.page-hero-scenes { width: 100%; max-width: none; background: transparent; }
.page-hero-scenes .page-gallery__image { aspect-ratio: 8 / 5; }
.page-hero-scenes__ui { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; }
.page-hero-scenes__toolbar { position: absolute; right: 0; top: calc(100% + 28px); z-index: 3; display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 999px; background: #fff; box-shadow: 0 3px 16px #080b1114; }
.page-hero-scenes__toolbar .page-gallery__choices { gap: 0; flex-wrap: nowrap; }
.page-hero-scenes__toolbar .page-gallery__choices button { flex: none; max-width: none; padding: 8px 10px; border-radius: 999px; font-size: 12px; white-space: nowrap; }
.page-hero-scenes__toolbar .page-gallery__choices button[aria-pressed="true"] { background: #eef4ff; }
.page-hero-scenes__toolbar .page-gallery__choices button::after { display: none; }
.page-hero-scenes__toolbar .page-gallery__actions { position: static; padding: 0; box-shadow: none; }
.page-story__devices:has(.page-hero-scenes) { padding-bottom: 72px; }
@media (max-width: 760px) {
  .page-hero-scenes__toolbar { top: calc(100% + 32px); gap: 2px; }
  .page-hero-scenes__toolbar .page-gallery__choices button { padding: 8px 7px; font-size: 11px; }
  .page-hero-scenes__toolbar .page-gallery__actions button { width: 30px; height: 32px; }
  .page-story__devices:has(.page-hero-scenes) { padding-bottom: 84px; }
}
@media (max-width: 480px) {
  .page-hero-scenes__toolbar { width: 100%; box-sizing: border-box; flex-wrap: wrap; justify-content: center; border-radius: 20px; }
  .page-hero-scenes__toolbar .page-gallery__choices { width: 100%; justify-content: space-between; }
  .page-hero-scenes__toolbar .page-gallery__choices button { font-size: 10px; padding: 6px 4px; }
  .page-story__devices:has(.page-hero-scenes) { padding-bottom: 104px; }
}

/* Tool links share the existing Stage glossary assets and a single optical size. */
.page-story__tool-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; list-style: none; margin: 24px 0 0; padding: 0; }
.page-story__tool-row a { display: flex; align-items: center; gap: 12px; min-height: 48px; color: #62708e; font-size: 16px; font-weight: 700; line-height: 1.4; text-decoration: none; }
.page-story__tool-row img { display: block; flex: none; width: 48px; height: 48px; object-fit: contain; }
.page-story__benefit--gallery-grid .page-story__tool-row { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.page-story__tool-row a:is(:hover, :focus-visible) { color: var(--link-highlight); }
.page-story__tool-row a:focus-visible { outline: 2px solid #0565ff; outline-offset: 3px; }
.page-tools__tool { scroll-margin-top: 110px; }

@media (max-width: 400px) {
  .page-story__tool-row { grid-template-columns: 1fr; }
}

.page-gallery-grid--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.page-gallery-grid--pair img { aspect-ratio: auto; }
