/* Atlas Map — навигатор: полноэкранный HUD (верхняя плашка манёвра, полосы, нижняя панель ETA/скорость/кнопки),
   скрытие панели и контролов на время ведения, сводка поездки. Десктоп и мобильный, светлая и тёмная темы. */

body.nav-active .panel, body.nav-active .map-controls, body.nav-active .traffic-badge, body.nav-active .ruler-panel, body.nav-active .maplibregl-ctrl-bottom-left { display: none !important; }
body.nav-active .toasts { left: 12px; right: 12px; top: auto; bottom: 120px; }
.route-marker.nav-hidden { display: none; }

.nav-hud { position: absolute; inset: 0; z-index: 7; pointer-events: none; --nav-bg: rgba(255, 255, 255, .96); --nav-text: #0F172A; --nav-muted: #64748B; --nav-border: rgba(15, 23, 42, .08); }
html[data-theme="dark"] .nav-hud { --nav-bg: rgba(17, 26, 46, .96); --nav-text: #E5E9F2; --nav-muted: #94A3B8; --nav-border: rgba(255, 255, 255, .08); }
.nav-hud > * { pointer-events: auto; }

/* верхняя плашка */
.nav-top { position: absolute; top: 12px; left: 12px; width: 420px; max-width: calc(100% - 24px); display: flex; flex-direction: column; gap: 6px; }
.nav-primary { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--blue); color: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); }
.nav-man-ico { width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.nav-man-ico svg { width: 60px; height: 60px; stroke-width: 2.2; }
.nav-primary-body { flex: 1; min-width: 0; }
.nav-dist { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.nav-primary-text { font-size: 16px; font-weight: 600; line-height: 1.3; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-street { font-size: 13px; opacity: .85; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-street:empty { display: none; }
.nav-next { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: var(--nav-bg); color: var(--nav-text); box-shadow: var(--shadow-sm); font-size: 13.5px; align-self: flex-start; max-width: 100%; }
.nav-next-label { color: var(--nav-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.nav-next-ico { width: 22px; height: 22px; color: var(--blue); flex: none; }
.nav-next-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-lanes { display: flex; justify-content: center; gap: 4px; padding: 6px 10px; border-radius: 12px; background: var(--nav-bg); box-shadow: var(--shadow-sm); align-self: flex-start; }
.nav-lane { display: flex; gap: 1px; padding: 4px 6px; border-radius: 8px; color: var(--nav-muted); opacity: .45; border-right: 1px dashed var(--nav-border); }
.nav-lane:last-child { border-right: 0; }
.nav-lane.on { color: var(--blue); opacity: 1; background: rgba(45, 108, 223, .1); }
.nav-lane .ico { width: 26px; height: 26px; }
.nav-hud.rerouting .nav-primary { background: #475569; }

/* нижняя панель */
.nav-bottom { position: absolute; left: 12px; right: 12px; bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px 10px 18px; border-radius: 18px; background: var(--nav-bg); color: var(--nav-text); box-shadow: var(--shadow); border: 1px solid var(--nav-border); backdrop-filter: blur(6px); }
.nav-stats { display: flex; align-items: center; gap: 22px; min-width: 0; flex: 1; }
.nav-stat { display: flex; flex-direction: column; min-width: 0; }
.nav-stat b { font-size: 22px; font-weight: 800; line-height: 1.1; letter-spacing: -.01em; white-space: nowrap; }
.nav-stat span { font-size: 12px; color: var(--nav-muted); white-space: nowrap; }
.nav-speedbox b { color: var(--blue); }
.nav-limit { width: 46px; height: 46px; border-radius: 50%; background: #fff; border: 5px solid #DC2626; color: #0F172A; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.nav-limit.over { animation: nav-blink 1s infinite; }
@keyframes nav-blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .6); } 50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } }
.nav-actions { display: flex; gap: 6px; flex: none; }
.nav-btn { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: var(--nav-text); background: transparent; transition: background .15s; }
.nav-btn:hover { background: var(--hover); }
.nav-btn .ico { width: 24px; height: 24px; }
.nav-btn.active { color: var(--blue); background: rgba(45, 108, 223, .12); }
.nav-btn.muted { color: var(--red); }
.nav-btn.nav-close { background: rgba(220, 38, 38, .1); color: var(--red); }
.nav-btn.nav-close:hover { background: rgba(220, 38, 38, .2); }
.nav-follow { position: absolute; right: 16px; bottom: 96px; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px; border-radius: 20px; background: var(--blue); color: #fff; font-weight: 700; box-shadow: var(--shadow-sm); }
.nav-follow .ico { width: 20px; height: 20px; }
.nav-sim { position: absolute; top: 12px; right: 12px; padding: 4px 10px; border-radius: 8px; background: #F59E0B; color: #1F2937; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; box-shadow: var(--shadow-sm); }

/* сводка поездки */
.nav-summary-wrap { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.nav-sum-dest { font-size: 15px; font-weight: 600; }
.nav-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nav-sum-row { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; background: var(--input-bg); }
.nav-sum-row b { font-size: 20px; font-weight: 800; }
.nav-sum-row span { font-size: 12.5px; color: var(--muted); }

@media (max-width: 899px) {
  .nav-top { top: calc(8px + env(safe-area-inset-top, 0px)); left: 8px; right: 8px; width: auto; max-width: none; }
  .nav-primary { padding: 12px 14px; gap: 12px; }
  .nav-man-ico { width: 56px; height: 56px; }
  .nav-man-ico svg { width: 52px; height: 52px; }
  .nav-dist { font-size: 24px; }
  .nav-primary-text { font-size: 15px; }
  .nav-next { align-self: stretch; }
  .nav-lanes { align-self: center; }
  .nav-bottom { left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 10px 8px 10px 14px; border-radius: 18px; flex-wrap: wrap; }
  .nav-stats { gap: 14px; width: 100%; justify-content: space-between; }
  .nav-stat b { font-size: 20px; }
  .nav-actions { width: 100%; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--nav-border); margin-top: 6px; }
  .nav-btn { width: 52px; height: 44px; }
  .nav-follow { bottom: 150px; right: 12px; }
  .nav-sim { top: auto; bottom: 150px; left: 12px; right: auto; }
  body.nav-active .toasts { bottom: 160px; top: auto; }
}
@media (max-width: 380px) {
  .nav-stats { gap: 10px; }
  .nav-stat b { font-size: 18px; }
  .nav-limit { width: 40px; height: 40px; font-size: 14px; }
}
