body.land-mode #toast { pointer-events: none; }
html body.v9-map-first.land-mode #marineStage:has(#landMap:not([hidden])) > #weatherGraphSystem#weatherGraphSystem.weather-graph-system,
html body.v9-map-first.land-mode #layerChips#layerChips,
body.land-mode .surface-frame-trust,
body.land-mode #frameTrustHide,
html body.land-mode[data-phone-tab="roads"] #atlasModePeek.atlas-mode-peek,
html.atlas-phone-shell body.v9-map-first.land-mode[data-phone-tab="roads"] #weatherGraphSystem.weather-graph-system,
html.atlas-phone-shell body.v9-map-first.land-mode[data-phone-tab="roads"] #layerChips#layerChips,
html.atlas-pro-phone body.land-mode[data-phone-tab="roads"] #layerChips#layerChips,
body.land-mode[data-phone-tab="roads"] #layerChips,
body.land-mode[data-phone-tab="roads"] #particleCanvas,
body.land-mode[data-phone-tab="roads"] .c9-compass,
body.land-mode[data-phone-tab="roads"] .layer-rail,
body.land-mode[data-phone-tab="roads"] .surface-frame-trust,
body.land-mode[data-phone-tab="roads"] #frameTrustHide,
body.land-mode[data-phone-tab="roads"] #mapLegend,
body.land-mode[data-phone-tab="roads"] #legendPeek,
body.land-mode #atlasMapPicker {
  display: none !important;
}

body.land-mode #landMap {
  background: #12bbd6;
}

html body.land-mode #landMap .maplibregl-canvas {
  filter: none;
}

.land-overview-tools,
.land-overview-legend,
#landOverviewBack {
  display: none;
  position: absolute;
  z-index: 4;
  pointer-events: auto;
}

.road-overview:not(:has(#landPlacePanel:not([hidden]), #landSheet.road-details-open)) #landOverviewTools,
.road-overview:not(:has(#landPlacePanel:not([hidden]), #landSheet.road-details-open)) .land-overview-legend {
  display: flex;
}

#landUi:not(.road-overview):not(:has(#landPlacePanel:not([hidden]), #landSheet.road-details-open)) #landOverviewBack {
  display: block;
}

.road-overview #landSearchForm,
body.land-mode #landUi:has(#landSheet.road-details-open) #landSearchForm,
.road-overview #landSheet:not(.road-details-open),
.road-overview #landSheet .land-modes,
.road-overview #landSheet > :is(header,footer,.land-sheet-grip),
.road-overview .land-identity,
.road-overview .land-terrain-badge {
  display: none;
}

.land-overview-tools,
#landOverviewBack {
  top: 12px;
}

.land-overview-tools,
.land-overview-legend {
  left: 12px;
  gap: 5px;
}

.land-overview-tools:has(#landOverviewRoadMenu:not([hidden])) {
  z-index: 5;
}

#landOverviewBack {
  left: min(468px, calc(100% - 190px));
}

.land-overview-tools > button,
.land-overview-legend > button,
#landOverviewBack {
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 12px;
  border: 1px solid #8faaa9;
  border-radius: 6px;
  background: #f9fcfb;
  color: #15373a;
  font: 700 13px/1.1 system-ui, sans-serif;
}

#landOverviewRoute {
  border-color: #0a5b5b;
  color: #fff;
  background: #0b6866;
}

#landOverviewRoadMenu:not([hidden]) {
  display: grid;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  width: max-content;
  max-height: calc(100dvh - 100px);
  overflow: auto;
  padding: 4px;
  border: 1px solid #8faaa9;
  border-radius: 6px;
  background: #f9fcfb;
  overscroll-behavior: contain;
}

#landOverviewRoadMenu > button {
  min-height: 44px;
  padding: 5px 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #15373a;
  text-align: start;
  font: 700 13px/1.1 system-ui, sans-serif;
}

#landOverviewRoadMenu > button:is(:hover,:focus-visible) {
  background: #d8efeb;
}

.land-overview-legend {
  bottom: 10px;
  align-items: center;
}

#landRoadUpdated:not([hidden]) {
  padding: 6px 8px;
  border-radius: 4px;
  background: #14373e;
  color: #fff;
  font: 700 12px/1.2 system-ui, sans-serif;
  white-space: nowrap;
}

body.land-mode #landMap .maplibregl-ctrl-top-right {
  top: 12px;
  right: 12px;
}

body.land-mode #landMap .maplibregl-ctrl-top-right .maplibregl-ctrl-group {
  margin: 0;
}

html body.v9-map-first.land-mode #landMap .maplibregl-ctrl-bottom-right {
  bottom: 10px !important;
}

html.atlas-phone-shell body.v9-map-first.land-mode #landMap .maplibregl-ctrl-bottom-right {
  bottom: calc(var(--road-tab-bottom) + 52px) !important;
}

body.land-mode .land-map-tools {
  right: 62px;
}

.road-overview .land-map-tools {
  display: flex;
  top: 12px;
}

.road-overview .land-style-menu {
  top: calc(100% + 4px);
  right: 0;
}

.road-overview #landPitch {
  display: none;
}

html.atlas-phone-shell body.land-mode .land-overview-tools,
html.atlas-phone-shell body.land-mode #landOverviewBack {
  top: calc(55px + env(safe-area-inset-top));
}

