/* Mobile header and guidance layout. Keep this after the earlier theme sheets. */
@media (max-width: 760px) {
  .topbar {
    top: calc(10px + env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center !important;
    gap: 8px !important;
    min-height: 48px;
    padding: 0 !important;
  }
  .topbar .brand {
    display: flex;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    overflow: hidden;
    font-size: 14px !important;
  }
  .topbar .brand > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .header-meta {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    height: 48px;
    min-width: 0;
    gap: 0 !important;
  }
  /* The live routing status remains available to screen readers and the planner. */
  .topbar .engine-status, .topbar .version {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0 !important;
  }
  .topbar .profile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    height: 48px;
    box-sizing: border-box;
    padding: 8px 11px;
    font-size: 14px !important;
  }
  .planner-peek, body:not(.nav-active):not(.arrived) .layers-fab {
    top: calc(68px + env(safe-area-inset-top)) !important;
  }
  .discover-bar {
    top: calc(130px + env(safe-area-inset-top)) !important;
    mask-image: none !important;
  }
  #discover-bar .discover-scroller {
    min-height: 56px;
    box-sizing: border-box;
    padding: 0 12px 8px;
    gap: 7px;
  }
  #discover-bar .discover-scroller > button {
    min-height: 48px !important;
    padding: 6px 7px;
    gap: 5px;
    font-size: 13px !important;
    line-height: 1.2;
    white-space: nowrap;
  }
  #discover-bar .discover-scroller .ui-icon { width: 19px; height: 19px; }
  .search-area-btn, .poi-search-area-btn, .poi-status {
    top: calc(194px + env(safe-area-inset-top)) !important;
  }

  body.nav-collapsed .navigation .nav-collapsed-summary {
    font-size: 16px !important;
    line-height: 1.35 !important;
    max-height: 2.7em !important;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.nav-collapsed .navigation .nav-top { min-height: 62px; padding: 8px 11px; }
  .nav-top-label { font-size: 12px !important; }
  .navigation-stats .nav-sheet-toggle { min-height: 79px; padding: 16px 5px 10px; }
  .navigation-stats .nav-sheet-summary strong { font-size: 31px !important; line-height: 1.1; }
  .navigation-stats .nav-sheet-summary > span {
    font-size: 16px !important;
    line-height: 1.35 !important;
    gap: 3px 7px;
  }
  .navigation-stats .nav-speed { padding: 3px 0 9px; }
  .navigation-stats .speed-card { min-height: 68px; padding: 9px 10px; }
  .navigation-stats .speed-card > span {
    font-size: 12px !important;
    line-height: 1.2;
    white-space: normal;
  }
  .navigation-stats .speed-card strong { font-size: 31px !important; }
  .navigation-stats .speed-card small { font-size: 13px !important; }
  .navigation-stats .gps-quality {
    padding: 8px 3px 3px;
    font-size: 14px !important;
    line-height: 1.35;
  }
  body.nav-active .health-fab {
    bottom: calc(var(--nav-stats-height, 205px) + 16px + env(safe-area-inset-bottom));
  }
  body.ui-large.nav-collapsed .navigation .nav-collapsed-summary { font-size: 19px !important; }
  body.ui-large .navigation-stats .nav-sheet-summary > span { font-size: 19px !important; }
  body.ui-large .navigation-stats .speed-card > span,
  body.ui-large .navigation-stats .gps-quality { font-size: 16px !important; }
}
@media (max-width: 370px) {
  .topbar .brand { font-size: 12px !important; }
  .topbar .profile-btn { padding: 7px 9px; font-size: 13px !important; }
  #discover-bar .discover-scroller > button { font-size: 12px !important; padding: 6px 5px; }
  #discover-bar .discover-scroller .ui-icon { width: 18px; height: 18px; }
}
