/* AirRadar 2.8 mobile map-first shell. Desktop remains controlled by app.css. */
.mobile-v28-sheet,
.mobile-v28-nav,
.mobile-v28-track-chip {
  display: none;
}

@media (max-width: 850px) {
  :root {
    --mobile-v28-nav-height: calc(62px + env(safe-area-inset-bottom));
    --mobile-v28-sheet-peek: 92px;
    --mobile-v28-sheet-half: min(53vh, 430px);
    --mobile-v28-sheet-full: calc(100dvh - 70px - var(--mobile-v28-nav-height));
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    min-height: 100dvh;
  }

  .topbar {
    z-index: 1200;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 10px !important;
    min-height: 58px;
    padding: 8px 10px !important;
  }

  .topbar .brand {
    display: flex !important;
    min-width: 0;
  }

  .topbar .brand-mark {
    display: inline-flex !important;
  }

  .topbar .brand > div {
    display: flex !important;
  }

  .topbar .brand > div span,
  #mobileMenuButton,
  .topbar .top-actions,
  #mobileNavigation,
  #mobileMenuBackdrop {
    display: none !important;
  }

  .topbar .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .topbar .brand strong {
    font-size: 1rem;
  }

  .search-wrap {
    width: 100%;
    min-width: 0;
  }

  .search-wrap input {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 12px;
  }

  .search-results {
    position: fixed;
    top: 58px;
    right: 8px;
    left: 8px;
    max-height: min(55dvh, 420px);
    z-index: 1550;
  }

  .left-panel,
  #detailPanel {
    display: none !important;
  }

  .map-wrap {
    inset: 58px 0 var(--mobile-v28-nav-height) !important;
    height: auto !important;
    min-height: 0 !important;
  }

  #map {
    height: 100% !important;
  }

  .timeline-panel {
    bottom: calc(var(--mobile-v28-sheet-peek) + 12px) !important;
    max-width: calc(100vw - 20px);
  }

  .mobile-v28-sheet {
    position: fixed;
    right: 0;
    bottom: var(--mobile-v28-nav-height);
    left: 0;
    z-index: 1400;
    display: flex;
    height: var(--mobile-v28-sheet-peek);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border, rgba(148, 163, 184, .35));
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: var(--panel, #111827);
    color: var(--text, #f8fafc);
    box-shadow: 0 -12px 34px rgba(2, 6, 23, .24);
    transition: height .22s ease;
    overscroll-behavior: contain;
  }

  .mobile-v28-sheet.is-half {
    height: var(--mobile-v28-sheet-half);
  }

  .mobile-v28-sheet.is-full {
    height: var(--mobile-v28-sheet-full);
  }

  .mobile-v28-handle {
    display: flex;
    min-height: 26px;
    flex: 0 0 26px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    cursor: ns-resize;
  }

  .mobile-v28-handle span {
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
    opacity: .28;
  }

  .mobile-v28-summary {
    display: block;
    padding: 0 14px 12px;
  }

  .mobile-v28-sheet:not(.is-peek) .mobile-v28-summary {
    display: none;
  }

  .mobile-v28-summary button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
  }

  .mobile-v28-summary strong {
    font-size: 1.45rem;
  }

  .mobile-v28-summary small {
    color: var(--muted, #94a3b8);
  }

  .mobile-v28-content {
    display: none;
    min-height: 0;
    flex: 1;
    overflow: hidden;
  }

  .mobile-v28-sheet:not(.is-peek) .mobile-v28-content {
    display: block;
  }

  .mobile-v28-view {
    display: none;
    height: 100%;
    overflow: auto;
    padding: 0 14px calc(18px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  .mobile-v28-view.is-active {
    display: block;
  }

  .mobile-v28-view-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border, rgba(148, 163, 184, .25));
    background: var(--panel, #111827);
  }

  .mobile-v28-view-head h2 {
    margin: 0;
    font-size: 1rem;
  }

  .mobile-v28-back {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.8rem;
  }

  #mobileListHost .stats-grid,
  #mobileListHost .aircraft-list-section,
  #mobileLayersHost .panel-section,
  #mobileDetailHost #detailPanel {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    transform: none !important;
    box-shadow: none !important;
  }

  #mobileListHost .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 12px;
  }

  #mobileListHost .stats-grid article {
    min-height: 62px;
    padding: 10px 12px;
  }

  #mobileListHost .aircraft-list-section,
  #mobileLayersHost .panel-section,
  #mobileDetailHost #detailPanel {
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }

  #mobileDetailHost #detailPanel {
    overflow: visible !important;
  }

  #mobileDetailHost .detail-photo-card img {
    max-height: 190px;
    object-fit: cover;
  }

  #mobileDetailHost .detail-actions {
    position: sticky;
    bottom: 0;
    padding: 10px 0;
    background: var(--panel, #111827);
  }

  .mobile-v28-settings-link {
    display: none;
    min-height: 44px;
    margin: 0 14px 12px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--border, rgba(148, 163, 184, .35));
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
  }

  .mobile-v28-sheet[data-panel="layers"] .mobile-v28-settings-link {
    display: flex;
  }

  .mobile-v28-settings {
    display: grid;
    gap: 8px;
    padding-top: 12px;
  }

  .mobile-v28-settings > button,
  .mobile-v28-settings > a,
  .mobile-v28-language {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 12px;
    padding: 0 14px;
    border: 1px solid var(--border, rgba(148, 163, 184, .3));
    border-radius: 12px;
    background: var(--surface, rgba(148, 163, 184, .08));
    color: inherit;
    font: inherit;
    text-decoration: none;
  }

  .mobile-v28-language > span {
    margin-right: auto;
  }

  .mobile-v28-language button {
    min-width: 40px;
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 1.25rem;
  }

  .mobile-v28-language button.active {
    background: #16a34a;
  }

  .mobile-v28-settings .mobile-v28-coffee {
    border-color: #eab308;
    background: #ffdd57;
    color: #18212f;
    font-weight: 700;
  }

  .mobile-v28-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1500;
    display: grid;
    height: var(--mobile-v28-nav-height);
    grid-template-columns: repeat(3, 1fr);
    padding: 4px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border, rgba(148, 163, 184, .35));
    background: var(--panel, #111827);
    box-shadow: 0 -4px 20px rgba(2, 6, 23, .18);
  }

  .mobile-v28-nav button {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted, #94a3b8);
    font: inherit;
  }

  .mobile-v28-nav button span {
    font-size: 1.25rem;
    line-height: 1;
  }

  .mobile-v28-nav button small {
    font-size: .7rem;
  }

  .mobile-v28-nav button.active {
    color: #22c55e;
    background: rgba(34, 197, 94, .12);
  }

  .mobile-v28-track-chip {
    position: fixed;
    top: 68px;
    left: 50%;
    z-index: 1350;
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 10px;
    padding: 0 6px 0 13px;
    transform: translateX(-50%);
    border: 1px solid rgba(239, 68, 68, .5);
    border-radius: 999px;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    box-shadow: 0 8px 22px rgba(2, 6, 23, .3);
    font-size: .82rem;
  }

  .mobile-v28-track-chip.hidden {
    display: none;
  }

  .mobile-v28-track-chip button {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 1.15rem;
  }

  .support-promo {
    display: none;
  }

  .data-attribution {
    display: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .mobile-v28-sheet {
      transition: none;
    }
  }
}