html.atlas-phone-shell body.land-mode .land-overview-legend {
  bottom: calc(var(--road-tab-bottom) + 6px);
}

html.atlas-phone-shell body.land-mode .road-overview .land-map-tools {
  top: auto;
  bottom: calc(var(--road-tab-bottom) + 6px);
  right: 9px;
  flex-direction: row;
}

@media (orientation: portrait) {
  html.atlas-phone-shell body.land-mode .road-overview .land-style-menu {
    top: auto;
    bottom: calc(100% + 4px);
  }
}

html.atlas-phone-shell body.land-mode:not(:has(.road-overview)) #landOverviewBack {
  top: calc(117px + env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  padding-inline: 8px;
}

@media (orientation: landscape) and (max-height: 360px) {
  #landOverviewRoadMenu:not([hidden]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  html.atlas-phone-shell body.land-mode .road-overview .land-map-tools {
    top: calc(54px + env(safe-area-inset-top));
    bottom: auto;
    right: calc(max(8px, env(safe-area-inset-right)) + 128px);
  }
  html.atlas-phone-shell body.land-mode .land-overview-legend {
    gap: 4px;
  }
  html.atlas-phone-shell body.v9-map-first.land-mode:has(.road-overview) #landMap .maplibregl-ctrl-bottom-right {
    bottom: calc(var(--road-tab-bottom) + 5px) !important;
    right: 47px;
  }
  html.atlas-phone-shell body.land-mode:not(:has(.road-overview)) #landOverviewBack {
    top: calc(5px + env(safe-area-inset-top));
    left: auto;
    right: min(30vw, 200px);
  }
}

@media (max-width: 359px) {
  .road-overview #landLocate { display: none; }
}

body[data-phone-tab="roads"] #harbourBrowser:not([hidden]) {
  margin-bottom: 0;
}

#atlasRoadsPanel {
  flex: 0 1 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 4px;
  padding: 0 8px 6px;
  background: #101a22;
  color: #eef4f7;
  font: 600 13px/1.35 system-ui, sans-serif;
}

#atlasRoadsPanel[hidden],
#atlasRoadDetails[hidden] {
  display: none;
}

body.v9-map-first.land-mode #landSheet {
  z-index: 3;
}

body.v9-map-first.land-mode .land-search {
  z-index: 4;
}

.atlas-roads-region {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.atlas-roads-region select {
  flex: 1 1 12ch;
  min-width: 0;
  min-height: 44px;
  padding: 4px 7px;
  border: 1px solid #3c5262;
  border-radius: 9px;
  background: #20313d;
  color: #eef4f7;
  color-scheme: dark;
  font: inherit;
}

.atlas-roads-region select:focus-visible,
.atlas-roads-region-group summary:focus-visible {
  outline: 2px solid #a5d8ff;
  outline-offset: 1px;
}

.atlas-roads-region-title {
  margin: 5px 0 0;
  color: #b7ddfa;
  font-size: 13px;
}

.atlas-roads-region-group summary {
  min-height: 44px;
  box-sizing: border-box;
  padding: 12px 7px 8px;
  border: 1px solid #3c5262;
  border-radius: 9px;
  cursor: pointer;
}

.atlas-roads-region-group .atlas-roads-list,
.atlas-roads-regional-list > .atlas-roads-list {
  margin: 4px 0;
}

body.land-mode:has(#harbourBrowser[data-phone-sheet="roads"]:not([hidden]), #inspectSheet:not([hidden]), #atlasBriefSheet:not([hidden])) #landSheet {
  display: none;
}

html body.land-mode #harbourBrowser[data-phone-sheet="roads"]:not([hidden]) {
  display: flex !important;
}

body.land-mode #landSheet.collapsed {
  height: auto;
  min-height: 0;
  max-height: min(58dvh, 440px);
}

body.land-mode #landSheet.road-details-open #landContent {
  display: none;
}

body.land-mode #landSheet {
  background: #0c232c;
}

body.land-mode #landSheet:not(.road-details-open) #atlasRoadsPanel {
  flex-shrink: 0;
}

body.land-mode #landSheet .land-sheet-grip {
  flex: 0 0 28px;
  height: 28px;
  min-height: 28px;
}

body.land-mode #landSheet .land-modes button {
  height: 44px;
  flex-direction: row;
  font-size: 12px;
}

body.land-mode #landSheet .land-modes {
  flex: none;
  padding: 4px 8px;
}

body.land-mode #landSheet .land-modes button i {
  font-size: 14px;
}

body.land-mode #landSheet .land-content {
  padding-top: 8px;
}

body.land-mode #landSheet .land-layer-toggles {
  grid-template-columns: 1fr;
}

.land-route-closure-note {
  margin: 7px 1px 0;
  color: #f9d789;
  font-size: 11px;
  line-height: 1.35;
}

