/* Pal Atlas responsive hardening - 2026-08-25
   Final cascade layer for phones, tablets, iPad and narrow desktops. */

:root{
  --pa-responsive-breakpoint:1180px;
  --pa-mobile-gutter:clamp(12px,3vw,22px);
}

html,body{max-width:100%;}
body.pal-atlas-page{overflow-x:hidden;}
.pal-atlas-layout,.pal-atlas-content,.view-container,.view,
.pal-atlas-layout main,.pal-atlas-layout section,.pal-atlas-layout article,
.pal-atlas-layout div,.pal-atlas-layout form,.pal-atlas-layout fieldset{min-width:0;}
.pal-atlas-layout img,.pal-atlas-layout svg,.pal-atlas-layout canvas,.pal-atlas-layout video{max-width:100%;}
.pal-atlas-layout pre,.pal-atlas-layout code{max-width:100%;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere;}

/* Navigation search - added by responsive-hardening.js. */
.pa-nav-search{display:none;flex:0 0 auto;padding:0 2px 10px;}
.pa-nav-search-inner{position:relative;display:flex;align-items:center;gap:8px;}
.pa-nav-search input{
  width:100%;min-height:44px!important;padding:9px 12px 9px 38px!important;
  border:1px solid #34343c!important;border-radius:9px!important;
  background:#101014!important;color:#fff!important;font-size:12px!important;
  outline:none!important;
}
.pa-nav-search input:focus{border-color:#d90a2c!important;box-shadow:0 0 0 3px rgba(217,10,44,.12)!important;}
.pa-nav-search-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:#8e8e98;font-size:15px;pointer-events:none;}
.sidebar-nav.pa-searching .nav-dropdown-menu{display:block!important;}
.sidebar-nav.pa-searching .nav-dropdown{display:block!important;}
.sidebar-nav .pa-search-hidden{display:none!important;}
.pa-nav-no-results{display:none;padding:15px 10px;color:#8e8e98;font-size:11px;line-height:1.5;text-align:center;}
.sidebar-nav.pa-searching.is-empty .pa-nav-no-results{display:block;}

/* Any renderer can emit a table. The runtime wraps naked tables with this. */
.pa-responsive-table-wrap{
  width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;
  -webkit-overflow-scrolling:touch;overscroll-behavior-inline:contain;
  border-radius:inherit;
}
.pa-responsive-table-wrap>table{min-width:max-content;max-width:none;}

/* General narrow-width safety. */
@media (max-width:1180px){
  html:not(.map-route-root),
  html:not(.map-route-root) body.pal-atlas-page{overflow-y:auto!important;height:auto!important;max-height:none!important;}

  body.pal-atlas-page .pal-atlas-layout{
    display:block!important;grid-template-columns:1fr!important;width:100%!important;
    min-height:calc(100dvh - var(--pa-header-offset,72px))!important;
  }
  body.pal-atlas-page .pal-atlas-content,
  body.pal-atlas-page .main-content{
    width:100%!important;max-width:100%!important;margin-left:0!important;
    min-height:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
  }

  /* Proper tablet/mobile route bar. */
  body.pal-atlas-page .topbar{
    position:sticky!important;top:var(--pa-header-offset,72px)!important;z-index:120!important;
    display:flex!important;min-height:58px!important;width:100%!important;
    gap:9px!important;padding:8px var(--pa-mobile-gutter)!important;
    border-bottom:1px solid #29292f!important;background:rgba(5,5,7,.97)!important;
    backdrop-filter:blur(12px)!important;
  }
  body.pal-atlas-page .topbar-left{display:flex!important;min-width:0!important;align-items:center!important;gap:10px!important;}
  body.pal-atlas-page .topbar-left>div{min-width:0!important;}
  body.pal-atlas-page .topbar p{display:none!important;}
  body.pal-atlas-page .topbar h1{
    max-width:min(70vw,650px)!important;margin:0!important;overflow:hidden!important;
    color:#fff!important;font-size:clamp(17px,2.6vw,23px)!important;line-height:1.1!important;
    text-overflow:ellipsis!important;white-space:nowrap!important;
  }
  body.pal-atlas-page .mobile-only{display:grid!important;}
  body.pal-atlas-page #mobile-menu-btn{
    display:grid!important;flex:0 0 42px!important;width:42px!important;height:42px!important;
    min-width:42px!important;min-height:42px!important;background:#101014!important;border-color:#34343c!important;
  }
  body.pal-atlas-page .topbar-actions{margin-left:auto!important;}
  body.pal-atlas-page .topbar-actions .button,body.pal-atlas-page .inventory-pill{display:none!important;}

  /* Override all historical fixed/sidebar variants with one predictable drawer. */
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:fixed!important;top:var(--pa-header-offset,72px)!important;left:0!important;right:auto!important;bottom:0!important;
    z-index:150!important;display:flex!important;flex-direction:column!important;
    width:min(380px,92vw)!important;min-width:0!important;max-width:92vw!important;
    height:auto!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:12px 10px max(12px,env(safe-area-inset-bottom))!important;
    border:0!important;border-right:1px solid #29292f!important;border-radius:0!important;
    background:#050507!important;box-shadow:20px 0 55px rgba(0,0,0,.55)!important;
    overflow:hidden!important;opacity:1!important;visibility:visible!important;
    transform:translate3d(-104%,0,0)!important;transition:transform .2s ease!important;
    pointer-events:none!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar.open{
    transform:translate3d(0,0,0)!important;pointer-events:auto!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar .brand,
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-foot,
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-status{display:none!important;}
  body.pal-atlas-page .pa-nav-search{display:block;}
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:static!important;display:flex!important;flex:1 1 auto!important;min-height:0!important;
    width:100%!important;height:auto!important;max-height:none!important;
    flex-direction:column!important;align-items:stretch!important;gap:3px!important;
    padding:0 4px 22px 0!important;margin:0!important;
    overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;
    scrollbar-width:thin!important;white-space:normal!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar .nav-item,
  body.pal-atlas-page .pal-atlas-sidebar .nav-dropdown-toggle{
    display:flex!important;width:100%!important;max-width:100%!important;min-width:0!important;
    min-height:44px!important;height:auto!important;flex:0 0 auto!important;
    margin:0 0 3px!important;padding:9px 10px!important;
    color:#f7f7f8!important;background:#0d0d11!important;border:1px solid transparent!important;
    font-size:12px!important;line-height:1.3!important;white-space:normal!important;
    overflow:visible!important;text-overflow:clip!important;transform:none!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar .nav-item:hover{background:#141419!important;border-color:#303038!important;}
  body.pal-atlas-page .pal-atlas-sidebar .nav-item.active{background:rgba(217,10,44,.13)!important;border-color:#d90a2c!important;box-shadow:inset 3px 0 0 #d90a2c!important;}
  body.pal-atlas-page .pal-atlas-sidebar .nav-dropdown,
  body.pal-atlas-page .pal-atlas-sidebar .nav-subdropdown{display:block!important;width:100%!important;min-width:0!important;}
  body.pal-atlas-page .pal-atlas-sidebar .nav-dropdown-menu{width:100%!important;min-width:0!important;padding-left:12px!important;}
  body.pal-atlas-page .pal-atlas-sidebar .nav-subdropdown>.nav-dropdown-menu{margin-left:0!important;padding-left:9px!important;}

  body.pal-atlas-page .sidebar-scrim{
    position:fixed!important;inset:var(--pa-header-offset,72px) 0 0 0!important;z-index:140!important;
    display:block!important;width:100%!important;height:auto!important;padding:0!important;border:0!important;
    background:rgba(0,0,0,.72)!important;backdrop-filter:blur(2px)!important;
    opacity:0!important;visibility:hidden!important;pointer-events:none!important;
    transition:opacity .18s ease,visibility .18s ease!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar.open~.sidebar-scrim{opacity:1!important;visibility:visible!important;pointer-events:auto!important;}

  body.pal-atlas-page .view-container{
    width:100%!important;max-width:100%!important;min-height:0!important;
    margin:0!important;padding:20px var(--pa-mobile-gutter) 34px!important;
  }
  body.pal-atlas-page .page-heading,body.pal-atlas-page .compact-heading{
    align-items:flex-start!important;flex-direction:column!important;gap:10px!important;
  }
  body.pal-atlas-page .page-heading h2{font-size:clamp(30px,6.5vw,48px)!important;line-height:1!important;overflow-wrap:anywhere!important;}
  body.pal-atlas-page .page-heading p{max-width:100%!important;font-size:12.5px!important;line-height:1.55!important;}

  /* Inline desktop min-widths are a common source of iPad deformation. */
  body.pal-atlas-page .view .field[style*="min-width"],
  body.pal-atlas-page .view [class*="toolbar"]>*[style*="min-width"]{min-width:0!important;}
  body.pal-atlas-page .view input,body.pal-atlas-page .view select,body.pal-atlas-page .view textarea,
  body.pal-atlas-page .view button,body.pal-atlas-page .view .button{max-width:100%;}

  /* Search/filter bars should reflow instead of squeezing fields to unusable widths. */
  body.pal-atlas-page .toolbar,body.pal-atlas-page .data-toolbar,body.pal-atlas-page .dx-toolbar,
  body.pal-atlas-page .passive-controls,body.pal-atlas-page .tech-toolbar,
  body.pal-atlas-page .recommendation-control-row,body.pal-atlas-page .achievement-toolbar{
    width:100%!important;min-width:0!important;flex-wrap:wrap!important;
  }
  body.pal-atlas-page .data-toolbar .search-field,body.pal-atlas-page .toolbar .search-field{min-width:min(100%,260px)!important;}
  body.pal-atlas-page .data-toolbar .field:not(.search-field){min-width:150px!important;flex:1 1 150px!important;}
  body.pal-atlas-page .item-browser-controls{grid-template-columns:minmax(0,1.4fr) minmax(150px,.8fr)!important;}
  body.pal-atlas-page .item-browser-controls>.field:last-child{grid-column:auto!important;}
  body.pal-atlas-page .tier-controls .toolbar{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.pal-atlas-page .tier-controls .toolbar .search-field{grid-column:1/-1!important;min-width:0!important;}

  /* Flexible card grids for iPad/tablet widths. */
  body.pal-atlas-page :is(.entity-grid,.item-browser-grid,.inventory-pal-grid,.pal-grid,.tier-pal-grid,.recommendation-grid,
    .technology-grid,.achievement-grid,.journal-grid,.ruins-grid,.active-skills-grid,.skill-fruits-grid,.passive-db-grid,
    .guide-card-grid,.guide-v3-cards,.fish-grid,.team-pal-grid,.boss-reward-grid,.boss-stat-grid,.boss-info-grid,
    .dx-card-grid,.kind-research-grid,.kind-structure-grid,.work-grid,.work-grid-two,.pamod-feature-grid,.pamod-gallery){
    grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))!important;
  }
  body.pal-atlas-page :is(.overview-grid,.overview-target-card,.dashboard-grid,.boss-page-layout,.pt-workspace,.breeding-stage){
    grid-template-columns:1fr!important;
  }
  body.pal-atlas-page .overview-metrics{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
  body.pal-atlas-page .overview-tool-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}

  /* Every wide table gets a predictable swipe area. */
  body.pal-atlas-page :is(.guide-v3-table-wrap,.table-wrap,[class$="-table-wrap"],[class*=" table-wrap"],.raw-data){
    max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-inline:contain!important;
  }

  /* Interactive map: 901-1180 used to retain the cramped desktop shell. */
  body.map-route-active .pal-atlas-content,body.map-route-active .main-content{
    height:auto!important;max-height:none!important;overflow:visible!important;
  }
  body.map-route-active .view-container,body.map-route-active #view-interactive-map{
    height:auto!important;max-height:none!important;overflow:visible!important;padding:14px var(--pa-mobile-gutter) 28px!important;
  }
  body.map-route-active .interactive-map-shell{
    display:grid!important;grid-template-columns:1fr!important;height:auto!important;max-height:none!important;
    min-height:0!important;overflow:visible!important;border-radius:12px!important;
  }
  body.map-route-active .map-filter-panel,body.map-route-active .map-details-panel{
    height:auto!important;max-height:none!important;overflow:visible!important;border-left:0!important;border-right:0!important;
  }
  body.map-route-active .map-filter-panel{border-bottom:1px solid #303038!important;}
  body.map-route-active .map-layer-scroll,body.map-route-active #map-layer-scroll,body.map-route-active #map-category-list{
    max-height:none!important;overflow:visible!important;
  }
  body.map-route-active .map-category-list{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.map-route-active .map-main-column{min-height:560px!important;height:auto!important;max-height:none!important;grid-template-rows:auto minmax(500px,62dvh)!important;}
  body.map-route-active .map-viewport{min-height:500px!important;height:62dvh!important;max-height:720px!important;}
  body.map-route-active .map-details-panel{grid-column:auto!important;border-top:1px solid #303038!important;}
  body.map-route-active .map-detail-card{grid-template-columns:1fr!important;}
  body.map-route-active .map-detail-card>*{grid-column:1!important;grid-row:auto!important;}

  /* Mod page hero no longer keeps a 440px minimum column on iPad. */
  body.pal-atlas-page .pamod-hero{grid-template-columns:1fr!important;min-height:0!important;}
}

@media (max-width:760px){
  :root{--pa-mobile-gutter:13px;}
  body.pal-atlas-page .topbar{min-height:56px!important;}
  body.pal-atlas-page .topbar h1{font-size:18px!important;max-width:68vw!important;}
  body.pal-atlas-page .view-container{padding:15px var(--pa-mobile-gutter) 28px!important;}
  body.pal-atlas-page .panel,body.pal-atlas-page .card,body.pal-atlas-page .detail-panel{padding:13px!important;border-radius:9px!important;}
  body.pal-atlas-page .page-heading h2{font-size:clamp(28px,9vw,40px)!important;}
  body.pal-atlas-page input,body.pal-atlas-page select,body.pal-atlas-page textarea,body.pal-atlas-page .button{min-height:44px;}

  body.pal-atlas-page .toolbar,body.pal-atlas-page .data-toolbar,body.pal-atlas-page .dx-toolbar,
  body.pal-atlas-page .recommendation-control-row,body.pal-atlas-page .achievement-toolbar,
  body.pal-atlas-page .section-heading,body.pal-atlas-page .section-heading-row{
    align-items:stretch!important;flex-direction:column!important;
  }
  body.pal-atlas-page .toolbar>*,body.pal-atlas-page .data-toolbar>*,body.pal-atlas-page .dx-toolbar>*{width:100%!important;min-width:0!important;}
  body.pal-atlas-page .item-browser-controls,body.pal-atlas-page .tier-controls .toolbar,
  body.pal-atlas-page .passive-db-search-row,body.pal-atlas-page .active-skills-filter-grid,
  body.pal-atlas-page .skill-fruits-filter-grid,body.pal-atlas-page .breeding-control-grid,
  body.pal-atlas-page .breeding-path-control-grid{grid-template-columns:1fr!important;}
  body.pal-atlas-page .item-browser-controls>*{grid-column:auto!important;}

  body.pal-atlas-page :is(.entity-grid,.item-browser-grid,.inventory-pal-grid,.pal-grid,.tier-pal-grid,.recommendation-grid,
    .technology-grid,.achievement-grid,.journal-grid,.ruins-grid,.active-skills-grid,.skill-fruits-grid,.passive-db-grid,
    .guide-card-grid,.guide-v3-cards,.fish-grid,.team-pal-grid,.boss-reward-grid,.boss-stat-grid,.boss-info-grid,
    .dx-card-grid,.dx-materials,.dx-pal-grid,.kind-research-grid,.kind-structure-grid,.work-grid,.work-grid-two,
    .pamod-feature-grid,.pamod-gallery,.pamod-platforms,.pamod-safety-grid,.pamod-two-col){
    grid-template-columns:1fr!important;
  }
  body.pal-atlas-page :is(.overview-metrics,.collection-overview,.stat-grid,.item-source-summary){grid-template-columns:repeat(2,minmax(0,1fr))!important;}
  body.pal-atlas-page .overview-tool-grid{grid-template-columns:1fr!important;}

  body.pal-atlas-page .entity-card{grid-template-columns:52px minmax(0,1fr) auto!important;gap:9px!important;}
  body.pal-atlas-page .item-browser-card{grid-template-columns:52px minmax(0,1fr)!important;min-height:84px!important;gap:9px!important;padding:10px!important;}
  body.pal-atlas-page .item-browser-card img,body.pal-atlas-page .item-browser-card .item-icon-shell{max-width:52px!important;}
  body.pal-atlas-page .item-filter-panel{padding:10px!important;}
  body.pal-atlas-page .item-filter-row{display:flex!important;flex-wrap:wrap!important;gap:6px!important;}
  body.pal-atlas-page .item-filter-chip{min-height:42px!important;flex:1 1 120px!important;justify-content:flex-start!important;}

  body.pal-atlas-page .action-row{width:100%!important;display:grid!important;grid-template-columns:1fr!important;}
  body.pal-atlas-page .action-row .button{width:100%!important;}

  body.map-route-active .map-category-list{grid-template-columns:1fr!important;}
  body.map-route-active .map-main-column{min-height:480px!important;grid-template-rows:auto minmax(430px,62dvh)!important;}
  body.map-route-active .map-viewport{min-height:430px!important;height:62dvh!important;}
  body.map-route-active .map-toolbar{flex-wrap:wrap!important;gap:6px!important;}
  body.map-route-active #map-progress-readout{width:100%!important;text-align:left!important;}

  body.pal-atlas-page .modal-container{align-items:flex-end!important;padding:0!important;}
  body.pal-atlas-page .modal-shell,body.pal-atlas-page .modal-card{
    width:100%!important;max-width:100%!important;max-height:94dvh!important;margin:0!important;border-radius:14px 14px 0 0!important;
    overflow:hidden!important;
  }
  body.pal-atlas-page .modal-content{max-height:calc(94dvh - 110px)!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;}
}

@media (max-width:480px){
  body.pal-atlas-page .pal-atlas-sidebar,body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{width:94vw!important;max-width:94vw!important;}
  body.pal-atlas-page :is(.overview-metrics,.collection-overview,.stat-grid,.item-source-summary){grid-template-columns:1fr 1fr!important;gap:7px!important;}
  body.pal-atlas-page .entity-card{grid-template-columns:46px minmax(0,1fr)!important;}
  body.pal-atlas-page .entity-card>b{grid-column:2!important;justify-self:start!important;}
  body.pal-atlas-page .data-row{grid-template-columns:1fr!important;gap:4px!important;}
  body.pal-atlas-page .data-row strong{text-align:left!important;}
  body.pal-atlas-page .egg-region-tabs,body.pal-atlas-page .egg-size-tabs,body.pal-atlas-page .egg-simple-type-tabs{
    display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;
  }
  body.pal-atlas-page .egg-region-tabs button,body.pal-atlas-page .egg-size-tabs button,body.pal-atlas-page .egg-simple-type-tabs button{min-width:0!important;width:100%!important;}
}

@media (prefers-reduced-motion:reduce){
  body.pal-atlas-page .pal-atlas-sidebar,body.pal-atlas-page .sidebar-scrim{transition:none!important;}
}


/* v42 - mobile/tablet top-gap fix
   The global Versys header already reserves its own vertical space on compact
   layouts. Making the Pal Atlas route bar sticky with top=header-height counted
   that header a second time, producing the large black gap seen on phones. */
@media (max-width:1180px){
  body.pal-atlas-page .pal-atlas-layout,
  body.pal-atlas-page .pal-atlas-content,
  body.pal-atlas-page .main-content{
    margin-top:0!important;
    padding-top:0!important;
  }

  body.pal-atlas-page .topbar{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    margin:0!important;
    transform:none!important;
  }

  body.pal-atlas-page .view-container{
    margin-top:0!important;
  }
}

/* Keep the route bar compact on phones so content starts immediately below it. */
@media (max-width:760px){
  body.pal-atlas-page .topbar{
    min-height:54px!important;
    padding-top:6px!important;
    padding-bottom:6px!important;
  }
}


/* v43 - interactive map document scrolling on phones/tablets
   interactive-map.js intentionally locks <html> on desktop so the three-panel
   map behaves like an app. On compact layouts the map is stacked vertically,
   so the document itself must be scrollable. */
@media (max-width:1180px){
  html.map-route-root{
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  html.map-route-root body.map-route-active{
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
  }

  body.map-route-active .pal-atlas-layout,
  body.map-route-active .pal-atlas-content,
  body.map-route-active .main-content,
  body.map-route-active .view-container,
  body.map-route-active #view-interactive-map,
  body.map-route-active .interactive-map-shell{
    touch-action:auto!important;
    overscroll-behavior-y:auto!important;
  }

  /* The map canvas can still be dragged, but vertical browser scrolling remains
     available around it instead of the entire route being hard-locked. */
  body.map-route-active .map-filter-panel,
  body.map-route-active .map-details-panel{
    touch-action:pan-y!important;
  }
}

@media (max-width:760px){
  /* Keep enough map to use comfortably without turning the whole phone screen
     into one giant gesture target. */
  body.map-route-active .map-main-column{
    min-height:0!important;
    grid-template-rows:auto minmax(360px,56dvh)!important;
  }

  body.map-route-active .map-viewport{
    min-height:360px!important;
    height:56dvh!important;
    max-height:560px!important;
  }
}


/* v44 - mobile map touch gesture fix
   Base interactive-map.css uses touch-action:none on .map-viewport. That means
   a swipe beginning on the map can never scroll the document on a phone.
   On compact layouts: vertical gesture = page scroll; horizontal gesture = map pan. */
@media (max-width:1180px){
  body.map-route-active .map-viewport{
    touch-action:pan-y pinch-zoom!important;
    overscroll-behavior-y:auto!important;
  }

  body.map-route-active .map-marker,
  body.map-route-active .map-overlay-controls,
  body.map-route-active .map-zoom-controls{
    touch-action:manipulation!important;
  }
}


/* v45 - native document scrolling/pull-to-refresh for Interactive Map */
@media (max-width:1180px){
  html.map-route-root{
    position:static!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }

  html.map-route-root body.map-route-active{
    position:static!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
  }

  body.map-route-active .map-viewport{
    touch-action:pan-y pinch-zoom!important;
    overscroll-behavior-y:auto!important;
  }
}


/* v46 - mobile Interactive Map gesture model
   1 finger = native document scroll/pull-to-refresh
   2 fingers = map pan + pinch zoom */
.map-mobile-gesture-hint{
  display:none;
}

@media (max-width:1180px){
  body.map-route-active .map-viewport{
    touch-action:pan-y!important;
    overscroll-behavior-y:auto!important;
  }

  body.map-route-active .map-mobile-gesture-hint{
    position:absolute;
    z-index:120;
    display:block;
    left:50%;
    bottom:8px;
    top:auto;
    transform:translateX(-50%);
    max-width:calc(100% - 24px);
    padding:5px 8px;
    border:1px solid rgba(255,255,255,.16);
    border-radius:7px;
    background:rgba(5,5,7,.82);
    color:#fff;
    font-size:8px;
    font-weight:800;
    line-height:1.2;
    white-space:nowrap;
    pointer-events:none;
    backdrop-filter:blur(6px);
  }
}


/* v48 - stable custom 2-finger map pinch/pan.
   Browser keeps native one-finger vertical page scrolling. */
@media (max-width:1180px){
  body.map-route-active .map-viewport{
    touch-action:pan-y!important;
  }
}


/* Stage 14 search/header mobile fix v71 */
.pa-nav-search{display:block;flex:0 0 auto;padding:0 0 8px;}
.pa-nav-search .nav-item.pa-nav-search-item{display:grid!important;grid-template-columns:24px minmax(0,1fr)!important;align-items:center!important;gap:10px!important;padding:8px 10px!important;}
.pa-nav-search .nav-item.pa-nav-search-item>span{display:grid!important;place-items:center!important;min-width:24px!important;height:24px!important;padding:0!important;border-radius:7px!important;font-size:9px!important;}
.pa-nav-search-inner{position:relative;display:flex;align-items:center;min-width:0;width:100%;}
.pa-nav-search input{width:100%!important;min-width:0!important;padding-left:36px!important;}
@media (max-width: 980px){
  body.pal-atlas-page .pa-nav-search{display:block!important;padding:0 0 10px!important;}
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{padding-top:10px!important;}
}


/* ========================================================================== 
   PAL ATLAS SHELL CONTRACT v72
   One positioning model only:
   - global Versys header is fixed by /assets/css/main.css
   - body reserves the header height
   - desktop menu is sticky INSIDE the Pal Atlas layout, so it stops at footer
   - compact menu is a drawer BELOW the global header
   - search is the first child of the menu and never positioned independently
   ========================================================================== */
:root{
  --pa-shell-header-h:var(--versys-header-height,82px);
  --pa-shell-sidebar-w:var(--pa-sidebar,205px);
  --pa-shell-gap:10px;
}

body.pal-atlas-page{
  padding-top:var(--pa-shell-header-h)!important;
}
body.pal-atlas-page #vm-header{
  position:fixed!important;
  inset:0 0 auto 0!important;
  z-index:9999!important;
}

/* Search is part of sidebar-nav - never fixed/sticky on its own. */
body.pal-atlas-page .pa-nav-search{
  position:relative!important;
  inset:auto!important;
  z-index:auto!important;
  display:grid!important;
  grid-template-columns:24px minmax(0,1fr)!important;
  align-items:center!important;
  gap:9px!important;
  width:100%!important;
  min-width:0!important;
  margin:0 0 7px!important;
  padding:7px 8px!important;
  border:1px solid #303039!important;
  border-radius:9px!important;
  background:#101014!important;
  box-sizing:border-box!important;
}
body.pal-atlas-page .pa-nav-search-index{
  display:grid!important;
  place-items:center!important;
  width:24px!important;
  height:24px!important;
  border:1px solid #34343d!important;
  border-radius:7px!important;
  color:#fff!important;
  background:#111219!important;
  font-size:9px!important;
  font-weight:900!important;
  line-height:1!important;
}
body.pal-atlas-page .pa-nav-search-inner{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  width:100%!important;
  min-width:0!important;
}
body.pal-atlas-page .pa-nav-search-icon{
  position:absolute!important;
  left:2px!important;
  top:50%!important;
  width:11px!important;
  height:11px!important;
  transform:translateY(-56%)!important;
  border:2px solid #85858f!important;
  border-radius:50%!important;
  pointer-events:none!important;
}
body.pal-atlas-page .pa-nav-search-icon::after{
  content:""!important;
  position:absolute!important;
  width:6px!important;
  height:2px!important;
  right:-5px!important;
  bottom:-3px!important;
  border-radius:2px!important;
  background:#85858f!important;
  transform:rotate(45deg)!important;
  transform-origin:left center!important;
}
body.pal-atlas-page .pa-nav-search input{
  display:block!important;
  width:100%!important;
  min-width:0!important;
  height:32px!important;
  min-height:32px!important;
  margin:0!important;
  padding:5px 6px 5px 23px!important;
  border:0!important;
  border-radius:5px!important;
  outline:0!important;
  background:transparent!important;
  color:#fff!important;
  font:inherit!important;
  font-size:11px!important;
  box-shadow:none!important;
}
body.pal-atlas-page .pa-nav-search:focus-within{
  border-color:#d90a2c!important;
  box-shadow:0 0 0 2px rgba(217,10,44,.12)!important;
}
body.pal-atlas-page .pa-nav-no-results{
  display:none;
  padding:12px 8px;
  color:#85858f;
  font-size:10px;
  line-height:1.45;
}
body.pal-atlas-page .sidebar-nav.is-empty>.pa-nav-no-results{display:block!important;}

/* DESKTOP: in-flow aside + one sticky child. The footer is the natural stop. */
@media (min-width:1181px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    align-self:stretch!important;
    width:var(--pa-shell-sidebar-w)!important;
    min-width:var(--pa-shell-sidebar-w)!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    padding:10px 9px 14px!important;
    overflow:visible!important;
    transform:none!important;
    visibility:visible!important;
    opacity:1!important;
    z-index:2!important;
  }
  body.pal-atlas-page .sidebar-nav{
    position:sticky!important;
    top:calc(var(--pa-shell-header-h) + var(--pa-shell-gap))!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--pa-shell-header-h) - (var(--pa-shell-gap) * 2))!important;
    margin:0!important;
    padding:0 1px 8px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    z-index:45!important;
  }
  body.pal-atlas-page .sidebar-scrim{display:none!important;}
}

/* COMPACT: drawer begins exactly below fixed global header. Its internal nav has
   no top offset, preventing header-height from being counted twice. */
@media (max-width:1180px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:fixed!important;
    top:var(--pa-shell-header-h)!important;
    right:auto!important;
    bottom:0!important;
    left:0!important;
    width:min(92vw,360px)!important;
    min-width:0!important;
    height:calc(100dvh - var(--pa-shell-header-h))!important;
    min-height:0!important;
    max-height:none!important;
    padding:10px!important;
    overflow:hidden!important;
    transform:translate3d(-105%,0,0)!important;
    visibility:hidden!important;
    opacity:0!important;
    background:#08090d!important;
    border-right:1px solid #24262d!important;
    z-index:520!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar.open{
    transform:translate3d(0,0,0)!important;
    visibility:visible!important;
    opacity:1!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0 2px 18px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    z-index:1!important;
  }
  body.pal-atlas-page .sidebar-scrim{
    position:fixed!important;
    top:var(--pa-shell-header-h)!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:auto!important;
    height:auto!important;
    background:rgba(0,0,0,.58)!important;
    z-index:500!important;
  }
  body.pal-atlas-page .topbar{
    top:var(--pa-shell-header-h)!important;
    z-index:300!important;
  }
}

@media (max-width:640px){
  :root{--pa-shell-header-h:var(--versys-header-height,72px);}
  body.pal-atlas-page .pal-atlas-sidebar{width:min(94vw,340px)!important;}
  body.pal-atlas-page .pa-nav-search{grid-template-columns:24px minmax(0,1fr)!important;padding:7px!important;}
}


/* ==========================================================================
   PAL ATLAS MENU VISIBILITY CONTRACT v73
   Desktop/tablet >= 901px: sidebar is always visible in the layout.
   Phone/small tablet <= 900px: sidebar is a drawer opened by the route bar.
   This intentionally overrides every older 800/1180px sidebar rule.
   ========================================================================== */

@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-layout{
    display:grid!important;
    grid-template-columns:var(--pa-shell-sidebar-w,205px) minmax(0,1fr)!important;
    align-items:stretch!important;
    width:100%!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    display:flex!important;
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    grid-column:1!important;
    width:var(--pa-shell-sidebar-w,205px)!important;
    min-width:var(--pa-shell-sidebar-w,205px)!important;
    max-width:var(--pa-shell-sidebar-w,205px)!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    margin:0!important;
    padding:10px 9px 14px!important;
    overflow:visible!important;
    transform:none!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    z-index:30!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    display:flex!important;
    position:sticky!important;
    top:calc(var(--pa-shell-header-h,82px) + 8px)!important;
    flex-direction:column!important;
    align-items:stretch!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--pa-shell-header-h,82px) - 16px)!important;
    margin:0!important;
    padding:0 2px 10px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    white-space:normal!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }

  body.pal-atlas-page .pal-atlas-content{
    grid-column:2!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
  }

  body.pal-atlas-page .topbar{
    display:none!important;
  }

  body.pal-atlas-page .sidebar-scrim{
    display:none!important;
  }
}

