/* Maps app (navapp.js). Full screen: the site's own top bar is hidden while it is open. */
body[data-app="maps"] #topbar { display: none; }
body[data-app="maps"] #browse { overflow: hidden; }
body[data-app="maps"] #page { position: fixed; inset: 0; padding: 0; }

.nv {
  --g: rgba(255, 255, 255, 0.9); --g-line: rgba(0, 0, 0, 0.08); --ink: #12151a; --ink-2: #5b6573; --on: #1a8cff; --row: rgba(0, 0, 0, 0.05);
  position: absolute; inset: 0; overflow: hidden; color: var(--ink); font-family: var(--font); background: #dfe4ea;
}
.nv.night { --g: rgba(24, 27, 33, 0.9); --g-line: rgba(255, 255, 255, 0.1); --ink: #f4f6f8; --ink-2: #a3acb8; --row: rgba(255, 255, 255, 0.07); background: #0e1116; }
.nv * { box-sizing: border-box; }
.nv button { min-height: 0; min-width: 0; padding: 0; font: inherit; color: inherit; background: none; border: 0; border-radius: 0; transition: transform 0.12s, background 0.15s; }
.nv button:active { background: none; transform: scale(0.96); }
.nv-i { width: 1em; height: 1em; flex: none; }
.nv-map, .nv-waze { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nv-waze { z-index: 2; background: #e8eef2; }
.nv-loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: var(--ink-2); pointer-events: none; }
.maplibregl-ctrl-attrib { font-size: 11px; opacity: 0.8; }
.maplibregl-ctrl-bottom-left { z-index: 1; }

/* Round glass buttons */
.nv-round {
  width: 60px; height: 60px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 27px;
  border-radius: 50% !important; background: var(--g) !important; border: 1px solid var(--g-line) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}
.nv-round.on { color: #fff; background: var(--on) !important; }
.nv-livebtn { width: auto; padding: 0 18px !important; border-radius: 999px !important; font-size: 24px; font-weight: 700; }
.nv-livebtn span { font-size: 17px; }

/* Top row: home, search, tools */
.nv-top { position: absolute; z-index: 5; top: 14px; left: 14px; right: 14px; display: flex; align-items: flex-start; gap: 12px; pointer-events: none; }
.nv-top > * { pointer-events: auto; }
.nv-searchbox { position: relative; flex: 0 1 560px; min-width: 0; }
.nv-search {
  position: relative; display: flex; align-items: center; height: 60px; border-radius: 999px; background: var(--g); border: 1px solid var(--g-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
}
.nv-s-ico { position: absolute; left: 20px; font-size: 24px; color: var(--ink-2); }
.nv-search input { flex: 1; min-width: 0; height: 100%; padding: 0 56px 0 56px; font: inherit; font-size: 20px; color: var(--ink); background: transparent; border: 0; outline: none; }
.nv-search input::placeholder { color: var(--ink-2); }
.nv-search input::-webkit-search-cancel-button { display: none; }
.nv-clear { position: absolute; right: 8px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; color: var(--ink-2); border-radius: 50% !important; }
.nv-results {
  position: absolute; left: 0; right: 0; top: 68px; max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; border-radius: 24px;
  background: var(--g); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
  touch-action: pan-y;
}
.nv-head { padding: 10px 14px 6px; font-size: 14px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-2); }
.nv-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 12px; text-align: left; border-radius: 16px !important; }
.nv-row:active { background: var(--row) !important; }
.nv-row-ico { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 23px; border-radius: 50%; color: #fff; background: #1a8cff; }
.nv-row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nv-row-txt b { font-size: 19px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-row-txt small { font-size: 15px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nv-row-dist { flex: none; font-size: 15px; color: var(--ink-2); }
.nv-tools { margin-left: auto; display: flex; gap: 10px; }

/* Side controls */
.nv-side { position: absolute; z-index: 4; right: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; }
.nv-me-btn.on { color: #fff; }

/* Quick chips under the search */
.nv-chips { position: absolute; z-index: 4; left: 14px; right: 100px; bottom: 18px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; padding: 4px 0; }
.nv-chips::-webkit-scrollbar { display: none; }
.nv-chip {
  flex: none; height: 52px; display: inline-flex !important; align-items: center; gap: 9px; padding: 0 20px !important; font-size: 18px; font-weight: 650;
  border-radius: 999px !important; background: var(--g) !important; border: 1px solid var(--g-line) !important; box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.nv-chip .nv-i { font-size: 21px; color: var(--on); }

/* Panels: a card on the left of a wide screen, a sheet at the bottom of a narrow one */
.nv-panel {
  position: absolute; z-index: 6; left: 14px; bottom: 14px; width: min(430px, calc(100% - 28px)); max-height: calc(100% - 110px); overflow-y: auto;
  padding: 18px 18px 16px; border-radius: 28px; background: var(--g); border: 1px solid var(--g-line);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.32);
  animation: nv-up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); touch-action: pan-y;
}
@keyframes nv-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.nv-grab { display: none; width: 44px; height: 5px; margin: -6px auto 12px; border-radius: 3px; background: var(--g-line); }
.nv-ph { display: flex; align-items: flex-start; gap: 12px; }
.nv-ph > div { flex: 1; min-width: 0; }
.nv-ph h2 { margin: 0; font-size: 26px; font-weight: 750; letter-spacing: -0.01em; line-height: 1.15; }
.nv-addr { margin: 6px 0 0; font-size: 17px; color: var(--ink-2); }
.nv-away { margin: 4px 0 0; font-size: 15px; font-weight: 650; color: var(--on); }
.nv-x { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-size: 22px; color: var(--ink-2); border-radius: 50% !important; background: var(--row) !important; }
.nv-actions { display: flex; gap: 12px; margin-top: 18px; }
.nv-actions.busy { opacity: 0.55; pointer-events: none; }
.nv-actions button { flex: 1; height: 64px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 21px; font-weight: 700; border-radius: 20px !important; background: var(--row) !important; }
.nv-actions .nv-primary { flex: 2; color: #fff; background: var(--on) !important; box-shadow: 0 8px 22px rgba(26, 140, 255, 0.4); }
.nv-saveopts { display: flex; gap: 10px; margin-top: 12px; }
.nv-saveopts button { flex: 1; height: 54px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 650; border-radius: 16px !important; background: var(--row) !important; }
.nv-routelist { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.nv-route { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: baseline; padding: 14px 16px !important; text-align: left; border-radius: 18px !important; background: var(--row) !important; border: 2px solid transparent !important; }
.nv-route.on { border-color: var(--on) !important; background: rgba(26, 140, 255, 0.12) !important; }
.nv-r-time { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.nv-r-meta { font-size: 17px; color: var(--ink-2); }
.nv-r-via { grid-column: 1 / -1; font-size: 15px; color: var(--ink-2); }
.nv-tag { position: absolute; right: 14px; top: 14px; padding: 4px 10px; font-size: 13px; font-weight: 700; color: #fff; border-radius: 999px; background: #22a559; }

/* Navigating */
.nv.navigating .nv-top { left: auto; }
.nv.navigating .nv-home { display: none; }
.nv.navigating .nv-chips { display: none; }
.nv-banner {
  position: absolute; z-index: 6; left: 14px; top: 14px; width: min(520px, calc(100% - 28px)); display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border-radius: 26px; color: #fff; background: #0f7a3a; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); animation: nv-up 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.nv-banner.soon { background: #1a8cff; }
.nv-b-icon { flex: none; width: 78px; height: 78px; display: grid; place-items: center; }
.nv-b-icon svg { width: 100%; height: 100%; }
.nv-b-main { flex: 1; min-width: 0; }
.nv-b-dist { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.nv-b-text { margin-top: 4px; font-size: 21px; font-weight: 600; opacity: 0.95; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nv-b-then { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, 0.3); }
.nv-b-then small { font-size: 13px; opacity: 0.85; }
.nv-b-then svg { width: 38px; height: 38px; }
.nv-panel.navbar { left: 50%; bottom: 14px; width: min(700px, calc(100% - 28px)); transform: translateX(-50%); display: flex; align-items: center; gap: 22px; padding: 12px 18px; animation: none; }
.nv-nstat { display: flex; flex-direction: column; align-items: center; min-width: 74px; }
.nv-nstat b { font-size: 31px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.nv-nstat span { font-size: 14px; color: var(--ink-2); }
.nv-speed { margin-left: auto; }
.nv-end { height: 56px; padding: 0 28px !important; font-size: 20px; font-weight: 700; color: #fff; border-radius: 999px !important; background: #e5484d !important; }
.nv-panel.navbar .nv-round { width: 54px; height: 54px; box-shadow: none; }

/* My position */
.nv-me { position: relative; width: 26px; height: 26px; }
.nv-me-dot { position: absolute; inset: 3px; border-radius: 50%; background: #1a8cff; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4); }
.nv-me-pulse { position: absolute; inset: -14px; border-radius: 50%; background: rgba(26, 140, 255, 0.25); animation: nv-pulse 2.2s ease-out infinite; }
@keyframes nv-pulse { 0% { transform: scale(0.4); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.nv-me-arrow { display: none; position: absolute; inset: -6px; width: 38px; height: 38px; color: #1a8cff; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.nv-me-arrow path { stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.nv.moving .nv-me-arrow { display: block; }
.nv.moving .nv-me-dot, .nv.moving .nv-me-pulse { display: none; }
.nv-pin { font-size: 46px; color: #e5484d; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4)); }
.nv-pin svg { fill: #e5484d; stroke: #fff; stroke-width: 1.6; }
.nv-pin svg circle { fill: #fff; stroke: none; }

/* Menu popover */
.nv-menu-pop { position: absolute; z-index: 8; right: 14px; top: 84px; width: min(340px, calc(100% - 28px)); padding: 8px; border-radius: 22px; background: var(--g); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); box-shadow: 0 16px 44px rgba(0, 0, 0, 0.32); }
.nv-menu-row { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 16px !important; text-align: left; border-radius: 16px !important; }
.nv-menu-row:active { background: var(--row) !important; }
.nv-menu-row b { font-size: 19px; }
.nv-menu-row small { font-size: 14px; color: var(--ink-2); }
.nv-menu-note { padding: 10px 16px 8px; font-size: 13px; line-height: 1.4; color: var(--ink-2); }

/* The Waze live layer: keep our own controls on top */
.nv.waze-on .nv-side, .nv.waze-on .nv-chips, .nv.waze-on .nv-panel, .nv.waze-on .nv-banner { display: none; }
.nv.waze-on .nv-top { z-index: 9; }

/* Condensed window (the car's side panel open) and phones: sheets at the bottom */
@media (max-width: 900px) {
  .nv-round { width: 54px; height: 54px; font-size: 24px; }
  .nv-livebtn span { display: none; }
  .nv-livebtn { padding: 0 !important; width: 54px; }
  .nv-top { top: 10px; left: 10px; right: 10px; gap: 8px; }
  .nv-search { height: 54px; }
  .nv-search input { font-size: 18px; }
  .nv-searchbox { flex: 1 1 auto; }
  .nv-tools { gap: 8px; }
  .nv-side { right: 10px; top: 76px; transform: none; }
  .nv.navigating .nv-side { top: 130px; }
  .nv-chips { left: 10px; right: 78px; bottom: 12px; }
  .nv-panel { left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 58%; padding: 14px 16px 14px; border-radius: 26px; }
  .nv-grab { display: block; }
  .nv-ph h2 { font-size: 23px; }
  .nv-actions { margin-top: 14px; }
  .nv-actions button { height: 58px; font-size: 19px; }
  .nv-banner { left: 10px; right: 10px; top: 10px; width: auto; padding: 12px 16px; gap: 12px; }
  .nv-b-icon { width: 62px; height: 62px; }
  .nv-b-dist { font-size: 32px; }
  .nv-b-text { font-size: 18px; }
  .nv-panel.navbar { left: 10px; right: 10px; width: auto; transform: none; gap: 12px; padding: 10px 14px; }
  .nv-nstat { min-width: 0; }
  .nv-nstat b { font-size: 25px; }
  .nv.navigating .nv-top { top: auto; bottom: 90px; right: 10px; left: auto; }
  .nv.navigating .nv-tools { flex-direction: column; }
  .nv-menu-pop { top: 74px; right: 10px; }
}
@media (max-width: 560px) {
  .nv-theme { display: none; }
  .nv-nstat.nv-speed { display: none; }
}

/* Speed limit sign and over-the-limit warning */
.nv-limit { flex: none; width: 64px; height: 74px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; color: #111; background: #fff; border: 4px solid #111; line-height: 1; }
.nv-limit span { font-size: 9px; font-weight: 800; text-align: center; }
.nv-limit b { font-size: 30px; font-weight: 800; }
.nv-speed.over b { color: #e5484d; }