/* 9.26.0: Myndir uses the shared map screen — chips, time slider, legend and compass stay like Veður */
html body[data-phone-tab="cameras"]:has(#harbourBrowser:not([hidden]),#inspectSheet:not([hidden])) #atlasModePeek.atlas-mode-peek,
html body[data-phone-tab="cameras"] .layer-rail {
  display: none !important;
}

html body.land-mode :is(.atlas-wave-legend-float,.c9-compass,.c9-cross,.c9-zoom) {
  display: none !important;
}

.atlas-roads-actions {
  display: grid;
  grid-template-columns: .65fr .82fr 1.23fr 1.30fr;
  gap: 5px;
}

#atlasRoadsPanel button {
  min-width: 0;
  color: inherit;
  background: #20313d;
  border: 1px solid #3c5262;
  border-radius: 9px;
  font: inherit;
  cursor: pointer;
}

#atlasRoadsPanel button:focus-visible,
#atlasRoadsPanel a:focus-visible {
  outline: 2px solid #a5d8ff;
  outline-offset: 1px;
}

.atlas-roads-actions button {
  min-height: 44px;
  padding: 4px 2px;
  overflow-wrap: anywhere;
}

#atlasRoadsPanel .atlas-roads-actions button[aria-expanded="true"] {
  background: #e3f3ff;
  color: #101a22;
  border-color: #e3f3ff;
}

.atlas-roads-status {
  color: #b8cad6;
  min-width: 0;
  font-size: 11px;
  overflow-wrap: anywhere;
}

#atlasRoadsPanel a {
  color: #b7ddfa;
}

.atlas-roads-details {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border-block: 1px solid #303f49;
  padding: 0 4px 7px;
}

.atlas-roads-detail-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: #101a22;
}

.atlas-roads-detail-header h2,
.atlas-roads-details h3,
.atlas-roads-details p {
  margin: 0;
  overflow-wrap: anywhere;
}

.atlas-roads-detail-header h2 {
  font-size: 15px;
}

#atlasRoadsPanel .atlas-roads-close {
  flex: 0 0 44px;
  height: 44px;
  font-size: 22px;
}

.atlas-roads-detail-content,
.atlas-roads-list {
  display: grid;
  gap: 6px;
}

.atlas-roads-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(135px, 100%), 1fr));
  gap: 7px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.atlas-roads-legend li,
.atlas-roads-condition {
  display: flex;
  align-items: center;
  gap: 7px;
}

.atlas-roads-swatch {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
  background: #a0a6ac;
  border: 1px solid #8f9ca7;
  border-radius: 4px;
}

.atlas-roads-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 1px 8px;
  min-height: 44px;
  padding: 6px 8px;
  text-align: left;
}

.atlas-roads-item small {
  grid-column: 2;
}

.atlas-roads-meta,
.atlas-roads-item small {
  color: #bdcbd5;
}

.atlas-roads-notice {
  display: grid;
  gap: 3px;
  padding: 7px 0;
  border-bottom: 1px solid #303f49;
}

.atlas-roads-notice p {
  white-space: pre-line;
}

.atlas-roads-list-button {
  min-height: 44px;
  padding: 6px 10px;
  text-align: left;
}

html.atlas-phone-shell body.land-mode {
  --road-tab-bottom: var(--atlas-tab-bottom, calc(var(--atlas-tab-h, 44px) + var(--atlas-visual-bottom, 0px)));
}

html.atlas-phone-shell body.land-mode #landSheet {
  inset: auto 0 var(--road-tab-bottom);
  width: auto;
  max-height: min(46dvh, 380px);
  border-radius: 16px 16px 0 0;
}

html.atlas-phone-shell body.land-mode #landSheet.road-details-open {
  max-height: min(60dvh, calc(100dvh - var(--road-tab-bottom) - 64px), 460px);
}

html.atlas-phone-shell body.land-mode #landSheet.collapsed:not(.detail-open,.road-details-open) .atlas-roads-status {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

html.atlas-phone-shell body.land-mode #landSheet.road-details-open > :is(header,footer) {
  display: none;
}

@media (orientation: portrait) {
  html.atlas-phone-shell body.land-mode:has(#landSheet.road-details-open) .land-map-tools {
    display: none;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-panel-size="full"].road-details-open #atlasRoadsPanel {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-panel-size="full"].road-details-open #atlasRoadDetails {
    min-height: 0;
    overflow: auto;
  }
}

html.atlas-phone-shell body.land-mode #harbourBrowser#harbourBrowser#harbourBrowser[data-phone-sheet="roads"]:not([hidden]) {
  top: auto !important;
  bottom: var(--road-tab-bottom) !important;
  max-height: min(56dvh, calc(100dvh - var(--road-tab-bottom) - 52px)) !important;
  height: auto !important;
  min-height: 0 !important;
}

html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"] > header,
html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"] > footer {
  display: none;
}

html.atlas-phone-shell body.land-mode #landSearchForm {
  top: calc(58px + env(safe-area-inset-top));
  left: 8px;
  width: min(440px, calc(100% - 68px));
  box-sizing: border-box;
  grid-template-columns: minmax(0,1fr) 44px;
  padding: 4px;
}

html.atlas-phone-shell body.land-mode #landSearchForm:has(#landSearchResults:not([hidden])) {
  z-index: 5;
}

html.atlas-phone-shell body.land-mode #landSearchResults {
  top: calc(100% + 4px);
  max-height: min(38dvh, 320px);
}

@media (max-height: 640px) {
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"]:not(.road-details-open) .atlas-roads-status {
    display: none;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"] .land-modes {
    padding-block: 3px;
  }
}