@media (max-width:900px){
  body.pal-atlas-page .pal-atlas-layout{
    display:block!important;
    grid-template-columns:1fr!important;
    width:100%!important;
  }

  body.pal-atlas-page .topbar{
    display:flex!important;
    position:sticky!important;
    top:var(--pa-shell-header-h,72px)!important;
    z-index:500!important;
    width:100%!important;
  }

  body.pal-atlas-page #mobile-menu-btn{
    display:grid!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    display:flex!important;
    position:fixed!important;
    top:var(--pa-shell-header-h,72px)!important;
    right:auto!important;
    bottom:0!important;
    left:0!important;
    width:min(92vw,360px)!important;
    min-width:0!important;
    max-width:min(92vw,360px)!important;
    height:calc(100dvh - var(--pa-shell-header-h,72px))!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:10px!important;
    overflow:hidden!important;
    background:#08090d!important;
    border-right:1px solid #24262d!important;
    transform:translate3d(-105%,0,0)!important;
    visibility:hidden!important;
    opacity:0!important;
    pointer-events:none!important;
    z-index:700!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar.open{
    transform:translate3d(0,0,0)!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    display:flex!important;
    position:relative!important;
    top:auto!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0 2px 18px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    white-space:normal!important;
  }

  body.pal-atlas-page .sidebar-scrim{
    display:block!important;
    position:fixed!important;
    top:var(--pa-shell-header-h,72px)!important;
    right:0!important;
    bottom:0!important;
    left:0!important;
    width:auto!important;
    height:auto!important;
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    background:rgba(0,0,0,.62)!important;
    z-index:680!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar.open ~ .sidebar-scrim{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
}

/* ========================================================================== 
   PAL ATLAS SIDEBAR TOP ALIGNMENT v74
   Desktop/tablet sidebar itself is sticky directly below the fixed Versys
   header. The nav is no longer independently sticky, which removes the empty
   vertical gap while retaining a natural stop at the Pal Atlas layout/footer.
   ========================================================================== */
@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:sticky!important;
    top:var(--versys-header-height,82px)!important;
    align-self:start!important;
    height:calc(100dvh - var(--versys-header-height,82px))!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--versys-header-height,82px))!important;
    padding:10px 9px 12px!important;
    overflow:hidden!important;
    background:#08090d!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:static!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0 2px 10px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }

  body.pal-atlas-page .pa-nav-search{
    margin-top:0!important;
  }
}

