:root {
  color-scheme: dark;
  --bg: #070707;
  --panel: rgba(10, 10, 10, 0.95);
  --panel-soft: rgba(15, 15, 15, 0.93);
  --panel-solid: #101010;
  --text: #f4faf8;
  --muted: #a6bbb4;
  --accent: #ff8a00;
  --accent-strong: #e96f00;
  --amber: #ff9d1c;
  --danger: #ff6868;
  --border: rgba(255, 255, 255, 0.12);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { position: relative; width: 100%; height: 100dvh; min-height: 100%; overflow: hidden; background: var(--bg); }
#map { position: absolute; inset: 0; background: radial-gradient(circle at 50% 40%, rgba(255, 138, 0, 0.13), transparent 35%), #15120f; }
.maplibregl-ctrl-attrib { margin-bottom: calc(190px + var(--safe-bottom)) !important; font-size: 10px; border-radius: 8px 0 0 0; }
.maplibregl-ctrl-logo { margin-bottom: calc(190px + var(--safe-bottom)) !important; }

.top-panel {
  position: absolute; top: calc(12px + var(--safe-top)); left: 12px; right: 12px; min-height: 64px;
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 19px; background: var(--panel); backdrop-filter: blur(16px); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 2px solid var(--amber); border-radius: 13px; color: var(--amber); font-weight: 800; transform: rotate(45deg); }
.brand-mark span { transform: rotate(-45deg); }
.brand-copy { min-width: 0; }
.top-panel h1 { margin: 1px 0 0; font-size: 19px; line-height: 1.1; }
.eyebrow, .label, .privacy-note, .status-card p, .search-help { margin: 0; color: var(--muted); }
.eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; }
.stage-badge { margin-left: auto; padding: 7px 9px; border-radius: 999px; color: var(--accent); background: rgba(255, 138, 0, 0.12); border: 1px solid rgba(255, 138, 0, 0.3); font-size: 11px; white-space: nowrap; }

.destination-panel {
  position: absolute; z-index: 3; top: calc(88px + var(--safe-top)); left: 12px; right: 72px; max-width: 470px;
  padding: 14px; border: 1px solid var(--border); border-radius: 21px; background: var(--panel);
  backdrop-filter: blur(18px); box-shadow: 0 16px 36px rgba(0,0,0,.30); transition: transform .2s ease, opacity .2s ease;
}
.destination-heading { display: flex; align-items: flex-start; gap: 10px; }
.destination-heading > div { min-width: 0; }
.destination-panel h2 { margin: 3px 0 12px; font-size: 18px; line-height: 1.2; }
.icon-button { border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.07); cursor: pointer; }
.panel-toggle { width: 34px; height: 34px; margin-left: auto; flex: 0 0 auto; border-radius: 11px; font-size: 19px; }
.destination-panel.collapsed { padding-bottom: 10px; }
.destination-panel.collapsed h2 { margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.destination-panel.collapsed #destinationPanelBody { display: none; }
.destination-panel.collapsed .panel-toggle { transform: rotate(180deg); }

.search-box { min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 14px; border: 1px solid rgba(255,255,255,.17); border-radius: 16px; background: rgba(255,255,255,.08); }
.search-box:focus-within { border-color: rgba(255,138,0,.72); box-shadow: 0 0 0 3px rgba(255,138,0,.14); }
.search-icon { color: var(--accent); font-size: 26px; line-height: 1; transform: rotate(-15deg); }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
.search-box input::placeholder { color: #a8b9b3; }
.clear-button { width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.07); cursor: pointer; font-size: 20px; }
.search-help { margin: 7px 3px 11px; font-size: 10px; line-height: 1.35; }

.current-location-button, .quick-button { border: 1px solid var(--border); color: var(--text); background: rgba(255,255,255,.055); cursor: pointer; }
.current-location-button { width: 100%; min-height: 56px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 15px; text-align: left; }
.current-location-button:hover, .quick-button:hover { background: rgba(255,255,255,.09); }
.current-location-button:active, .quick-button:active { transform: scale(.985); }
.quick-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: var(--accent); background: rgba(255,138,0,.12); font-size: 20px; }
.current-location-button strong, .quick-button strong { display: block; font-size: 14px; }
.current-location-button small, .quick-button small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.chevron { color: var(--muted); font-size: 24px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 9px; }
.quick-button { min-height: 64px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 8px; padding: 9px; border-radius: 15px; text-align: left; }

.status-card { position: absolute; top: calc(94px + var(--safe-top)); right: 72px; display: none; align-items: center; gap: 10px; max-width: 390px; padding: 10px 12px; border-radius: 15px; border: 1px solid var(--border); background: var(--panel-soft); backdrop-filter: blur(12px); }
.status-card strong { font-size: 14px; }
.status-card p { margin-top: 2px; font-size: 12px; }
.status-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(255,181,71,.13); }
.status-dot.active { background: var(--accent); box-shadow: 0 0 0 5px rgba(39,211,162,.13); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 5px rgba(255,104,104,.13); }

.map-actions { position: absolute; top: calc(88px + var(--safe-top)); right: 12px; display: flex; flex-direction: column; gap: 9px; }
.round-button { width: 48px; height: 48px; border: 1px solid var(--border); border-radius: 16px; color: var(--text); background: var(--panel); backdrop-filter: blur(12px); font-size: 25px; cursor: pointer; box-shadow: 0 7px 20px rgba(0,0,0,.22); }
.round-button:active { transform: scale(.96); }
.compass-button { color: var(--amber); font-size: 16px; font-weight: 800; }

