/* V510: additive web+mobile UI. No map position/route data changes. */
html body[data-prtmx-v510-route="board"] .prtmx-ui-header{
  display:block!important;position:fixed!important;top:0!important;left:0!important;right:0!important;
  z-index:2800!important;height:72px!important;min-height:72px!important;
  background:#fbfdfff5!important;border-bottom:1px solid #d7e5ef!important;
}
html body[data-prtmx-v510-route="board"] .prtmx-ui-header-inner{height:100%!important;}
html body[data-prtmx-v510-route="board"] > .prtmx-ui-dock{
  display:grid!important;position:fixed!important;z-index:2800!important;
  left:50%!important;transform:translateX(-50%)!important;
  bottom:calc(7px + env(safe-area-inset-bottom,0px))!important;
  border-radius:10px!important;box-shadow:0 3px 0 #d8e6ef,0 10px 26px #2b526a25!important;
}
html body[data-prtmx-v510-route="board"] .prtmx-ui-sheet[hidden]{display:none!important;}
html body[data-prtmx-v510-route="board"] :is(.prtmx-v58-company-tag,.prtmx-v510-company-tag){
  display:inline-flex!important;align-items:center!important;vertical-align:middle!important;
  margin:5px 2px 5px 11px!important;padding:4px 9px!important;
  border:1px solid #d3e1ec!important;border-radius:7px!important;
  background:#f5f9fd!important;box-shadow:0 2px 0 #dce8f1!important;
  color:#35536b!important;font-size:11px!important;line-height:1.35!important;
  white-space:nowrap!important;
}
html body[data-prtmx-v510-route="board"] .prtmx-v510-company-tag::before{
  content:"";display:block;width:8px;height:8px;flex:none;
  background:var(--prtmx-v510-color,#2d85b7);border-radius:2px;
}
html body[data-prtmx-v510-route="board"] :is(.board-card,.board-row,.stop-card,.stop-row,.ship-board-item){
  border-radius:10px!important;
}
/* Compact centered map menu, with native details/summary fallback if JS fails. */
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapbar{
  display:flex!important;align-items:center!important;gap:12px!important;
  position:fixed!important;z-index:3000!important;left:50%!important;top:12px!important;
  transform:translateX(-50%)!important;
  height:56px!important;width:max-content!important;max-width:calc(100vw - 22px)!important;
  box-sizing:border-box!important;padding:7px 10px!important;border:1px solid #d9e5ee!important;
  background:rgba(255,255,255,.97)!important;backdrop-filter:blur(12px);
  border-radius:10px!important;box-shadow:0 3px 0 #d8e6f0,0 10px 22px #254b6d24!important;
  font:700 13px/1.25 system-ui,-apple-system,'Segoe UI',sans-serif!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapbrand img{
  display:block!important;object-fit:contain!important;width:116px!important;height:40px!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu{position:relative!important;flex:none!important;}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu summary{
  list-style:none!important;display:flex!important;align-items:center!important;justify-content:center!important;
  gap:7px!important;min-height:36px!important;padding:0 12px!important;
  border:1px solid #dce7ef!important;border-radius:7px!important;background:#eef6fc!important;
  color:#2e5c7f!important;cursor:pointer!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu summary::-webkit-details-marker{display:none!important;}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu[open] nav{
  display:flex!important;flex-direction:column!important;gap:4px!important;
  position:absolute!important;top:calc(100% + 10px)!important;right:0!important;
  min-width:205px!important;max-width:calc(100vw - 26px)!important;
  padding:8px!important;border:1px solid #d7e5ef!important;border-radius:9px!important;
  background:#fff!important;box-shadow:0 10px 30px #203e582c!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu nav{display:none;}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu nav a{
  display:block!important;padding:10px 12px!important;text-decoration:none!important;
  color:#345a75!important;background:#f8fbfe!important;border-radius:6px!important;
  white-space:nowrap!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu nav a:is(:hover,:focus-visible){background:#e8f3fc!important;}
/* Map area fills the viewport after removing large header and bottom navigation. */
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] :is(#map,.leaflet-container){
  min-height:100dvh!important;height:100dvh!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v58-map-stats{
  position:fixed!important;z-index:2700!important;
  top:82px!important;left:12px!important;right:auto!important;bottom:auto!important;
  margin:0!important;transform:none!important;
  max-width:calc(100vw - 24px)!important;
  padding:8px 10px!important;border-radius:7px!important;
  background:#fff!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v58-map-panel{
  position:fixed!important;z-index:2700!important;
  bottom:16px!important;left:14px!important;top:auto!important;right:auto!important;
  margin:0!important;transform:none!important;
  max-height:min(64dvh,600px)!important;width:min(350px,calc(100vw - 28px))!important;
  overflow-y:auto!important;border-radius:9px!important;
}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .leaflet-bottom{bottom:0!important;}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .leaflet-top.leaflet-left{margin-top:131px!important;}
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .leaflet-top.leaflet-right{margin-top:80px!important;}
/* R2 already owns the vessel image layer. Do NOT append another icon or
   modify Leaflet anchors. Clip and shrink its content INSIDE the ring. */
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"]
.leaflet-marker-icon.prtmx-v59r2-voxel > .prtmx-v59r2-ship{
  box-sizing:border-box!important;
  overflow:hidden!important;
  border-radius:50%!important;
  width:calc(100% - 10px)!important;
  height:calc(100% - 10px)!important;
  left:5px!important;top:5px!important;
  background-color:#fff!important;
  background-image:url('/static/prtmx-v59r2-voxel-map-192.png?v=59r2')!important;
  background-repeat:no-repeat!important;
  background-position:center!important;
  background-size:76% 76%!important;
  background-clip:padding-box!important;
  border:0!important;
  pointer-events:none!important;
}
/* Avoid painting two separate ship images from old themes. */
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"]
.leaflet-marker-icon.prtmx-v59r2-voxel > .prtmx-v59r2-ship :is(img,svg,canvas){display:none!important;}
/* Never modify joined ship/company labels or icon anchor of Leaflet. */
html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] :is(.prtmx-v57-card,.prtmx-v55-marker-card){border-radius:8px!important;}
@media(max-width:700px){
  html body[data-prtmx-v510-route="board"] .prtmx-ui-header{height:80px!important;min-height:80px!important;}
  html body[data-prtmx-v510-route="board"] > .prtmx-ui-dock{width:calc(100% - 16px)!important;}
  html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapbar{height:52px!important;top:10px!important;gap:7px!important;padding:6px 8px!important;}
  html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapbrand img{width:96px!important;height:37px!important;}
  html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v510-mapmenu summary{padding:0 10px!important;font-size:12px!important;}
  html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v58-map-stats{top:73px!important;left:10px!important;}
  html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .prtmx-v58-map-panel{left:9px!important;bottom:10px!important;width:calc(100vw - 18px)!important;max-height:min(55dvh,530px)!important;}
  html body.prtmx-unified-ui[data-prtmx-ui-route="map"][data-prtmx-v510-route="map"] .leaflet-top.leaflet-left{margin-top:126px!important;}
}