@media (max-height: 640px) and (orientation: portrait) {
  html.atlas-phone-shell body.land-mode:has(#landSheet[data-mode="route"]) .land-map-tools {
    display: none;
  }
}

html.atlas-phone-shell body.land-mode .land-identity,
html.atlas-phone-shell body.land-mode .land-terrain-badge {
  display: none;
}

html.atlas-phone-shell body.land-mode #landMap .maplibregl-ctrl-top-right {
  top: calc(105px + env(safe-area-inset-top)) !important;
  bottom: auto !important;
  right: max(8px, env(safe-area-inset-right)) !important;
}

html.atlas-phone-shell body.land-mode:not(.ui-hidden) #landMap .maplibregl-ctrl-top-right .maplibregl-ctrl-group {
  display: var(--road-navigation-display, block) !important;
}


@media (orientation: landscape) and (max-height: 520px) {
  html.atlas-phone-shell body.land-mode #landSheet {
    right: auto;
    width: min(420px, 62vw);
    max-height: min(52dvh, calc(100dvh - var(--road-tab-bottom) - 100px));
  }
  html.atlas-phone-shell body.land-mode #landSheet.road-details-open {
    max-height: calc(100dvh - var(--road-tab-bottom) - 116px - env(safe-area-inset-top));
  }
  html.atlas-phone-shell body.land-mode .land-map-tools {
    grid-template-columns: repeat(4, 44px);
    right: calc(max(8px, env(safe-area-inset-right)) + 52px);
    top: calc(58px + env(safe-area-inset-top));
  }
  html.atlas-phone-shell body.land-mode #landSearchForm {
    width: min(390px, calc(100% - 275px));
  }
  html.atlas-phone-shell body.land-mode #landSheet.road-details-open .land-modes,
  html.atlas-phone-shell body.land-mode #landSheet.road-details-open .land-sheet-grip {
    display: none;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"] .land-sheet-grip {
    height: 20px;
    flex-basis: 20px;
  }
  html.atlas-phone-shell body.land-mode #harbourBrowser#harbourBrowser#harbourBrowser[data-phone-sheet="roads"]:not([hidden]) {
    left: 0 !important;
    right: auto !important;
    width: min(420px, 62vw) !important;
    max-height: calc(100dvh - var(--road-tab-bottom) - 60px) !important;
  }
}

/* The route readout and place close button stay above their scrolling content. */
.land-route-dock:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 8px;
  flex: 0 0 auto;
  background: #142c36;
  border-bottom: 1px solid #37505e;
}

.land-route-dock .land-route-summary {
  flex: 1;
  min-width: 0;
  padding: 1px 4px;
  background: transparent;
  border: 0;
}

.land-route-dock .land-route-summary strong {
  font-size: 15px;
  margin: 0;
}

.land-route-dock .land-route-summary span {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.35;
  color: #d4e6ed;
}

.land-route-dock .land-route-summary .route-alert {
  color: #ffd282;
  font-weight: 700;
}

#landRouteDetailsToggle, #landClosePlace, #landDepartureOpen, #landRouteWeatherOpen {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 9px;
  border: 1px solid #445e6b;
  border-radius: 9px;
  background: #203744;
  color: #eef4f7;
  font: 700 13px/1 system-ui, sans-serif;
}

body.land-mode #landSheet.road-details-open #landRouteDock {
  display: none;
}

.land-route-provider {
  color: #d4e6ed;
  font-size: 12px;
}

.land-route-provider a, .land-place-hero a {
  color: inherit;
  text-decoration: underline;
}

.land-route-group, .land-route-stops {
  margin: 8px 0;
  padding: 0;
}

.land-route-stops, .land-route-group ul {
  list-style: none;
  padding: 0;
}

.land-route-group summary, .land-route-group button, .land-route-stops button {
  display: block;
  box-sizing: border-box;
  text-align: left;
  min-height: 44px;
  padding: 9px;
  border-radius: 8px;
  color: #eef4f7;
  background: #192e39;
  border: 1px solid #344952;
  font: inherit;
  cursor: pointer;
}

.land-route-group summary {
  display: list-item;
}

.land-route-group button, .land-route-stops button {
  width: 100%;
  margin: 3px 0;
}

.land-route-group button span {
  display: block;
  margin-top: 3px;
  color: #bfced2;
  font-size: 12px;
}

.land-place-panel[hidden] {
  display: none;
}

body.land-mode:has(#landPlacePanel:not([hidden])) #landSheet {
  visibility: hidden;
  pointer-events: none;
}

.land-place-panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  z-index: 6;
  bottom: 16px;
  left: 16px;
  width: min(450px, calc(100% - 32px));
  max-height: calc(100% - 102px);
  color: #efffff;
  border: 1px solid #37505e;
  border-radius: 16px;
  background: #0c232c;
  pointer-events: auto;
  overflow: hidden;
}

.land-place-panel > header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 2px 8px 2px 12px;
  border-bottom: 1px solid #37505e;
}

#landClosePlace {
  font-size: 22px;
}

.land-place-scroll {
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.land-place-panel .land-place-card {
  padding: 0;
  border: 0;
}

.land-place-panel .land-place-hero {
  margin: 10px 0;
  border-radius: 9px;
}

.land-place-panel .land-place-hero[hidden] {
  display: none;
}

.land-place-panel figcaption {
  font-size: 11px;
}

html.atlas-phone-shell body.land-mode #landPlacePanel {
  bottom: var(--road-tab-bottom);
  max-height: min(60dvh, calc(100dvh - var(--road-tab-bottom) - 60px));
}

