/* iOS phone geometry only. Load after the existing layout and phone styles.
   Docks have one native bottom anchor in Safari and installed web apps.
   The keyboard-session script owns viewport measurements; CSS never pans body. */
html:root.gsfc-ios-keyboard {
  --safe-area-inset-top: env(safe-area-inset-top, 0px) !important;
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px) !important;
  /* Retain the approved nav inset and product-action spacing. */
  --gsfc-nav-safe: max(0px, calc(env(safe-area-inset-bottom, 0px) - 16px));
  --gsfc-action-safe: env(safe-area-inset-bottom, 0px);
  --gsfc-chat-safe: env(safe-area-inset-bottom, 0px);
}
html:root.gsfc-ios-keyboard.gsfc-ios-browser {
  --gsfc-action-safe: max(0px, calc(env(safe-area-inset-bottom, 0px) - 8px));
}
/* Keep the physical chat inset stable during pointerdown/focus/blur.
   The existing viewport owner already lifts the composer above the keyboard. */
/* The dock itself owns bottom safe spacing, so the document does not add it. */
html:root.gsfc-ios-keyboard:is(.gsfc-store-layout, .gsfc-seller-layout) body {
  padding-bottom: 0 !important;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-tabbar,
html:root.gsfc-ios-keyboard.gsfc-store-layout .classic-bottom-nav,
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-dock-host,
html:root.gsfc-ios-keyboard.gsfc-seller-layout #app .dynamic-island-container[data-v-6e61367a],
html:root.gsfc-ios-keyboard.gsfc-seller-layout #app .gsfc-library-dock-host,
html:root.gsfc-ios-keyboard.gsfc-store-layout .h5-product-details .bottom-actions {
  position: fixed !important;
  top: auto !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  margin-bottom: 0 !important;
  transform: none !important;
  -webkit-transform: none !important;
  transition: none !important;
  box-sizing: border-box !important;
}
/* Only an observed post-keyboard native anchor gap in an installed iOS chat
   session activates this correction. Nested docks retain their own zero inset. */
html:root.gsfc-ios-keyboard.gsfc-keyboard-recovered.gsfc-store-layout .gsfc-buyer-tabbar,
html:root.gsfc-ios-keyboard.gsfc-keyboard-recovered.gsfc-store-layout .classic-bottom-nav,
html:root.gsfc-ios-keyboard.gsfc-keyboard-recovered.gsfc-store-layout .gsfc-buyer-dock-host,
html:root.gsfc-ios-keyboard.gsfc-keyboard-recovered.gsfc-seller-layout #app .dynamic-island-container[data-v-6e61367a],
html:root.gsfc-ios-keyboard.gsfc-keyboard-recovered.gsfc-seller-layout #app .gsfc-library-dock-host,
html:root.gsfc-ios-keyboard.gsfc-keyboard-recovered.gsfc-store-layout .h5-product-details .bottom-actions {
  bottom: calc(0px - var(--gsfc-keyboard-dock-gap, 0px)) !important;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-dock-host {
  height: calc(var(--gsfc-nav-row, 60px) + var(--gsfc-nav-safe, 0px)) !important;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-dock-host .classic-bottom-nav {
  position: absolute !important;
  inset: 0 !important;
  height: 100% !important;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-tabbar {
  height: calc(var(--gsfc-nav-row, 60px) + var(--gsfc-nav-safe, 0px)) !important;
  padding-bottom: var(--gsfc-nav-safe, 0px) !important;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-tabbar__row,
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-tabbar__item {
  height: var(--gsfc-nav-row, 60px) !important;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .gsfc-buyer-tabbar__item {
  padding-bottom: 4px !important;
}
/* Content-sized host replaces the old transparent full-screen library layer. */
html:root.gsfc-ios-keyboard.gsfc-seller-layout #app .gsfc-library-dock-host {
  height: auto !important;
  min-height: 0 !important;
  pointer-events: none;
}
html:root.gsfc-ios-keyboard.gsfc-seller-layout #app .gsfc-library-dock-host .fixed-wrap {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 10px 14px calc(10px + var(--gsfc-nav-safe, 0px)) !important;
  pointer-events: auto;
}
html:root.gsfc-ios-keyboard.gsfc-store-layout .h5-product-details .bottom-actions {
  padding-bottom: var(--gsfc-action-safe, 0px) !important;
}
/* Full-page chat has exactly one viewport owner: the chat root itself. */
html:root.gsfc-ios-keyboard.gsfc-customer-service-page body {
  position: static !important;
  inset: auto !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
}
html:root.gsfc-ios-keyboard .mobile-customer-service,
html:root.gsfc-ios-keyboard .customer-service-wrap .customer-service-dialog.ant-modal {
  position: fixed !important;
  top: var(--gsfc-keyboard-viewport-top, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: var(--gsfc-keyboard-viewport-height, 100dvh) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
html:root.gsfc-ios-keyboard .mobile-customer-service > .safe-bottom {
  flex: 0 0 auto !important;
  padding-bottom: calc(10px + var(--gsfc-chat-safe, 0px)) !important;
}
html:root.gsfc-ios-keyboard .customer-service-dialog .customer-service-footer {
  position: static !important;
  flex: 0 0 auto !important;
  padding-bottom: max(12px, var(--gsfc-chat-safe, 0px)) !important;
}
html:root.gsfc-ios-keyboard .customer-service-dialog > div:first-child {
  height: 100% !important;
  min-height: 0 !important;
}
html:root.gsfc-ios-keyboard .customer-service-dialog .ant-modal-content {
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
html:root.gsfc-ios-keyboard .customer-service-dialog .ant-modal-header {
  flex: 0 0 auto !important;
}
html:root.gsfc-ios-keyboard .customer-service-dialog .ant-modal-body,
html:root.gsfc-ios-keyboard .customer-service-dialog .customer-service {
  height: auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}
/* Only message content scrolls; headers and composers stay in the flex layout. */
html:root.gsfc-ios-keyboard .mobile-customer-service .gsfc-service-messages,
html:root.gsfc-ios-keyboard .customer-service-dialog .customer-service-list {
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}
