/* 9.19.37: slim sea/roads/cameras chrome, stations peek, inspect above tabs, quieter marine markers */

/* --- Screen budget: hide weather chip row in Sjór; slim dock --- */
/* 9.26.0: the shared map screen shows the chip row in Sjór too (map-screen-926.js) */
html body[data-phone-tab="sea"] .layer-rail,
html.atlas-pro-phone body[data-phone-tab="sea"] .layer-rail,
html body[data-phone-tab="sea"] #agnirPop{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  overflow:hidden!important;
  pointer-events:none!important;
}

html body.atlas-dock-slim #weatherGraphSystem{
  height:48px!important;
  min-height:48px!important;
  max-height:48px!important;
  padding:0 8px!important;
  gap:0!important;
  overflow:hidden!important;
  border-radius:14px 14px 0 0!important;
}
html body.atlas-dock-slim #graphDockHandle,
html body.atlas-dock-slim #dockLead,
html body.atlas-dock-slim #graphPanel,
html body.atlas-dock-slim .forecast-ribbon-wrap,
html body.atlas-dock-slim #forecastRibbon,
html body.atlas-dock-slim #timelineMeta,
html body.atlas-dock-slim #timeKind,
html body.atlas-dock-slim #graphDockToggle,
html body.atlas-dock-slim #dockColorToggle,
html body.atlas-dock-slim #timelineDays,
html body.atlas-dock-slim #timelineBubble,
html body.atlas-dock-slim #pastMeasureHint,
html body.atlas-dock-slim .timeline-foot,
html body.atlas-dock-slim #timelineInsight,
html body.atlas-dock-slim .timeline-day-select,
html body.atlas-dock-slim #graphSelectedValues{
  display:none!important;
}
html body.atlas-dock-slim #timeDock,
html body.atlas-dock-slim #timeDock .timeline-main{
  height:48px!important;
  min-height:0!important;
  padding:0!important;
  margin:0!important;
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
}
html body.atlas-dock-slim #timeDock{flex:1 1 auto!important;width:auto!important;}
html body.atlas-dock-slim #timeDock .timeline-head{
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  height:48px!important;
  padding:0!important;
  margin:0!important;
  flex:1 1 auto!important;
}
html body.atlas-dock-slim #timeDock .timeline-live-label{margin:0!important;}
html body.atlas-dock-slim #timeDock .timeline-actions{
  display:flex!important;
  align-items:center!important;
  gap:4px!important;
  margin-left:auto!important;
}
html body.atlas-dock-slim #timelineTouch{
  display:none!important;
  height:0!important;
}
html body.atlas-dock-slim:not(.atlas-dock-slim-noticks) #timelineTouch{
  /* reserved if we later show a thin strip */
}

/* Sea peek: default single 44px row sitting on the dock */
html body #atlasModePeek.atlas-mode-peek{
  z-index:70!important;
  max-height:none;
}
html body #atlasModePeek.atlas-mode-peek.is-slim{
  max-height:44px!important;
  height:44px!important;
  padding:0 8px 0 10px!important;
  overflow:hidden!important;
  border-radius:14px 14px 0 0!important;
}
html body #atlasModePeek.atlas-mode-peek.is-slim .atlas-peek-handle{display:none!important;}
html body #atlasModePeek.atlas-mode-peek.is-slim .atlas-mode-peek-body{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
  height:44px!important;
  padding:0!important;
  overflow:hidden!important;
}
html body #atlasModePeek .atlas-slim-chips{
  display:flex;
  align-items:center;
  gap:6px;
  overflow-x:auto;
  overflow-y:hidden;
  flex:1 1 auto;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
  height:44px;
}
html body #atlasModePeek .atlas-slim-chips::-webkit-scrollbar{display:none;}
html body #atlasModePeek .atlas-slim-chips button,
html body #atlasModePeek .atlas-slim-chips .atlas-peek-legend{
  flex:0 0 auto;
  white-space:nowrap;
  height:28px;
  padding:0 10px;
  border-radius:999px;
  font-size:12px;
}
html body #atlasModePeek .atlas-peek-legend{
  color:#c9d6de;
  font-size:11px;
  padding:0 4px;
  display:flex;
  align-items:center;
  gap:8px;
  letter-spacing:.01em;
}
html body #atlasModePeek .atlas-peek-more{
  flex:0 0 auto;
  height:32px;
  min-width:32px;
  border:0;
  border-radius:10px;
  background:rgba(255,255,255,.1);
  color:#fff;
  font-size:16px;
  line-height:1;
}
html body #atlasModePeek.atlas-mode-peek.is-expanded{
  height:auto!important;
  max-height:min(18vh, 150px)!important;
  padding:4px 10px 8px!important;
}
html body #atlasModePeek.atlas-mode-peek.is-expanded .atlas-peek-extra{display:block;}
html body #atlasModePeek .atlas-peek-extra{display:none;padding-top:6px;}