/* ========================================================================== 
   PAL ATLAS DESKTOP SIDEBAR HARD LOCK v76
   The desktop rail is viewport-fixed below the global header. It no longer
   depends on the rendered route height, so loading -> loaded cannot move it.
   JS updates --pa-sidebar-footer-stop only when the footer enters the viewport.
   ========================================================================== */
:root{--pa-sidebar-footer-stop:0px;}

@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-layout{
    display:grid!important;
    grid-template-columns:var(--pa-shell-sidebar-w,205px) minmax(0,1fr)!important;
    align-items:start!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:fixed!important;
    top:var(--versys-header-height,82px)!important;
    right:auto!important;
    bottom:var(--pa-sidebar-footer-stop,0px)!important;
    left:0!important;
    width:var(--pa-shell-sidebar-w,205px)!important;
    min-width:var(--pa-shell-sidebar-w,205px)!important;
    max-width:var(--pa-shell-sidebar-w,205px)!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:10px 9px 12px!important;
    overflow:hidden!important;
    transform:none!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    background:#08090d!important;
    border-right:1px solid #24262d!important;
    z-index:420!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:static!important;
    inset:auto!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0 2px 10px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    white-space:normal!important;
    transform:none!important;
  }

  body.pal-atlas-page .pa-nav-search{
    position:relative!important;
    inset:auto!important;
    margin:0 0 7px!important;
    transform:none!important;
  }

  body.pal-atlas-page .pal-atlas-content{
    grid-column:2!important;
    min-width:0!important;
    width:100%!important;
    margin:0!important;
  }
}

