/* JUJUBUR V1.3.102: scoped MOBILE interaction improvements only.
   No mobile enhancements apply above 767px except short landscape touch screens. */
.jj-page-atlas .atlas-mobile-create,.jj-page-atlas .atlas-mobile-create-sheet{display:none;}
@media screen and (max-width:767px), screen and (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%;}
  body.jj-phone-page{overscroll-behavior-x:none;}
  body.jj-phone-page :is(button,a,summary,[role="button"]){-webkit-tap-highlight-color:transparent;touch-action:manipulation;}
  body.jj-phone-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea,select){font-size:max(16px,1em);min-width:0;max-width:100%;}
  body.jj-phone-page :is(button,[role="button"],a):focus-visible{outline:2px solid #dfba80;outline-offset:2px;}
  body.jj-phone-page :is(.modal-cover,.overlay,.lightbox,.viewer){overscroll-behavior:contain;}
  body.jj-phone-page :is(.modal-cover,.share-dialog,.atlas-import-dialog,.library-dialog,.access-panel,.term-popup-card){box-sizing:border-box;max-width:100vw;}
  body.jj-phone-page :is(.modal-cover,.share-dialog,.atlas-import-dialog,.library-dialog,.access-panel,.term-popup-card) :is(input,textarea,select){min-width:0;max-width:100%;box-sizing:border-box;}
  body.jj-phone-page :is(.topics,.filters,.toolbar){scrollbar-width:none;}
  body.jj-phone-page :is(.topics,.filters,.toolbar)::-webkit-scrollbar{display:none;}
  body.jj-phone-page :is(.viewer__bottom,.sidebar-content,.modal-content,.atlas-import-scroll){-webkit-overflow-scrolling:touch;overscroll-behavior:contain;}
  body.jj-phone-page :is(.viewer__arrow,.lightbox-gallery-arrow,.closebox,.viewer__close){min-width:42px;min-height:44px;}
  body.jj-phone-page :is(.copy-button,.bridge-link,.service-cta,.material-bar__actions button,.material-bar__actions a){min-height:44px;}
  body.jj-phone-page :is(.field-label,.field-row-title,.map-display-panel__heading){overflow-wrap:anywhere;}
  /* Map search is one full-width phone row; metadata appears below it, never behind it. */
  body.jj-page-atlas:not(.share-view):not(.collab-editor) .searchmap{top:10px!important;left:10px!important;right:10px!important;width:auto!important;max-width:calc(100% - 20px)!important;}
  body.jj-page-atlas:not(.share-view):not(.collab-editor) .map-toplabel{top:68px!important;left:10px!important;max-width:min(210px,calc(100vw - 140px))!important;}
  body.jj-page-atlas:not(.share-view):not(.collab-editor) .geo-results{top:51px!important;left:10px!important;right:10px!important;width:auto!important;max-width:calc(100% - 20px)!important;}
  /* Mobile Atlas: popups + forms stay within visual viewport. */
  body.jj-page-atlas .map-popup{box-sizing:border-box;max-width:min(310px,calc(100vw - 60px));}
  body.jj-page-atlas .map-popup .popbody button{min-height:41px;margin:4px 2px 2px 0;padding:9px 12px;}
  body.jj-page-atlas .leaflet-popup-content-wrapper{max-height:min(67dvh,520px);overflow-y:auto;overscroll-behavior:contain;}
  body.jj-page-atlas .modal-cover .modal{margin:0;max-height:calc(100dvh - 18px - env(safe-area-inset-bottom,0px))!important;}
  body.jj-page-atlas .modal-cover .modal-footer{position:sticky;bottom:0;z-index:5;background:var(--panel,#161b20);padding-bottom:max(12px,env(safe-area-inset-bottom,0px));}
  body.jj-page-atlas :is(.atlas-import-dialog,.share-dialog){max-height:calc(100dvh - 14px - env(safe-area-inset-bottom,0px));overflow-y:auto;}
  body.jj-page-atlas .route-draft-banner{bottom:max(126px,calc(104px + env(safe-area-inset-bottom,0px)))!important;width:min(340px,calc(100vw - 20px))!important;max-height:40dvh;overflow:auto;}
  body.jj-page-atlas .route-draft-banner .route-buttons{gap:7px;}
  body.jj-page-atlas .route-draft-banner .route-buttons button{min-height:40px;}
  body.jj-page-atlas .route-draft-banner .route-buttons button:disabled{opacity:.4;cursor:default;}
  body.jj-page-atlas .route-edit-handle span{min-width:26px;min-height:26px;display:flex;justify-content:center;align-items:center;}
  body.jj-page-atlas .route-edit-handle.atlas-mobile-via-selected span{box-shadow:0 0 0 4px rgba(242,194,103,.4);border:2px solid #fff0b2;transform:scale(1.12);}
  body.jj-page-atlas .map-footer{display:none;}
  body.jj-page-atlas #mapShell .leaflet-bottom.leaflet-left .leaflet-control-scale{margin-bottom:88px;}
  body.jj-page-atlas .atlas-mobile-create:not([hidden]){display:flex;align-items:center;justify-content:center;position:absolute;left:12px;bottom:calc(68px + env(safe-area-inset-bottom,0px));z-index:760;min-height:45px;max-width:calc(100% - 140px);padding:8px 15px;border:1px solid rgba(220,188,140,.7);border-radius:28px;background:rgba(17,20,24,.95);color:#f1d5a8;font-size:13px;font-weight:500;box-shadow:0 8px 22px #0006;touch-action:manipulation;}
  body.jj-page-atlas .atlas-mobile-create[aria-pressed="true"]{background:#cfaa71;color:#16171a;border-color:#efdbb3;}
  body.jj-page-atlas .atlas-mobile-create-sheet:not([hidden]){display:flex;position:absolute;left:10px;right:10px;bottom:max(10px,env(safe-area-inset-bottom,0px));z-index:1500;max-width:460px;margin:auto;flex-direction:column;gap:10px;box-sizing:border-box;padding:19px 18px 18px;border:1px solid #bb986b;border-radius:18px;background:#171b20;color:#f3eadc;box-shadow:0 12px 45px #000b;}
  body.jj-page-atlas .atlas-mobile-sheet-kicker{color:#c6a978;font:500 10px/1.3 'IBM Plex Mono',monospace;letter-spacing:.16em;}
  body.jj-page-atlas .atlas-mobile-create-sheet strong{font-size:17px;font-weight:500;}
  body.jj-page-atlas .atlas-mobile-create-sheet small{font-variant-numeric:tabular-nums;color:#b9b7b1;}
  body.jj-page-atlas .atlas-mobile-sheet-actions{display:grid;grid-template-columns:1fr 1.25fr;gap:10px;margin-top:4px;}
  body.jj-page-atlas .atlas-mobile-sheet-actions button{min-height:45px;border:1px solid #82735c;border-radius:9px;background:#2c302f;color:#eee;}
  body.jj-page-atlas #atlasMobileCreateConfirm{background:#d4b184;border-color:#e3c49a;color:#191a1e;font-weight:600;}
  body.jj-page-atlas .atlas-share-mobile-backdrop:not([hidden]){display:block;position:absolute;inset:0;background:rgba(5,8,12,.62);z-index:1100;}
  body.jj-page-atlas .sidebar.open{z-index:1102!important;box-shadow:8px 0 42px #0009;}
  body.jj-page-atlas .mobile-menu{min-width:42px;min-height:42px;}
  body.jj-page-atlas .sidebar :is(.tool-btn,.trip-subtabs button,.item-row button,.viewer-filter-reset){min-height:39px;}
  body.jj-page-atlas .map-display-panel{max-height:min(60dvh,560px);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  body.jj-page-atlas .atlas-basemap-menu{overscroll-behavior:contain;-webkit-overflow-scrolling:touch;}
  body.jj-page-atlas :is(.map-display-panel,.atlas-basemap-menu) :is(button,label,summary){touch-action:manipulation;}
  body.jj-page-atlas.theme-light .atlas-mobile-create-sheet{background:#fffaf1;color:#332b24;border-color:#b9a481;}
  body.jj-page-atlas.theme-light .atlas-mobile-create-sheet small{color:#65605b;}
  body.jj-page-atlas.theme-light .atlas-mobile-create-sheet button:first-child{background:#eee7db;color:#3b3631;}
  /* Focus gallery and purchasing on reachability rather than hover. */
  body.jj-page-works .viewer__bar-actions button,body.jj-page-works .material-pick{min-width:43px;min-height:43px;}
  body.jj-page-works .material-bar{padding-bottom:max(12px,env(safe-area-inset-bottom,0px));}
  body.jj-page-admin :is(.tab,.tabs button,.admin-nav-link),body.jj-page-camera-manager :is(.studio-nav-item,.toolbar button){min-height:44px;}
}
@media (prefers-reduced-motion:reduce){body.jj-phone-page :is(.sidebar,.modal,.viewer__media){scroll-behavior:auto;}}