/* Stations / harbour catalogues as peeks */
html body[data-phone-tab="stations"] #stationBrowser,
html.atlas-pro-phone body[data-phone-tab="stations"] #stationBrowser,
html.atlas-phone-shell body[data-phone-tab="stations"] #stationBrowser,
html body.v9-map-first[data-phone-tab="stations"] #stationBrowser{
  top:auto!important;
  bottom:calc(var(--atlas-mode-peek-bottom, 100px))!important;
  left:0!important;
  right:0!important;
  width:auto!important;
  height:auto!important;
  max-height:40vh!important;
  border-radius:16px 16px 0 0!important;
  z-index:80!important;
}
html body[data-phone-tab="stations"] #stationBrowser[data-sheet-size="full"],
html.atlas-pro-phone body[data-phone-tab="stations"] #stationBrowser[data-sheet-size="full"]{
  max-height:calc(100dvh - 52px - env(safe-area-inset-bottom,0px) - 8px)!important;
  top:8px!important;
  bottom:calc(52px + env(safe-area-inset-bottom,0px))!important;
}
html body[data-phone-tab="sea"] #harbourBrowser,
html body[data-phone-tab="roads"] #harbourBrowser,
html body[data-phone-tab="cameras"] #harbourBrowser,
html.atlas-pro-phone body[data-phone-tab="sea"] #harbourBrowser,
html.atlas-pro-phone body[data-phone-tab="roads"] #harbourBrowser,
html.atlas-pro-phone body[data-phone-tab="cameras"] #harbourBrowser{
  top:auto!important;
  bottom:calc(var(--atlas-mode-peek-bottom, 100px))!important;
  left:0!important;
  right:0!important;
  height:auto!important;
  max-height:30vh!important;
  border-radius:16px 16px 0 0!important;
  z-index:80!important;
}

/* Inspect / harbour / buoy sheets sit above the tab bar */
html body #inspectSheet,
html body #inspectSheet.inspect-sheet,
html body #inspectSheet.station-sheet,
html body #mapPointCard{
  bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
  padding-bottom:max(12px, env(safe-area-inset-bottom, 0px))!important;
  max-height:calc(100dvh - var(--phone-tab-height, 52px) - env(safe-area-inset-bottom, 0px) - 8px)!important;
}
html body #phoneTabs{z-index:140!important;}

/* Measured sea-level dot on tide graph */
.sjor-measured-dot{fill:#f0c14a;stroke:#101820;stroke-width:1.4;}
.sjor-measured-lab{fill:#f4e3a8;font-size:8px;font-family:inherit;}
html body.atlas-dock-slim #weatherGraphSystem,
html body.atlas-dock-slim #weatherGraphSystem[data-dock-mode="collapsed"]{
  height:48px!important;
  min-height:48px!important;
  max-height:48px!important;
  --graph-dock-height:48px!important;
}
html body.atlas-dock-slim #timeDock,
html body.atlas-dock-slim #timeDock .timeline-main,
html body.atlas-dock-slim #timeDock .timeline-head{
  height:48px!important;
  min-height:0!important;
  max-height:48px!important;
}
html body.atlas-dock-slim #timelineTouch,
html body.atlas-dock-slim .timeline-range,
html body.atlas-dock-slim #timeTicks,
html body.atlas-dock-slim #timeSlider{
  display:none!important;
  height:0!important;
  min-height:0!important;
}
html body #inspectSheet.inspect-sheet,
html body #inspectSheet.station-sheet,
html body #inspectSheet{
  bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
  top:auto!important;
  max-height:calc(100dvh - var(--phone-tab-height, 52px) - env(safe-area-inset-bottom, 0px) - 8px)!important;
  padding-bottom:16px!important;
}

@media (max-width:900px){
  html body.v9-map-first #inspectSheet#inspectSheet:not([hidden]),
  html body.v9-map-first #inspectSheet#inspectSheet.inspect-sheet:not([hidden]),
  html body.v9-map-first #inspectSheet#inspectSheet.station-sheet:not([hidden]),
  html body.v9-map-first #inspectSheet#inspectSheet.forecast-sheet:not([hidden]),
  html body #mapPointCard:not([hidden]){
    bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
    top:auto!important;
    max-height:calc(100dvh - var(--phone-tab-height, 52px) - env(safe-area-inset-bottom, 0px) - 8px)!important;
    padding-bottom:16px!important;
  }
}

@media (max-width:900px){
  html body.v9-map-first #inspectSheet#inspectSheet.camera-sheet:not([hidden]),
  html body.v9-map-first #inspectSheet#inspectSheet.camera-sheet:not([hidden]):not(.station-sheet):not(.forecast-sheet):not(.point-sheet),
  html body.v9-map-first #inspectSheet#inspectSheet.managed-panel:not([hidden]),
  html body.v9-map-first #inspectSheet#inspectSheet.panel-custom:not([hidden]){
    bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
    top:auto!important;
    max-height:calc(100dvh - var(--phone-tab-height, 52px) - env(safe-area-inset-bottom, 0px) - 8px)!important;
    padding-bottom:16px!important;
  }
}

