/* Tablet-only layout corrections for both Studio render modes.
   Keep the gallery, video stage, and purchase summary in separate rows. */
@media (min-width: 761px) and (max-width: 1023px) {
  .aip-page .aip-shell {
    width: min(920px, calc(100% - 48px));
  }

  .aip-page .aip-product-layout {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 30px;
    min-width: 0;
  }

  /* Flatten the gallery/editorial wrapper so purchase content follows the
     gallery, while editorial content remains after the purchase summary. */
  .aip-page .aip-left-column {
    display: contents;
  }

  .aip-page .aip-gallery {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 780px;
    min-width: 0;
    margin-inline: auto;
  }

  .aip-page .aip-gallery-thumbs {
    min-width: 0;
    gap: 9px;
  }

  .aip-page .aip-thumb {
    width: 60px;
    height: 60px;
  }

  .aip-page .aip-gallery-stage {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    aspect-ratio: .98;
    overflow: hidden;
  }

  .aip-page .aip-gallery-slides,
  .aip-page .aip-slide,
  .aip-page .studio-product-video {
    min-width: 0;
    max-width: 100%;
  }

  .aip-page .aip-summary {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
  }

  .aip-page .aip-summary h1,
  .aip-page .aip-description,
  .aip-page .aip-price-finance,
  .aip-page .aip-service-row,
  .aip-page .aip-options,
  .aip-page .aip-purchase-row,
  .aip-page .aip-trust-row {
    min-width: 0;
    max-width: 100%;
  }

  .aip-page .aip-price-finance,
  .aip-page .aip-finance-promo,
  .aip-page .aip-finance-pitch,
  .aip-page .aip-service-item {
    min-width: 0;
  }

  .aip-page .aip-summary h1 {
    overflow-wrap: anywhere;
  }

  .aip-page .aip-editorial {
    grid-column: 1;
    grid-row: 3;
    width: 100%;
    min-width: 0;
  }

  .aip-page .aip-editorial > * {
    min-width: 0;
    max-width: 100%;
  }

  .aip-page .aip-editorial-feature {
    grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
    gap: clamp(20px, 3vw, 30px);
  }

  .aip-page .aip-editorial-photo,
  .aip-page .aip-editorial-copy {
    min-width: 0;
  }

  .aip-page .aip-editorial-photo img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .aip-page .aip-editorial-measures,
  .aip-page .aip-editorial-facts,
  .aip-page .aip-editorial-social,
  .aip-page .aip-editorial-help {
    min-width: 0;
    max-width: 100%;
  }

  .aip-page .aip-measure-list,
  .aip-page .aip-editorial-measures .aip-studio-stats {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  }

  .aip-page .aip-editorial-social {
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  }

  .aip-page .aip-social-layout,
  .aip-page .aip-social-main,
  .aip-page .aip-social-posters,
  .aip-page .aip-social-sidebar {
    min-width: 0;
    max-width: 100%;
  }

  .aip-page .aip-attribute-table-wrap,
  .aip-page .aip-editorial-original .aip-details-content {
    max-width: 100%;
    overflow-x: auto;
  }

  .aip-page .aip-attribute-table {
    width: 100%;
    table-layout: fixed;
  }

  .aip-page .aip-editorial-facts th,
  .aip-page .aip-editorial-facts td,
  .aip-page .aip-attribute-table th,
  .aip-page .aip-attribute-table td {
    overflow-wrap: anywhere;
  }
}
