/* PhotoBridge v0.17.686 — mobile scroll recovery + deterministic design controls + chat clearance.
   IMPORTANT: this file intentionally does NOT freeze html/body or replace the app's native scroller. */
@media (max-width:820px){
  /* Non-print photographer pages already own a native rolePageScrollArea. Keep it as the only scroll target. */
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace),
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.workspaceContent{
    min-height:0!important;
  }
  body.pbAuthenticatedPhotographerPortal .photographerMain.pbFixedRoleHeader>.photographerRolePageScrollArea{
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-y:contain!important;
    touch-action:pan-y!important;
  }

  /* Print keeps its dedicated v678 flex shell/scroller; only identity rhythm is normalized here. */
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader>.photographerHeaderIdentity{
    min-height:90px!important;height:90px!important;padding:9px 10px!important;align-items:flex-start!important;
  }
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .workspaceIdentityCopy{
    display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
    width:100%!important;min-width:0!important;gap:0!important;padding:0!important;text-align:right!important;direction:rtl!important;
  }
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .workspaceIdentityCopy>h1{
    order:1!important;position:static!important;inset:auto!important;transform:none!important;float:none!important;
    width:100%!important;margin:0!important;font-size:15px!important;font-weight:900!important;line-height:1.3!important;text-align:right!important;
  }
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .workspaceIdentityCopy>small{
    order:2!important;position:static!important;inset:auto!important;transform:none!important;float:none!important;
    display:block!important;width:100%!important;margin:1px 0 0!important;font-size:7.5px!important;font-weight:600!important;line-height:1.35!important;text-align:right!important;color:#667085!important;
  }
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .photographerIdentityDateOnly{
    order:3!important;position:static!important;inset:auto!important;transform:none!important;float:none!important;
    display:flex!important;width:100%!important;min-width:0!important;min-height:18px!important;margin:6px 0 0!important;padding:0!important;
    align-self:stretch!important;align-items:center!important;justify-content:flex-start!important;text-align:right!important;
  }
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .photographerIdentityDateOnly .todayStamp.compact{
    position:static!important;inset:auto!important;transform:none!important;width:auto!important;max-width:100%!important;
    margin:0!important;padding:4px 7px!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:4px!important;
  }
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .photographerIdentityDateOnly .todayStamp.compact span{font-size:9px!important;font-weight:850!important;line-height:1.2!important}
  .photographerMain.photographerPrintWorkspace .photographerPrintModeHeader .photographerIdentityDateOnly .todayStamp.compact b{display:inline-block!important;font-size:8.5px!important}

  /* Six permanent React-owned destinations. */
  .photographerBottomAppNav .photographerBottomAppNavGrid:not(.labBottomAppNavGrid){grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:2px!important}
  .photographerBottomAppNav .photographerBottomAppNavGrid:not(.labBottomAppNavGrid)>button em{font-size:7.3px!important;letter-spacing:-.2px!important}
  .photographerBottomNavIcon.instagram::before,
  .photographerBottomNavIcon.store::before{
    content:""!important;display:block!important;width:18px!important;height:18px!important;background:currentColor!important;
    -webkit-mask-position:center!important;mask-position:center!important;-webkit-mask-repeat:no-repeat!important;mask-repeat:no-repeat!important;
    -webkit-mask-size:contain!important;mask-size:contain!important;
  }
  .photographerBottomNavIcon.instagram::before{
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3.2' y='3.2' width='17.6' height='17.6' rx='5.2' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='12' cy='12' r='4.1' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='17.6' cy='6.5' r='1.25' fill='black'/%3E%3C/svg%3E")!important;
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3.2' y='3.2' width='17.6' height='17.6' rx='5.2' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='12' cy='12' r='4.1' fill='none' stroke='black' stroke-width='2.2'/%3E%3Ccircle cx='17.6' cy='6.5' r='1.25' fill='black'/%3E%3C/svg%3E")!important;
  }
  .photographerBottomNavIcon.store::before{
    -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.2h15l-1 11.3h-13l-1-11.3Z'/%3E%3Cpath d='M7.5 8.2V6.7A4.5 4.5 0 0 1 12 2.5a4.5 4.5 0 0 1 4.5 4.2v1.5M8.3 12.2h7.4'/%3E%3C/svg%3E")!important;
    mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 8.2h15l-1 11.3h-13l-1-11.3Z'/%3E%3Cpath d='M7.5 8.2V6.7A4.5 4.5 0 0 1 12 2.5a4.5 4.5 0 0 1 4.5 4.2v1.5M8.3 12.2h7.4'/%3E%3C/svg%3E")!important;
  }

  /* Instagram has no group selector. Do not leave an empty white strip under the header. */
  body.pbInstagramDesignRoute .photographerAlbumDesignCatalog .albumDesignMobilePickerButtons:empty,
  body.pb685InstagramOnly .photographerAlbumDesignCatalog .albumDesignMobilePickerButtons:empty{
    display:none!important;margin:0!important;padding:0!important;min-height:0!important;height:0!important;border:0!important;
  }

  /* Mobile catalog toolbar physical order: FILTER at far right, model count beside it, view buttons at far left. */
  .photographerAlbumDesignCatalog .albumDesignModelViewToolbar{
    display:flex!important;direction:rtl!important;align-items:center!important;justify-content:flex-start!important;gap:7px!important;
  }
  .photographerAlbumDesignCatalog .albumDesignModelViewToolbar .albumDesignMobileTopFilter{order:0!important;flex:0 0 38px!important}
  .photographerAlbumDesignCatalog .albumDesignModelViewToolbar>b{order:1!important;margin:0!important;white-space:nowrap!important}
  .photographerAlbumDesignCatalog .albumDesignModelViewToolbar .albumDesignPopularitySort{
    order:2!important;margin-right:auto!important;margin-left:0!important;
  }
  .photographerAlbumDesignCatalog .albumDesignModelViewToolbar .albumDesignMobileGridToggle{
    order:3!important;margin-right:0!important;margin-left:0!important;display:flex!important;
  }

  /* Instagram editor stays portrait in mobile fullscreen. The actual template aspect is preserved. */
  .albumDesignFullscreenModal.pb651InstagramPortrait.albumDesignCanvasFirst:not(.minimized) .albumDesignEditorViewport{
    width:100vw!important;height:calc(100dvh - 50px)!important;max-height:calc(100dvh - 50px)!important;
    display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;
  }
  .albumDesignFullscreenModal.pb651InstagramPortrait.albumDesignCanvasFirst:not(.minimized) .albumDesignFullscreenStage.instagram{
    aspect-ratio:var(--album-runtime-aspect)!important;
    width:min(calc(100vw - 12px),calc((100dvh - 62px) * var(--album-runtime-aspect)))!important;
    height:auto!important;max-width:calc(100vw - 12px)!important;max-height:calc(100dvh - 62px)!important;
    margin:auto!important;transform:none!important;
  }

  /* Assistant always clears the persistent photographer dock. */
  body.pbAuthenticatedPhotographerPortal .aiAssistantLauncher{
    display:grid!important;position:fixed!important;right:12px!important;left:auto!important;
    bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;z-index:5200!important;
    visibility:visible!important;opacity:1!important;pointer-events:auto!important;
  }
  body.pbAuthenticatedPhotographerPortal .aiAssistantDock{
    position:fixed!important;right:8px!important;left:auto!important;top:auto!important;
    bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;width:calc(100vw - 16px)!important;
    height:min(600px,calc(100dvh - 112px - env(safe-area-inset-bottom,0px)))!important;
    max-height:calc(100dvh - 112px - env(safe-area-inset-bottom,0px))!important;z-index:5199!important;
  }

  /* Photographer chat: larger useful message/type area and never under the bottom dock. */
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock.collapsed{
    position:fixed!important;left:10px!important;right:auto!important;top:auto!important;
    bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;z-index:5198!important;
  }
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed){
    position:fixed!important;left:8px!important;right:auto!important;top:auto!important;
    bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;
    width:min(390px,calc(100vw - 16px))!important;max-width:calc(100vw - 16px)!important;
    height:min(620px,calc(100dvh - 112px - env(safe-area-inset-bottom,0px)))!important;
    max-height:calc(100dvh - 112px - env(safe-area-inset-bottom,0px))!important;
    min-height:0!important;overflow:hidden!important;z-index:5197!important;
    display:flex!important;flex-direction:column!important;
  }
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed)>.chatHeader{min-height:48px!important;padding:7px 9px!important;flex:0 0 auto!important}
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed)>.chatThreadHead{min-height:44px!important;padding:7px 9px!important;flex:0 0 auto!important}
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed)>.chatMessages{flex:1 1 auto!important;min-height:170px!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed)>.chatComposer{flex:0 0 auto!important;padding:8px!important;gap:6px!important}
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed)>.chatComposer textarea{min-height:54px!important;max-height:110px!important;padding:9px 10px!important;font-size:16px!important;line-height:1.55!important}
  body.pbAuthenticatedPhotographerPortal .roleWorkspace:not(.labRoleWorkspace)>.chatDock:not(.collapsed)>.chatComposer button{min-height:46px!important;min-width:62px!important}

  /* Lab chat button/panel must clear its own mobile bottom navigation too. */
  .labRoleWorkspace>.chatDock.collapsed{
    position:fixed!important;left:10px!important;right:auto!important;top:auto!important;
    bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;z-index:5198!important;
  }
  .labRoleWorkspace>.chatDock:not(.collapsed){
    bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;max-height:calc(100dvh - 112px - env(safe-area-inset-bottom,0px))!important;z-index:5197!important;
  }
}