@media (orientation: portrait) {
  html.atlas-phone-shell body.land-mode #landPlacePanel {
    left: 0;
    width: calc(100% - 2px);
  }
  html.atlas-phone-shell body.land-mode:has(#landPlacePanel:not([hidden])) .land-map-tools {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 360px), (orientation: portrait) and (max-height: 560px) {
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"]:not(.road-details-open) {
    max-height: calc(100dvh - var(--road-tab-bottom) - 60px);
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"] .land-sheet-grip {
    display: none;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"]:not(.collapsed,.road-details-open) :is(.land-modes,#atlasRoadsPanel) {
    display: none;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"]:not(.collapsed,.road-details-open) .land-content {
    max-height: none;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"].collapsed:not(.road-details-open) .land-modes {
    padding-block: 0;
  }
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"].collapsed:not(.road-details-open) #atlasRoadsPanel {
    padding-bottom: 2px;
  }
}

@media (orientation: landscape) and (max-height: 360px) {
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"].collapsed:not(.road-details-open) :is(.land-modes,#atlasRoadsPanel) {
    display: none;
  }
  html.atlas-phone-shell body.land-mode:has(#landSheet[data-mode="route"]) #landSearchForm {
    top: calc(53px + env(safe-area-inset-top));
    padding-block: 1px;
  }
  html.atlas-phone-shell body.land-mode #landSearchResults {
    max-height: min(46dvh, calc(100dvh - 117px));
  }
  html.atlas-phone-shell body.land-mode:has(#landSheet[data-mode="route"]) .land-map-tools {
    display: none;
  }
  html.atlas-phone-shell body.land-mode #landPlacePanel {
    bottom: var(--road-tab-bottom);
    max-height: calc(100dvh - var(--road-tab-bottom) - 52px);
  }
}

.land-route-shortcuts {
  display: none;
}

@media (orientation: landscape) and (max-height: 360px), (orientation: portrait) and (max-height: 560px) {
  html.atlas-phone-shell body.land-mode #landSheet:not(.collapsed,.road-details-open) .land-route-shortcuts {
    display: flex;
    margin-top: 12px;
  }
}

@media (orientation: landscape) and (max-height: 280px) {
  html.atlas-phone-shell body.land-mode #landSheet.road-details-open {
    max-height: calc(100dvh - var(--road-tab-bottom) - 50px);
  }
  html.atlas-phone-shell body.land-mode #landSheet.road-details-open .atlas-roads-actions {
    display: none;
  }
}

@media (orientation: landscape) and (max-height: 360px) {
  html.atlas-phone-shell body.land-mode:has(#landSheet[data-mode="route"]:not(.collapsed)) #landSearchForm {
    left: calc(min(420px, 62vw) + 8px);
    width: calc(100% - min(420px, 62vw) - 68px);
  }
}

@media (orientation: portrait) and (max-height: 560px) {
  html.atlas-phone-shell body.land-mode #landSheet[data-mode="route"]:not(.collapsed,.road-details-open) {
    max-height: calc(100dvh - var(--road-tab-bottom) - 118px - env(safe-area-inset-top));
  }
}

.land-detour-info {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid #3f6170;
  border-radius: 10px;
  background: #17313e;
  font-size: 12px;
  line-height: 1.4;
}

.land-detour-info[data-status="no-verified-detour"],
.land-detour-info[data-status="conditions-unavailable"] {
  border-color: #b67a48;
}

.land-detour-info > b {
  color: #f0f8fb;
  font-size: 14px;
}

.land-detour-info p {
  margin: 4px 0 6px;
  color: #d4e6ed;
}

.land-detour-info ul {
  list-style: none;
  margin: 6px 0;
  padding: 0;
}

.land-detour-info button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 7px 8px;
  margin-top: 5px;
  border: 1px solid #527180;
  border-radius: 7px;
  background: #1c3b49;
  color: #edf6fa;
  text-align: left;
  font: inherit;
}

.land-detour-info button span {
  display: block;
  color: #cedeeb;
}

#landDepartureOpen {
  min-width: 72px;
  padding-inline: 5px;
  text-align: center;
}

#landDepartureOpen small,
#landDepartureOpen b {
  display: block;
  line-height: 1.2;
}

#landDepartureOpen small {
  margin-bottom: 3px;
  color: #c3d8df;
  font-size: 10px;
}

#landDepartureOpen b {
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

#landDepartureDialog {
  box-sizing: border-box;
  width: min(430px, calc(100% - 16px));
  max-height: calc(100dvh - 12px);
  padding: 0;
  border-color: #496873;
  background: #142c36;
  color: #f0f8fa;
}

#landDepartureDialog::backdrop {
  background: rgba(4, 17, 24, .6);
}

#landDepartureForm > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 8px 3px 12px;
  border-bottom: 1px solid #395765;
  background: #142c36;
}

#landDepartureTitle {
  margin: 0;
  font-size: 16px;
}