/* ========================================================================== 
   PAL ATLAS SIDEBAR CLIP FIX v77
   The old footer collision value could be calculated while the route was still
   changing height, collapsing the fixed rail to a thin black strip. v77 uses a
   separate guarded footer-stop value and never allows the rail to collapse.
   ========================================================================== */
:root{--pa-sidebar-footer-stop-v77:0px;}

@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    top:var(--versys-header-height,82px)!important;
    bottom:var(--pa-sidebar-footer-stop-v77,0px)!important;
    height:auto!important;
    min-height:240px!important;
    max-height:none!important;
    overflow:hidden!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
  }
}

/* ========================================================================== 
   PAL ATLAS SIDEBAR FULL-HEIGHT FIX v78
   v77 could still accept a stale footer collision value and shrink the rail to
   its 240px safety minimum. That made the rest of the left column look like a
   black box covering the lower menu. v78 ignores all older footer-stop vars and
   only shortens the rail when the real footer is actually being reached.
   ========================================================================== */
:root{--pa-sidebar-footer-stop-v78:0px;}

@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:fixed!important;
    top:var(--versys-header-height,82px)!important;
    right:auto!important;
    bottom:auto!important;
    left:0!important;
    width:var(--pa-shell-sidebar-w,205px)!important;
    min-width:var(--pa-shell-sidebar-w,205px)!important;
    max-width:var(--pa-shell-sidebar-w,205px)!important;
    height:calc(100dvh - var(--versys-header-height,82px) - var(--pa-sidebar-footer-stop-v78,0px))!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--versys-header-height,82px) - var(--pa-sidebar-footer-stop-v78,0px))!important;
    overflow:hidden!important;
    background:#08090d!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
}


