/* Keep all mobile language choices available in a bounded, independently scrolling list. */
.mobile-language-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  max-block-size: min(34vh, 12rem);
  max-block-size: min(34dvh, 12rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.mobile-language-list > a {
  display: block;
  min-width: 0;
}

/* Product photo galleries and media panels fill the complete product grid. */
.product-page .product-layout > .pg-media30-gallery,
.product-page .product-layout > .pg-product-media {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

/* CP225: public subpages use the approved wide canvas instead of narrow
   centered cards that leave unused columns on desktop. */
.pg-quote-form-shell {
  width: 100%;
  max-width: none;
  margin: clamp(24px, 3vw, 42px) 0;
}

.pg-quote-form-shell .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.pg-quote-form-shell .form-grid label:has(textarea) {
  grid-column: 1 / -1;
}

.pg-quote-form-shell .form-grid > button {
  justify-self: start;
  min-width: min(100%, 240px);
}

.legal-page > .container,
.product-page > .container {
  max-width: 1440px;
}

/* Private quote portals and shared result pages are public-facing subpages too. */
.pg-private-shell,
.pg-share-shell {
  width: min(1440px, calc(100% - (2 * var(--pg-gutter))));
  max-width: 1440px;
  min-width: 0;
}

.pg-private-shell {
  padding-block: clamp(20px, 3vw, 40px) clamp(32px, 5vw, 68px);
}

/* Trim legacy section padding at subpage roots so content begins promptly and
   short templates do not appear to float in large empty bands. */
.subpage-visual-scene,
.legal-page {
  padding-block: clamp(24px, 3.2vw, 48px);
}

.pg-private-shell .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.pg-private-table {
  min-width: 640px;
}

/* Several toolkit cards have no eyebrow above their heading; remove the
   legacy spacer that left a visibly empty block at the top of those cards. */
.pg-partner-card h3 {
  margin-block-start: clamp(12px, 1.3vw, 20px);
}

@media (max-width: 640px) {
  .subpage-visual-scene,
  .legal-page {
    padding-block: clamp(18px, 5vw, 24px);
  }

  .pg-quote-form-shell .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .pg-quote-form-shell .form-grid label:has(textarea) {
    grid-column: auto;
  }

  .pg-quote-form-shell .form-grid > button {
    width: 100%;
    justify-self: stretch;
  }

  .pg-private-card,
  .pg-share-card {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .pg-private-actions {
    align-items: stretch;
  }

  .pg-private-actions > .cta,
  .pg-private-actions > .ghost {
    flex: 1 1 100%;
    text-align: center;
  }
}

/* CP227: large legal cookie tables remain inside their card and scroll horizontally
   on desktop and touch devices without widening the document. */
.legal-cookie-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  touch-action: pan-x pan-y;
}
.legal-cookie-table > table {
  width: max-content;
  min-width: 760px;
  max-width: none;
  table-layout: auto;
}
.legal-cookie-table:focus-visible {
  outline: 2px solid #62b8ff;
  outline-offset: 3px;
}


/* CP243 bounded language and model navigation */
.langmenu {
  max-height: min(68vh, 36rem);
  max-height: min(68dvh, 36rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.mobile-panel.open,
.subpage-shell .mobile-panel.open {
  max-height: min(78vh, calc(100vh - 96px));
  max-height: min(78dvh, calc(100dvh - 96px));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.mobile-language-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  max-height: min(42vh, 18rem);
  max-height: min(42dvh, 18rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.mobile-language-list > a { min-width: 0; overflow-wrap: anywhere; }
.registry-grid[data-pg-registry] {
  max-height: min(68vh, 46rem);
  max-height: min(68dvh, 46rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  align-content: start;
  padding: 4px;
  scroll-padding-block: 12px;
}
.pg-live-finder:not([hidden]) {
  max-height: min(54vh, 30rem);
  max-height: min(54dvh, 30rem);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
@media (max-width: 900px) {
  .registry-grid[data-pg-registry] { max-height: min(60vh, 38rem); max-height: min(60dvh, 38rem); }
}
@media (prefers-reduced-motion: reduce) {
  .mobile-panel.open, .mobile-language-list, .registry-grid[data-pg-registry], .pg-live-finder:not([hidden]) { scroll-behavior: auto; }
}