#landDepartureDialog button {
  min-width: 44px;
  min-height: 44px;
  padding-inline: 8px;
  border: 1px solid #486574;
  border-radius: 8px;
  background: #203744;
  color: #eef4f7;
  font: 700 13px/1.2 system-ui, sans-serif;
}

#landDepartureClose {
  font-size: 22px !important;
}

#landDepartureForm .land-departure-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 8px;
  margin: 6px 10px 0;
}

.land-departure-fields label {
  color: #d4e6ed;
  font-size: 12px;
}

.land-departure-fields input {
  box-sizing: border-box;
  display: block;
  appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  margin-top: 3px;
  padding: 3px 7px;
  border: 1px solid #486574;
  border-radius: 8px;
  background: #203744;
  color: #eef4f7;
  color-scheme: dark;
  font: 16px/1.25 system-ui, sans-serif;
  text-align: start;
}

#landDepartureHint,
#landDepartureError {
  margin: 5px 10px;
  color: #c3d8df;
  font-size: 11px;
  line-height: 1.25;
}

#landDepartureError {
  color: #ffce98;
}

#landDepartureForm .land-departure-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin: 6px 10px 8px;
}

#landDepartureDialog #landDepartureApply {
  border-color: #468884;
  background: #12605d;
}

@media (max-width: 359px) {
  #landDepartureOpen,
  #landRouteDetailsToggle {
    padding-inline: 5px;
  }

  #landDepartureOpen {
    min-width: 66px;
  }

  #landDepartureOpen b {
    font-size: 11px;
  }
}

@media (orientation: landscape) and (max-height: 230px) {
  #landDepartureForm > header {
    padding-block: 0;
  }

  #landDepartureHint {
    margin-block: 4px;
  }
}

#landRouteWeatherOpen {
  padding-inline: 6px;
}

#landRouteWeatherOpen:disabled {
  opacity: .5;
}

#landRouteWeatherDialog {
  box-sizing: border-box;
  width: min(560px, calc(100% - 16px));
  max-height: calc(100dvh - 12px);
  padding: 0;
  overflow: hidden;
  border-color: #496873;
  background: #142c36;
  color: #f0f8fa;
}

#landRouteWeatherDialog[open] {
  display: flex;
  flex-direction: column;
}

#landRouteWeatherDialog::backdrop {
  background: rgba(4, 17, 24, .6);
}

#landRouteWeatherDialog > header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 8px 3px 12px;
  border-bottom: 1px solid #395765;
}

#landRouteWeatherTitle {
  margin: 0;
  font-size: 16px;
}

#landRouteWeatherDialog button {
  min-width: 44px;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid #486574;
  border-radius: 8px;
  background: #1c3542;
  color: #eef4f7;
  font: inherit;
  text-align: start;
  cursor: pointer;
}

#landRouteWeatherDialog #landRouteWeatherClose {
  flex: 0 0 44px;
  text-align: center;
  font-size: 22px;
}

.land-route-weather-content {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  font-size: 13px;
}

.land-weather-date,
.land-weather-note,
.land-weather-warning {
  margin: 3px 2px 9px;
  color: #d3e6eb;
  line-height: 1.35;
}

.land-weather-note {
  margin-top: 8px;
  font-size: 12px;
}

.land-weather-note a {
  color: inherit;
  text-decoration: underline;
}

.land-weather-warning {
  color: #ffd08e;
}

.land-route-weather-group h3 {
  margin: 7px 0;
  font-size: 14px;
}

.land-weather-peaks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.land-weather-peaks article {
  min-width: 0;
  padding: 6px;
  border: 1px solid #395765;
  border-radius: 8px;
  background: #182f3a;
}

.land-weather-peaks article > small,
.land-weather-peaks article > b {
  display: block;
}

.land-weather-peaks article > b {
  margin: 2px 0;
  color: #f8d48a;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.land-weather-peaks button,
#landRouteWeatherSections button {
  width: 100%;
  overflow-wrap: anywhere;
}

.land-weather-peaks button span,
#landRouteWeatherSections button > span {
  display: block;
  color: #cadee6;
  font-size: 11px;
  line-height: 1.4;
}

#landRouteWeatherSections {
  margin-top: 8px;
}

#landRouteWeatherSections summary {
  box-sizing: border-box;
  min-height: 44px;
  padding: 12px 8px;
  border: 1px solid #486574;
  border-radius: 8px;
  cursor: pointer;
}

#landRouteWeatherSections ol {
  margin: 7px 0;
  padding: 0;
  list-style: none;
}

#landRouteWeatherSections li + li {
  margin-top: 5px;
}

#landRouteWeatherSections button > .land-weather-values {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 5px;
}

.land-weather-values > span {
  display: flex;
  flex-direction: column;
  color: #f0f8fa;
}

.land-weather-values strong {
  font-variant-numeric: tabular-nums;
}

@media (orientation: landscape) and (max-height: 360px) {
  #landRouteWeatherDialog {
    width: min(660px, calc(100% - 16px));
  }

  .land-weather-peaks {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 359px) {
  #landRouteWeatherOpen {
    padding-inline: 3px;
    font-size: 12px;
  }

  .land-route-dock:not([hidden]) {
    gap: 4px;
    padding-inline: 5px;
  }
}


/* Map tools use their own rows. The information sheets have stacking priority. */
body.v9-map-first.land-mode .land-map-tools {
  z-index: 2;
}