/* ==========================================================================
   PAL ATLAS COMPACT ROUTE BAR FLOW FIX v79
   On <=900px the global Versys header is in normal document flow. Older
   rules offset the Pal Atlas route bar by the header height a second time,
   creating a black gap and allowing the Overview bar to cover page content.
   Keep the route bar in flow at the top of the Pal Atlas content; once the
   header scrolls away it may stick to the viewport top without covering the
   first content block.
   ========================================================================== */
@media (max-width:900px){
  body.pal-atlas-page .pal-atlas-layout,
  body.pal-atlas-page .pal-atlas-content,
  body.pal-atlas-page .main-content{
    margin-top:0!important;
    padding-top:0!important;
  }

  body.pal-atlas-page .topbar{
    display:flex!important;
    position:sticky!important;
    top:0!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    width:100%!important;
    margin:0!important;
    transform:none!important;
    z-index:500!important;
  }

  body.pal-atlas-page .view-container{
    margin-top:0!important;
  }
}

/* ========================================================================== 
   PAL ATLAS GLOBAL FOOTER / SIDEBAR CONTAINMENT FIX v80 - 2026-09-02
   The desktop rail must be sticky inside the Pal Atlas grid, never viewport-
   fixed. This makes the end of .pal-atlas-layout the hard boundary, so the
   global footer always starts after the app shell and can never be covered by
   the left navigation while routes or async footer content are loading.
   ========================================================================== */
