/* The map app: the side bar (lm-side) beside the map (lm-map); on a phone the side
   bar is a sheet over the lower part of the map. Dark with :root[data-theme=dark]. */
:root {
  --side: 408px;
  --bg: #fff;
  --bg2: #f5f7f9;
  --fg: #1d2329;
  --muted: #5d6974;
  --line: #e2e6ea;
  --hot: #eef3f8;
  --accent: #1a5fd0;
  --red: #c92a2a;
  --green: #2b8a3e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 10px rgba(0, 0, 0, .08);
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #17191c;
  --bg2: #202328;
  --fg: #e8eaed;
  --muted: #9aa4ae;
  --line: #30353b;
  --hot: #252b31;
  --accent: #78a9ff;
  --red: #ff8787;
  --green: #69db7c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* no pull to refresh over the map, and no zoom of the page: only the map zooms (it handles its own touches) */
html, body { height: 100%; margin: 0; overscroll-behavior: none; touch-action: pan-x pan-y; }
body { background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.lm-noscript { padding: 2rem; }

.lm { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; height: 100dvh; }
.lm-side { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 0; background: var(--bg); border-right: 1px solid var(--line); box-shadow: var(--shadow); }
.lm-map { position: relative; min-width: 0; min-height: 0; }

.lm-top { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem .2rem; }
.lm-brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.05rem; color: var(--fg); text-decoration: none; letter-spacing: -.01em; }
.lm-logo-img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.lm-tag { color: var(--muted); font-size: .85rem; flex: 1; }
.lm-icon-btn { border: 0; background: none; padding: .35rem; border-radius: 8px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.lm-icon-btn:hover { background: var(--hot); color: var(--fg); }
.lm-sheet-btn { display: none; }

.lm-form { padding: .5rem 1rem .6rem; display: flex; gap: .5rem; align-items: center; }
.lm-form .lm-combo { flex: 1; min-width: 0; }
.lm-dir-btn { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center;
  box-shadow: var(--shadow); cursor: pointer; }
.lm-dir-btn .lm-dir-arrow { stroke: var(--accent); }
.lm-dir-btn:hover { filter: brightness(1.1); }
.lm-dir-btn[hidden] { display: none; }
.lm-head { position: relative; }
.lm-place-acts { position: absolute; top: .45rem; right: 1rem; border-bottom: 0; padding: 0; overflow: visible; }
.lm-place-acts:empty { display: none; }
.lm-place-acts .lm-action { flex-direction: row; gap: .3rem; min-width: 0; padding: .35rem .8rem .35rem .45rem; border: 1px solid var(--line);
  border-radius: 20px; background: var(--bg); font-size: .85rem; font-weight: 600; }
.lm-place-acts .lm-action svg { width: 22px; height: 22px; padding: 0; border: 0; background: none; }
.lm-head:has(.lm-place-acts:not(:empty)) .lm-title, .lm-head:has(.lm-place-acts:not(:empty)) .lm-notes { padding-right: 9rem; }
.lm-combo { position: relative; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.lm-combo:focus-within { border-color: var(--accent); }
.lm-input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: 16px; padding: .7rem 0 .7rem 1.1rem; }
.lm-input::-webkit-search-cancel-button { display: none; }
.lm-clear, .lm-go { border: 0; background: none; cursor: pointer; color: var(--muted); padding: .55rem .6rem; display: grid; place-items: center; }
.lm-go { color: var(--accent); padding-right: .9rem; }
.lm-clear:hover, .lm-go:hover { color: var(--fg); }
.lm-suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 10; margin: 0; padding: .3rem 0; list-style: none; background: var(--bg);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.lm-opt { display: flex; gap: .7rem; align-items: center; padding: .5rem .9rem; cursor: pointer; }
.lm-opt[aria-selected=true], .lm-opt:hover { background: var(--hot); }
.lm-opt-icon { color: var(--muted); display: grid; }
.lm-opt-text { display: flex; flex-direction: column; min-width: 0; }
.lm-opt-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-opt-detail { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lm-status { margin: 0 1rem .4rem; padding: .5rem .75rem; border-radius: 8px; background: var(--bg2); color: var(--muted); font-size: .9rem; }
.lm-status.lm-bad { color: var(--red); }

.lm-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.lm-head { padding: .2rem 1rem .3rem; }
.lm-title { font-size: 1.05rem; font-weight: 600; line-height: 1.35; margin: .2rem 0 .2rem; }
.lm-notes { margin: 0 0 .3rem; color: var(--muted); font-size: .85rem; }
.lm-notes:empty { display: none; }
.lm-chips { padding: 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.lm-chips:empty { display: none; }
.lm-chiprow { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .3rem; }
.lm-chipname { color: var(--muted); font-size: .8rem; margin-right: .1rem; }
.lm-chip { border: 1px solid var(--line); background: var(--bg); border-radius: 16px; padding: .3rem .75rem; font-size: .85rem; cursor: pointer; }
.lm-chip:hover { background: var(--hot); border-color: var(--accent); }
.lm-count { margin: .6rem 1rem .2rem; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.lm-count:empty { display: none; }

.lm-results { list-style: none; margin: 0; padding: 0; }
.lm-card { display: flex; gap: .8rem; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: .8rem 1rem; cursor: pointer; }
.lm-card:hover, .lm-card.lm-hot { background: var(--hot); }
.lm-card-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: .05rem; }
.lm-card-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.lm-card-sub, .lm-card-addr { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-card-hours { font-size: .85rem; }
.lm-card-hours:empty { display: none; }
.lm-open { color: var(--green); }
.lm-closed { color: var(--red); }
.lm-thumb { flex: none; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; font-weight: 700; font-size: 1.4rem;
  color: #fff; background: var(--c, #868e96); opacity: .9; }
.lm-thumb.lm-has-img { background: var(--bg2); opacity: 1; }
.lm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lm-thumb img.lm-logo { object-fit: contain; padding: 8px; background: #fff; }
.lm-more { display: block; margin: .8rem auto; border: 1px solid var(--line); background: var(--bg); border-radius: 18px; padding: .4rem 1.1rem; cursor: pointer; }
.lm-more:hover { background: var(--hot); }
.lm-query { margin: .6rem 1rem 1rem; font-size: .85rem; }
.lm-query summary { cursor: pointer; color: var(--muted); }
.lm-query pre { white-space: pre-wrap; word-break: break-word; background: var(--bg2); border-radius: 8px; padding: .6rem; font-size: .78rem; max-height: 280px; overflow: auto; }
.lm-copy { border: 1px solid var(--line); background: var(--bg); border-radius: 6px; padding: .2rem .6rem; cursor: pointer; font-size: .8rem; }

.lm-detail { padding: 0 0 1rem; }
.lm-back { display: inline-flex; align-items: center; gap: .2rem; border: 0; background: none; color: var(--accent); cursor: pointer; padding: .3rem 1rem .5rem .6rem; }
.lm-pic { margin: 0 0 .6rem; }
.lm-pic img { display: block; width: 100%; max-height: 260px; object-fit: cover; background: var(--bg2); }
.lm-pic.lm-pic-logo img { object-fit: contain; max-height: 160px; padding: 1rem; background: #fff; }
.lm-pic figcaption { font-size: .72rem; color: var(--muted); padding: .25rem 1rem 0; }
.lm-dname { font-size: 1.4rem; line-height: 1.25; margin: .2rem 1rem .15rem; }
.lm-dsub { margin: 0 1rem .2rem; color: var(--muted); }
.lm-dstate { margin: 0 1rem .4rem; font-weight: 500; }
.lm-actions { display: flex; gap: .5rem; padding: .6rem 1rem .8rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.lm-action { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-width: 64px; text-decoration: none; color: var(--accent); font-size: .78rem; }
.lm-action svg { width: 40px; height: 40px; padding: 10px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); }
.lm-action:hover svg { background: var(--hot); }
.lm-rows { list-style: none; margin: 0; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.lm-rows li { display: flex; gap: .9rem; align-items: flex-start; padding: .55rem 1rem; overflow-wrap: anywhere; }
.lm-row-icon { color: var(--accent); flex: none; display: grid; padding-top: .1rem; }
.lm-hours { display: flex; flex-direction: column; }
.lm-tags { margin: .6rem 1rem; font-size: .85rem; }
.lm-tags summary { cursor: pointer; color: var(--muted); }
.lm-tags dl { display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; margin: .5rem 0 0; }
.lm-tags dt { color: var(--muted); }
.lm-tags dd { margin: 0; overflow-wrap: anywhere; }

.lm-foot { padding: .5rem 1rem .6rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; line-height: 1.35; }

.lm-area { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; border: 0; border-radius: 18px; padding: .5rem 1rem;
  background: var(--bg); color: var(--accent); font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.lm-area:hover { background: var(--hot); }
.maplibregl-ctrl-group { background: var(--bg); }
:root[data-theme=dark] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }

/* phones: the map fills the screen, the side bar is a sheet over its lower part */
@media (max-width: 760px) {
  .lm { grid-template-columns: 1fr; }
  .lm-map { grid-area: 1 / 1; }
  .lm-side { grid-area: 1 / 1; align-self: end; height: 48dvh; border-right: 0; border-radius: 16px 16px 0 0; padding-top: 14px;
    transition: height .22s ease; overflow: hidden; }
  .lm-side.lm-dragging { transition: none; }
  .lm-sheet-btn { display: block; position: absolute; top: 0; left: 0; right: 0; height: 26px; border: 0; background: none; cursor: grab; touch-action: none; z-index: 1; }
  .lm-sheet-btn::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .45; margin: 8px auto 0; }
  .lm-head { touch-action: none; }
  .lm-top { display: none; }
  .lm-foot { display: none; }
  .lm[data-sheet=peek] .lm-chips, .lm[data-sheet=peek] .lm-status { display: none; }
  .lm-thumb { width: 60px; height: 60px; }
  .lm-area { top: 10px; }
}

/* the location button and the toast */
.lm-locate { position: absolute; right: 10px; bottom: 112px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg);
  color: var(--muted); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.lm-locate:hover { color: var(--fg); }
.lm-locate.lm-on { color: #1a73e8; }
.lm-locate.lm-busy svg { animation: lm-spin 1.2s linear infinite; }
@keyframes lm-spin { to { transform: rotate(360deg); } }
.lm-area { display: inline-flex; align-items: center; gap: .4rem; animation: lm-in .18s ease-out; }
@keyframes lm-in { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 760px) {
  .lm-locate { bottom: calc(var(--sheet, 40dvh) + 12px); }
  .maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: var(--sheet, 40dvh); }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
}
.lm-chip { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-chip-place { max-width: 16rem; }
.lm-tag a { color: inherit; }
.lm-here-note { padding: 0 1rem; }
.lm-here .lm-count { margin-top: .8rem; }

/* directions */
button.lm-action { border: 0; background: none; padding: 0; font: inherit; font-size: .78rem; cursor: pointer; }
.lm-here-actions { border-bottom: 0; padding-bottom: .4rem; }
.lm-route { padding: 0 0 1rem; }
.lm-route-head { padding: .3rem 1rem .6rem; border-bottom: 1px solid var(--line); }
.lm-modes { display: flex; gap: .4rem; margin-bottom: .7rem; }
.lm-mode { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid var(--line); background: var(--bg);
  color: var(--fg); border-radius: 18px; padding: .4rem .5rem; font: inherit; font-size: .85rem; cursor: pointer; }
.lm-mode:hover { background: var(--hot); }
.lm-mode[aria-checked=true] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.lm-ends { position: relative; display: flex; flex-direction: column; gap: .35rem; padding-right: 2.4rem; }
.lm-end { display: grid; grid-template-columns: auto 3rem 1fr; align-items: center; gap: .5rem; background: var(--bg2); border-radius: 8px; padding: .45rem .6rem; }
.lm-end-dot { width: 12px; height: 12px; border-radius: 50%; border: 3px solid #111827; background: #fff; }
.lm-end-to .lm-end-dot { border-color: #fff; background: #d0312d; box-shadow: 0 0 0 1px #d0312d; }
.lm-end-name { color: var(--muted); font-size: .8rem; }
.lm-end-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-end-box { position: relative; min-width: 0; }
.lm-end-input { width: 100%; border: 0; background: none; color: var(--fg); font: inherit; padding: .1rem 0; outline: none; text-overflow: ellipsis; }
.lm-end-input::placeholder { color: var(--muted); }
.lm-end:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.lm-end-list { left: -5.35rem; right: -.6rem; }
.lm-end-none { color: var(--muted); }
.lm-swap { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.lm-swap:disabled { opacity: .4; cursor: default; }
.lm-use-me { margin-top: .6rem; color: var(--accent); }
.lm-route-msg { padding: .6rem 1rem 0; margin: 0; }
.lm-route-sum { margin: .7rem 1rem .3rem; font-size: 1.2rem; font-weight: 600; }
.lm-route-sum:empty { display: none; }
.lm-steps { list-style: none; margin: 0; padding: 0; }
.lm-step button { display: flex; width: 100%; gap: .8rem; justify-content: space-between; align-items: baseline; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--fg); font: inherit; text-align: left; padding: .55rem 1rem; cursor: pointer; }
.lm-step button:hover { background: var(--hot); }
.lm-step-km { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* the menu: a drawer from the left, over everything */
.lm-burger { margin-left: -.35rem; }
.lm-map-burger { display: none; }
.lm-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .35); }
.lm-menu { position: fixed; top: 0; left: 0; bottom: 0; z-index: 21; width: min(320px, 86vw); overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); box-shadow: 4px 0 24px rgba(0, 0, 0, .25); padding: .8rem 1rem 1.2rem; animation: lm-slide .18s ease-out; }
@keyframes lm-slide { from { transform: translateX(-100%); } to { transform: none; } }
.lm-menu-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.lm-menu-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1rem 0 .5rem; font-weight: 600; }
.lm-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.lm-style { display: flex; flex-direction: column; gap: .3rem; align-items: stretch; border: 2px solid transparent; border-radius: 10px; background: none;
  padding: .25rem; cursor: pointer; font-size: .8rem; color: var(--fg); }
.lm-style:hover { background: var(--hot); }
.lm-style[aria-checked=true] { border-color: var(--accent); }
.lm-swatch { display: block; height: 46px; border-radius: 7px; border: 1px solid var(--line); }
.lm-swatch-light { background: linear-gradient(135deg, #f2efe9 55%, #aad3df 55% 70%, #f2efe9 70%), #f2efe9; }
.lm-swatch-dark { background: linear-gradient(135deg, #2a2d33 55%, #1b2a3a 55% 70%, #2a2d33 70%); }
.lm-swatch-auto { background: linear-gradient(135deg, #f2efe9 50%, #2a2d33 50%); }
.lm-swatch-outdoor { background: linear-gradient(135deg, #dfe9c8 40%, #b9d39a 40% 62%, #e9e3d3 62%); }
.lm-swatch-relief { background: linear-gradient(135deg, #8fbf7a, #d9c38f 45%, #b49a7a 70%, #fff); }
.lm-swatch-driving { background: linear-gradient(135deg, #f4f1ea 45%, #f2a541 45% 55%, #f4f1ea 55%); }
.lm-swatch-marine { background: linear-gradient(135deg, #f1ead4 35%, #b8dcef 35% 60%, #7fb6da 60%); }
.lm-swatch-white { background: #fff; }
.lm-swatch-grayscale { background: linear-gradient(135deg, #e6e6e6 55%, #c4c4c4 55% 70%, #e6e6e6 70%); }
.lm-swatch-black { background: linear-gradient(135deg, #111 55%, #2b2b2b 55% 70%, #111 70%); }
.lm-toggle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.lm-toggle-text { display: flex; flex-direction: column; }
.lm-toggle-note { color: var(--muted); font-size: .8rem; }
.lm-toggle input { appearance: none; flex: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; }
.lm-toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.lm-toggle input:checked { background: var(--accent); }
.lm-toggle input:checked::after { left: 21px; }
.lm-menu-foot { color: var(--muted); font-size: .72rem; margin-top: 1.2rem; }
@media (max-width: 760px) {
  .lm-map-burger { display: grid; position: absolute; top: 10px; left: 10px; z-index: 3; width: 44px; height: 44px; border-radius: 50%;
    background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }
  .lm-area { left: calc(50% + 20px); }
}

/* the name: "maps" in the blue of ".ch" in the logo of overpass.ch */
.lm-word { font-weight: 800; letter-spacing: -.02em; font-size: 1.15rem; }
.lm-word-maps { color: #0284c7; }
.lm-top .lm-tag { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lm-powered { display: flex; align-items: center; gap: .6rem; margin-top: 1.4rem; padding: .8rem; border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); text-decoration: none; font-size: .85rem; }
.lm-powered:hover { background: var(--hot); }
.lm-powered img { height: 22px; width: auto; display: block; }
.lm-powered-dark, :root[data-theme=dark] .lm-powered-light { display: none !important; }
:root[data-theme=dark] .lm-powered-dark { display: block !important; }

/* the compass: above the location button; the needle turns with the map */
.lm-compass { position: absolute; right: 10px; bottom: 160px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: var(--bg); color: var(--fg); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.lm-compass:hover { background: var(--hot); }
.lm-needle { transform-origin: 12px 12px; transition: transform .1s linear; }
.lm-in-area { color: var(--accent); }
@media (max-width: 760px) {
  .lm-compass { bottom: calc(var(--sheet, 40dvh) + 62px); }
}

/* navigation: the map alone, the next turn on top, the trip below */
.lm-nav-go { display: flex; gap: .5rem; align-items: center; padding: .2rem 1rem .7rem; border-bottom: 1px solid var(--line); }
.lm-nav-start { display: inline-flex; align-items: center; gap: .4rem; border: 0; border-radius: 20px; background: var(--accent); color: var(--bg);
  font: inherit; font-weight: 600; padding: .5rem 1.2rem; cursor: pointer; }
.lm-nav-start:hover { filter: brightness(1.08); }
.lm.lm-navigating { grid-template-columns: 1fr; }
.lm.lm-navigating .lm-side { display: none; }
.lm.lm-navigating .lm-map { grid-area: 1 / 1; }
.lm-navigating .lm-area, .lm-navigating .lm-locate, .lm-navigating .maplibregl-ctrl-bottom-right { display: none !important; }
.lm-navigating .lm-compass { bottom: 96px; }
.lm-nav { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.lm-nav > * { pointer-events: auto; }
.lm-nav-banner { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; max-width: 460px; display: flex; gap: .8rem;
  align-items: center; background: #0284c7; color: #fff; border-radius: 14px; padding: .7rem 1rem; box-shadow: 0 4px 18px rgba(0, 0, 0, .3); }
.lm-nav-arrow { flex: none; display: grid; place-items: center; }
.lm-nav-text { min-width: 0; }
.lm-nav-dist { font-size: 1.9rem; font-weight: 700; line-height: 1.05; letter-spacing: -.01em; }
.lm-nav-instr { font-size: 1.05rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lm-nav-then { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 86px); left: 18px; display: inline-flex; align-items: center; gap: .3rem;
  background: #01699f; color: #fff; border-radius: 0 0 10px 10px; padding: .25rem .7rem; font-size: .85rem; }
.lm-nav-then-arrow { display: grid; }
/* the sign of the junction: green for motorways, blue for other roads (as in Switzerland) */
.lm-nav-sign { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 90px); right: 10px; max-width: 230px; color: #fff; border: 2px solid #fff;
  outline: 2px solid rgba(0, 0, 0, .25); border-radius: 6px; padding: .45rem .7rem; box-shadow: 0 3px 12px rgba(0, 0, 0, .3); font-weight: 600; }
.lm-sign-motorway { background: #00843d; }
.lm-sign-road { background: #1d5aa8; }
.lm-sign-top { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .25rem; }
.lm-sign-exit { background: #fff; color: #00843d; border-radius: 3px; padding: 0 .35rem; font-size: .8rem; }
.lm-sign-road .lm-sign-exit { color: #1d5aa8; }
.lm-shield, .lm-shield-a, .lm-shield-e { border-radius: 3px; padding: 0 .35rem; font-size: .8rem; border: 1.5px solid #fff; }
.lm-shield-a { background: #d52b1e; }
.lm-shield-e { background: #00843d; }
.lm-shield { background: #1d5aa8; }
.lm-sign-name { font-size: .8rem; opacity: .9; }
.lm-sign-to { font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lm-nav-limit { position: absolute; left: 14px; bottom: 96px; width: 58px; height: 58px; border-radius: 50%; background: #fff; border: 6px solid #d52b1e;
  color: #111; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.lm-nav-center { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .35rem; border: 0;
  border-radius: 20px; background: var(--bg); color: var(--accent); font: inherit; font-weight: 600; padding: .5rem 1rem; box-shadow: var(--shadow); cursor: pointer; }
.lm-nav-bottom { position: absolute; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: flex;
  align-items: center; gap: .5rem; background: var(--bg); color: var(--fg); border-radius: 16px; padding: .5rem .6rem; box-shadow: 0 4px 18px rgba(0, 0, 0, .25); }
.lm-nav-eta { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.lm-nav-eta strong { font-size: 1.3rem; color: var(--green); }
/* the arrival time and the delay by the traffic ahead */
.lm-ontime { color: var(--green); }
.lm-slow, .lm-nav-eta strong.lm-slow { color: #e37400; }
.lm-late, .lm-nav-eta strong.lm-late { color: #d93025; }
.lm-delay { margin-left: .5rem; font-size: .85rem; font-weight: 600; }
.lm-delay.lm-ontime { color: var(--muted); }
.lm-nav-eta span { color: var(--muted); font-size: .85rem; }
.lm-nav-btn { border: 0; background: var(--bg2); color: var(--fg); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.lm-nav-btn:hover { background: var(--hot); }
.lm-nav-x { background: #d52b1e; color: #fff; }
.lm-nav-x:hover { background: #b3241a; }
.lm-sprite { width: 40px; height: 40px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.lm-sprite svg { display: block; }

/* the height profile of a route by bike or on foot */
.lm-elev { padding: .6rem 1rem .8rem; border-bottom: 1px solid var(--line); }
.lm-elev-head { display: flex; flex-wrap: wrap; gap: .3rem .9rem; align-items: baseline; font-size: .9rem; margin-bottom: .35rem; }
.lm-elev-up { font-weight: 600; }
.lm-elev-down { color: var(--muted); }
.lm-elev-read { margin-left: auto; color: var(--fg); font-variant-numeric: tabular-nums; }
.lm-elev-frame { display: flex; gap: .4rem; }
.lm-elev-scale { display: flex; flex-direction: column; justify-content: space-between; font-size: .72rem; color: var(--muted); text-align: right; min-width: 3.2em; }
.lm-elev-plot { position: relative; flex: 1; height: 88px; touch-action: pan-y; cursor: crosshair; border-bottom: 1px solid var(--line); }
.lm-elev-plot svg { display: block; width: 100%; height: 100%; }
.lm-elev-axis { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin: .2rem 0 0 3.6em; }
.lm-elev-cursor { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--muted); pointer-events: none; }
.lm-elev-dot { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--fg); border: 2px solid var(--bg); pointer-events: none; }
.lm-elev-pin { width: 14px; height: 14px; border-radius: 50%; background: #111827; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
/* in navigation: a strip above the bottom bar, with the point reached */
.lm-nav-elev { position: absolute; left: 10px; right: 10px; bottom: calc(max(10px, env(safe-area-inset-bottom)) + 70px); max-width: 560px; margin: 0 auto;
  background: var(--bg); color: var(--fg); border-radius: 12px; padding: .35rem .6rem .3rem; box-shadow: 0 4px 18px rgba(0, 0, 0, .2); pointer-events: none; }
.lm-elev-compact { padding: 0; border: 0; display: flex; align-items: center; gap: .6rem; }
.lm-elev-compact .lm-elev-plot { height: 34px; border: 0; cursor: default; }
.lm-elev-compact .lm-elev-cursor { border-left: 2px solid var(--fg); }
.lm-elev-left { flex: none; font-size: .8rem; color: var(--muted); max-width: 40%; text-align: right; }
.lm-elev-left:empty { display: none; }
.lm-nav-elev:not([hidden]) ~ .lm-nav-center { bottom: 150px; }
/* 2D or 3D, above the compass; in navigation both above the height strip when it shows */
.lm-dim { position: absolute; right: 10px; bottom: 210px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg);
  color: var(--fg); font: inherit; font-size: .85rem; font-weight: 700; box-shadow: var(--shadow); cursor: pointer; }
.lm-dim:hover { background: var(--hot); }
@media (max-width: 760px) {
  .lm-dim { bottom: calc(var(--sheet, 40dvh) + 112px); }
}
.lm-navigating .lm-dim { bottom: 146px; }
.lm-navigating.lm-nav-elev-on .lm-compass { bottom: 146px; }
.lm-navigating.lm-nav-elev-on .lm-dim { bottom: 196px; }
/* the language in the menu */
.lm-lang-select { font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .3rem .4rem; }

/* the speed now, above the speed limit */
.lm-nav-speed { position: absolute; left: 14px; bottom: 164px; min-width: 58px; padding: .3rem .4rem; border-radius: 12px; background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.lm-nav-speed strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.lm-nav-speed span { font-size: .7rem; color: var(--muted); }
.lm-nav-speed.lm-over { background: #d52b1e; color: #fff; }
.lm-nav-speed.lm-over span { color: #fff; }
.lm-nav-limit[hidden] + .lm-nav-speed { bottom: 96px; }
/* the message of a traffic event */
.lm-traffic-pop { font: inherit; color: #1d2329; }
.lm-traffic-pop strong { display: block; margin-bottom: .2rem; }
.lm-traffic-pop p { margin: 0; font-size: .85rem; line-height: 1.35; }

/* traffic on and off, above 2D/3D */
.lm-traffic-btn { position: absolute; right: 10px; bottom: 260px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--bg);
  color: var(--muted); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; }
.lm-traffic-btn[hidden] { display: none; }
.lm-traffic-btn circle { fill: currentColor; opacity: .5; }
.lm-traffic-btn.lm-on { color: var(--fg); }
.lm-traffic-btn.lm-on .lm-tl-r { fill: #d93025; opacity: 1; }
.lm-traffic-btn.lm-on .lm-tl-y { fill: #f29900; opacity: 1; }
.lm-traffic-btn.lm-on .lm-tl-g { fill: #1e8e3e; opacity: 1; }
@media (max-width: 760px) {
  .lm-traffic-btn { bottom: calc(var(--sheet, 40dvh) + 162px); }
}
.lm-navigating .lm-traffic-btn { bottom: 196px; }
.lm-navigating.lm-nav-elev-on .lm-traffic-btn { bottom: 246px; }

/* the menu while navigating: a round button above the traffic button */
.lm-navigating .lm-map-burger { display: grid; place-items: center; position: absolute; top: auto; left: auto; right: 10px; bottom: 246px; z-index: 5; width: 40px;
  height: 40px; border-radius: 50%; border: 0; background: var(--bg); color: var(--fg); box-shadow: var(--shadow); cursor: pointer; }
.lm-navigating.lm-nav-elev-on .lm-map-burger { bottom: 296px; }
/* the lanes before a turn, under the banner: the lanes to take light, the others dim */
.lm-nav-lanes { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 88px); left: 10px; display: flex; gap: 2px; padding: 4px;
  border-radius: 10px; background: #01699f; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); max-width: calc(100% - 20px); overflow: hidden; }
.lm-lane { display: flex; align-items: center; justify-content: center; min-width: 34px; height: 40px; padding: 0 3px; border-radius: 6px; color: rgba(255, 255, 255, .38); }
.lm-lane + .lm-lane { border-left: 2px dashed rgba(255, 255, 255, .35); border-radius: 0; }
.lm-lane-arrow { display: grid; margin: 0 -5px; }
.lm-lane-arrow.lm-lane-on { color: #fff; }
.lm-nav-lanes:not([hidden]) ~ .lm-nav-then, .lm-nav-lanes:not([hidden]) ~ .lm-nav-sign { top: calc(max(10px, env(safe-area-inset-top)) + 140px); }