.bottom-panel { position: absolute; left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom)); padding: 15px; border: 1px solid var(--border); border-radius: 22px; background: var(--panel); backdrop-filter: blur(18px); box-shadow: 0 -10px 35px rgba(0,0,0,.25); }
.location-readout { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.coordinates { margin: 3px 0 0; font-size: 16px; font-weight: 700; }
.accuracy { padding: 7px 9px; border-radius: 11px; background: rgba(255,255,255,.07); color: var(--muted); font-size: 12px; white-space: nowrap; }
.primary-button { width: 100%; min-height: 54px; border: 0; border-radius: 16px; color: #17100a; background: linear-gradient(180deg, var(--accent), var(--accent-strong)); font-weight: 800; font-size: 17px; cursor: pointer; box-shadow: 0 10px 24px rgba(255,138,0,.24); }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: not-allowed; opacity: .72; }
.location-icon { margin-right: 7px; font-size: 22px; vertical-align: -1px; }
.privacy-note { margin-top: 9px; text-align: center; font-size: 11px; }

.permission-help, .noscript-message { position: absolute; z-index: 10; left: 14px; right: 14px; top: 50%; transform: translateY(-50%); padding: 18px; border: 1px solid rgba(255,104,104,.35); border-radius: 18px; color: var(--text); background: rgba(42,13,13,.96); text-align: center; }
.permission-help button { width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 12px; font-weight: 700; color: #2a0d0d; background: #ffb0b0; }
.toast { position: absolute; z-index: 20; left: 50%; bottom: calc(194px + var(--safe-bottom)); transform: translateX(-50%); width: min(90%, 420px); padding: 11px 14px; border: 1px solid rgba(39,211,162,.28); border-radius: 14px; color: var(--text); background: rgba(7,21,18,.96); text-align: center; font-size: 13px; box-shadow: 0 12px 28px rgba(0,0,0,.3); }
.user-location-marker { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.user-marker-core { position: absolute; inset: 4px; border: 5px solid #111; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,.95), 0 0 0 10px rgba(255,138,0,.22), 0 5px 14px rgba(0,0,0,.48); }
.user-heading-arrow { position: absolute; z-index: 2; left: 50%; top: -20px; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 23px solid var(--accent); filter: drop-shadow(0 2px 0 #111) drop-shadow(0 4px 5px rgba(0,0,0,.45)); transform: translateX(-50%) rotate(0deg); transform-origin: 50% 37px; transition: transform .28s linear; }

@media (max-height: 700px) {
  .destination-panel { max-height: calc(100dvh - 285px); overflow-y: auto; }
  .destination-panel h2 { font-size: 16px; }
  .search-help { display: none; }
  .quick-button { min-height: 56px; }
}

@media (min-width: 720px) {
  .top-panel { max-width: 470px; }
  .destination-panel { top: calc(92px + var(--safe-top)); right: auto; width: 470px; }
  .map-actions { top: calc(92px + var(--safe-top)); }
  .bottom-panel { left: 18px; right: auto; width: 420px; bottom: 18px; }
  .status-card { display: flex; left: 500px; right: auto; top: calc(12px + var(--safe-top)); }
  .maplibregl-ctrl-attrib, .maplibregl-ctrl-logo { margin-bottom: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Stage 3 route planning */
.search-wrap { position: relative; }
.search-results { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: 260px; overflow-y: auto; padding: 6px; border: 1px solid var(--border); border-radius: 15px; background: #101010; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.search-result { width: 100%; display: grid; grid-template-columns: 30px 1fr; gap: 9px; padding: 10px; border: 0; border-radius: 11px; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus { background: rgba(255,255,255,.08); outline: none; }
.search-result span { color: var(--accent); }
.search-result strong, .search-result small { display: block; }
.search-result strong { font-size: 13px; }
.search-result small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.search-message { padding: 12px; color: var(--muted); font-size: 12px; text-align: center; }
.selected-destination { display: grid; grid-template-columns: 22px 1fr 34px; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 11px; border: 1px solid rgba(39,211,162,.28); border-radius: 14px; background: rgba(39,211,162,.09); }
.destination-pin { color: var(--amber); }
.selected-destination small, .selected-destination strong { display: block; }
.selected-destination small { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.selected-destination strong { margin-top: 2px; font-size: 13px; }
.selected-destination button { width: 32px; height: 32px; border: 0; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.07); cursor: pointer; }
.route-summary { display: grid; grid-template-columns: 1fr 1fr auto; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.route-summary strong { display: block; margin-top: 3px; font-size: 18px; }
.secondary-button { min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.07); cursor: pointer; }
.text-button { width: 100%; min-height: 42px; margin-top: 7px; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: rgba(255,255,255,.055); cursor: pointer; }
.destination-marker { width: 24px; height: 24px; border: 4px solid white; border-radius: 50% 50% 50% 0; background: var(--amber); box-shadow: 0 4px 12px rgba(0,0,0,.4); transform: rotate(-45deg); }
.destination-marker::after { content: ''; position: absolute; width: 6px; height: 6px; top: 5px; left: 5px; border-radius: 50%; background: #3a2100; }
@media (max-width: 520px) { .route-summary { grid-template-columns: 1fr 1fr; } .route-summary .secondary-button { grid-column: 1 / -1; } }

/* Stage 3.1 mobile layout correction */
@media (max-width: 719px) {
  .top-panel {
    top: calc(6px + var(--safe-top));
    left: 7px;
    right: 7px;
    min-height: 52px;
    gap: 9px;
    padding: 6px 9px;
    border-radius: 15px;
  }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
  .top-panel h1 { font-size: 16px; }
  .top-panel .eyebrow { font-size: 8px; }
  .stage-badge { padding: 5px 7px; font-size: 9px; }

  .destination-panel {
    top: calc(65px + var(--safe-top));
    left: 7px;
    right: 61px;
    width: auto;
    max-width: none;
    max-height: min(46dvh, 390px);
    overflow-y: auto;
    padding: 10px;
    border-radius: 16px;
  }
  .destination-heading { align-items: center; }
  .destination-panel h2 { margin: 1px 0 8px; font-size: 15px; }
  .destination-panel .eyebrow { display: none; }
  .panel-toggle { width: 31px; height: 31px; border-radius: 9px; }
  .search-box { min-height: 45px; border-radius: 13px; }
  .search-help { display: none; }
  .current-location-button { min-height: 48px; margin-top: 8px; }
  .quick-grid { gap: 6px; margin-top: 7px; }
  .quick-button { min-height: 48px; padding: 7px; border-radius: 12px; }
  .quick-button small { display: none; }
  .quick-icon { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; }
  .selected-destination { margin-top: 7px; padding: 8px 9px; }
  .search-results { max-height: 210px; }

  .map-actions {
    top: calc(65px + var(--safe-top));
    right: 7px;
    gap: 7px;
  }
  .round-button { width: 45px; height: 45px; border-radius: 14px; }

  .bottom-panel {
    left: 7px;
    right: 7px;
    bottom: calc(7px + var(--safe-bottom));
    padding: 10px;
    border-radius: 17px;
  }
  .location-readout { margin-bottom: 8px; }
  .coordinates { font-size: 13px; }
  .accuracy { padding: 5px 7px; font-size: 10px; }
  .primary-button { min-height: 47px; border-radius: 13px; font-size: 15px; }
  .text-button { min-height: 37px; margin-top: 5px; }
  .privacy-note { display: none; }
  .route-summary { gap: 7px; margin-bottom: 8px; padding-bottom: 8px; }
  .route-summary strong { font-size: 15px; }
  .route-summary .secondary-button { min-height: 34px; }

  .toast { bottom: calc(150px + var(--safe-bottom)); }
  .maplibregl-ctrl-attrib, .maplibregl-ctrl-logo {
    margin-bottom: calc(148px + var(--safe-bottom)) !important;
  }
}

@media (max-width: 380px), (max-height: 660px) and (max-width: 719px) {
  .destination-panel { max-height: 39dvh; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick-button { display: flex; flex-direction: column; justify-content: center; gap: 3px; text-align: center; }
  .quick-button strong { font-size: 10px; }
  .quick-button .quick-icon { width: 27px; height: 27px; margin: 0 auto; }
  .current-location-button { grid-template-columns: 30px 1fr auto; }
}

/* Stage 3.5 — original Adventure Builder journey flow */
.journey-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; }
.save-button { min-height: 54px; border: 1px solid rgba(255,181,71,.38); border-radius: 16px; color: var(--text); background: rgba(255,181,71,.11); font-weight: 750; cursor: pointer; }
.save-button:active { transform: translateY(1px); }
.save-button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 719px) {
  .journey-actions { grid-template-columns: 1fr 1fr; gap: 6px; }
  .save-button { min-height: 47px; border-radius: 13px; font-size: 13px; }
}
@media (max-width: 370px) {
  .journey-actions { grid-template-columns: 1fr; }
}

/* Stage 4.1 — live navigation and voice */
.navigation-banner { position:absolute; z-index:7; top:calc(88px + var(--safe-top)); left:50%; transform:translateX(-50%); width:min(620px, calc(100% - 150px)); min-height:82px; display:grid; grid-template-columns:64px 1fr 46px; align-items:center; gap:12px; padding:12px 14px; border:1px solid rgba(39,211,162,.38); border-radius:20px; background:rgba(9,9,9,.97); box-shadow:0 14px 36px rgba(0,0,0,.38); }
.navigation-banner[hidden] { display:none; }
.turn-arrow { width:58px; height:58px; display:grid; place-items:center; border-radius:17px; color:#03100c; background:var(--accent); font-size:36px; font-weight:900; }
.turn-copy { min-width:0; }
.turn-copy small,.turn-copy strong,.turn-copy span { display:block; }
.turn-copy small { color:var(--amber); font-size:12px; font-weight:750; }
.turn-copy strong { margin-top:2px; font-size:20px; line-height:1.12; }
.turn-copy span { margin-top:3px; color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.voice-icon-button { width:44px; height:44px; border:1px solid var(--border); border-radius:14px; color:var(--text); background:rgba(255,255,255,.07); cursor:pointer; }
.navigation-actions { display:grid; grid-template-columns:1.4fr .8fr auto; gap:8px; margin-top:8px; }
.voice-toggle-button,.end-button { min-height:54px; padding:0 13px; border-radius:16px; font-weight:750; cursor:pointer; }
.voice-toggle-button { border:1px solid rgba(39,211,162,.32); color:var(--text); background:rgba(39,211,162,.1); }
.end-button { border:1px solid rgba(255,104,104,.42); color:#ffd5d5; background:rgba(255,104,104,.13); }
.app-shell.navigation-active .destination-panel,.app-shell.navigation-active .status-card { display:none; }
.app-shell.navigation-active .bottom-panel { max-width:520px; }
.app-shell.navigation-active .journey-actions,.app-shell.navigation-active .text-button { display:none; }
@media (max-width:719px) {
  .navigation-banner { top:calc(65px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; min-height:70px; grid-template-columns:52px 1fr 40px; gap:9px; padding:9px 10px; border-radius:16px; }
  .turn-arrow { width:49px; height:49px; border-radius:14px; font-size:30px; }
  .turn-copy strong { font-size:16px; }
  .navigation-actions { grid-template-columns:1fr 1fr; gap:6px; }
  .navigation-actions .primary-button { grid-column:1/-1; }
  .voice-toggle-button,.end-button { min-height:45px; border-radius:13px; font-size:12px; }
  .app-shell.navigation-active .map-actions { top:calc(145px + var(--safe-top)); }
}

/* Stage 5.1 — proper map views and saved journeys */
.map-view-button { font-size: 22px; }
.map-view-menu { position: absolute; right: 56px; top: 0; width: 190px; padding: 10px; border: 1px solid var(--border); border-radius: 15px; background: rgba(9,9,9,.98); box-shadow: 0 14px 34px rgba(0,0,0,.4); }
.map-view-menu p { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.map-view-option { width: 100%; min-height: 40px; margin-top: 5px; padding: 0 10px; border: 1px solid transparent; border-radius: 11px; color: var(--text); background: rgba(255,255,255,.055); text-align: left; cursor: pointer; }
.map-view-option.active { border-color: rgba(39,211,162,.42); background: rgba(39,211,162,.14); }
.map-view-menu small { display: block; margin-top: 8px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.saved-journeys-backdrop { position: absolute; z-index: 19; inset: 0; background: rgba(0,0,0,.55); }
.saved-journeys-panel { position: absolute; z-index: 20; top: 50%; left: 50%; width: min(560px, calc(100% - 28px)); max-height: min(76dvh, 620px); transform: translate(-50%, -50%); overflow: hidden; border: 1px solid var(--border); border-radius: 22px; background: #080808; box-shadow: 0 24px 70px rgba(0,0,0,.6); }
.saved-journeys-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.saved-journeys-header h2 { margin: 2px 0 0; font-size: 20px; }
.saved-journeys-list { max-height: calc(min(76dvh, 620px) - 82px); overflow-y: auto; padding: 12px; }
.saved-empty { padding: 32px 16px; color: var(--muted); text-align: center; }
.saved-journey-card { padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.045); }
.saved-journey-card + .saved-journey-card { margin-top: 9px; }
.saved-journey-card strong, .saved-journey-card small { display: block; }
.saved-journey-card small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.saved-journey-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 7px; margin-top: 11px; }
.saved-journey-actions button { min-height: 39px; padding: 0 10px; border-radius: 11px; font-weight: 750; cursor: pointer; }
.saved-open { border: 1px solid rgba(39,211,162,.35); color: var(--text); background: rgba(39,211,162,.1); }
.saved-go { border: 0; color: #03100c; background: var(--accent); }
.saved-delete { border: 1px solid rgba(255,104,104,.4); color: #ffd5d5; background: rgba(255,104,104,.11); }
@media (max-width:719px) {
  .map-view-menu { right: 52px; width: 170px; }
  .saved-journey-actions { grid-template-columns: 1fr 1fr; }
  .saved-delete { grid-column: 1 / -1; }
}

/* Stage 5.2 — route visibility, orange branding and mobile overlap polish */
.map-actions { z-index: 6; transition: opacity .18s ease, transform .18s ease; }
.app-shell.search-active .map-actions { opacity: 0; pointer-events: none; transform: translateX(12px); }
.map-view-button::after { content: 'Layers'; position: absolute; right: 56px; padding: 5px 8px; border-radius: 9px; color: var(--text); background: rgba(10,10,10,.88); font-size: 10px; font-weight: 800; letter-spacing: .03em; opacity: 0; pointer-events: none; transition: opacity .16s; }
.map-view-button:hover::after, .map-view-button:focus-visible::after { opacity: 1; }
.turn-arrow { color: #17100a; background: var(--accent); box-shadow: inset 0 0 0 3px rgba(0,0,0,.72), 0 8px 18px rgba(0,0,0,.25); }
.navigation-banner { border-color: rgba(255,138,0,.48); background: rgba(14,12,10,.96); }
.map-view-option.active { border-color: rgba(255,138,0,.5); background: rgba(255,138,0,.16); }
@media (max-width:719px) {
  .destination-panel:not(.collapsed) { right: 7px; max-height: min(50dvh, 410px); }
  .destination-panel:not(.collapsed) + .navigation-banner { pointer-events: none; }
  .map-view-menu { position: fixed; top: calc(64px + var(--safe-top)); right: 7px; width: min(210px, calc(100vw - 14px)); }
  .navigation-banner { grid-template-columns: 58px 1fr 42px; }
  .turn-arrow { width: 55px; height: 55px; font-size: 34px; }
  .search-results { max-height: min(34dvh, 250px); }
}


/* Stage 6.0 — safety-first Scenic Route beta and final Stage 5.2 polish */
.route-mode { margin: 9px 0 0; padding: 0; border: 0; }
.route-mode legend { padding: 0; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.route-mode-options { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 6px; }
.route-mode-button { min-height: 42px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.045); font-weight: 760; cursor: pointer; }
.route-mode-button small { margin-left: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.route-mode-button.active { border-color: rgba(255,138,0,.56); background: rgba(255,138,0,.14); box-shadow: inset 0 0 0 1px rgba(255,138,0,.08); }
#routeModeHelp { margin: 6px 1px 0; color: var(--muted); font-size: 9px; line-height: 1.35; }
.app-shell.scenic-mode .stage-badge::before { content: '⌁ '; }
.app-shell.navigation-active .route-summary .secondary-button { display: none; }
.app-shell.navigation-active .route-summary { grid-template-columns: 1fr 1fr; }
/* Pop-up surfaces are neutral black; orange is reserved for active journey controls. */
.destination-panel, .bottom-panel, .top-panel, .navigation-banner, .status-card,
.map-view-menu, .saved-journeys-panel, .search-results, .toast, .permission-help { background-color: rgba(10,10,10,.96); }
.current-location-button, .quick-button, .selected-destination, .saved-journey-card { background-color: rgba(255,255,255,.045); }
@media (max-width:719px) {
  .route-mode { margin-top: 7px; }
  .route-mode-button { min-height: 38px; font-size: 12px; }
  #routeModeHelp { display: none; }
}


/* Stage 6.1 — local developer build tracker */
.build-dashboard-button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(255,138,0,.42); border-radius: 11px; color: var(--text); background: rgba(255,138,0,.11); font-size: 11px; font-weight: 800; cursor: pointer; }
.build-dashboard-button span { margin-right: 4px; color: var(--accent); }
.build-dashboard-backdrop { position: absolute; z-index: 29; inset: 0; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
.build-dashboard-panel { position: absolute; z-index: 30; top: 0; right: 0; width: min(430px, 94vw); height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; border-left: 1px solid rgba(255,138,0,.28); background: #090909; box-shadow: -22px 0 60px rgba(0,0,0,.55); animation: buildPanelIn .2s ease-out; }
.build-dashboard-panel[hidden], .build-dashboard-backdrop[hidden] { display: none; }
@keyframes buildPanelIn { from { transform: translateX(28px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.build-dashboard-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(16px + var(--safe-top)) 16px 15px; border-bottom: 1px solid var(--border); background: #0c0c0c; }
.build-dashboard-header h2 { margin: 2px 0 0; font-size: 21px; }
.build-dashboard-body { overflow-y: auto; padding: 14px 14px 28px; }
.build-overview { display: grid; grid-template-columns: 1fr 86px; align-items: center; gap: 14px; padding: 15px; border: 1px solid rgba(255,138,0,.28); border-radius: 18px; background: linear-gradient(135deg, rgba(255,138,0,.13), rgba(255,255,255,.025)); }
.build-overview small, .build-overview strong, .build-overview span { display: block; }
.build-overview small { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.build-overview strong { margin-top: 4px; font-size: 24px; }
.build-overview span { margin-top: 3px; color: var(--accent); font-size: 12px; font-weight: 750; }
.build-progress-ring { width: 76px; height: 76px; display: grid; place-content: center; text-align: center; border-radius: 50%; background: radial-gradient(circle at center, #0b0b0b 55%, transparent 57%), conic-gradient(var(--accent) 0 95%, rgba(255,255,255,.1) 95% 100%); }
.build-progress-ring strong { margin: 0; font-size: 18px; }
.build-progress-ring span { margin: 0; color: var(--muted); font-size: 9px; }
.build-section { margin-top: 17px; }
.build-section-label { margin: 0 0 8px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.build-current-card { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding: 13px; border: 1px solid rgba(255,138,0,.42); border-radius: 15px; background: rgba(255,138,0,.1); }
.build-status-icon { color: var(--accent); font-size: 17px; }
.build-current-card strong, .build-current-card small { display: block; }
.build-current-card small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.build-checklist, .build-roadmap { margin: 0; padding: 0; list-style: none; }
.build-checklist li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 10px 5px; border-bottom: 1px solid rgba(255,255,255,.075); }
.build-checklist li > span { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: #111; background: var(--accent); font-weight: 900; }
.build-checklist strong, .build-checklist small, .build-roadmap strong, .build-roadmap small { display: block; }
.build-checklist small, .build-roadmap small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.build-roadmap li { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.028); }
.build-roadmap li + li { margin-top: 7px; }
.build-roadmap li > span { display: grid; place-items: center; min-height: 38px; border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.055); font-size: 11px; font-weight: 850; }
.build-roadmap li.next { border-color: rgba(255,138,0,.4); }
.build-roadmap li.next > span { color: #111; background: var(--accent); }
.build-empty-state, .build-safety-note { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 13px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 11px; line-height: 1.45; }
.build-safety-note strong { color: var(--text); }
.build-dashboard-footer { padding: 11px 15px calc(11px + var(--safe-bottom)); border-top: 1px solid var(--border); color: var(--muted); background: #0c0c0c; font-size: 9px; text-align: center; }
body.build-dashboard-open { overflow: hidden; }
@media (max-width:719px) {
  .build-dashboard-button { min-width: 42px; padding: 0 9px; font-size: 0; }
  .build-dashboard-button span { margin: 0; font-size: 17px; }
  .build-dashboard-panel { width: min(390px, 100vw); }
  .build-dashboard-header { padding-left: 13px; padding-right: 13px; }
}


/* Stage 6.1 private developer access */
.build-dashboard-button[hidden] { display: none !important; }
.stage-badge { user-select: none; -webkit-user-select: none; }
.build-dashboard-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.build-dashboard-footer button { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 1px solid rgba(255,138,0,.38); border-radius: 10px; background: rgba(255,138,0,.10); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
@media (max-width: 420px) { .build-dashboard-footer { align-items: stretch; flex-direction: column; } .build-dashboard-footer button { width: 100%; } }

/* Stage 6.2 — GPS Speed Assistant */
.speed-assistant { position:absolute; z-index:7; top:calc(160px + var(--safe-top)); left:50%; width:min(390px, calc(100% - 24px)); transform:translateX(-50%); display:grid; grid-template-columns:1fr 92px auto; gap:9px; align-items:stretch; }
.speed-assistant[hidden] { display:none; }
.speed-reading { min-height:82px; display:grid; grid-template-columns:1fr auto; grid-template-rows:auto 1fr; align-items:end; padding:10px 14px; border:1px solid var(--border); border-radius:18px; background:rgba(10,10,10,.96); box-shadow:0 12px 30px rgba(0,0,0,.36); }
.speed-reading small { grid-column:1/-1; align-self:start; color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.1em; text-transform:uppercase; }
.speed-reading strong { font-size:42px; line-height:.88; letter-spacing:-.04em; }
.speed-reading span { padding:0 0 3px 5px; color:var(--muted); font-size:12px; font-weight:800; }
.speed-reading.over-limit { border-color:rgba(255,104,104,.85); background:rgba(54,10,10,.96); animation:speedPulse 1.2s ease-in-out infinite; }
.speed-reading.over-limit strong { color:#ff8b8b; }
@keyframes speedPulse { 50% { box-shadow:0 0 0 5px rgba(255,104,104,.12), 0 12px 30px rgba(0,0,0,.36); } }
.speed-limit-sign { width:82px; min-height:82px; justify-self:center; display:grid; place-content:center; text-align:center; border:6px solid #e33232; border-radius:50%; color:#101010; background:#fff; box-shadow:0 12px 30px rgba(0,0,0,.36); }
.speed-limit-sign small { font-size:8px; font-weight:900; line-height:1; text-transform:uppercase; }
.speed-limit-sign strong { font-size:30px; line-height:1; }
.speed-limit-sign.unavailable { border-color:#77817d; color:#5c6662; }
.speed-alert-toggle { min-width:98px; border:1px solid rgba(255,138,0,.42); border-radius:16px; color:var(--text); background:rgba(10,10,10,.96); font-size:11px; font-weight:800; cursor:pointer; }
.speed-alert-toggle[aria-pressed="false"] { border-color:var(--border); color:var(--muted); }
@media (max-width:719px) {
  .speed-assistant { top:calc(145px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; grid-template-columns:1fr 78px 92px; gap:7px; }
  .speed-reading { min-height:70px; padding:9px 12px; border-radius:16px; }
  .speed-reading strong { font-size:36px; }
  .speed-limit-sign { width:70px; min-height:70px; border-width:5px; }
  .speed-limit-sign strong { font-size:26px; }
  .speed-alert-toggle { min-width:0; border-radius:14px; font-size:10px; }
  .app-shell.navigation-active .map-actions { top:calc(225px + var(--safe-top)); }
}

/* Stage 6.3 — Lane Guidance Beta */
.navigation-banner { transition: min-height .25s ease, transform .25s ease, opacity .25s ease; }
.navigation-banner.lane-active { grid-template-rows:auto auto; }
.lane-guidance { grid-column:1 / -1; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px; margin-top:2px; padding:9px 11px; border-top:1px solid rgba(255,255,255,.10); border-radius:0 0 14px 14px; background:rgba(255,255,255,.035); }
.lane-guidance[hidden] { display:none; }
.lane-guidance-label { color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.lane-arrows { display:flex; justify-content:center; gap:6px; }
.lane-arrow { width:42px; height:34px; display:grid; place-items:center; border:1px solid rgba(255,255,255,.16); border-radius:9px; color:#777; background:#171717; font-size:22px; font-weight:900; opacity:.65; }
.lane-arrow.recommended { color:#07120e; border-color:rgba(39,211,162,.7); background:var(--accent); box-shadow:0 0 0 2px rgba(39,211,162,.13), 0 5px 14px rgba(0,0,0,.28); opacity:1; }
.lane-guidance strong { color:#fff; font-size:12px; white-space:nowrap; }
@media (max-width:700px) {
  .navigation-banner.lane-active { min-height:116px; }
  .lane-guidance { grid-template-columns:1fr auto; gap:7px; padding:7px 8px; }
  .lane-guidance-label { display:none; }
  .lane-arrows { justify-content:flex-start; }
  .lane-arrow { width:35px; height:30px; font-size:19px; }
  .lane-guidance strong { font-size:11px; }
}

/* Stage 6.4 — Traffic Awareness Beta */
.traffic-assistant { position:absolute; z-index:7; top:calc(252px + var(--safe-top)); left:50%; width:min(390px, calc(100% - 24px)); transform:translateX(-50%); display:grid; grid-template-columns:1fr auto; gap:8px; }
.traffic-assistant[hidden] { display:none; }
.traffic-status-card { min-height:58px; display:grid; grid-template-columns:14px 1fr; gap:10px; align-items:center; padding:10px 12px; border:1px solid var(--border); border-radius:16px; background:rgba(10,10,10,.96); box-shadow:0 12px 30px rgba(0,0,0,.30); }
.traffic-status-card small,.traffic-status-card strong,.traffic-status-card span { display:block; }
.traffic-status-card small { color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.08em; text-transform:uppercase; }
.traffic-status-card strong { margin-top:2px; font-size:13px; }
.traffic-status-card span { margin-top:2px; color:var(--muted); font-size:10px; }
.traffic-status-dot { width:12px; height:12px; border-radius:50%; background:#27d3a2; box-shadow:0 0 0 5px rgba(39,211,162,.12); }
.traffic-status-dot.moderate { background:#ffb020; box-shadow:0 0 0 5px rgba(255,176,32,.12); }
.traffic-status-dot.heavy { background:#ff6868; box-shadow:0 0 0 5px rgba(255,104,104,.12); }
.traffic-refresh-button { min-width:88px; border:1px solid rgba(255,138,0,.42); border-radius:15px; color:var(--text); background:rgba(10,10,10,.96); font-size:11px; font-weight:800; cursor:pointer; }
.traffic-incident-panel { grid-column:1/-1; display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; padding:10px 12px; border:1px solid rgba(255,176,32,.42); border-radius:15px; background:rgba(48,31,5,.96); }
.traffic-incident-panel[hidden] { display:none; }
.traffic-incident-panel small,.traffic-incident-panel strong,.traffic-incident-panel span { display:block; }
.traffic-incident-panel small { color:#ffd37d; font-size:9px; font-weight:850; text-transform:uppercase; }
.traffic-incident-panel strong { margin-top:2px; font-size:12px; }
.traffic-incident-panel span { margin-top:2px; color:#d9c39b; font-size:10px; }
.traffic-incident-panel button { min-height:38px; padding:0 12px; border:0; border-radius:11px; background:var(--accent); color:#111; font-weight:900; cursor:pointer; }
@media (max-width:719px) {
  .traffic-assistant { top:calc(224px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; }
  .traffic-status-card { min-height:54px; }
  .traffic-refresh-button { min-width:78px; font-size:10px; }
  .app-shell.navigation-active .map-actions { top:calc(325px + var(--safe-top)); }
}

/* Stage 6.5 — Adventure Stops */
.adventure-stops-button { width:100%; min-height:44px; margin:0 0 10px; border:1px solid rgba(255,138,0,.45); border-radius:14px; background:rgba(255,138,0,.10); color:var(--text); font-weight:900; cursor:pointer; }
.adventure-stops { position:absolute; z-index:18; left:50%; bottom:calc(24px + var(--safe-bottom)); width:min(520px, calc(100% - 24px)); max-height:min(72vh, 650px); transform:translateX(-50%); overflow:auto; padding:15px; border:1px solid var(--border); border-radius:22px; background:rgba(8,8,8,.98); box-shadow:0 25px 70px rgba(0,0,0,.55); }
.adventure-stops[hidden] { display:none; }
.adventure-stops-header { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:start; }
.adventure-stops-header small,.adventure-stops-header strong,.adventure-stops-header span { display:block; }
.adventure-stops-header small { color:var(--accent); font-size:9px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.adventure-stops-header strong { margin-top:3px; font-size:20px; }
.adventure-stops-header span { margin-top:3px; color:var(--muted); font-size:11px; }
.adventure-stops-header button { width:36px; height:36px; border:1px solid var(--border); border-radius:50%; background:#171717; color:var(--text); font-size:22px; cursor:pointer; }
.adventure-stop-categories { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px; }
.adventure-stop-categories button { min-height:58px; padding:8px 5px; border:1px solid var(--border); border-radius:14px; background:#141414; color:var(--text); font-size:19px; cursor:pointer; }
.adventure-stop-categories button span { display:block; margin-top:3px; font-size:10px; font-weight:850; }
.adventure-stop-categories button.active { border-color:var(--accent); background:rgba(255,138,0,.14); }
.adventure-stop-scope { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:10px; padding:4px; border-radius:13px; background:#101010; }
.adventure-stop-scope button { min-height:36px; border:0; border-radius:10px; background:transparent; color:var(--muted); font-weight:850; cursor:pointer; }
.adventure-stop-scope button.active { background:#252525; color:var(--text); }
.adventure-stop-scope button:disabled { opacity:.4; cursor:not-allowed; }
.adventure-stops-status { margin:12px 2px 8px; color:var(--muted); font-size:11px; font-weight:700; }
.adventure-stops-results { display:grid; gap:7px; }
.adventure-stop-result { display:grid; grid-template-columns:30px 1fr auto; gap:9px; align-items:center; padding:9px; border:1px solid var(--border); border-radius:14px; background:#121212; }
.adventure-stop-number,.adventure-stop-marker { display:grid; place-items:center; border-radius:50%; background:var(--accent); color:#111; font-weight:950; }
.adventure-stop-number { width:27px; height:27px; font-size:11px; }
.adventure-stop-result strong,.adventure-stop-result small,.adventure-stop-result div>span { display:block; }
.adventure-stop-result strong { font-size:12px; }
.adventure-stop-result small { margin-top:2px; color:var(--muted); font-size:9px; }
.adventure-stop-result div>span { margin-top:3px; color:#ffbd6d; font-size:9px; font-weight:800; }
.adventure-stop-result button { min-height:35px; padding:0 10px; border:0; border-radius:10px; background:var(--accent); color:#111; font-size:10px; font-weight:900; cursor:pointer; }
.adventure-stop-message { padding:22px 10px; border:1px dashed var(--border); border-radius:14px; color:var(--muted); text-align:center; font-size:11px; }
.adventure-stops-note { margin:10px 2px 0; color:var(--muted); font-size:9px; line-height:1.4; }
.adventure-stop-marker { width:28px; height:28px; border:2px solid #fff; box-shadow:0 5px 15px rgba(0,0,0,.45); font-size:10px; }
@media (max-width:719px) {
  .adventure-stops { left:7px; right:7px; bottom:calc(7px + var(--safe-bottom)); width:auto; max-height:76vh; transform:none; }
  .adventure-stop-result { grid-template-columns:28px 1fr; }
  .adventure-stop-result button { grid-column:2; justify-self:start; }
}


/* Stage 6.6 — Ferry & Eurotunnel Integration */
.journey-tools { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:10px; }
.journey-tools .adventure-stops-button { margin:0; }
.cross-channel-button { min-height:44px; border:1px solid rgba(63,169,245,.45); border-radius:14px; background:rgba(63,169,245,.10); color:var(--text); font-weight:900; cursor:pointer; }
.cross-channel-panel { position:absolute; z-index:19; left:50%; bottom:calc(24px + var(--safe-bottom)); width:min(560px, calc(100% - 24px)); max-height:min(76vh, 690px); transform:translateX(-50%); overflow:auto; padding:15px; border:1px solid var(--border); border-radius:22px; background:rgba(8,8,8,.985); box-shadow:0 25px 70px rgba(0,0,0,.58); }
.cross-channel-panel[hidden] { display:none; }
.cross-channel-header { display:grid; grid-template-columns:1fr auto; gap:12px; align-items:start; }
.cross-channel-header small,.cross-channel-header strong,.cross-channel-header span { display:block; }
.cross-channel-header small { color:#78c8ff; font-size:9px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.cross-channel-header strong { margin-top:3px; font-size:20px; }
.cross-channel-header span { margin-top:3px; color:var(--muted); font-size:11px; line-height:1.4; }
.cross-channel-header button { width:36px; height:36px; border:1px solid var(--border); border-radius:50%; background:#171717; color:var(--text); font-size:22px; cursor:pointer; }
.cross-channel-journey { margin-top:13px; padding:10px 12px; border:1px solid rgba(63,169,245,.28); border-radius:13px; background:rgba(63,169,245,.08); color:#cceaff; font-size:11px; font-weight:750; line-height:1.45; }
.cross-channel-options { display:grid; gap:8px; margin-top:10px; }
.cross-channel-options article { display:grid; grid-template-columns:38px 1fr auto; gap:10px; align-items:center; padding:11px; border:1px solid var(--border); border-radius:15px; background:#121212; }
.cross-channel-icon { font-size:24px; text-align:center; }
.cross-channel-options strong,.cross-channel-options span,.cross-channel-options small { display:block; }
.cross-channel-options strong { font-size:13px; }
.cross-channel-options span { margin-top:2px; color:#d6d6d6; font-size:10px; }
.cross-channel-options small { margin-top:3px; color:var(--muted); font-size:9px; }
.cross-channel-options button { min-height:36px; padding:0 11px; border:0; border-radius:10px; background:#78c8ff; color:#07121a; font-size:10px; font-weight:950; cursor:pointer; }
.cross-channel-note { margin:11px 2px 0; color:var(--muted); font-size:9px; line-height:1.45; }
@media (max-width:719px) {
  .journey-tools { grid-template-columns:1fr; }
  .cross-channel-panel { left:7px; right:7px; bottom:calc(7px + var(--safe-bottom)); width:auto; max-height:79vh; transform:none; }
  .cross-channel-options article { grid-template-columns:34px 1fr; }
  .cross-channel-options button { grid-column:2; justify-self:start; }
}


/* Stage 6.7 — Final Navigation Polish */
:root { --panel-elevated: rgba(8,8,8,.975); }
button { transition: transform .14s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease; }
button:focus-visible, input:focus-visible { outline:3px solid rgba(255,138,0,.42); outline-offset:2px; }
button:not(:disabled):active { transform:scale(.975); }
.top-panel,.destination-panel,.bottom-panel,.navigation-banner,.speed-assistant,.traffic-assistant { isolation:isolate; }
.stage-badge { font-weight:900; letter-spacing:.02em; box-shadow:inset 0 0 0 1px rgba(255,138,0,.08); }
.build-progress-ring.complete { border-color:rgba(39,211,162,.5); box-shadow:0 0 0 5px rgba(39,211,162,.08); }
.build-progress-ring.complete strong { color:#55e0b8; }
.navigation-banner { background:var(--panel-elevated); box-shadow:0 16px 38px rgba(0,0,0,.38); }
.turn-copy strong { letter-spacing:-.01em; }
.speed-reading,.speed-limit-sign,.traffic-status-card { box-shadow:0 10px 28px rgba(0,0,0,.28); }
.app-shell.navigation-active .journey-tools,
.app-shell.navigation-active .location-readout,
.app-shell.navigation-active .privacy-note { display:none; }
.app-shell.navigation-active .bottom-panel { padding:10px; border-radius:18px; }
.app-shell.navigation-active .navigation-actions { margin:0; }
.app-shell.navigation-active .route-summary { margin-bottom:9px; padding-bottom:9px; }
.navigation-actions button { min-height:46px; }
.adventure-stops,.cross-channel-panel { overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:rgba(255,138,0,.45) transparent; }
@media (max-width:719px) {
  .top-panel .brand-copy .eyebrow { display:none; }
  .top-panel h1 { font-size:17px; }
  .stage-badge { padding:6px 8px; font-size:10px; }
  .app-shell.navigation-active .top-panel { opacity:.96; }
  .app-shell.navigation-active .bottom-panel { left:7px; right:7px; bottom:calc(7px + var(--safe-bottom)); }
  .app-shell.navigation-active .route-summary strong { font-size:16px; }
  .app-shell.navigation-active .maplibregl-ctrl-attrib,
  .app-shell.navigation-active .maplibregl-ctrl-logo { margin-bottom:calc(120px + var(--safe-bottom)) !important; }
}
@media (max-height:660px) and (max-width:719px) {
  .app-shell.navigation-active .traffic-assistant { display:none; }
  .app-shell.navigation-active .map-actions { top:calc(225px + var(--safe-top)); }
}


/* Stage 6.7.1 — separate Journey Planner and Navigation pages */
.app-shell.planner-page { background:radial-gradient(circle at 50% 10%, rgba(255,138,0,.16), transparent 32%), linear-gradient(180deg,#08130f 0%,#070707 52%,#050505 100%); overflow-y:auto; }
.app-shell.planner-page #map { opacity:0; pointer-events:none; }
.app-shell.planner-page .map-actions,
.app-shell.planner-page .navigation-banner,
.app-shell.planner-page .speed-assistant,
.app-shell.planner-page .traffic-assistant { display:none !important; }
.app-shell.planner-page .top-panel { position:fixed; z-index:30; }
.app-shell.planner-page .destination-panel { z-index:20; }
.app-shell.planner-page .bottom-panel { z-index:20; }
.app-shell.navigation-active #map { opacity:1; }
.app-shell.navigation-active .destination-panel { display:none !important; }
.app-shell.navigation-active .journey-actions,
.app-shell.navigation-active .journey-tools { display:none !important; }
.back-planner-button { grid-column:1/-1; min-height:40px; border:1px solid var(--border); border-radius:12px; background:#171717; color:var(--text); font-weight:850; cursor:pointer; }
@media (max-width:719px) {
  .app-shell.planner-page { min-height:100dvh; overflow:hidden; }
  .app-shell.planner-page .destination-panel { top:calc(88px + var(--safe-top)); left:7px; right:7px; max-height:calc(100dvh - 390px); }
  .app-shell.planner-page .bottom-panel { left:7px; right:7px; bottom:calc(7px + var(--safe-bottom)); max-height:285px; overflow:auto; }
  .app-shell.navigation-active .navigation-actions { grid-template-columns:1fr 1fr; }
}


/* Stage 6.8 — Route Simulator */
.journey-actions { grid-template-columns:1.25fr .95fr 1fr; }
.simulate-button { min-height:54px; border:1px solid rgba(118,200,255,.46); border-radius:16px; color:#dff4ff; background:rgba(72,162,224,.15); font-weight:800; cursor:pointer; }
.simulate-button:disabled { opacity:.5; cursor:not-allowed; }
.simulation-panel { position:absolute; z-index:11; left:50%; bottom:142px; width:min(620px,calc(100% - 24px)); transform:translateX(-50%); padding:10px; border:1px solid rgba(118,200,255,.5); border-radius:18px; background:rgba(5,14,20,.97); box-shadow:0 16px 38px rgba(0,0,0,.48); }
.simulation-panel[hidden] { display:none; }
.simulation-warning { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:8px 10px; border-radius:12px; background:rgba(72,162,224,.15); }
.simulation-warning strong { color:#9bdcff; font-size:12px; letter-spacing:.04em; }
.simulation-warning span { color:var(--muted); font-size:10px; }
.simulation-controls { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin-top:8px; }
.simulation-controls button,.simulation-speed button { min-height:38px; border:1px solid var(--border); border-radius:10px; color:var(--text); background:rgba(255,255,255,.055); font-size:11px; font-weight:800; cursor:pointer; }
.simulation-speed { display:grid; grid-template-columns:1fr repeat(3,52px) 52px; align-items:center; gap:6px; margin-top:7px; }
.simulation-speed > span { color:var(--muted); font-size:10px; font-weight:800; text-transform:uppercase; }
.simulation-speed-button.active { border-color:rgba(118,200,255,.65); background:rgba(72,162,224,.24); }
#simulationProgress { color:#9bdcff; text-align:right; font-size:12px; }
.app-shell.simulation-active .stage-badge { border-color:rgba(118,200,255,.6); color:#bde9ff; background:rgba(72,162,224,.16); }
.simulation-marker .user-marker-core { box-shadow:0 0 0 6px rgba(118,200,255,.22),0 0 20px rgba(118,200,255,.8); }
@media (max-width:719px) {
  .journey-actions { grid-template-columns:1fr 1fr; }
  .journey-actions .save-button { grid-column:1/-1; }
  .simulate-button { min-height:47px; border-radius:13px; font-size:13px; }
  .simulation-panel { left:7px; right:7px; bottom:calc(132px + var(--safe-bottom)); width:auto; transform:none; padding:8px; }
  .simulation-warning { align-items:flex-start; flex-direction:column; gap:2px; }
  .simulation-controls { grid-template-columns:1fr 1fr; }
  .simulation-speed { grid-template-columns:1fr repeat(3,44px) 42px; }
}
@media (max-height:700px) and (max-width:719px) {
  .simulation-panel { bottom:calc(120px + var(--safe-bottom)); }
  .simulation-warning span { display:none; }
  .simulation-controls button { min-height:34px; }
}


/* Stage 6.8.1 — Simulator UI, safety and smooth-motion polish */
.simulation-mode-banner {
  position:absolute; z-index:15; top:calc(86px + var(--safe-top)); left:50%; width:min(610px,calc(100% - 28px));
  transform:translateX(-50%); display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:10px;
  min-height:52px; padding:8px 12px; border:1px solid rgba(39,211,162,.72); border-radius:15px;
  background:rgba(5,30,24,.97); box-shadow:0 12px 32px rgba(0,0,0,.42),0 0 0 3px rgba(39,211,162,.08);
}
.simulation-mode-banner[hidden] { display:none; }
.simulation-mode-dot { width:12px; height:12px; border-radius:50%; background:#27d3a2; box-shadow:0 0 0 6px rgba(39,211,162,.15); animation:simulationPulse 1.6s ease-in-out infinite; }
.simulation-mode-banner strong,.simulation-mode-banner small { display:block; }
.simulation-mode-banner strong { color:#75efc9; font-size:13px; letter-spacing:.08em; }
.simulation-mode-banner small { margin-top:2px; color:#d5eee6; font-size:10px; }
.simulation-mode-banner b { padding:6px 9px; border-radius:999px; color:#062219; background:#75efc9; font-size:9px; letter-spacing:.08em; }
@keyframes simulationPulse { 50% { opacity:.5; transform:scale(.82); } }

/* Give every navigation HUD component a dedicated vertical zone. */
.app-shell.navigation-active .navigation-banner { top:calc(150px + var(--safe-top)); }
.app-shell.navigation-active .speed-assistant { top:calc(272px + var(--safe-top)); width:min(610px,calc(100% - 28px)); grid-template-columns:1.1fr 92px auto; }
.app-shell.navigation-active .traffic-assistant { top:calc(366px + var(--safe-top)); width:min(610px,calc(100% - 28px)); }
.app-shell.navigation-active .simulation-panel { bottom:134px; }
.app-shell.simulation-active .navigation-banner { top:calc(150px + var(--safe-top)); }

/* Keep the blue simulator toolbar compact and clearly separated from route cards. */
.app-shell.simulation-active .bottom-panel { bottom:12px; }
.app-shell.simulation-active .simulation-panel { bottom:132px; }

@media (min-width:720px) {
  .app-shell.navigation-active .navigation-banner { left:50%; right:auto; width:min(610px,calc(100% - 520px)); transform:translateX(-8%); }
  .app-shell.navigation-active .speed-assistant,
  .app-shell.navigation-active .traffic-assistant { left:50%; transform:translateX(-8%); width:min(610px,calc(100% - 520px)); }
  .app-shell.navigation-active .simulation-panel { left:50%; transform:translateX(-8%); width:min(610px,calc(100% - 520px)); }
  .app-shell.navigation-active .simulation-mode-banner { left:50%; transform:translateX(-8%); width:min(610px,calc(100% - 520px)); }
}

@media (max-width:719px) {
  .simulation-mode-banner { top:calc(76px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; min-height:48px; padding:7px 10px; }
  .simulation-mode-banner small { font-size:9px; }
  .app-shell.navigation-active .navigation-banner { top:calc(132px + var(--safe-top)); }
  .app-shell.navigation-active .speed-assistant { top:calc(252px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; }
  .app-shell.navigation-active .traffic-assistant { top:calc(334px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; }
  .app-shell.simulation-active .simulation-panel { bottom:calc(128px + var(--safe-bottom)); }
}

@media (max-height:720px) and (max-width:719px) {
  .app-shell.navigation-active .traffic-assistant { display:none; }
  .app-shell.navigation-active .speed-assistant { top:calc(244px + var(--safe-top)); }
  .app-shell.simulation-active .simulation-panel { bottom:calc(116px + var(--safe-bottom)); }
}

/* Stage 6.8.2 — approved shared PC navigation layout */
.hud-info-card {
  min-height:82px; display:grid; align-content:center; padding:10px 13px;
  border:1px solid var(--border); border-radius:16px; background:rgba(10,10,10,.97);
  box-shadow:0 12px 30px rgba(0,0,0,.34); overflow:hidden;
}
.hud-info-card small { color:var(--muted); font-size:9px; font-weight:850; letter-spacing:.09em; text-transform:uppercase; }
.hud-info-card strong { margin-top:4px; font-size:24px; line-height:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hud-info-card span { margin-top:4px; color:var(--muted); font-size:9px; }

@media (min-width:900px) {
  /* One stable desktop grid is shared by real satnav and simulator. */
  .app-shell.navigation-active .top-panel {
    display:flex; top:8px; left:8px; right:auto; width:338px; max-width:none; min-height:72px;
    padding:10px 14px; border-radius:20px; opacity:1;
  }
  .app-shell.navigation-active .simulation-mode-banner {
    top:8px; left:354px; right:auto; width:178px; min-height:72px; transform:none;
    padding:10px 12px; border-radius:18px;
  }
  .app-shell.navigation-active:not(.simulation-active) .simulation-mode-banner { display:none !important; }

  /* Keep the journey panel present on the left, matching the approved PC design. */
  .app-shell.navigation-active .destination-panel {
    display:block !important; top:88px; left:8px; right:auto; width:456px; max-width:none;
    max-height:calc(100dvh - 286px); overflow:auto; padding:14px; border-radius:20px;
  }
  .app-shell.navigation-active .destination-panel .panel-toggle { display:none; }
  .app-shell.navigation-active .bottom-panel {
    left:8px; right:auto; width:456px; max-width:none; bottom:8px; padding:10px 14px; border-radius:18px;
  }
  .app-shell.navigation-active .route-summary { margin-bottom:7px; padding-bottom:7px; }
  .app-shell.navigation-active .navigation-actions { grid-template-columns:1fr 1fr; gap:7px; }
  .app-shell.navigation-active .back-planner-button { grid-column:1/-1; }
  .app-shell.navigation-active .location-readout,
  .app-shell.navigation-active .privacy-note { display:flex; }

  /* Central HUD columns begin after the permanent left planner. */
  .app-shell.navigation-active .navigation-banner {
    top:8px; left:544px; right:170px; width:auto; max-width:none; min-height:112px;
    transform:none; grid-template-columns:72px minmax(0,1fr) 52px; padding:14px 16px; border-radius:20px;
  }
  .app-shell.navigation-active .speed-assistant {
    top:128px; left:548px; right:170px; width:auto; transform:none;
    grid-template-columns:minmax(120px,1.15fr) 104px minmax(125px,1fr) minmax(112px,.9fr) minmax(110px,.9fr);
    gap:8px;
  }
  .app-shell.navigation-active .speed-reading,
  .app-shell.navigation-active .speed-limit-sign,
  .app-shell.navigation-active .hud-info-card,
  .app-shell.navigation-active .speed-alert-toggle { min-height:88px; }
  .app-shell.navigation-active .speed-limit-sign { width:84px; min-height:84px; align-self:center; }
  .app-shell.navigation-active .traffic-assistant {
    top:224px; left:548px; right:170px; width:auto; transform:none; grid-template-columns:1fr auto;
  }
  .app-shell.navigation-active .map-actions { top:136px; right:18px; }

  /* Simulator controls occupy a reserved bottom strip and never move the shared HUD. */
  .app-shell.navigation-active .simulation-panel {
    left:486px; right:170px; bottom:10px; width:auto; transform:none; padding:9px 11px;
    display:grid; grid-template-columns:auto minmax(350px,1fr) auto; align-items:center; gap:10px;
    border-radius:18px;
  }
  .app-shell.navigation-active .simulation-panel[hidden] { display:none; }
  .app-shell.navigation-active .simulation-warning { padding:7px 9px; min-width:150px; }
  .app-shell.navigation-active .simulation-warning span { display:none; }
  .app-shell.navigation-active .simulation-controls { margin:0; grid-template-columns:repeat(4,minmax(78px,1fr)); }
  .app-shell.navigation-active .simulation-speed { margin:0; grid-template-columns:auto repeat(3,48px) 48px; }

  .app-shell.navigation-active .maplibregl-ctrl-attrib,
  .app-shell.navigation-active .maplibregl-ctrl-logo { margin-bottom:90px !important; }
}

@media (min-width:900px) and (max-width:1180px) {
  .app-shell.navigation-active .destination-panel,
  .app-shell.navigation-active .bottom-panel { width:390px; }
  .app-shell.navigation-active .navigation-banner { left:408px; right:76px; }
  .app-shell.navigation-active .speed-assistant,
  .app-shell.navigation-active .traffic-assistant { left:412px; right:76px; }
  .app-shell.navigation-active .simulation-panel { left:408px; right:76px; }
  .app-shell.navigation-active .speed-assistant {
    grid-template-columns:minmax(105px,1fr) 82px minmax(105px,.9fr) minmax(98px,.8fr) minmax(96px,.8fr);
  }
  .hud-info-card strong { font-size:20px; }
  .app-shell.navigation-active .map-actions { right:10px; }
}


/* Stage 6.9 — Adventure Builder PC Navigation Cockpit */
@media (min-width: 900px) {
  /* PC planning and navigation now live on one screen. */
  .app-shell.planner-page { overflow:hidden; background:#070707; }
  .app-shell.planner-page #map { opacity:1; pointer-events:auto; }
  .app-shell.planner-page .top-panel { display:flex; top:10px; left:10px; right:auto; width:420px; min-height:70px; }
  .app-shell.planner-page .destination-panel { top:90px; left:10px; right:auto; width:420px; max-height:calc(100dvh - 350px); overflow:auto; }
  .app-shell.planner-page .bottom-panel { left:10px; right:auto; bottom:10px; width:420px; max-height:250px; overflow:auto; }
  .app-shell.planner-page .map-actions { display:flex !important; top:18px; right:18px; }
  .app-shell.planner-page .status-card { display:flex; top:10px; left:445px; right:auto; }

  /* Shared cockpit structure for both real navigation and simulation. */
  .app-shell.navigation-active .top-panel {
    top:10px; left:10px; width:420px; min-height:70px; border-radius:18px;
  }
  .app-shell.navigation-active .destination-panel {
    top:90px; left:10px; width:420px; max-height:calc(100dvh - 330px); padding:14px;
  }
  .app-shell.navigation-active .bottom-panel {
    left:10px; width:420px; bottom:10px; max-height:220px; overflow:auto;
  }

  /* Large instruction banner: one job, no metric cards competing with it. */
  .app-shell.navigation-active .navigation-banner {
    top:18px; left:450px; right:250px; min-height:112px;
    grid-template-columns:92px minmax(0,1fr) 56px; padding:14px 18px;
    border-radius:20px; background:rgba(5,14,20,.96);
  }
  .app-shell.navigation-active .turn-arrow { width:76px; height:76px; border-radius:16px; font-size:42px; }
  .app-shell.navigation-active .turn-copy small { color:#74e7c0; font-size:14px; }
  .app-shell.navigation-active .turn-copy strong { font-size:clamp(22px,2.1vw,34px); }
  .app-shell.navigation-active .turn-copy span { font-size:14px; }

  /* Tall, fixed information dock on the right. */
  .app-shell.navigation-active .speed-assistant {
    top:90px; right:14px; left:auto; width:218px; transform:none;
    display:grid; grid-template-columns:1fr; gap:9px; padding:10px;
    border:1px solid var(--border); border-radius:20px; background:rgba(5,14,20,.96);
  }
  .app-shell.navigation-active .speed-reading,
  .app-shell.navigation-active .speed-limit-sign,
  .app-shell.navigation-active .hud-info-card,
  .app-shell.navigation-active .speed-alert-toggle {
    width:100%; min-height:76px; border-radius:14px; margin:0;
  }
  .app-shell.navigation-active .speed-reading { grid-template-columns:1fr auto; align-items:end; }
  .app-shell.navigation-active .speed-reading strong { font-size:38px; }
  .app-shell.navigation-active .speed-limit-sign { display:grid; grid-template-columns:1fr auto; align-items:center; padding:10px 13px; }
  .app-shell.navigation-active .speed-limit-sign strong { width:54px; height:54px; font-size:24px; }
  .app-shell.navigation-active .hud-info-card strong { font-size:27px; }
  .app-shell.navigation-active .speed-alert-toggle { min-height:58px; }

  .app-shell.navigation-active .traffic-assistant {
    top:calc(90px + 5 * 85px + 18px); right:14px; left:auto; width:218px; transform:none;
    grid-template-columns:1fr; padding:9px; border:1px solid var(--border); border-radius:18px;
    background:rgba(5,14,20,.96);
  }
  .app-shell.navigation-active .traffic-refresh-button { width:100%; }

  /* Small controls stay clear of the right dock. */
  .app-shell.navigation-active .map-actions { top:146px; right:246px; }
  .app-shell.navigation-active .round-button { width:46px; height:46px; border-radius:14px; }
  .app-shell.navigation-active .map-view-button { font-size:14px; font-weight:850; color:#73e8c0; }

  /* Simulation warning stays visible in the brand/status area. */
  .app-shell.navigation-active .simulation-mode-banner {
    top:10px; left:auto; right:14px; width:218px; min-height:70px; transform:none;
    padding:10px 12px; border-radius:18px;
  }

  /* Fixed cockpit toolbar across the bottom of the map, excluding planner and dock. */
  .app-shell.navigation-active .simulation-panel {
    left:450px; right:250px; bottom:12px; width:auto; min-height:94px; transform:none;
    display:grid; grid-template-columns:minmax(180px,.7fr) minmax(360px,1.5fr) minmax(250px,1fr);
    align-items:center; gap:12px; padding:12px 14px; border-radius:20px;
  }
  .app-shell.navigation-active .simulation-warning { min-width:0; }
  .app-shell.navigation-active .simulation-warning strong { color:#74e7c0; }
  .app-shell.navigation-active .simulation-warning span { display:block; }
  .app-shell.navigation-active .simulation-controls { grid-template-columns:repeat(4,minmax(78px,1fr)); }
  .app-shell.navigation-active .simulation-speed { grid-template-columns:auto repeat(3,minmax(52px,1fr)) auto; }

  /* Larger, clearer satnav pointer with a subtle halo. */
  .app-shell.navigation-active .user-location-marker { width:54px; height:54px; }
  .app-shell.navigation-active .user-marker-core {
    inset:13px; border:3px solid #07100e; background:#27d3a2;
    box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 18px rgba(39,211,162,.16),0 8px 22px rgba(0,0,0,.55);
  }
  .app-shell.navigation-active .user-heading-arrow {
    top:-34px; border-left-width:16px; border-right-width:16px; border-bottom-width:42px;
    border-bottom-color:#27d3a2; transform-origin:50% 61px; transition:none;
  }

  .app-shell.navigation-active .maplibregl-ctrl-attrib,
  .app-shell.navigation-active .maplibregl-ctrl-logo { margin-bottom:112px !important; }
}

@media (min-width:900px) and (max-width:1250px) {
  .app-shell.navigation-active .top-panel,
  .app-shell.navigation-active .destination-panel,
  .app-shell.navigation-active .bottom-panel { width:360px; }
  .app-shell.navigation-active .navigation-banner,
  .app-shell.navigation-active .simulation-panel { left:380px; right:210px; }
  .app-shell.navigation-active .speed-assistant,
  .app-shell.navigation-active .simulation-mode-banner,
  .app-shell.navigation-active .traffic-assistant { right:8px; width:190px; }
  .app-shell.navigation-active .map-actions { right:208px; }
  .app-shell.navigation-active .simulation-panel { grid-template-columns:150px 1fr 220px; }
}

/* Stage 6.9.2 — lower cockpit camera and exact route endpoint flags */
.route-flag-marker {
  position:relative;
  width:50px;
  height:72px;
  pointer-events:none;
  filter:drop-shadow(0 7px 9px rgba(0,0,0,.52));
}
.route-flag-pole {
  position:absolute;
  left:23px;
  bottom:8px;
  width:4px;
  height:53px;
  border-radius:4px;
  background:linear-gradient(90deg,#d9e2e6,#fff 45%,#89969c);
  box-shadow:0 2px 4px rgba(0,0,0,.5);
}
.route-flag-cloth {
  position:absolute;
  left:26px;
  top:4px;
  display:grid;
  place-items:center;
  width:29px;
  height:25px;
  border:2px solid rgba(255,255,255,.95);
  border-left:0;
  border-radius:0 5px 5px 0;
  color:#06110e;
  background:#55daaE;
  font-size:14px;
  font-weight:950;
  line-height:1;
  box-shadow:0 4px 10px rgba(0,0,0,.42);
}
.route-end-flag .route-flag-cloth { color:#fff; background:#e63333; }
.route-end-flag .route-flag-cloth::after {
  content:'🏁';
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-size:16px;
  background:#e63333;
}
.route-flag-endpoint {
  position:absolute;
  left:17px;
  bottom:0;
  width:16px;
  height:9px;
  border:3px solid #fff;
  border-radius:50%;
  background:#16d3a1;
  box-shadow:0 0 0 3px rgba(3,12,10,.72),0 3px 8px rgba(0,0,0,.55);
}
.route-end-flag .route-flag-endpoint { background:#e63333; }
.app-shell.navigation-active .route-start-flag { opacity:.62; transition:opacity .5s ease; }
.app-shell.navigation-active .route-end-flag { transform:scale(1.06); transform-origin:50% 100%; }

/* Stage 7.1 — approved Premium Adventure Builder phone Driver Screen */
.driver-menu-button { display:none; }
@media (max-width: 899px) {
  .app-shell.navigation-active { background:#07110f; }
  .app-shell.navigation-active .top-panel,
  .app-shell.navigation-active .status-card,
  .app-shell.navigation-active .traffic-assistant,
  .app-shell.navigation-active .location-readout,
  .app-shell.navigation-active .privacy-note,
  .app-shell.navigation-active #locateButton { display:none !important; }

  .app-shell.navigation-active .navigation-banner {
    position:absolute; z-index:30;
    top:calc(8px + var(--safe-top)); left:8px; right:8px;
    min-height:104px; padding:10px 12px;
    display:grid; grid-template-columns:72px minmax(0,1fr) 42px;
    grid-template-rows:auto auto; gap:5px 10px;
    border:1px solid rgba(255,157,28,.55); border-radius:22px;
    background:linear-gradient(145deg,rgba(5,17,20,.98),rgba(8,8,8,.96));
    box-shadow:0 14px 34px rgba(0,0,0,.45); backdrop-filter:blur(16px);
  }
  .app-shell.navigation-active .turn-arrow {
    grid-row:1/3; width:68px; height:68px; align-self:center;
    border-radius:18px; font-size:42px; color:#17100a;
    background:linear-gradient(145deg,#ffb020,#ff8500);
  }
  .app-shell.navigation-active .turn-copy { min-width:0; align-self:center; }
  .app-shell.navigation-active .turn-copy small { display:block; color:#ffae2b; font-size:13px; font-weight:900; }
  .app-shell.navigation-active .turn-copy strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:clamp(20px,5.6vw,28px); line-height:1.08; }
  .app-shell.navigation-active .turn-copy span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; margin-top:3px; color:#b8c9c3; font-size:13px; }
  .app-shell.navigation-active .voice-icon-button { width:42px; height:42px; border-radius:14px; font-size:19px; }
  .app-shell.navigation-active .lane-guidance { grid-column:2/4; min-height:28px; padding-top:5px; border-top:1px solid rgba(255,255,255,.09); }
  .app-shell.navigation-active .lane-guidance-label { display:none; }

  .app-shell.navigation-active .speed-assistant {
    position:absolute; z-index:28; inset:auto 0 0 0; pointer-events:none;
    display:block !important; background:none; border:0; box-shadow:none; padding:0;
  }
  .app-shell.navigation-active .speed-reading {
    position:fixed; z-index:28; left:14px; bottom:calc(91px + var(--safe-bottom));
    width:76px; height:76px; min-height:0; padding:8px 6px 6px;
    display:grid; place-items:center; gap:0; border:2px solid #ff9d1c; border-radius:50%;
    background:rgba(5,14,16,.94); pointer-events:auto;
  }
  .app-shell.navigation-active .speed-reading small { font-size:8px; letter-spacing:.08em; }
  .app-shell.navigation-active .speed-reading strong { font-size:31px; line-height:.9; }
  .app-shell.navigation-active .speed-reading span { font-size:10px; }
  .app-shell.navigation-active .speed-limit-sign {
    position:fixed; z-index:28; right:14px; bottom:calc(91px + var(--safe-bottom));
    width:76px; height:76px; min-height:0; padding:4px; display:grid; place-items:center;
    border:6px solid #e53935; border-radius:50%; background:#fff; color:#101010;
    pointer-events:auto; box-shadow:0 8px 22px rgba(0,0,0,.36);
  }
  .app-shell.navigation-active .speed-limit-sign small { font-size:7px; color:#151515; text-transform:uppercase; }
  .app-shell.navigation-active .speed-limit-sign strong { width:auto; height:auto; border:0; font-size:31px; line-height:.85; color:#111; background:none; }
  .app-shell.navigation-active .speed-limit-sign.unavailable { opacity:.72; }
  .app-shell.navigation-active .speed-alert-toggle { display:none !important; }

  .app-shell.navigation-active .map-actions {
    top:calc(126px + var(--safe-top)); right:10px; gap:7px;
  }
  .app-shell.navigation-active .map-actions #zoomInButton,
  .app-shell.navigation-active .map-actions #zoomOutButton,
  .app-shell.navigation-active .map-actions #resetNorthButton { display:none; }
  .app-shell.navigation-active .map-view-button { width:42px; height:42px; border-radius:14px; font-size:12px; }

  .app-shell.navigation-active .bottom-panel {
    position:absolute; z-index:27; left:8px; right:8px; bottom:calc(8px + var(--safe-bottom));
    min-height:72px; max-height:none; padding:8px 66px 8px 10px; overflow:visible;
    border:1px solid rgba(255,157,28,.32); border-radius:22px;
    background:linear-gradient(145deg,rgba(5,17,20,.97),rgba(8,8,8,.97));
    box-shadow:0 12px 32px rgba(0,0,0,.45); backdrop-filter:blur(16px);
  }
  .app-shell.navigation-active .route-summary {
    display:grid !important; grid-template-columns:repeat(3,1fr); gap:0; margin:0; padding:0; border:0;
  }
  .app-shell.navigation-active .route-summary > div { min-width:0; padding:5px 8px; text-align:center; border-right:1px solid rgba(255,255,255,.09); }
  .app-shell.navigation-active .route-summary > div:last-of-type { border-right:0; }
  .app-shell.navigation-active .route-summary .label { font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
  .app-shell.navigation-active .route-summary strong { display:block; margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:18px; }
  .app-shell.navigation-active .route-summary .secondary-button { display:none !important; }
  .app-shell.navigation-active .driver-menu-button {
    display:grid; place-items:center; position:absolute; z-index:32; right:9px; bottom:9px;
    width:54px; height:54px; border:1px solid #ff9d1c; border-radius:17px;
    color:#ff9d1c; background:#0b1314; font-size:26px; font-weight:900; cursor:pointer;
  }
  .app-shell.navigation-active .navigation-actions.driver-menu {
    position:absolute; right:0; bottom:72px; width:min(270px,calc(100vw - 32px));
    display:none; grid-template-columns:1fr; gap:8px; margin:0; padding:10px;
    border:1px solid rgba(255,157,28,.38); border-radius:18px; background:rgba(7,12,13,.98);
    box-shadow:0 18px 40px rgba(0,0,0,.55);
  }
  .app-shell.navigation-active .navigation-actions.driver-menu.open { display:grid; }
  .app-shell.navigation-active .navigation-actions.driver-menu button { grid-column:auto; min-height:48px; }
  .app-shell.navigation-active .simulation-panel { bottom:calc(92px + var(--safe-bottom)); }
  .app-shell.navigation-active .maplibregl-ctrl-attrib,
  .app-shell.navigation-active .maplibregl-ctrl-logo { margin-bottom:calc(80px + var(--safe-bottom)) !important; }
}

@media (max-width:899px) and (orientation:landscape) {
  .app-shell.navigation-active .navigation-banner { right:34%; min-height:88px; grid-template-columns:58px minmax(0,1fr) 38px; }
  .app-shell.navigation-active .turn-arrow { width:56px; height:56px; font-size:34px; }
  .app-shell.navigation-active .bottom-panel { left:34%; }
  .app-shell.navigation-active .speed-reading { left:12px; bottom:12px; }
  .app-shell.navigation-active .speed-limit-sign { right:auto; left:98px; bottom:12px; }
}



/* Stage 7.2 — private Satnav Test Recorder */
.test-recorder-card{border:1px solid rgba(255,138,0,.35);background:rgba(7,21,18,.7);border-radius:18px;padding:16px;display:grid;gap:12px}.test-recorder-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}.test-recorder-head strong{display:block;font-size:1rem}.test-recorder-head small,.test-recorder-summary,.test-recorder-message{display:block;color:#b9c9c3;line-height:1.45}.test-recorder-state{font-size:.72rem;font-weight:900;letter-spacing:.08em;border:1px solid rgba(255,255,255,.18);border-radius:999px;padding:7px 10px;white-space:nowrap}.test-recorder-state.recording{background:#a51f1f;color:#fff;border-color:#ff7777;animation:testPulse 1.4s ease-in-out infinite}.test-recorder-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.test-recorder-actions button{border:0;border-radius:12px;padding:11px 9px;font-weight:800;background:#24352f;color:#fff}.test-recorder-actions button:first-child{background:#ff8a00;color:#15100a}.test-recorder-actions button:disabled{opacity:.42}.test-recorder-privacy{display:flex;align-items:flex-start;gap:9px;font-size:.8rem;color:#d6e0dc}.test-recorder-privacy input{margin-top:3px}.test-recorder-warning{margin:0;color:#ffd5a1;font-size:.78rem;line-height:1.4}@keyframes testPulse{50%{box-shadow:0 0 0 6px rgba(255,70,70,.08)}}



/* Stage 2A — Journey start and live navigation information */
.navigation-journey-summary {
  position:absolute; z-index:7; top:calc(184px + var(--safe-top)); left:50%; transform:translateX(-50%);
  width:min(700px, calc(100% - 170px)); display:grid; grid-template-columns:minmax(150px,1.6fr) repeat(3,minmax(90px,1fr));
  gap:1px; overflow:hidden; border:1px solid rgba(39,211,162,.35); border-radius:16px; background:rgba(7,21,18,.94);
  box-shadow:0 12px 28px rgba(0,0,0,.28);
}
.navigation-journey-summary[hidden] { display:none; }
.navigation-journey-summary > div { padding:9px 12px; min-width:0; border-right:1px solid rgba(255,255,255,.09); }
.navigation-journey-summary > div:last-child { border-right:0; }
.navigation-journey-summary small { display:block; color:rgba(255,255,255,.65); font-size:.72rem; text-transform:uppercase; letter-spacing:.06em; }
.navigation-journey-summary strong { display:block; margin-top:2px; color:#fff; font-size:1rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@media (max-width:700px) {
  .navigation-journey-summary { top:calc(144px + var(--safe-top)); left:7px; right:7px; width:auto; transform:none; grid-template-columns:1.35fr repeat(3,1fr); border-radius:13px; }
  .navigation-journey-summary > div { padding:7px 6px; text-align:center; }
  .navigation-journey-summary .journey-destination { text-align:left; }
  .navigation-journey-summary small { font-size:.58rem; }
  .navigation-journey-summary strong { font-size:.82rem; }
}

/* Stage 2C Repair A: dedicated camera re-centre control */
.camera-recenter-button { font-size: 20px; font-weight: 900; }
.app-shell.navigation-active #cameraRecenterButton { display: grid !important; }

/* Stage 2C Repair C2: phone Re-centre control stays separate on the left. */
.app-shell.navigation-active #cameraRecenterButton {
  position: fixed !important;
  left: 12px !important;
  right: auto !important;
  top: calc(225px + var(--safe-top)) !important;
  z-index: 12 !important;
  display: grid !important;
  pointer-events: auto !important;
}
@media (max-width: 540px) {
  .app-shell.navigation-active #cameraRecenterButton {
    left: 10px !important;
    top: calc(225px + var(--safe-top)) !important;
  }
}