@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-layout{
    position:relative!important;
    display:grid!important;
    grid-template-columns:var(--pa-shell-sidebar-w,205px) minmax(0,1fr)!important;
    align-items:stretch!important;
    min-height:calc(100dvh - var(--versys-header-height,82px))!important;
    isolation:isolate!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    grid-column:1!important;
    align-self:stretch!important;
    width:var(--pa-shell-sidebar-w,205px)!important;
    min-width:var(--pa-shell-sidebar-w,205px)!important;
    max-width:var(--pa-shell-sidebar-w,205px)!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    margin:0!important;
    padding:10px 9px 14px!important;
    overflow:visible!important;
    transform:none!important;
    z-index:20!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:sticky!important;
    top:calc(var(--versys-header-height,82px) + 10px)!important;
    inset:auto auto auto auto!important;
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--versys-header-height,82px) - 20px)!important;
    margin:0!important;
    padding:0 2px 10px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    transform:none!important;
    z-index:21!important;
  }

  body.pal-atlas-page .pal-atlas-content{
    position:relative!important;
    grid-column:2!important;
    min-width:0!important;
    width:100%!important;
    margin:0!important;
    z-index:1!important;
  }

  body.pal-atlas-page #vm-footer{
    position:relative!important;
    z-index:30!important;
    width:100%!important;
    clear:both!important;
  }
}

