/* Pop It Here v8.12.0 — mobile-first stabilization */

/* Keep shared navigation/touch chrome calm on phones. */
@media (max-width:760px){
  html{scroll-padding-bottom:calc(92px + env(safe-area-inset-bottom))!important}
  body:has(.pih-mobile-tabs){padding-bottom:calc(84px + env(safe-area-inset-bottom))!important}
  .pih-icon-btn,.pih-avatar-btn,.pih-account-btn,.pih-sheet-close{min-width:44px!important;width:44px!important;min-height:44px!important;height:44px!important}
  .pih-account-avatar{width:34px!important;height:34px!important}
  .pih-sheet{top:max(58px,calc(env(safe-area-inset-top) + 52px))!important;right:8px!important;width:calc(100vw - 16px)!important;max-height:calc(100dvh - max(74px,calc(env(safe-area-inset-top) + 66px)) - max(84px,calc(env(safe-area-inset-bottom) + 76px)))!important;padding-bottom:max(12px,env(safe-area-inset-bottom))!important}
  .pih-menu-card{min-height:52px!important}
  .pih-notice-row{min-height:56px!important}
  .pih-notice-row a,.pih-notice-row button{min-height:44px!important;display:inline-flex!important;align-items:center!important;padding:0 10px!important}
  .pih-mobile-tabs{left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;height:68px!important;padding:5px!important;grid-template-columns:repeat(5,minmax(0,1fr))!important}
  .pih-mobile-tabs a,.pih-mobile-tabs button{min-height:56px!important;font-size:10px!important}
  .pih-mobile-tabs .pih-tab-pop{margin:-15px 4px 1px!important;min-height:62px!important;border-radius:20px!important;background:var(--pih-blue)!important;color:#fff!important;font-size:24px!important;font-weight:900!important;box-shadow:0 9px 24px rgba(36,107,253,.30)!important}
  .pih-mobile-tabs .pih-tab-pop span{font-size:9px!important;line-height:1!important}
}

/* Home: restore a deliberate swipe flow without burying Next Move under old widgets. */
@media (max-width:760px){
  body.pih-mobile-deck-mounted{overflow-x:hidden!important}
  .mobile-life-deck{display:flex!important;align-items:flex-start!important;gap:8px!important;width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;scroll-snap-type:x mandatory!important;scroll-padding:0!important;overscroll-behavior-x:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:none!important;padding:0 0 8px!important;margin:0!important}
  .mobile-life-deck::-webkit-scrollbar{display:none!important}
  .mobile-life-deck>[data-mobile-home-slide]{box-sizing:border-box!important;flex:0 0 100%!important;width:100%!important;max-width:100%!important;min-width:100%!important;scroll-snap-align:start!important;scroll-snap-stop:always!important;margin:0!important;max-height:none!important;overflow:visible!important}
  .mobile-life-deck .quick-pop-hero{min-height:0!important;padding:1.05rem 1rem 1rem!important;border-radius:20px!important}
  .mobile-life-deck .home-now,.mobile-life-deck .home-life-section{padding:0 .1rem!important}
  .mobile-life-deck .home-now{margin-top:0!important}
  .mobile-life-deck .home-life-section{margin-top:0!important}
  .mobile-deck-dots{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;position:sticky!important;left:auto!important;bottom:auto!important;transform:none!important;width:calc(100% - 16px)!important;max-width:430px!important;margin:4px auto 10px!important;padding:4px!important;gap:3px!important;border:1px solid rgba(30,40,55,.10)!important;border-radius:15px!important;background:rgba(255,255,255,.96)!important;box-shadow:none!important;backdrop-filter:blur(12px)!important;z-index:20!important}
  .mobile-deck-dot{width:auto!important;height:44px!important;min-height:44px!important;padding:0 8px!important;border:0!important;border-radius:11px!important;background:transparent!important;color:#667085!important;font-size:10px!important;font-weight:900!important;letter-spacing:.01em!important;transition:background .15s ease,color .15s ease!important}
  .mobile-deck-dot.active{width:auto!important;background:#eef4ff!important;color:#174fbf!important}
  .quick-pop-copy{margin:.4rem auto 0!important}
  .quick-pop-copy h2{white-space:normal!important;text-wrap:balance!important;font-size:clamp(1.72rem,8.2vw,2.2rem)!important}
  .quick-pop-form textarea{grid-column:1!important;grid-row:1!important;width:100%!important;min-width:0!important;min-height:58px!important;max-height:132px!important;padding:.82rem 3.8rem .82rem .9rem!important;border-radius:17px!important;font-size:16px!important;line-height:1.35!important;resize:none!important}
  .quick-pop-voice{width:44px!important;min-width:44px!important;height:44px!important;min-height:44px!important;right:7px!important;top:7px!important}
  .quick-pop-chip,.mobile-customize-button,.app-version-badge,.quick-pop-attention .shared-alert-dismiss{min-height:44px!important}
  .quick-pop-chip{padding:.46rem .72rem!important}
  .mobile-customize-button{width:44px!important;height:44px!important}
  .app-version-badge{height:44px!important;padding:0 .55rem!important}
  .quick-pop-attention .shared-alert-dismiss{width:44px!important;height:44px!important;right:.15rem!important;top:.12rem!important}
  .quick-pop-result{max-height:none!important;overflow:visible!important}
  #homeSecondary{margin-top:12px!important}
  #p62HomeContextGrid{margin-top:12px!important}
}

/* Board / Shopping: drawer behaves like a real mobile drawer and live updates do not jerk the list around. */
@media (max-width:760px){
  body.pih-lists-drawer-open{overflow:hidden!important}
  body.pih-lists-drawer-open::before{content:"";position:fixed;inset:0;z-index:39;background:rgba(15,23,42,.28);backdrop-filter:blur(1px)}
  .lists-sidebar{top:0!important;bottom:0!important;padding-top:max(.7rem,env(safe-area-inset-top))!important;padding-bottom:max(.8rem,env(safe-area-inset-bottom))!important;overscroll-behavior:contain!important}
  .lists-sidebar.open{z-index:40!important}
  #sidebarToggle,.board-mobile-tools button,.shopping-v83-add,.shopping-v83-addform button,.smart-shop-actions button,.shopping-v83-ghost,.item-edit{min-height:44px!important}
  .item-edit{min-width:44px!important;width:44px!important}
  .shopping-v83-addform input,.capture-row input,#captureInput{font-size:16px!important;min-height:48px!important}
  .shopping-v83-main,.shopping-v83-items,.shopping-v83-store,.item-list{overflow-anchor:none}
  .list-item{transition:opacity .16s ease,transform .16s ease!important}
}

/* Kitchen: the global app nav is the app nav. Do not add a second bottom app bar to the library. */
@media (max-width:760px){
  body.pih-recipes-page .mobile-bottom-nav{display:none!important}
  body.recipe-library-only.pih-recipes-page .app{padding-bottom:calc(88px + env(safe-area-inset-bottom))!important}
  body.recipe-library-only.pih-recipes-page .recipe-library-header button{min-height:44px!important}
  body.recipe-library-only.pih-recipes-page .recipe-library-filters button{min-height:44px!important}
  .recipe-mobile-library{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:44px!important;margin:0 0 8px!important;padding:0 12px!important;border:1px solid rgba(31,41,55,.14)!important;border-radius:12px!important;background:#fff!important;color:#1f2937!important;font-weight:850!important;box-shadow:none!important}
  .recipe-tabs .recipe-tab{min-height:44px!important}
  .mobile-context-bar button,.ingredient-add-list,.simple-primary-actions button{min-height:44px!important}
}

/* Plans / profile / Watch: no tiny desktop controls pretending to be touch UI. */
@media (max-width:760px){
  .plans-past-toggle,.plan-row button,.plan-row a,.pih-filterbar button,.profile-food-actions button,.watch-filter-group .pih-filterbar button{min-height:44px!important}
  .profile-food-grid input,.profile-food-grid textarea,.pih-field input,.pih-field select,.pih-field textarea{font-size:16px!important}
  dialog,.pih-feedback-dialog,.meal-planner-dialog,.smart-dialog-card{max-height:calc(100dvh - 16px)!important}
}

/* Dynamic Type / long labels: wrapping is preferable to clipping. */
@media (max-width:760px){
  h1,h2,h3,.home-card-title,.pih-page-brand strong{overflow-wrap:anywhere}
  .pih-mobile-tabs span{white-space:normal!important}
}

@media (min-width:761px){.recipe-mobile-library{display:none!important}}
