/* ZUMI-22: Zumi Design System / Grid layouts, node 46:2387.
   The 375/768/1280 frames are reference sizes, not fixed page widths. */
body[data-zumi-responsive] {
  --zumi-layout-max: 1280px;
  --zumi-layout-gutter: 16px;
  --gb-max: var(--zumi-layout-max);
  --maxw: var(--zumi-layout-max);
  --max: var(--zumi-layout-max);
  margin-inline: 0;
}
body[data-zumi-responsive], body[data-zumi-responsive] * { box-sizing: border-box; }
body[data-zumi-responsive] > :is(.app,.page,.screen,.auth-shell,.VendorDetails,.ch-shell,.zp-shell,.zp-profile-shell,.za-shell,.zm-shell,.zm-thread-shell,.bk-page,.bd-page,.ba-page,.br-page,.receipt-page,.lr-page,.pn-page,.confirmation-shell,.claim-shell,.gb-app) {
  width: 100%;
  max-width: var(--zumi-layout-max);
  margin-inline: auto;
  min-width: 0;
}
/* Keep the existing single-column component arrangements and typography. */
body[data-zumi-responsive] :is(.ch-main,.zp-shell,.zp-profile-shell,.za-shell,.zm-inbox,.bk-page,.bd-page,.ba-page,.br-page,.receipt-page,.lr-page,.pn-page,.confirmation-shell,.claim-shell,.gb-content,.br-head,.br-content,.photo-head,.date-head,.date-content) {
  padding-inline: var(--zumi-layout-gutter);
}
body[data-zumi-responsive] > .page :is(.zpd-hero-content,.zpd-tabs-wrap,.zpd-content) {
  padding-inline: var(--zumi-layout-gutter);
}
body[data-zumi-responsive] > .app > .page { padding-inline: var(--zumi-layout-gutter); }
body[data-zumi-responsive] > .screen > .content { padding-inline: var(--zumi-layout-gutter); }
body[data-zumi-responsive] :is(.zm-thread-nav,.zm-composer-wrap,.auth-content,.auth-page .fg-header) { padding-inline: var(--zumi-layout-gutter); }
body[data-zumi-responsive] :is(.ch-welcome-row,.s4-copy,.br-price-group,.gb-row > *,.za-copy,.zm-message-content) { min-width: 0; }
body[data-zumi-responsive] :is(input,select,textarea) { max-width: 100%; min-width: 0; }
body[data-zumi-responsive] :is(.br-address,.za-copy,.zm-message-text,.bd-address) { overflow-wrap: anywhere; }

/* Every fixed bottom surface shares its page's horizontal bounds. */
body[data-zumi-responsive] :is(nav.zumi-tabbar,.ch-tabbar,.zp-tabbar,.zm-tabbar,.bk-tabbar,.bd-tabbar,.br-sticky,.gb-bar-in) {
  width: 100%;
  max-width: var(--zumi-layout-max);
  padding-inline: var(--zumi-layout-gutter);
}
body[data-zumi-responsive] nav.zumi-tabbar {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
body[data-zumi-responsive] :is(.ch-tabbar,.zp-tabbar,.zm-tabbar,.bk-tabbar,.bd-tabbar) {
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
body[data-zumi-responsive] .br-sticky { gap: 12px; }
body[data-zumi-responsive] .br-sticky > div { min-width: 0; }
body[data-zumi-responsive] .br-sticky .gb-btn { min-width: 0; white-space: normal; }
body[data-zumi-responsive] > .br-app:has(.br-sticky) {
  padding-bottom: max(128px, calc(var(--zumi-fixed-bottom-height, 0px) + 32px));
}
body[data-zumi-responsive].zumi-has-tabbar .zm-thread-shell {
  height: calc(100dvh - var(--zumi-fixed-bottom-height, var(--zumi-tabbar-height)));
}

/* Bottom sheets stay bottom sheets; only their bounds and scrolling adapt. */
body[data-zumi-responsive] :is(.zp-sheet,.za-dialog,.zp-medical-dialog,.br-info-dialog,.zm-permission-sheet,.zm-media-panel,.bd-modal-panel,.bd-payment-sheet,.bd-sheet,.bd-cancel-confirmed-sheet,.br-photos-dialog,.bd-lightbox-inner,.ba-lightbox-inner,.overlay .modal) {
  width: min(100%, var(--zumi-layout-max));
  max-width: var(--zumi-layout-max);
  min-width: 0;
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 16px);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding-inline: var(--zumi-layout-gutter);
}
body[data-zumi-responsive] :is(.zp-sheet,.za-dialog,.zp-medical-dialog,.br-info-dialog,.zm-permission-sheet,.overlay .modal) {
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}
/* A sticky action row inside a short sheet would cover its date inputs. */
body[data-zumi-responsive] .zp-sheet .zp-bottom-cta { position: static; }
body[data-zumi-responsive] :is(.date-days,.date-weekdays) { min-width: 0; }
body[data-zumi-responsive] .date-days button { max-width: 100%; justify-self: center; }
/* Browse has legacy !important phone caps; scope their replacement to this page. */
body[data-zumi-responsive] #viewResults .resultsWrap,
body[data-zumi-responsive] #viewResults .filterSheet,
body[data-zumi-responsive] #searchSheet {
  width: min(100%, var(--zumi-layout-max)) !important;
  max-width: var(--zumi-layout-max) !important;
}
body[data-zumi-responsive].bk-browse-open main.browse,
body[data-zumi-responsive].bk-browse-open #nav-root .bk-topbar { max-width: var(--zumi-layout-max); }
@media (min-width: 768px) {
  body[data-zumi-responsive] { --zumi-layout-gutter: 32px; }
  /* The phone card is about 164px wide. Add columns instead of magnifying it. */
  body[data-zumi-responsive] #petGrid { grid-template-columns: repeat(auto-fill, minmax(164px, 1fr)); }
  body[data-zumi-responsive] .zp-profile-track { width: 100%; max-width: none; }
  body[data-zumi-responsive] .zp-profile-section { align-items: stretch; }
}