/* Phase 3: merged-tab navigation search results. */
body.pal-atlas-page .pa-nav-tab-results {
  display: none;
  gap: 5px;
  margin: 0 0 8px;
  padding: 0;
}

body.pal-atlas-page .pa-nav-tab-results.is-visible {
  display: grid;
}

body.pal-atlas-page .pa-nav-tab-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #303039;
  border-left: 2px solid #d90a2c;
  border-radius: 8px;
  background: #0d0d11;
  color: #fff;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

body.pal-atlas-page .pa-nav-tab-result:hover,
body.pal-atlas-page .pa-nav-tab-result:focus-visible {
  border-color: #d90a2c;
  background: #15151b;
  transform: translateX(2px);
  outline: none;
}

body.pal-atlas-page .pa-nav-tab-result > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

body.pal-atlas-page .pa-nav-tab-result strong {
  overflow: hidden;
  color: #fff;
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.pal-atlas-page .pa-nav-tab-result small {
  overflow: hidden;
  color: #8f8f99;
  font-size: 8px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.pal-atlas-page .pa-nav-tab-result em {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 4px;
  background: rgba(217,10,44,.13);
  color: #ef1238;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .08em;
}

/* When a hidden tab matches the search, softly pulse its parent hub in the menu. */
body.pal-atlas-page .sidebar-nav a.nav-item.pa-tab-match {
  position: relative;
  border-color: rgba(217,10,44,.7) !important;
  box-shadow: inset 2px 0 0 #d90a2c, 0 0 0 0 rgba(217,10,44,.22);
  animation: pa-tab-parent-pulse 2.6s ease-in-out infinite;
}

@keyframes pa-tab-parent-pulse {
  0%, 100% {
    box-shadow: inset 2px 0 0 #d90a2c, 0 0 0 0 rgba(217,10,44,0);
  }
  50% {
    box-shadow: inset 2px 0 0 #d90a2c, 0 0 0 4px rgba(217,10,44,.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.pal-atlas-page .sidebar-nav a.nav-item.pa-tab-match {
    animation: none;
    box-shadow: inset 2px 0 0 #d90a2c;
  }
}

@media (max-width: 640px) {
  body.pal-atlas-page .pa-nav-tab-result {
    padding: 10px;
  }
  body.pal-atlas-page .pa-nav-tab-result strong {
    font-size: 11px;
  }
  body.pal-atlas-page .pa-nav-tab-result small {
    font-size: 9px;
  }
}


/* ==========================================================================\n   FINAL NAVIGATION CONTRACT v81 - 2026-09-03\n   Search is a command palette. It never opens, hides or mutates menu groups.\n   The sidebar rail is sticky inside the app shell and owns its own scrolling.\n   ========================================================================== */
.sidebar-nav.pa-searching .nav-dropdown-menu{display:none!important;}
.sidebar-nav.pa-searching .nav-dropdown.is-open > .nav-dropdown-menu{display:block!important;}
.sidebar-nav.pa-searching .nav-dropdown{display:block!important;}
.sidebar-nav .pa-search-hidden{display:revert!important;}
.sidebar-nav.pa-searching.is-empty .pa-nav-no-results{display:block!important;}

body.pal-atlas-page .pa-nav-tab-results{
  display:none;
  grid-template-columns:1fr;
  gap:6px;
  margin:0 0 10px;
  padding:0;
}
body.pal-atlas-page .pa-nav-tab-results.is-visible{display:grid;}
body.pal-atlas-page .pa-nav-tab-result{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-width:0;
  padding:9px 10px;
  border:1px solid #2b2d35;
  border-left:2px solid #d90a2c;
  border-radius:8px;
  background:#111218;
  color:#fff;
  text-decoration:none;
}
body.pal-atlas-page .pa-nav-tab-result:hover,
body.pal-atlas-page .pa-nav-tab-result:focus-visible{background:#171820;border-color:#d90a2c;outline:none;}
body.pal-atlas-page .pa-nav-tab-result span{display:grid;min-width:0;gap:2px;}
body.pal-atlas-page .pa-nav-tab-result strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;line-height:1.2;}
body.pal-atlas-page .pa-nav-tab-result small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#9b9eaa;font-size:9px;line-height:1.2;}
body.pal-atlas-page .pa-nav-tab-result em{flex:0 0 auto;padding:3px 5px;border-radius:4px;background:rgba(217,10,44,.16);color:#ff2348;font-size:7px;font-style:normal;font-weight:800;letter-spacing:.06em;}
body.pal-atlas-page .nav-item.pa-tab-match{animation:paNavMatchPulse 2.2s ease-in-out infinite;}
@keyframes paNavMatchPulse{0%,100%{box-shadow:inset 2px 0 0 rgba(217,10,44,.25)}50%{box-shadow:inset 3px 0 0 #d90a2c,0 0 0 1px rgba(217,10,44,.24)}}

@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-layout{align-items:stretch!important;}
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:relative!important;
    top:auto!important;bottom:auto!important;left:auto!important;right:auto!important;
    height:auto!important;min-height:100%!important;max-height:none!important;
    overflow:visible!important;
  }
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:sticky!important;
    top:calc(var(--versys-header-height,82px) + 8px)!important;
    height:auto!important;
    max-height:calc(100dvh - var(--versys-header-height,82px) - 16px)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    scrollbar-gutter:stable;
  }
}

/* Every generated Copy link action gets its own row, clear of tabs/pills/filters. */
body.pal-atlas-page .pal-atlas-copy-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  margin:12px 0 14px;
  clear:both;
}
body.pal-atlas-page .pal-atlas-copy-row .pal-atlas-copy-page-link{margin:0!important;align-self:auto!important;}
@media(max-width:640px){body.pal-atlas-page .pal-atlas-copy-row{margin:10px 0 12px;}body.pal-atlas-page .pal-atlas-copy-row .pal-atlas-copy-page-link{min-height:42px;}}


/* ==========================================================================\n   FINAL DEVICE SAFETY v82 - 2026-09-05\n   Loaded after route-specific CSS. Prevents late modules from reintroducing\n   fixed-width overflow on phones, tablets, landscape devices or narrow PCs.\n   ========================================================================== */
body.pal-atlas-page .pal-atlas-layout *,
body.pal-atlas-page .pal-atlas-layout *::before,
body.pal-atlas-page .pal-atlas-layout *::after{box-sizing:border-box;}

body.pal-atlas-page .pal-atlas-content,
body.pal-atlas-page .view-container,
body.pal-atlas-page .view,
body.pal-atlas-page .view>*,
body.pal-atlas-page .panel,
body.pal-atlas-page [class*="grid"],
body.pal-atlas-page [class*="toolbar"]{min-width:0;max-width:100%;}

body.pal-atlas-page .view img,
body.pal-atlas-page .view picture,
body.pal-atlas-page .view video,
body.pal-atlas-page .view canvas,
body.pal-atlas-page .view svg{max-width:100%;height:auto;}

body.pal-atlas-page .view h1,
body.pal-atlas-page .view h2,
body.pal-atlas-page .view h3,
body.pal-atlas-page .view h4,
body.pal-atlas-page .view p,
body.pal-atlas-page .view li,
body.pal-atlas-page .view strong,
body.pal-atlas-page .view span{overflow-wrap:anywhere;}

body.pal-atlas-page .view [role="tablist"],
body.pal-atlas-page .view .tabs,
body.pal-atlas-page .view .tab-bar,
body.pal-atlas-page .view [class*="tabs-row"],
body.pal-atlas-page .view [class*="tab-strip"]{
  max-width:100%;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;
  scrollbar-width:thin;overscroll-behavior-inline:contain;
}
body.pal-atlas-page .view [role="tablist"]>[role="tab"]{flex:0 0 auto;}

body.pal-atlas-page .modal-container{max-width:100vw;max-height:100dvh;padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));}
body.pal-atlas-page .modal-container>*{max-width:min(960px,calc(100vw - 20px));max-height:calc(100dvh - 20px);overflow:auto;overscroll-behavior:contain;}