body.land-mode #landSearchForm {
  grid-template-columns: minmax(0, 1fr) 48px;
}

.land-fullscreen-button {
  position: absolute;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 10px;
  border: 1px solid #8faaa9;
  border-radius: 9px;
  background: #f9fcfb;
  color: #15373a;
  font: 700 13px/1.1 system-ui, sans-serif;
  pointer-events: auto;
  white-space: nowrap;
}

.land-fullscreen-button[hidden] {
  display: none;
}

.land-fullscreen-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

#landHideUi {
  top: 65px;
  right: 62px;
}

html.atlas-phone-shell body.land-mode #landSearchForm {
  grid-template-columns: minmax(0, 1fr) 44px;
}

html.atlas-phone-shell body.land-mode #landHideUi {
  top: calc(54px + env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
  width: 44px;
}

html.atlas-phone-shell body.land-mode #landHideUi span {
  display: none;
}

@media (min-width: 390px) {
  html.atlas-phone-shell body.land-mode .road-overview #landHideUi {
    width: auto;
  }

  html.atlas-phone-shell body.land-mode .road-overview #landHideUi span {
    display: inline;
  }
}

@media (orientation: portrait) {
  html.atlas-phone-shell body.land-mode #landUi:not(.road-overview) .land-map-tools {
    top: calc(117px + env(safe-area-inset-top));
    bottom: auto;
    left: calc(max(8px, env(safe-area-inset-left)) + 52px);
    right: auto;
    grid-template-columns: repeat(4, 44px);
    gap: 4px;
  }

  html.atlas-phone-shell body.land-mode #landUi:not(.road-overview) .land-style-menu {
    top: calc(100% + 4px);
    right: 0;
  }
}

html body.land-mode.land-map-fullscreen #marineStage {
  position: fixed;
  inset: 0;
  z-index: 300;
  padding: 0;
}

body.land-mode.land-map-fullscreen #marineStage > :not(#landMap, #landExitFullscreen, #marineMap),
body.land-mode.land-map-fullscreen :is(#atlasPhoneTop, .topbar, .bottom-nav),
html body.v9-map-first.land-mode.land-map-fullscreen #phoneTabs#phoneTabs {
  display: none !important;
}

#landExitFullscreen {
  top: calc(8px + env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
}

#landExitFullscreen [aria-hidden="true"] {
  font-size: 21px;
  line-height: 1;
}

html.atlas-phone-shell body.land-mode.land-map-fullscreen #landMap .maplibregl-ctrl-top-right {
  top: calc(8px + env(safe-area-inset-top)) !important;
}

html.atlas-phone-shell body.v9-map-first.land-mode.land-map-fullscreen #landMap .maplibregl-ctrl-bottom-right {
  bottom: calc(8px + env(safe-area-inset-bottom)) !important;
}


@media (orientation: landscape) and (max-height: 310px) {
  html.atlas-phone-shell body.land-mode #landMap .maplibregl-ctrl-top-right {
    --road-navigation-display: flex;
    width: auto !important;
  }

  html.atlas-phone-shell body.v9-map-first.land-mode:not(.land-map-fullscreen) #landMap .maplibregl-ctrl-bottom-right {
    bottom: calc(var(--road-tab-bottom) + 5px) !important;
  }

  html.atlas-phone-shell body.land-mode #landMap .maplibregl-ctrl-top-right .maplibregl-ctrl-group button + button {
    border-top: 0;
    border-left: 1px solid #424a50;
  }
}

/* The road detail view shares the land sheet's controls and its available height. */
body.v9-map-first :is(#landSheet,#landPlacePanel,#landDepartureDialog,#landRouteWeatherDialog) > .panel-size-controls {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 8px 4px;
}

body.v9-map-first :is(#landSheet,#landPlacePanel,#landDepartureDialog,#landRouteWeatherDialog) > .panel-size-controls .panel-size-grip {
  height: 16px;
  min-height: 16px;
}

body.v9-map-first :is(#landSheet,#landPlacePanel,#landDepartureDialog,#landRouteWeatherDialog) > .panel-size-controls [data-panel-size-choice] {
  padding-inline: 3px;
  font-size: 12px;
}

#landSheetClose:not([hidden]) {
  position: absolute;
  z-index: 12;
  top: 16px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 1px solid #486574;
  border-radius: 8px;
  background: #203744;
  color: #eef4f7;
  font-size: 22px;
}

body.v9-map-first #landSheet:has(> #landSheetClose:not([hidden])) > .panel-size-controls {
  padding-right: 60px;
}

body.land-mode #landSheet[data-panel-size="small"].road-details-open {
  max-height: min(46dvh, 300px, var(--road-detail-small-height, 300px));
}

html.atlas-phone-shell body.land-mode #landSheet[data-panel-size="small"].road-details-open {
  --road-detail-small-height: calc(100dvh - var(--road-tab-bottom) - 96px);
  max-height: min(46dvh, 300px, var(--road-detail-small-height));
}

body.land-mode #landSheet[data-panel-size="small"].road-details-open .atlas-roads-actions {
  display: none;
}

body.land-mode #landSheet[data-panel-size="large"]:not(.road-details-open) #landContent {
  max-height: none;
}

