/* LA STRADA — shared host chrome: Navigáció chip, sandwich, POI glance sheet */

.topbar .nav-chip--nav {
  background: var(--green, #007B3E);
  color: var(--paper, #f7f3ec);
}
.topbar .nav-chip--menu {
  background: #3a2e1d;
  color: var(--yellow, #FFD600);
}

.ls-host-sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(16, 12, 8, 0.46);
  z-index: 1000280;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.ls-host-sheet-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.ls-host-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 110%);
  width: min(440px, 100%);
  max-height: min(78vh, 640px);
  background: #f7f3ec;
  color: #1a1208;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.28);
  z-index: 1000290;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
}
.ls-host-sheet.is-open { transform: translate(-50%, 0); }
.ls-host-sheet-handle {
  width: 46px;
  height: 4px;
  border-radius: 4px;
  background: rgba(26, 18, 8, 0.18);
  margin: 4px auto 12px;
}
.ls-host-sheet h2 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.08em;
  font-size: 1.55rem;
  margin: 0 0 4px;
}
.ls-host-sheet p.ls-host-lead {
  font-size: 0.86rem;
  color: #6d6150;
  margin: 0 0 14px;
}
.ls-host-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  margin: 0 0 8px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(26,18,8,0.06);
}
.ls-host-opt:active { transform: scale(0.985); }
.ls-host-opt .ls-ico {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.ls-host-opt .ls-ico--green { background: #d9efe3; }
.ls-host-opt .ls-ico--red { background: #f6d6dc; }
.ls-host-opt .ls-ico--gold { background: #f4e6bf; }
.ls-host-opt .ls-ico--paper { background: #ebe4d6; }
.ls-host-opt strong {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.02rem;
}
.ls-host-opt span { color: #6d6150; font-size: 0.82rem; }

html.lastrada-map-first body.map-full .flag-stripe,
html.lastrada-map-first body.map-full .topbar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 1000200;
}
html.lastrada-map-first body.map-full .flag-stripe { top: 0; }
html.lastrada-map-first body.map-full .topbar { top: 4px; }
@media (min-width: 981px) {
  html.lastrada-map-first body.map-full .map-poi-search:not(.placed),
  html.lastrada-map-first body.map-full #mapPoiSearchWrap:not(.placed) {
    top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    right: 12px !important;
  }
  html.lastrada-map-first body.map-full .map-poi-search.placed,
  html.lastrada-map-first body.map-full #mapPoiSearchWrap.placed {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 1000310;
  }
}

.map-poi-search-drag {
  flex: 0 0 18px;
  align-self: stretch;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: grab;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  touch-action: none;
}
.map-poi-search-drag span {
  display: block;
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: rgba(26, 18, 8, 0.35);
}
.map-poi-search-drag.dragging,
.map-poi-search-drag:active { cursor: grabbing; }

@media (max-width: 980px), (max-height: 520px) {
  .map-poi-search-drag { display: none !important; }
}
/* Minimize / FAB / dock-toggle: map-first-ben rejtve.
   A .map-dock-handle (TÉRKÉP + táv/szint sáv) NEM kerül ide — mobilon
   az alsó fehér info-csík kell, landscape-ben is (lásd lent). */
html.lastrada-map-first body.map-full .map-dock-minimize,
html.lastrada-map-first body.map-full .leaflet-control-docktoggle,
html.lastrada-map-first body.map-full .map-dock-mobile-fab {
  display: none !important;
}

/* Alsó útvonal info-csík (TÉRKÉP + táv/szint), asztalon és telefonon is. */
@media (pointer: fine), (pointer: coarse), (max-width: 980px), (max-height: 520px) {
  html.lastrada-map-first body.map-full .map-dock.open.full,
  html.lastrada-map-first .map-dock.open.full {
    display: flex !important;
    flex-direction: column !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full .map-dock-body,
  html.lastrada-map-first .map-dock.open.full .map-dock-body {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    order: 0 !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full .map-dock-handle,
  html.lastrada-map-first body.map-full .map-dock-handle,
  html.lastrada-map-first .map-dock.open.full .map-dock-handle {
    display: flex !important;
    order: 1 !important;
    flex: 0 0 auto !important;
    position: relative !important;
    height: auto !important;
    min-height: 30px !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 5px 12px !important;
    gap: 10px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: #fff !important;
    color: #1a1208 !important;
    border-top: 2px solid transparent !important;
    border-image:
      linear-gradient(90deg, #007B3E 0 33.33%, #fff 33.33% 66.66%, #C8102E 66.66% 100%) 1 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.18) !important;
    z-index: 2 !important;
    pointer-events: auto !important;
    overflow: hidden !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full .map-dock-handle .map-dock-title,
  html.lastrada-map-first .map-dock.open.full .map-dock-handle .map-dock-title {
    color: #1a1208 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    flex-shrink: 0 !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full #elevHeader,
  html.lastrada-map-first .map-dock.open.full #elevHeader {
    background: transparent !important;
    color: #1a1208 !important;
    padding: 0 !important;
    gap: 8px !important;
    overflow: hidden !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full .elev-title,
  html.lastrada-map-first .map-dock.open.full .elev-title {
    font-size: 0 !important;
    color: #1a1208 !important;
    gap: 0 !important;
    flex-shrink: 0 !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full .elev-icon,
  html.lastrada-map-first .map-dock.open.full .elev-icon {
    font-size: 0.95rem !important;
    color: #C8102E !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full #elevStats,
  html.lastrada-map-first .map-dock.open.full #elevStats {
    font-size: 0.7rem !important;
    color: rgba(26, 18, 8, 0.78) !important;
    gap: 9px !important;
    align-items: baseline !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full #elevStats .elev-stat-route,
  html.lastrada-map-first .map-dock.open.full #elevStats .elev-stat-route {
    color: rgba(26, 18, 8, 0.58) !important;
    font-weight: 600 !important;
  }
  html.lastrada-map-first body.map-full .map-dock.open.full #elevStats .elev-stat-value,
  html.lastrada-map-first .map-dock.open.full #elevStats .elev-stat-value {
    color: #1a1208 !important;
    font-weight: 700 !important;
    font-size: 0.76rem !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase !important;
  }
}

html.lastrada-map-first #btnOpenFullMap { display: none !important; }

.ls-poi-filter-sheet {
  position: fixed;
  top: 58px;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: #f7f3ec;
  color: #1a1208;
  z-index: 1000292;
  transform: translateX(110%);
  transition: transform 0.24s ease;
  overflow: auto;
  box-shadow: -16px 0 32px rgba(0,0,0,0.22);
  padding: 12px 14px 24px;
}
.ls-poi-filter-sheet .filters { position: static !important; }
.ls-poi-filter-sheet .filters-main { display: block; }
.ls-poi-filter-sheet .ms-panel { z-index: 3; }
.ls-poi-filter-sheet.is-open { transform: translateX(0); }
.ls-poi-filter-sheet h2 {
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}
@media (orientation: portrait), (max-width: 720px) {
  .ls-poi-filter-sheet {
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-height: min(78vh, 640px);
    border-radius: 18px 18px 0 0;
    transform: translateY(110%);
  }
  .ls-poi-filter-sheet.is-open { transform: translateY(0); }
}

/* Google-style POI glance: portrait bottom, landscape left */
.ls-poi-glance {
  position: fixed;
  z-index: 1000180;
  display: none;
  pointer-events: none;
}
html.lastrada-map-first body.map-full:not(.vfm-active) .ls-poi-glance {
  display: flex;
}
html.lastrada-nav-boot .ls-poi-glance,
body.ls-glance-off .ls-poi-glance { display: none !important; }
.topbar .nav-chip--cards {
  background: #fffdf8;
  color: var(--dark, #1a1208);
  border: 1.5px solid var(--dark, #1a1208);
}
.topbar .nav-chip--cards.is-on {
  background: var(--yellow, #FFD600);
}
.topbar .nav-chip--cards.is-off {
  background: transparent;
  color: rgba(247, 243, 236, 0.72);
  border-color: rgba(247, 243, 236, 0.35);
}
.ls-poi-glance-track {
  display: flex;
  gap: 10px;
  overflow: auto;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ls-poi-glance-track::-webkit-scrollbar { display: none; }

.ls-glance-card {
  flex: 0 0 auto;
  width: min(250px, 78vw);
  background: #fffdf8;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(20, 14, 8, 0.22);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(26,18,8,0.08);
}
.ls-glance-card.is-focused {
  border-color: #C8102E;
  box-shadow: 0 0 0 2px #C8102E, 0 10px 24px rgba(20, 14, 8, 0.22);
}
.ls-glance-photo,
.ls-glance-card .ls-glance-body {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.ls-glance-card img,
.ls-glance-card .ls-glance-ph {
  display: block;
  width: 100%;
  height: 92px;
  object-fit: cover;
  background:
    linear-gradient(135deg, #007B3E 0 33%, #f7f3ec 33% 66%, #C8102E 66%);
}
.ls-glance-card .ls-glance-body { padding: 8px 10px 10px; }
.ls-glance-card strong {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  line-height: 1.15;
}
.ls-glance-card em {
  font-style: normal;
  color: #7a6d5a;
  font-size: 0.74rem;
}

@media (orientation: portrait) {
  .ls-poi-glance {
    left: 0;
    right: 0;
    top: auto;
    width: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 0 12px;
  }
  .ls-poi-glance-track { flex-direction: row; height: auto; }
}

@media (orientation: landscape) {
  .ls-poi-glance {
    top: 64px;
    bottom: 12px;
    left: 8px;
    right: auto;
    width: min(260px, 34vw);
    padding: 0;
  }
  .ls-poi-glance-track {
    flex-direction: column;
    height: 100%;
    padding-right: 4px;
  }
  .ls-glance-card { width: 100%; }
  .ls-glance-card img,
  .ls-glance-card .ls-glance-ph { height: 72px; }
}

body.ls-cards-front .ls-poi-glance { z-index: 10000070; }
body.ls-cards-front .loaded-routes-panel,
body.ls-cards-front #loadedRoutesPanel { z-index: 10000040 !important; }

.ls-mobile-nav-btn { display: none; }

@media (max-width: 980px), (max-height: 520px) {
  html.lastrada-map-first,
  html.lastrada-map-first body { overflow-x: hidden; }
  html.lastrada-map-first body.map-full .map-dock,
  html.lastrada-map-first .map-dock.open.full {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100dvh !important;
    max-width: 100% !important;
  }
  html.lastrada-map-first .leaflet-control-docktoggle,
  html.lastrada-map-first .map-dock-minimize,
  html.lastrada-map-first .map-dock-mobile-fab { display: none !important; }

  html.lastrada-map-first .ls-mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: 10px;
    background: #007B3E;
    color: #f7f3ec;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1.05rem;
    cursor: pointer;
  }
  html.lastrada-map-first .topbar-nav .nav-chip--home { display: none; }
  html.lastrada-map-first .topbar-brand { font-size: 1.15rem; }
  html.lastrada-map-first #lsTopbarRibbon {
    display: none;
  }
  html.lastrada-map-first .topbar.is-nav-open #lsTopbarRibbon {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: calc(52px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: auto;
    width: min(280px, calc(100vw - 16px));
    max-height: calc(100dvh - 70px);
    overflow: auto;
    z-index: 10000090;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    background: #1a1208;
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  }
  /* LRP (Szerkesztés / útvonal) is z-index 10000051 — hide while Menü/Beállítások open */
  html.lastrada-map-first body:has(.topbar.is-nav-open) .loaded-routes-panel,
  html.lastrada-map-first body:has(#lsSettingsSheet.is-open) .loaded-routes-panel,
  html.lastrada-map-first body:has(.topbar.is-nav-open) #btnWorkspaceRouteEditMode,
  html.lastrada-map-first body:has(#lsSettingsSheet.is-open) #btnWorkspaceRouteEditMode {
    visibility: hidden !important;
    pointer-events: none !important;
  }
  html.lastrada-map-first .topbar.is-nav-open #lsTopbarRibbon .nav-chip {
    width: auto;
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
    justify-content: flex-start;
    gap: 8px;
  }
  html.lastrada-map-first .topbar.is-nav-open #lsTopbarRibbon .nav-chip .label {
    display: inline;
  }

  html.lastrada-map-first .leaflet-top.leaflet-left {
    top: auto;
    bottom: calc(168px + env(safe-area-inset-bottom, 0px));
    left: auto;
    right: max(8px, env(safe-area-inset-right, 0px));
  }
  html.lastrada-map-first .leaflet-top.leaflet-right {
    top: auto;
    bottom: calc(168px + env(safe-area-inset-bottom, 0px));
    right: auto;
    left: max(8px, env(safe-area-inset-left, 0px));
  }
  html.lastrada-map-first .leaflet-top.leaflet-right .leaflet-control-docktoggle { display: none !important; }
  html.lastrada-map-first body.ls-glance-off .leaflet-top.leaflet-left,
  html.lastrada-map-first body.ls-glance-off .leaflet-top.leaflet-right {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  html.lastrada-map-first .leaflet-top.leaflet-left,
  html.lastrada-map-first .leaflet-top.leaflet-right {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  html.lastrada-map-first .leaflet-top.leaflet-right {
    left: calc(min(260px, 34vw) + 16px);
  }
  html.lastrada-map-first body.ls-glance-off .leaflet-top.leaflet-right {
    left: max(8px, env(safe-area-inset-left, 0px));
  }
}

/* POI_MAP_CLOSE_R1: the host stacks the yellow close button above its iframe. */
#lsPoiPageFrame {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000080;
  background: #fff;
}
#lsPoiPageFrame.is-open { display: block; }
#lsPoiPageFrame iframe {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
#lsPoiPageFrame > #lsMapReturn {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 1;
  min-width: 44px;
  min-height: 44px;
  border: 2px solid #1a1208;
  border-radius: 0;
  background: #FFD600;
  color: #1a1208;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 2px 2px 0 rgba(0,0,0,.2);
}
#lsPoiPageFrame > #lsMapReturn:focus-visible {
  outline: 3px solid #1a1208;
  outline-offset: 3px;
}

/* Map-first: catalog chrome leaves the map alone */
html.lastrada-map-first .page-masthead,
html.lastrada-map-first .edition-band,
html.lastrada-map-first .container,
html.lastrada-map-first #scrollTopBtn {
  display: none !important;
}
html.lastrada-map-first body.map-full .page {
  min-height: 0;
}

/* ── Phone chrome R1: topbar search, Beállítások, hide clutter ──
   NOTE: do NOT use html { zoom } — it leaves empty gray bands in mobile
   emulation and on-device. Shrink chrome only; map dock stays full-bleed. */
.ls-mobile-settings-btn { display: none; }

@media (pointer: coarse) and (max-width: 980px) {
  html.lastrada-map-first body.map-full .map-dock.open.full,
  html.lastrada-map-first .map-dock.open.full {
    inset: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    min-height: 100dvh !important;
  }
  html.lastrada-map-first body.map-full .page {
    min-height: 100dvh !important;
    height: 100dvh !important;
    overflow: hidden !important;
  }
  /* ~75% chrome density without shrinking the map viewport */
  html.lastrada-map-first body.map-full .ls-mobile-nav-btn,
  html.lastrada-map-first body.map-full .ls-mobile-settings-btn {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.82rem;
  }
  html.lastrada-map-first body.map-full .topbar-brand {
    font-size: 0.92rem !important;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap #mapPoiSearch {
    font-size: 0.78rem;
    padding: 6px 4px;
  }
  html.lastrada-map-first body.map-full .loaded-routes-panel {
    transform: scale(0.85);
    transform-origin: bottom left;
  }
}

@media (max-width: 980px), (max-height: 520px) {
  html.lastrada-map-first .ls-mobile-settings-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: #3a2e1d;
    color: #FFD600;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.95rem;
    cursor: pointer;
    flex-shrink: 0;
  }

  html.lastrada-map-first body.map-full .topbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    box-sizing: border-box;
  }
  html.lastrada-map-first body.map-full .topbar-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  html.lastrada-map-first body.map-full .topbar-brand {
    flex-shrink: 0;
    white-space: nowrap;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: min(420px, 46vw);
    position: relative;
    display: flex !important;
    align-items: stretch;
    gap: 4px;
    background: #fffdf8;
    border-radius: 10px;
    padding: 2px 4px 2px 8px;
    border: 1px solid rgba(26, 18, 8, 0.14);
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap #mapPoiSearch {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    font-size: 0.92rem;
    padding: 8px 4px;
    outline: none;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap #btnMapPoiSearch {
    flex-shrink: 0;
    border: 0;
    border-radius: 8px;
    background: #007B3E;
    color: #f7f3ec;
    padding: 6px 10px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap #btnMapPoiSearch .btn-full {
    display: none;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap #btnMapPoiSearch .btn-short {
    display: inline;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap #mapPoiSearchResults {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1000310;
    max-height: min(260px, 45vh);
  }
  /* Dock copy gone after adopt — keep toolbar from leaving a hole */
  html.lastrada-map-first body.map-full .map-overlay-toolbar--search-only:not(:has(#mapPoiSearchWrap)) {
    justify-content: flex-start;
  }
  html.lastrada-map-first body.map-full .map-overlay-toolbar--search-only:empty {
    display: none !important;
  }

  /* Hide map function chrome; reachable via Beállítások */
  html.lastrada-map-first body.map-full .lrp-tools-tab,
  html.lastrada-map-first body.map-full .leaflet-control-zoom,
  html.lastrada-map-first body.map-full .leaflet-control-layers,
  html.lastrada-map-first body.map-full .leaflet-control-diagnostics,
  html.lastrada-map-first body.map-full #leafletDiagnosticsBtn {
    display: none !important;
  }
  /* Útvonal opciók panel: only after Beállítások → Útvonal opciók */
  html.lastrada-map-first body.map-full .road-overlay-panel {
    display: none !important;
  }
  html.lastrada-map-first body.map-full .road-overlay-panel.ls-settings-open {
    display: block !important;
    z-index: 10000055 !important;
  }
  /* When layers opened from Beállítások, force the control visible/expanded */
  html.lastrada-map-first body.map-full .leaflet-control-layers.leaflet-control-layers-expanded {
    display: block !important;
    z-index: 10000060 !important;
  }
}

/* Portrait: search on top, Menü + Beállítások as two buttons (no full brand bar) */
@media (orientation: portrait) and (max-width: 980px), (orientation: portrait) and (max-height: 900px) {
  html.lastrada-map-first body.map-full .flag-stripe {
    display: none;
  }
  html.lastrada-map-first body.map-full .topbar {
    top: env(safe-area-inset-top, 0px);
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "search search"
      "nav settings";
    align-items: center;
    gap: 6px 8px;
    background: transparent;
    box-shadow: none;
    border: 0;
    padding: 8px 10px 0;
  }
  html.lastrada-map-first body.map-full .topbar-brand {
    display: none !important;
  }
  html.lastrada-map-first body.map-full .topbar > #mapPoiSearchWrap {
    grid-area: search;
    width: 100%;
    max-width: none;
    flex: none;
  }
  html.lastrada-map-first body.map-full .topbar-nav {
    grid-area: nav;
    width: auto;
    justify-content: flex-start;
    gap: 8px;
  }
  html.lastrada-map-first body.map-full .topbar > #lsMobileSettingsBtn {
    grid-area: settings;
    justify-self: end;
  }
  html.lastrada-map-first body.map-full .topbar.is-nav-open #lsTopbarRibbon {
    top: calc(96px + env(safe-area-inset-top, 0px));
  }
}

.ls-settings-sheet {
  display: none;
  position: fixed;
  top: calc(52px + env(safe-area-inset-top, 0px));
  left: 8px;
  right: auto;
  bottom: auto;
  transform: none;
  width: min(280px, calc(100vw - 16px));
  max-height: calc(100dvh - 70px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10000090;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  background: #1a1208;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.ls-settings-sheet.is-open {
  display: flex;
}
.ls-settings-sheet .ls-settings-opt,
.ls-settings-sheet.ls-settings-sheet--menu .nav-chip {
  width: auto !important;
  height: auto !important;
  min-height: 40px;
  padding: 8px 12px !important;
  justify-content: flex-start;
  gap: 8px;
  /* Same variant colors as .topbar .nav-chip--* (those selectors don't match outside .topbar) */
  appearance: none;
  -webkit-appearance: none;
}
.ls-settings-sheet .ls-settings-opt .label,
.ls-settings-sheet.ls-settings-sheet--menu .nav-chip .label {
  display: inline !important;
}
.ls-settings-sheet .nav-chip--home  { background: var(--green, #007B3E) !important; color: var(--paper, #f7f3ec) !important; }
.ls-settings-sheet .nav-chip--poi   { background: var(--yellow, #FFD600) !important; color: var(--dark, #1a1208) !important; }
.ls-settings-sheet .nav-chip--route { background: var(--la-orange, #D9651F) !important; color: var(--paper, #f7f3ec) !important; }
.ls-settings-sheet .nav-chip--my    { background: var(--la-red-deep, #B61C2E) !important; color: var(--paper, #f7f3ec) !important; }
.ls-settings-sheet .nav-chip--nav   { background: var(--green, #007B3E) !important; color: var(--paper, #f7f3ec) !important; }
.ls-settings-sheet .nav-chip--menu  { background: #3a2e1d !important; color: var(--yellow, #FFD600) !important; }
.ls-settings-sheet .nav-chip--map   { background: var(--paper, #f7f3ec) !important; color: var(--dark, #1a1208) !important; }
.ls-settings-sheet .nav-chip--cards {
  background: #fffdf8 !important;
  color: var(--dark, #1a1208) !important;
  border: 1.5px solid var(--dark, #1a1208);
}

@media (orientation: portrait) and (max-width: 980px), (orientation: portrait) and (max-height: 900px) {
  html.lastrada-map-first body.map-full .ls-settings-sheet {
    top: calc(96px + env(safe-area-inset-top, 0px));
  }
}

/* MOBILE_MAP_OPTIONS_R1: one mobile entry, original Leaflet layer inputs. */
#lsMapOptionsBtn, #lsMapOptionsPanel { display: none; }
@media (max-width: 980px), (max-height: 520px) {
  html.lastrada-map-first body .leaflet-control-layers:not(.ls-mobile-layers) { display: none !important; }
  #lsMapOptionsBtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 76px; min-height: 40px; padding: 5px 4px; border: 1px solid #007B3E;
    border-radius: 9px; background: #f7f3ec; color: #007B3E;
    font: 800 .7rem 'Barlow Condensed', sans-serif; text-transform: uppercase;
    line-height: 1.15; cursor: pointer; touch-action: manipulation; pointer-events: auto;
  }
  #lsMapOptionsBtn[aria-expanded="true"] { background: #007B3E; color: #fff; }
  #lsMapOptionsBtn:focus-visible { outline: 2px solid #111; outline-offset: 2px; }
  body.vfm-active #lsMapOptionsBtn, body.map-closed #lsMapOptionsBtn { display: none !important; }
  #lsMapOptionsPanel:not([hidden]) {
    display: flex; flex-direction: column; position: fixed; float: none;
    z-index: 10000070; left: var(--map-options-left, 12px); top: var(--map-options-top, 100px);
    width: var(--map-options-width, 280px); max-height: var(--map-options-height, 70vh);
    box-sizing: border-box; margin: 0; overflow: hidden;
    border: 1px solid #007B3E; border-radius: 12px; background: #f7f3ec;
    color: #1a1208; box-shadow: 0 6px 24px #0005; font: 14px 'Barlow', sans-serif;
  }
  #lsMapOptionsPanel .ls-map-options-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; flex-shrink: 0; border-bottom: 1px solid #d9d2c4;
  }
  #lsMapOptionsPanel .ls-map-options-close {
    min-height: 40px; padding: 6px 10px; border: 1px solid #007B3E;
    border-radius: 7px; color: #007B3E; background: #fff; cursor: pointer;
  }
  #lsMapOptionsPanel .ls-map-options-content {
    min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 10px;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  html body #lsMapOptionsPanel .leaflet-control-layers {
    display: block !important; visibility: visible !important; opacity: 1 !important;
    pointer-events: auto !important; position: static !important; float: none;
    width: 100%; min-width: 0; max-width: none; max-height: none; margin: 0; padding: 0;
    transform: none !important; border: 0; box-shadow: none; background: transparent;
  }
  #lsMapOptionsPanel .leaflet-control-layers-toggle { display: none !important; }
  #lsMapOptionsPanel .leaflet-control-layers-list {
    display: block !important; height: auto !important; max-height: none !important;
    overflow: visible !important; padding: 0; border: 0;
  }
  #lsMapOptionsPanel .leaflet-control-layers label {
    display: flex; align-items: center; min-height: 42px; margin: 0; white-space: normal;
  }
  #lsMapOptionsPanel .leaflet-control-layers-selector { top: 0; margin-right: 8px; }
  #lsMapOptionsPanel .road-overlay-menu-item { padding-top: 10px; padding-bottom: 10px; }
}