body.pal-atlas-page input,
body.pal-atlas-page select,
body.pal-atlas-page textarea,
body.pal-atlas-page button,
body.pal-atlas-page .button{font:inherit;}

@media (max-width:900px){
  body.pal-atlas-page .view-container{padding-left:clamp(10px,3.2vw,18px)!important;padding-right:clamp(10px,3.2vw,18px)!important;}
  body.pal-atlas-page .view .toolbar,
  body.pal-atlas-page .view .data-toolbar,
  body.pal-atlas-page .view [class*="filter-row"],
  body.pal-atlas-page .view [class*="control-row"]{max-width:100%!important;}
  body.pal-atlas-page .view input,
  body.pal-atlas-page .view select,
  body.pal-atlas-page .view textarea{min-width:0!important;max-width:100%!important;}
  body.pal-atlas-page .pa-responsive-table-wrap{margin-inline:0;max-width:100%;}
}

@media (max-width:640px){
  body.pal-atlas-page .view .field,
  body.pal-atlas-page .view label.field{min-width:0!important;max-width:100%!important;}
  body.pal-atlas-page .view .field>input,
  body.pal-atlas-page .view .field>select,
  body.pal-atlas-page .view .field>textarea{width:100%!important;}
  body.pal-atlas-page .view .action-row,
  body.pal-atlas-page .view [class*="actions"]{max-width:100%;flex-wrap:wrap;}
  body.pal-atlas-page .view .action-row>.button{max-width:100%;}
}

@media (max-width:420px){
  body.pal-atlas-page .view-container{padding-left:10px!important;padding-right:10px!important;}
  body.pal-atlas-page .topbar{padding-left:10px!important;padding-right:10px!important;}
  body.pal-atlas-page .topbar h1{max-width:calc(100vw - 82px)!important;font-size:16px!important;}
  body.pal-atlas-page .pal-atlas-sidebar{max-width:94vw!important;width:94vw!important;}
  body.pal-atlas-page .view button,
  body.pal-atlas-page .view .button{white-space:normal;overflow-wrap:anywhere;}
}

@media (max-height:520px) and (orientation:landscape) and (max-width:900px){
  body.pal-atlas-page .pal-atlas-sidebar{height:calc(100dvh - var(--pa-shell-header-h,72px))!important;}
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{padding-bottom:max(12px,env(safe-area-inset-bottom))!important;}
  body.pal-atlas-page .topbar{min-height:48px!important;padding-top:4px!important;padding-bottom:4px!important;}
}

/* ==========================================================================
   SIDEBAR HEADER GAP FINAL FIX v83 - 2026-09-05
   The document already reserves the fixed Versys header height. Keep the
   desktop sidebar itself sticky below that header and keep its nav in normal
   flow so the header offset is never counted a second time.
   ========================================================================== */
@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:sticky!important;
    top:var(--versys-header-height,82px)!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    align-self:start!important;
    height:calc(100dvh - var(--versys-header-height,82px))!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--versys-header-height,82px))!important;
    margin:0!important;
    padding:10px 9px 12px!important;
    overflow:hidden!important;
    transform:none!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:static!important;
    inset:auto!important;
    top:auto!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    padding:0 2px 10px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    transform:none!important;
  }

  body.pal-atlas-page .pa-nav-search{
    margin-top:0!important;
  }
}

/* Drawer already begins below the header on <=900px; keep its nav flush to
   the top of the drawer as well. */
@media (max-width:900px){
  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:relative!important;
    inset:auto!important;
    top:auto!important;
    margin-top:0!important;
    padding-top:0!important;
  }
  body.pal-atlas-page .pa-nav-search{margin-top:0!important;}
}

/* ==========================================================================\n   DESKTOP SIDEBAR ALIGNMENT v84 - 2026-09-05\n   The shared Versys header participates in document flow, so .pal-atlas-layout\n   already begins immediately below it. Do not add the header height again to\n   the sidebar or its nav. This keeps the first menu control flush with the\n   top of the Pal Atlas content rail while preserving sticky navigation.\n   ========================================================================== */
@media (min-width:901px){
  body.pal-atlas-page .pal-atlas-sidebar,
  body.pal-atlas-page .pal-atlas-sidebar.is-clean-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-desktop-fixed,
  body.pal-atlas-page .pal-atlas-sidebar.is-footer-locked,
  body.pal-atlas-page .pal-atlas-sidebar.is-stable-fixed{
    position:relative!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    align-self:stretch!important;
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    margin:0!important;
    padding:8px 9px 12px!important;
    overflow:visible!important;
    transform:none!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .sidebar-nav{
    position:sticky!important;
    top:8px!important;
    right:auto!important;
    bottom:auto!important;
    left:auto!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - 16px)!important;
    margin:0!important;
    padding:0 2px 10px 0!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
    transform:none!important;
  }

  body.pal-atlas-page .pal-atlas-sidebar .pa-nav-search{
    margin:0!important;
    padding-top:0!important;
  }
}