body.land-mode #landSheet[data-panel-size="full"] > header,
body.land-mode #landSheet[data-panel-size="full"] > footer {
  display: none;
}

body.land-mode #landSheet[data-panel-size="full"].road-details-open > #atlasRoadsPanel > .atlas-roads-actions {
  display: none;
}

body.land-mode #landSheet[data-panel-size="full"] {
  top: max(0px, env(safe-area-inset-top));
  right: 0;
  left: 0;
  width: auto;
  max-height: none;
  height: auto;
  border-radius: 0;
}

html.atlas-phone-shell body.v9-map-first.land-mode #landSheet[data-panel-size="full"] {
  inset: max(0px, env(safe-area-inset-top)) 0 var(--road-tab-bottom);
  max-height: none;
  width: auto;
  border-radius: 0;
}

html.atlas-phone-shell body.land-mode:has(#landSheet[data-panel-size="full"]) :is(#landOverviewBack, #landSearchForm) {
  visibility: hidden;
}

body.land-mode:not(.land-map-fullscreen):is(:has(#landSheet.panel-size-local[data-panel-size="full"]):has(#landUi:not(.road-overview), #landSheet.road-details-open), :has(#landPlacePanel:not([hidden])[data-panel-size="full"])) :is(#atlasPhoneTop, .topbar, #atlasMapReset) {
  visibility: hidden;
}

body.land-mode #landSheet[data-panel-size="full"] {
  z-index: 6;
}

#landSheet[data-panel-size="full"] #landContent,
#landSheet.road-details-open[data-panel-size="full"] #atlasRoadsPanel,
#landPlacePanel[data-panel-size="full"] .land-place-scroll,
#landRouteWeatherDialog[data-panel-size="full"] .land-route-weather-content {
  flex: 1 1 0;
  max-height: none;
}

html body.land-mode #landPlacePanel[data-panel-size="small"] {
  max-height: min(46dvh, 300px);
}

html body.land-mode #landPlacePanel[data-panel-size="full"] {
  inset: max(0px, env(safe-area-inset-top)) 0 var(--road-tab-bottom, 0px);
  width: auto;
  max-height: none;
  border-radius: 0;
}

:is(#landDepartureDialog,#landRouteWeatherDialog)[data-panel-size="small"] {
  max-height: min(55dvh, 300px);
}

:is(#landDepartureDialog,#landRouteWeatherDialog)[data-panel-size="full"] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  border-radius: 0;
}

#landDepartureDialog.panel-size-local[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#landDepartureDialog.panel-size-local #landDepartureForm {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

@media (min-height: 361px) {
  #landDepartureDialog[data-panel-size="small"] { max-height: min(46dvh, 214px); }
}

@media (max-height: 360px) {
  body.v9-map-first :is(#landSheet,#landPlacePanel,#landDepartureDialog,#landRouteWeatherDialog) > .panel-size-controls .panel-size-grip {
    display: none !important;
  }

  html body.land-mode #landPlacePanel[data-panel-size="small"],
  :is(#landDepartureDialog,#landRouteWeatherDialog)[data-panel-size="small"] {
    max-height: min(56dvh, 155px);
  }

  html.atlas-phone-shell body.land-mode #landSheet[data-panel-size="small"].road-details-open {
    max-height: min(56dvh, 155px, var(--road-detail-small-height));
  }

  #landSheetClose:not([hidden]) {
    top: 0;
  }

  html.atlas-phone-shell body.land-mode #landSheet[data-panel-size="large"]:not(.road-details-open) {
    max-height: min(62dvh, calc(100dvh - var(--road-tab-bottom) - 68px));
  }
}

@media (orientation: landscape) and (max-height: 360px) {
  html.atlas-phone-shell body.land-mode #landUi:not(.road-overview) #landSearchForm {
    left: calc(min(420px, 62vw) + 8px);
    width: calc(100% - min(420px, 62vw) - 68px);
  }

  html.atlas-phone-shell body.v9-map-first.land-mode #landSheet:not(.road-details-open) .land-modes {
    padding-block: 2px;
  }

  html.atlas-phone-shell body.v9-map-first.land-mode #landSheet:not(.road-details-open) #atlasRoadsPanel {
    flex-shrink: 1;
  }

  html.atlas-phone-shell body.v9-map-first.land-mode #landSheet[data-panel-size="full"]:not(.road-details-open) #atlasRoadsPanel {
    display: none;
  }
}


#landOverviewRoadMenu > span {
  grid-column: 1 / -1;
  padding: 5px 9px;
  background: #14373e;
  color: white;
  font: 700 12px system-ui, sans-serif;
}

.atlas-roads-layer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.atlas-roads-layer-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.atlas-roads-legend button[aria-pressed="true"] {
  background: #1b6671;
  color: white;
}


html.atlas-phone-shell body.land-mode #landOverviewRoadMenu {
  max-width: calc(100vw - 24px);
  max-height: max(72px, calc(100dvh - var(--road-tab-bottom) - 109px - env(safe-area-inset-top)));
}

/* A vertical, fixed menu inside the landscape horizontal scroller receives
   pointer events in WebKit but loses click activation at the scroller edge. */
html.atlas-lr body.land-mode #atlasLandStrip:has(#landOverviewRoadMenu:not([hidden])) {
  overflow: visible;
  touch-action: auto;
}