@media (max-width:900px){
  html.atlas-phone-shell body.v9-map-first #inspectSheet#inspectSheet#inspectSheet:not([hidden]),
  html.atlas-phone-shell body #inspectSheet#inspectSheet#inspectSheet:not([hidden]),
  html.atlas-phone-shell.atlas-pro-phone body #inspectSheet#inspectSheet#inspectSheet:not([hidden]),
  html.atlas-phone-shell body.v9-map-first #inspectSheet#inspectSheet.camera-sheet:not([hidden]):not(.station-sheet):not(.forecast-sheet):not(.point-sheet),
  html.atlas-phone-shell body.v9-map-first #inspectSheet#inspectSheet.camera-sheet:not([hidden]),
  html.atlas-phone-shell body #inspectSheet:not([hidden]),
  html body.v9-map-first #inspectSheet#inspectSheet#inspectSheet:not([hidden]){
    bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
    top:auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:calc(100dvh - var(--phone-tab-height, 52px) - env(safe-area-inset-bottom, 0px) - 8px)!important;
    padding-bottom:16px!important;
  }
}

/* 9.19.37: compact ⟲ Endurstilla kort in the phone top bar */
html.atlas-phone-shell #atlasPhoneTop #atlasMapReset,
html body #atlasMapReset.atlas-map-reset{
  flex:0 0 36px;
  width:36px;min-width:36px;max-width:36px;
  height:36px !important;min-height:36px !important;
  padding:0;
  border:1px solid rgba(255,255,255,.18);
  border-radius:10px;
  background:#0f1a22;
  color:#f4f7f8;
  font-size:18px;line-height:1;
  display:inline-flex;align-items:center;justify-content:center;
  box-shadow:0 1px 4px rgba(0,0,0,.35);
  cursor:pointer;
}
html.atlas-phone-shell #atlasPhoneTop #atlasMapReset span{font-size:18px;line-height:1;}
html.atlas-phone-shell #atlasPhoneTop #phoneMenuButton{margin-left:0 !important;}
/* keep Valmynd at the trailing edge; reset sits just before it */
html.atlas-phone-shell #atlasPhoneTop #atlasMapReset{margin-left:auto !important;}
html.atlas-phone-shell #atlasPhoneTop #phoneMenuButton{margin-left:0 !important;}

@media (max-width:360px){
  html.atlas-phone-shell #atlasPhoneTop .vi-label-full{display:none !important;}
  html.atlas-phone-shell #atlasPhoneTop .vi-label-short{display:inline !important;}
  html.atlas-phone-shell #atlasPhoneTop #openReferencePlayer{max-width:28%;padding-left:8px !important;padding-right:8px !important;}
  html.atlas-phone-shell #atlasPhoneTop #phoneMenuButton .valmynd-text{display:none !important;}
  html.atlas-phone-shell #atlasPhoneTop #atlasWarnBadge .warn-label,
  html.atlas-narrow-phone #atlasPhoneTop #atlasWarnBadge .warn-label{
    position:absolute !important;width:1px !important;height:1px !important;
    overflow:hidden !important;clip:rect(0,0,0,0) !important;
  }
  html.atlas-phone-shell #atlasPhoneTop #atlasMapReset{
    flex:0 0 32px;width:32px;min-width:32px;max-width:32px;
    height:32px !important;min-height:32px !important;
  }
}
@media (max-width:320px){
  html.atlas-phone-shell #atlasPhoneTop{gap:4px;left:6px;right:6px;}
  html.atlas-phone-shell #atlasPhoneTop #openReferencePlayer{max-width:26%;}
}

@media (max-width:900px){
  html.atlas-phone-shell body #stationBrowser#stationBrowser#stationBrowser:not([hidden]),
  html.atlas-phone-shell body.v9-map-first #stationBrowser#stationBrowser#stationBrowser:not([hidden]),
  html.atlas-phone-shell body[data-phone-tab="stations"] #stationBrowser#stationBrowser:not([hidden]),
  html.atlas-phone-shell body.v9-map-first[data-phone-tab="stations"] #stationBrowser#stationBrowser:not([hidden]){
    top:auto!important;
    bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
    left:0!important;right:0!important;width:100%!important;
    height:auto!important;
    min-height:0!important;
    max-height:40vh!important;
    padding-bottom:12px!important;
  }
  html.atlas-phone-shell body #stationBrowser#stationBrowser#stationBrowser[data-sheet-size="full"]:not([hidden]),
  html.atlas-phone-shell body.v9-map-first #stationBrowser#stationBrowser[data-sheet-size="full"]:not([hidden]){
    max-height:calc(100dvh - var(--phone-tab-height, 52px) - env(safe-area-inset-bottom, 0px) - 8px)!important;
    top:8px!important;
    bottom:calc(var(--phone-tab-height, 52px) + env(safe-area-inset-bottom, 0px))!important;
  }
}
