#phoneBackdrop { display: none; }
body #splashScreen { background: #ffffff !important; }
body:not(.phone-layout) #brandPanel,
body:not(.phone-layout) #brandLogo { width: 200px !important; min-width: 200px !important; max-width: 200px !important; height: 60px !important; min-height: 60px !important; max-height: 60px !important; background: transparent !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important; box-shadow: none !important; }
body:not(.phone-layout) #brandPanel { right: 33px !important; }
body:not(.phone-layout) #brandLogo { object-fit: contain !important; filter: drop-shadow(0 0 1px #ffffffb3) !important; }
body #deskAtcInstallHelp { width: 100%; white-space: pre-line; font: 500 14px/1.6 system-ui, sans-serif; padding: 12px; box-sizing: border-box; border-radius: 12px; background: #edf5f7; }
body #deskAtcInstallBanner { max-height: calc(100dvh - 160px); overflow-y: auto; }
body #deskAtcInstallBanner { z-index: 100790; bottom: calc(var(--phone-nav, 68px) + 10px); border: 1px solid #dce5eb; border-radius: 20px; background: #fff; color: #193448; font: 700 14px/1.4 system-ui, sans-serif; box-shadow: 0 8px 32px #102c4030; display: none; flex-wrap: wrap; padding: 14px; gap: 10px; }
body #deskAtcInstallBanner.show { display: flex; }
body #deskAtcInstallBanner .installIcon { border-radius: 12px; background: #fff; }
body #deskAtcInstallBanner .installCopy { padding-right: 26px; }
body #deskAtcInstallBanner .installCopy small { font-size: 12px; color: #587183; }
body #deskAtcInstallBanner button { min-height: 44px; font: 700 14px system-ui, sans-serif; letter-spacing: 0; }
body #deskAtcInstallBanner #deskAtcInstallAccept { width: 100%; background: #00899c; border-color: #00899c; color: #fff; border-radius: 12px; }
body #deskAtcInstallBanner #deskAtcInstallDismiss { position: absolute; top: 5px; right: 5px; width: 44px; padding: 0; border: 0; color: #587183; font-size: 24px; }
/* Flight card presentation is shared by phone, tablet and desktop. */
#phoneFlightCard { display: none; position: fixed; left: 12px; right: 12px; bottom: calc(var(--phone-nav) + 10px); z-index: 100670; padding: 10px 16px 16px; border: 1px solid var(--phone-border); border-radius: 23px; background: #fff; color: var(--phone-ink); box-shadow: var(--phone-shadow); max-height: calc(100dvh - 220px); overflow: auto; }
.phoneFlightHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phoneFlightHead > div:first-child { min-width: 0; }
.phoneFlightActions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
#phoneFlightCallsign { font-size: 22px; font-weight: 780; letter-spacing: -.5px; overflow-wrap: anywhere; }
/* Uçuş numarasının yanındaki ATC çağrı işareti: başlığı taşırmayacak kadar küçük. */
#phoneFlightCallsign .phoneCallsignAlt { margin-left: 7px; font-size: 12px; font-weight: 650; letter-spacing: 0; color: #6b8597; vertical-align: 2px; }
#phoneFlightMeta { margin-top: 4px; font-size: 11px; color: var(--phone-muted); }
#phoneFlightFollow { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--phone-accent); color: #fff; font-size: 12px; font-weight: 700; }
#phoneFlightFollow.active { background: #e4f3f2; color: #086b71; }
#phoneFlightClose { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #f2f5f7; color: var(--phone-muted); font-size: 23px; }
.phoneFlightStats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; padding: 14px 0 2px; border-top: 1px solid var(--phone-border); }
.phoneFlightStats div { min-width: 0; }
.phoneFlightStats span { display: block; color: var(--phone-muted); font-size: 8px; font-weight: 650; letter-spacing: .4px; }
.phoneFlightStats strong { display: block; margin-top: 6px; color: var(--phone-ink); font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
#phoneFlightRoute { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #f1f6f8; font-size: 12px; font-weight: 650; }
#phoneFlightRoute:empty { display: none; }
#phoneFlightExpand { display: block; width: 100%; min-height: 44px; padding: 8px; border: 0; border-bottom: 1px solid #e1e8ed; background: white; color: #087e8b; font: 600 11px system-ui, sans-serif; }
#phoneFlightCard.phone-flight-compact > :not(.phoneFlightHead):not(#phoneFlightExpand):not(#flightViewLaunch) { display: none !important; }
#phoneFlightCard.phone-flight-compact .phoneFlightHead { padding: 8px 0; }
#phoneFlightCard *, #phoneFlightCard *::before, #phoneFlightCard *::after { box-sizing: border-box; }
#phoneFlightCard [hidden] { display: none !important; }
#phoneFlightCard .phoneSheetHandle { display: none; }
#phoneFlightCard .phoneFlightHead { position: sticky; top: 0; z-index: 2; padding: 14px 0 10px; background: white; }
.phoneAirlineMark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; background: #f1f5f7; border-radius: 12px; }
#phoneAirlineLogo { width: 34px; height: 34px; object-fit: contain; }
#phoneAirlineFallback { color: #087e8b; font-size: 24px; }
#phoneFlightCard .phoneFlightHead > div:nth-child(2) { min-width: 0; flex: 1; }
#phoneFlightCard #phoneFlightCallsign { font-size: 19px; }
#phoneFlightCard #phoneFlightFollow { padding: 0 10px; font-size: 11px; }
#phoneFlightCard button { touch-action: manipulation; cursor: pointer; }
#phoneFlightCard button:focus-visible { outline: 3px solid #087e8b; outline-offset: 2px; }
.phoneAirlineLine { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; color: #526a7a; font-size: 12px; }
#phoneAircraftType:not(:empty) { padding: 4px 7px; border-radius: 5px; background: #eaf2f7; color: #24495f; font-weight: 700; }
#phoneAircraftPhotoWrap { position: relative; min-width: 0; margin: 0; background: #eaf2f7; }
#phoneAircraftPhoto { display: block; width: 100%; height: auto; object-fit: contain; }
#phonePhotoCredit:not(:empty) { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px 12px 6px; background: linear-gradient(transparent, #142936a6); color: white; font-size: 9px; }
#phoneFlightCard #phoneFlightRoute { display: grid; grid-template-columns: 1fr 32px 1fr; align-items: center; gap: 6px; margin: 0; padding: 16px 0 12px; border-radius: 0; background: white; }
#phoneFlightRoute > div { min-width: 0; }
#phoneFlightRoute > div:last-child { text-align: right; }
#phoneFlightRoute span:not(.phoneRoutePlane) { display: block; font-size: 9px; color: #718492; letter-spacing: 1px; }
#phoneFlightRoute strong { display: block; margin: 3px 0; color: #19394d; font-size: 28px; letter-spacing: -1px; }
/* Ana kodun yanındaki ikinci kod: kart dar olduğu için belirgin biçimde küçük. */
#phoneFlightRoute strong .phoneCodeAlt { margin-left: 5px; font-size: 11px; font-weight: 650; letter-spacing: 0; color: #6b8597; vertical-align: 4px; }
#phoneFlightRoute small { display: block; color: #607685; font-size: 10px; font-weight: 500; overflow-wrap: anywhere; }
.phoneRoutePlane { text-align: center; color: #087e8b; font-size: 24px; }
#phoneProgressBar { display: block; width: 100%; height: 4px; accent-color: #087e8b; border: 0; }
#phoneProgressBar::-webkit-progress-bar { background: #e5edf2; border-radius: 4px; }
#phoneProgressBar::-webkit-progress-value { background: #087e8b; border-radius: 4px; }
#phoneRouteProgress > div { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #657887; font-size: 10px; }
#phoneFlightStatus { color: #526a7a; font-size: 13px; line-height: 1.5; }

/* Mobile application shell. Map rendering is shared with desktop. */
#phoneApp,
#phoneBottomNav,
#phoneMoreSheet,
#phoneTrafficSheet,
#phoneLiveSheet {
  display: none !important;
}

@media (max-width: 700px) {
  body.phone-layout {
    background: #dce8d4 !important;
    font-family: Inter, "Segoe UI", system-ui, sans-serif !important;
  }

  body.phone-layout #radar,
  body.phone-layout canvas#radar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    transform: none !important;
    transform-origin: center center !important;
    z-index: 5 !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none !important;
    clip-path: none !important;
    -webkit-clip-path: none !important;
    overflow: visible !important;
  }

  body.phone-layout #radarWorldMapHost {
    opacity: 1 !important;
    z-index: 2 !important;
    background: #cfe0c8 !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    box-shadow: none !important;
    clip-path: none !important;
  }

  body.phone-layout #radarWorldMap,
  body.phone-layout #radarWorldMap .maplibregl-map,
  body.phone-layout #radarWorldMap .maplibregl-canvas-container,
  body.phone-layout #radarWorldMap .maplibregl-canvas {
    width: 100% !important;
    height: 100% !important;
  }

  body.phone-layout.has-world-map #radar,
  body.phone-layout.has-world-map canvas#radar {
    background: transparent !important;
  }

  body.phone-layout #metarPinnedCard,
  body.phone-layout #radarCompassLayer,
  body.phone-layout .radarCompass,
  body.phone-layout #radarZoomControls,
  body.phone-layout #compassN,
  body.phone-layout #compassS,
  body.phone-layout #compassE,
  body.phone-layout #compassW,
  body.phone-layout #leftHamburgerButton,
  body.phone-layout #rightHamburgerButton,
  body.phone-layout #menuToggleButton,
  body.phone-layout #topLiveStatus,
  body.phone-layout #status,
  body.phone-layout #radarSourceSelector,
  body.phone-layout #radarSourceBadge,
  body.phone-layout #bottomLeftIconDock,
  body.phone-layout #soundEffectsWrap,
  body.phone-layout #modeButton,
  body.phone-layout #trackButton,
  body.phone-layout #metarSearchButton,
  body.phone-layout #dashboardInfoPanel,
  body.phone-layout #dashboardLegend,
  body.phone-layout #dashboardClock,
  body.phone-layout #dashboardBottomBar,
  body.phone-layout #dashboardBrand,
  body.phone-layout #rangeControls,
  body.phone-layout #activeRouteBar,
  body.phone-layout #brandPanel,
  body.phone-layout #brandLogo,
  body.phone-layout #weatherPanel,
  body.phone-layout #compactWeatherLine,
  body.phone-layout #topTimePanel,
  body.phone-layout #leftHamburgerMenu,
  body.phone-layout #trackingBanner,
  body.phone-layout #trackedInfoPanel,
  body.phone-layout #routePanel,
  body.phone-layout #routeFinderButton,
  body.phone-layout #languageSwitcher {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Aynı gizleme, .phone-layout sınıfı beklenmeden. O sınıfı JS ekliyor;
     o ana kadar telefonda masaüstünün yeşil menüsü boyanıyor ve açılış
     ekranı belgede çok aşağıda olduğu için onu da örtmüyordu — girişte bir
     saniyelik yeşil menü görünmesinin sebebi buydu. Koşul JS'in kullandığı
     eşiğin (max-width: 700px) aynısı, dolayısıyla davranış değişmiyor. */
  #radarSourceSelector,
  #radarSourceBadge,
  #bottomLeftIconDock,
  #soundEffectsWrap,
  #modeButton,
  #trackButton,
  #metarSearchButton,
  #findAirportButton,
  #airportVideoButton,
  #emergencyWatchButton,
  #dashboardInfoPanel,
  #dashboardLegend,
  #dashboardClock,
  #dashboardBottomBar,
  #dashboardBrand,
  #rangeControls,
  #activeRouteBar,
  #brandPanel,
  #brandLogo,
  #weatherPanel,
  #compactWeatherLine,
  #topTimePanel,
  #leftHamburgerMenu,
  #leftMenuItems,
  #trackingBanner,
  #trackedInfoPanel,
  #routePanel,
  #routeFinderButton,
  #languageSwitcher {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Telefon menüsüne taşınan sekmeler görünür kalmalı. */
  #phoneMenuSheet :is(#trackButton, #metarSearchButton, #findAirportButton,
  #airportVideoButton, #emergencyWatchButton, #modeButton, #routeFinderButton,
  #soundEffectsWrap) {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.phone-layout #phoneApp {
    display: block !important;
    pointer-events: none;
  }


  body.phone-layout {
    --phone-ink: #182b3b;
    --phone-muted: #657887;
    --phone-accent: #087e8b;
    --phone-border: #e1e8ed;
    --phone-nav: calc(76px + env(safe-area-inset-bottom, 0px));
    --phone-shadow: 0 8px 32px #102c4026;
    -webkit-tap-highlight-color: transparent;
  }
  #phoneApp *, #phoneBottomNav *, #phoneTrafficSheet *, #phoneLiveSheet *, #phoneMoreSheet * { box-sizing: border-box; }
  #phoneApp > * { pointer-events: auto; }
  #phoneApp button, #phoneBottomNav button, #phoneTrafficSheet button, #phoneLiveSheet button, #phoneMoreSheet button { cursor: pointer; touch-action: manipulation; font-family: inherit; }
  #phoneApp button:focus-visible, #phoneBottomNav button:focus-visible, #phoneTrafficSheet button:focus-visible, #phoneLiveSheet button:focus-visible, #phoneMoreSheet button:focus-visible { outline: 3px solid #087e8b; outline-offset: 3px; }
  #phoneTopBar { position: fixed; left: 14px; right: 14px; top: calc(12px + env(safe-area-inset-top, 0px)); z-index: 100660; }
  .phoneBrandRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 10px; }
  .phoneBrand { display: block; flex-shrink: 0; width: clamp(136px, 43vw, 180px); height: 40px; padding: 2px 6px; box-sizing: content-box; object-fit: contain; border-radius: 8px; background: #fff; }
  #phoneConnection { padding: 7px 9px; border: 1px solid #ffffffa6; border-radius: 20px; background: #fffffff0; color: #425868; font-size: 10px; font-weight: 650; box-shadow: 0 2px 8px #102c4010; }
  #phoneConnection.offline { color: #a43f2d; }
  #phoneSearchWrap { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 12px 0 16px; border: 1px solid #ffffff; border-radius: 17px; background: #fff; box-shadow: var(--phone-shadow); }
  #phoneSearchWrap > svg { flex: 0 0 19px; width: 19px; height: 19px; color: var(--phone-accent); }
  #phoneSearchWrap:focus-within { outline: 2px solid var(--phone-accent); }
  #phoneSearchInput { flex: 1; width: 0; min-width: 0; height: 100%; padding: 0; border: 0; outline: none; background: transparent; color: var(--phone-ink); font: 450 16px/1.3 system-ui, sans-serif; }
  #phoneSearchInput::placeholder { color: #758692; font-size: 14px; }
  #phoneSearchInput::-webkit-search-cancel-button { display: none; }
  .phoneCount { border-left: 1px solid var(--phone-border); padding-left: 12px; text-align: center; color: var(--phone-ink); font-size: 15px; font-weight: 750; font-variant-numeric: tabular-nums; }
  .phoneCount small { display: block; margin-top: 2px; font-size: 8px; letter-spacing: 1px; color: var(--phone-muted); }
  #phoneSearchClear { width: 44px; height: 44px; border: 0; background: transparent; color: var(--phone-muted); font-size: 24px; }
  #phoneSearchResults { display: none; margin-top: 8px; max-height: min(50dvh, 400px); overflow: auto; overscroll-behavior: contain; border: 1px solid var(--phone-border); border-radius: 18px; background: white; box-shadow: var(--phone-shadow); }
  body.phone-search-open #phoneSearchResults { display: block; }
  /* Başlık satırı: solda özet, sağda kapatma çarpısı. */
  .phoneSearchHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f4f7f9; border-bottom: 1px solid #edf1f4; }
  .phoneSearchHead .phoneSearchHeading { flex: 1; min-width: 0; }
  .phoneSearchClose { flex: 0 0 auto; width: 44px; height: 44px; margin-right: 6px; border: 0; border-radius: 10px; background: transparent; color: var(--phone-muted); font-size: 24px; line-height: 1; cursor: pointer; touch-action: manipulation; }
  .phoneSearchClose:hover { background: #e7eef2; color: var(--phone-ink); }
  .phoneSearchHeading { margin: 0; padding: 16px; background: #f4f7f9; color: var(--phone-muted); font-size: 11px; font-weight: 650; }
  .phoneSearchRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 60px; padding: 14px 16px; border: 0; border-bottom: 1px solid #edf1f4; background: white; text-align: left; color: var(--phone-ink); }
  .phoneSearchRow strong { font-size: 14px; overflow-wrap: anywhere; }
  .phoneSearchRow span { font-size: 12px; color: var(--phone-muted); white-space: nowrap; }
  .phoneSearchEmpty { padding: 4px 16px 16px; font-size: 13px; line-height: 1.6; color: var(--phone-muted); }
  #phoneFabs { position: fixed; right: 14px; bottom: calc(var(--phone-nav) + 22px); z-index: 100640; display: flex; flex-direction: column; gap: 8px; }
  #phoneFabs button { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid #ffffff; border-radius: 15px; background: #fff; color: var(--phone-ink); box-shadow: 0 3px 16px #102c4020; }
  #phoneFabs button svg { width: 22px; height: 22px; }
  #phoneFabs button[data-phone-fab="locate"] { margin-bottom: 8px; color: var(--phone-accent); }
  body.phone-flight-open #phoneFabs { bottom: calc(var(--phone-nav) + 235px); }
  body.phone-flight-open #phoneFlightCard { display: block; }
  .phoneSheetHandle { width: 32px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: #d6e0e6; }
  body.phone-layout #phoneBottomNav { display: flex !important; position: fixed; inset: auto 0 0; height: var(--phone-nav); box-sizing: border-box; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: #fffffff5; border-top: 1px solid #dce5eb; box-shadow: 0 -4px 24px #102c4010; backdrop-filter: blur(16px); z-index: 100710 !important; }
  #phoneBottomNav button { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; min-width: 0; min-height: 48px; padding: 4px; border: 0; border-radius: 14px; background: transparent; color: #687b89; font-size: 10px; font-weight: 650; }
  .phoneNavIcon { display: grid; place-items: center; width: 40px; height: 25px; border-radius: 9px; }
  .phoneNavIcon svg { width: 22px; height: 22px; }
  /* YouTube işareti 28x20 oranında: kare kutuda ezilmesin. */
  #phoneBottomNav [data-phone-nav="live"] .phoneNavIcon svg { width: 24px; height: 17px; }
  #phoneBottomNav [data-phone-nav="source"] { gap: 1px; }
  #phoneBottomNav [data-phone-nav="source"] .phoneNavIcon { height: 22px; }
  .phoneTrafficLabel { line-height: 11px; }
  #phoneActiveSource { display: block; margin-top: 1px; font-size: 9px; line-height: 10px; font-weight: 750; color: #087e8b; white-space: nowrap; }
  #phoneBottomNav button.active { color: #087e8b; background: #eaf4f4; }
  #phoneTrafficSheet, #phoneLiveSheet, #phoneMoreSheet { position: fixed; left: 12px; right: 12px; bottom: calc(var(--phone-nav) + 10px); max-height: calc(100dvh - var(--phone-nav) - env(safe-area-inset-top, 0px) - 120px); overflow: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid var(--phone-border); border-radius: 24px; background: #fff; box-shadow: var(--phone-shadow); z-index: 100720 !important; }
  body.phone-layout.phone-source-open #phoneTrafficSheet, body.phone-layout.phone-live-open #phoneLiveSheet, body.phone-layout.phone-more-open #phoneMoreSheet { display: flex !important; flex-direction: column; gap: 8px; }
  .phoneSheetHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
  .phoneSheetTitle { margin: 0; color: var(--phone-ink); font-size: 18px; font-weight: 750; letter-spacing: -.4px; }
  #phoneTrafficSheet button, #phoneLiveSheet button, #phoneMoreSheet button { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-height: 50px; padding: 12px 14px; border: 1px solid #e7edf1; border-radius: 13px; background: #f6f8fa; color: var(--phone-ink); font-size: 14px; font-weight: 600; text-align: left; }
  #phoneTrafficSheet button.active, #phoneLiveSheet button.active { background: #eaf6f4; border-color: #b6dcd7; color: #086b71; }
  [data-phone-source]::after { content: ''; width: 17px; height: 17px; border: 1.5px solid #b7c6d0; border-radius: 50%; }
  [data-phone-source].active::after { border: 5px solid #087e8b; background: white; }
  [data-phone-layer]::after { content: ''; width: 34px; height: 20px; border-radius: 20px; background: #c3cfd7; box-shadow: inset 15px 0 0 2px #edf1f4; }
  [data-phone-layer].active::after { background: #edf9f7; box-shadow: inset -15px 0 0 2px #087e8b; }
  #phoneMoreSheet [data-phone-more]::after { content: '›'; color: #8496a3; font-size: 20px; }
  #phoneTrafficSheet .phoneSheetClose, #phoneLiveSheet .phoneSheetClose, #phoneMoreSheet .phoneSheetClose { justify-content: center; width: 44px; min-height: 44px; padding: 0; border: 0; font-size: 24px; }
  #phoneBackdrop { display: none; position: fixed; inset: 0; border: 0; background: #122b4166; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 100705; }
  body.phone-layout.phone-sheet-open #phoneBackdrop { display: block; }
  body.phone-layout.phone-sheet-open #phoneFabs, body.phone-layout.phone-sheet-open #phoneFlightCard, body.phone-layout.phone-sheet-open #phoneAirportStack { visibility: hidden !important; }
  body.phone-layout.phone-keyboard-open #phoneBottomNav, body.phone-layout.phone-keyboard-open #phoneFabs, body.phone-layout.phone-keyboard-open #phoneFlightCard { display: none !important; }
  body.phone-layout #phoneAirportStack { bottom: calc(var(--phone-nav) + 10px); }
  @media (max-width: 360px) {
    #phoneTopBar { left: 10px; right: 10px; }
    #phoneFlightCard { padding: 10px 12px 14px; }
    #phoneFlightCallsign { font-size: 18px; }
    #phoneFlightFollow { padding: 0 10px; }
    .phoneFlightStats strong { font-size: 11px; }
  }
  @media (max-height: 520px) {
    .phoneBrandRow { display: none; }
    body.phone-layout { --phone-nav: calc(62px + env(safe-area-inset-bottom, 0px)); }
    #phoneFabs { flex-direction: row; bottom: calc(var(--phone-nav) + 10px); }
    #phoneFabs button[data-phone-fab="locate"] { margin-bottom: 0; }
    body.phone-flight-open #phoneFabs { display: none; }
    #phoneFlightCard { left: 12px; right: 74px; max-height: calc(100dvh - 140px); }
    #phoneTrafficSheet, #phoneLiveSheet, #phoneMoreSheet { max-height: calc(100dvh - var(--phone-nav) - 85px); }
  }

  body.phone-layout.metar-pinned #metarPinnedCard {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    top: auto !important;
    bottom: calc(var(--phone-nav) + 10px) !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    max-height: min(58vh, 440px) !important;
    overflow: auto !important;
    z-index: 100675 !important;
    transform: none !important;
    padding: 14px 16px !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: #151815 !important;
    border: 0 !important;
    box-shadow: 0 16px 40px rgba(18, 24, 20, 0.22) !important;
  }

  body.phone-layout.metar-pinned #metarPinnedCard,
  body.phone-layout.metar-pinned #metarPinnedCard * {
    color: #151815 !important;
    font-family: Inter, "Segoe UI", system-ui, sans-serif !important;
  }

  body.phone-layout #phoneAirportStack {
    display: none;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--phone-nav) + 10px);
    z-index: 100690;
    max-height: min(64vh, 560px);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
  }

  body.phone-layout.metar-pinned #phoneAirportStack {
    display: flex;
    flex-direction: column;
  }

  body.phone-layout #phoneAirportStack #metarPinnedCard,
  body.phone-layout #phoneAirportStack #airportVideosCard:not([hidden]),
  body.phone-layout #phoneAirportStack #airportTrafficCard.show {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;
    min-height: 0 !important;
    height: auto !important;
    box-sizing: border-box !important;
    transform: none !important;
  }

  body.phone-layout #phoneAirportStack #airportTrafficCard,
  body.phone-layout #phoneAirportStack #airportVideosCard {
    padding: 14px 16px !important;
    border: 0 !important;
    border-radius: 18px !important;
    background: #fff !important;
    color: #151815 !important;
    box-shadow: 0 16px 40px rgba(18, 24, 20, 0.22) !important;
    font-family: Inter, "Segoe UI", system-ui, sans-serif !important;
  }

  body.phone-layout #phoneAirportStack #atbStation,
  body.phone-layout #phoneAirportStack .atbCallsign {
    color: #151815 !important;
  }

  body.phone-layout #phoneAirportStack .atbRow {
    min-height: 44px;
    border-color: #e3e8e4 !important;
    background: #f6f8f6 !important;
  }

  body.phone-layout #phoneAirportStack .atbStatus,
  body.phone-layout #phoneAirportStack .atbRoute,
  body.phone-layout #phoneAirportStack .atbRowBottom,
  body.phone-layout #phoneAirportStack #atbUpdated,
  body.phone-layout #phoneAirportStack .atbEmpty {
    color: #66706a !important;
  }

  body.phone-layout #phoneAirportStack .atbTab.active,
  body.phone-layout #phoneAirportStack .atbViewAll {
    border-color: #f5c518 !important;
    background: #f5c518 !important;
    color: #1a1608 !important;
  }

  body.phone-layout #phoneAirportStack .atbTab,
  body.phone-layout #phoneAirportStack #atbClose {
    border-color: #dfe5e0 !important;
    background: #f3f5f3 !important;
    color: #202520 !important;
  }

  body.phone-layout.metar-pinned #phoneFlightCard,
  body.phone-layout.metar-pinned #phoneFabs {
    display: none !important;
  }

  body.phone-layout #emergencyWatchBox {
    width: calc(100vw - 20px);
    max-width: 520px;
    max-height: min(72vh, 620px);
    overflow: auto;
    box-sizing: border-box;
  }

  body.phone-layout #emergencyAlertCard {
    left: 10px !important;
    right: 10px !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    width: auto !important;
    max-width: none !important;
  }

  body.phone-layout.metar-pinned #metarCardStation {
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
  }

  body.phone-layout.metar-pinned #metarCardAirportName {
    max-width: none !important;
    margin-top: 4px !important;
    color: #3e463f !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
  }

  body.phone-layout.metar-pinned #metarCardStatus,
  body.phone-layout.metar-pinned .metarLabel {
    color: #6a726c !important;
    font-size: 11px !important;
    letter-spacing: 0.3px !important;
  }

  body.phone-layout.metar-pinned .metarValue,
  body.phone-layout.metar-pinned #metarRaw {
    color: #151815 !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
  }

  body.phone-layout.metar-pinned .metarCell {
    border-bottom: 1px solid #e6ebe7 !important;
  }

  body.phone-layout.metar-pinned #metarClose {
    background: #f3f5f3 !important;
    color: #151815 !important;
    border: 0 !important;
  }

  body.phone-layout.idle-dim #phoneApp,
  body.phone-layout.idle-dim #phoneBottomNav,
  body.phone-layout.idle-dim #phoneTrafficSheet,
  body.phone-layout.idle-dim #phoneLiveSheet,
  body.phone-layout.idle-dim #phoneMoreSheet,
  body.phone-layout.idle-dim #radarWorldMapHost {
    opacity: 1 !important;
  }
}

/* Flight details and the shared display settings stay inside the mobile shell. */
#phoneFlightCard { display: none; }
@media (max-width: 700px) {
  body.phone-layout #displaySettingsButton { display: none !important; }
  body.phone-layout #leftMenuTrackCards { display: none !important; }
  body.phone-layout #phoneFlightCard {
    position: fixed !important;
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(var(--phone-nav) + 10px) !important;
    width: auto !important;
    max-height: min(62dvh, calc(100dvh - var(--phone-nav) - 125px));
    margin: 0 !important;
    padding: 0 16px 16px;
    transform: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    z-index: 100670;
  }
  body.phone-layout.phone-flight-open #phoneFlightCard { display: block; }
  body.phone-layout #phoneFlightCard.phone-flight-compact { padding-bottom: 2px; }
  .phone-flight-waiting #phoneFlightRoute, .phone-flight-waiting .phoneFlightStats { display: none !important; }
  body.phone-layout.phone-flight-open #phoneFabs { display: none; }
  body.phone-layout #phoneMoreSheet #displaySettingsPanel {
    display: block !important; position: static !important; inset: auto !important; width: 100%; min-width: 0;
    padding: 0 0 10px; border: 0; border-bottom: 1px solid #e1e8ed; border-radius: 0; box-shadow: none;
    background: white; color: #182b3b; font: 600 12px/1.4 system-ui, sans-serif;
  }
  body.phone-layout #phoneMoreSheet #displaySettingsPanel label { display: flex; align-items: center; gap: 12px; min-height: 46px; margin: 0; padding: 8px; }
  #phoneMoreSheet #displaySettingsPanel input { width: 22px; height: 22px; accent-color: #087e8b; }
  #phoneMoreSheet .displaySettingsTitle { color: #657887; border-color: #e1e8ed; }
  body.phone-layout #trackModal { z-index: 100800 !important; }
  body.phone-layout #trackModal.show { padding: max(12px, env(safe-area-inset-top)) 12px !important; box-sizing: border-box; }
  body.phone-layout #trackBox { box-sizing: border-box; max-width: 100%; padding: 20px; border: 1px solid #e1e8ed; background: white; color: #182b3b; border-radius: 20px; font-family: system-ui, sans-serif; }
  body.phone-layout #trackBox h2 { color: #182b3b; font-weight: 700; }
  body.phone-layout #trackBox p, body.phone-layout #trackNetworkLabel, body.phone-layout #trackMessage { color: #657887; font-size: 12px; }
  body.phone-layout #callsignInput { background: #f1f6f8; border-color: #c7d9e2; color: #18394d; font: 600 18px system-ui, sans-serif; }
  body.phone-layout .trackActions button { height: 46px; background: #edf4f6; color: #18394d; border: 0; font: 650 12px system-ui, sans-serif; }
  body.phone-layout .trackActions .primary { background: #087e8b; color: white; }
  @media (max-width: 360px) {
    .phoneAirlineMark { width: 32px; flex-basis: 32px; }
    #phoneAirlineLogo { width: 28px; height: 28px; }
    #phoneFlightCard #phoneFlightCallsign { font-size: 16px; }
    #phoneFlightCard .phoneFlightActions { gap: 3px; }
  }
  @media (max-height: 520px) {
    body.phone-layout #phoneFlightCard { max-height: calc(100dvh - var(--phone-nav) - 85px); }
  }
}

#phoneAirportStack { display: none; }
@media (max-width: 700px) {
  body.phone-layout #phoneAirportStack {
    top: auto; bottom: calc(var(--phone-nav) + 10px); left: 12px; right: 12px;
    max-height: min(62dvh, calc(100dvh - var(--phone-nav) - 125px));
    gap: 0; border: 1px solid #e1e8ed; border-radius: 23px; background: white;
    box-shadow: var(--phone-shadow); box-sizing: border-box;
  }
  .phoneAirportControls { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 4px 10px; background: white; border-bottom: 1px solid #e1e8ed; flex-shrink: 0; }
  .phoneAirportControls button { min-height: 44px; border: 0; background: white; color: #087e8b; font: 600 11px system-ui, sans-serif; touch-action: manipulation; cursor: pointer; }
  #phoneAirportExpand { flex: 1; }
  #phoneAirportClose { width: 44px; border-radius: 12px; background: #f2f5f7; color: #657887; font-size: 24px; }
  .phoneAirportControls button:focus-visible { outline: 3px solid #087e8b; outline-offset: -3px; }
  body.phone-layout #phoneAirportStack #metarPinnedCard,
  body.phone-layout #phoneAirportStack #airportTrafficCard { border-radius: 0 !important; box-shadow: none !important; }
  body.phone-layout #phoneAirportStack #metarClose { display: none !important; }
  /* Kart telefonda kendi kaydırma kabı olmasın: yüksekliği zaten serbest,
     ama iOS iç içe kaydırıcılarda parmağı içteki kaba veriyor ve dıştaki
     yığın kaymıyor. Kaydırma tek bir kapta (#phoneResultStack) toplanıyor. */
  body.phone-layout #phoneAirportStack #metarPinnedCard,
  body.phone-layout #phoneAirportStack #airportTrafficCard { overflow: visible !important; }
  body.phone-layout #phoneResultStack,
  body.phone-layout #phoneAirportStack { touch-action: pan-y; }
  body.phone-layout #phoneAirportStack.phone-airport-compact #metarPinnedCard { padding: 10px 16px 12px !important; }
  body.phone-layout #phoneAirportStack.phone-airport-compact #metarPinnedCard > :not(#metarCardHeader),
  body.phone-layout #phoneAirportStack.phone-airport-compact #airportTrafficCard,
  body.phone-layout #phoneAirportStack.phone-airport-compact #metarCardStatus { display: none !important; }
  body.phone-layout #phoneAirportStack.phone-airport-compact #metarCardAirportName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100% !important; }
  body.phone-layout #phoneAirportStack #metarCardHeader > div { min-width: 0; }
  @media (max-height: 520px) { body.phone-layout #phoneAirportStack { max-height: calc(100dvh - var(--phone-nav) - 85px); } }
}

@media (max-width: 700px) {
  #phoneMapCredit { position: fixed; left: 14px; top: calc(124px + env(safe-area-inset-top, 0px)); z-index: 100630; max-width: calc(100vw - 28px); padding: 4px 7px; border-radius: 5px; background: #132c3cbf; color: #fff; font: 8px/1.4 system-ui, sans-serif; text-decoration: none; }
  .phoneBasemapLabel { color: #657887; font-size: 12px; font-weight: 600; }
  /* Katmanlar Ayarlar sayfasına taşındı: düğmeler kenardan kenara. */
  #phoneLayerGroup { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  #phoneLayerGroup button { width: 100%; }
  /* Canlı Videolar listesi: her meydan kendi satırında, kapak görseliyle. */
  #phoneLiveList { display: flex; flex-direction: column; gap: 8px; }
  #phoneLiveSheet .phoneLiveRow { display: flex; align-items: center; justify-content: flex-start; gap: 11px; min-height: 64px; padding: 8px 10px; }
  .phoneLiveThumb { width: 64px; height: 36px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; background: #e7edf1; }
  .phoneLiveThumb[hidden] { display: none; }
  .phoneLiveText { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
  .phoneLiveRow strong { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .phoneLiveRow small { color: #657887; font-size: 11px; font-weight: 500; }
  .phoneLiveBadge { flex: 0 0 auto; width: max-content; align-self: center; padding: 3px 7px; border-radius: 5px; background: #ff0000; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .1em; }
  .phoneLiveHeading { margin: 6px 0 0; color: #657887; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
  .phoneLiveHeading:first-child { margin-top: 0; }
  /* Simülatör rozeti kırmızı değil: 7/24 kameradan ayrılsın. */
  .phoneSimBadge { background: #3c6e9a; }
  .phoneLiveRow small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .phoneLiveEmpty { margin: 4px 0; color: #657887; font-size: 13px; }
  #phoneBasemap, #phoneTheme { flex-shrink: 0; width: 100%; min-height: 48px; padding: 10px; border: 1px solid #dce5eb; border-radius: 12px; background: #f4f7f9; color: #18394d; font: 16px system-ui, sans-serif; }
}

/* Theme is set in the head so the first mobile frame also uses the saved colors. */
@media (max-width: 700px) {
  html[data-mobile-theme="dark"] { color-scheme: dark; background: #101923; }
  html[data-mobile-theme="dark"] body { background: #101923 !important; }
  html[data-mobile-theme="dark"] #splashScreen { background: #101923 !important; }
  html[data-mobile-theme="dark"] body.phone-layout {
    --phone-ink: #ecf2f7;
    --phone-muted: #a5b6c6;
    --phone-accent: #57d9cd;
    --phone-border: #304252;
    --phone-shadow: 0 8px 32px #0006;
  }
  html[data-mobile-theme="dark"] body.phone-layout #radarWorldMapHost { background: #101923 !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(
    #phoneConnection, #phoneSearchWrap, #phoneSearchResults, .phoneSearchRow,
    #phoneFabs button, #phoneBottomNav, #phoneFlightCard, .phoneFlightHead,
    #phoneFlightRoute, #phoneFlightExpand, #phoneTrafficSheet, #phoneLiveSheet,
    #phoneMoreSheet, #displaySettingsPanel, #phoneAirportStack, .phoneAirportControls,
    .phoneAirportControls button, #metarPinnedCard, #airportTrafficCard, #trackBox,
    #deskAtcInstallBanner, #starlinkCard
  ) { background: #172330 !important; color: var(--phone-ink) !important; border-color: var(--phone-border) !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(
    .phoneSearchHeading, #phoneFlightClose, #phoneAirportClose, #phoneAircraftType,
    #phoneBasemap, #phoneTheme, #phoneMoreSheet button, #phoneTrafficSheet button,
    #phoneLiveSheet button, #callsignInput, .trackActions button,
    #deskAtcInstallHelp, .atbRow, .atbTab, #atbClose, #metarClose
  ) { background: #223343 !important; color: var(--phone-ink) !important; border-color: var(--phone-border) !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(
    #phoneBottomNav button.active, #phoneFlightFollow.active,
    [data-phone-source].active, [data-phone-layer].active, .atbTab.active
  ) { background: #1c4447 !important; color: #7fe8dc !important; border-color: #397b78 !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(#phoneFlightFollow:not(.active), .trackActions .primary) { background: #57d9cd !important; color: #10252b !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(
    .phoneBasemapLabel, .phoneAirlineLine, #phoneFlightStatus, #phoneRouteProgress > div,
    #phoneFlightRoute small, #phoneFlightRoute span:not(.phoneRoutePlane),
    .displaySettingsTitle, #phoneBottomNav button, #trackBox p, #trackNetworkLabel,
    #trackMessage, #deskAtcInstallBanner small, #deskAtcInstallDismiss,
    #metarCardAirportName, #metarCardStatus, .metarLabel,
    .atbStatus, .atbRoute, .atbRowBottom, #atbUpdated, .atbEmpty
  ) { color: var(--phone-muted) !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(
    #phoneFlightRoute strong, #trackBox h2, #metarCardStation, .metarValue,
    #metarRaw, #atbStation, .atbCallsign, #starlinkCard button
  ) { color: var(--phone-ink) !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(.metarCell, .phoneFlightStats, .phoneAirportControls, #phoneFlightExpand) { border-color: var(--phone-border) !important; }
  html[data-mobile-theme="dark"] body.phone-layout :is(.phoneRoutePlane, #phoneFlightExpand, #phoneAirportExpand) { color: var(--phone-accent) !important; }
  html[data-mobile-theme="dark"] body.phone-layout #phoneConnection.offline { color: #ffae9d !important; }
  html[data-mobile-theme="dark"] body.phone-layout #phoneBottomNav svg circle { fill: #172330; }
  html[data-mobile-theme="dark"] body.phone-layout #phoneSearchInput::placeholder { color: var(--phone-muted); }
  html[data-mobile-theme="dark"] body.phone-layout #phoneBackdrop { background: #050b1480; }
  html[data-mobile-theme="dark"] body.phone-layout #starlinkCard :is(small, a) { color: #d3a9ff; }
  html[data-mobile-theme="dark"] body.phone-layout #phoneProgressBar::-webkit-progress-bar { background: #304252; }
  html[data-mobile-theme="dark"] body.phone-layout #phoneProgressBar::-webkit-progress-value { background: #57d9cd; }
}

@media (min-width: 701px) {
  html body:not(.phone-layout) #trackingBanner, html body:not(.phone-layout) #trackedInfoPanel,
  html body:not(.phone-layout) #routePanel, html body:not(.phone-layout) #leftMenuTrackCards,
  html body:not(.phone-layout) #dashboardInfoPanel { display: none !important; visibility: hidden !important; pointer-events: none !important; }
  body:not(.phone-layout) #phoneFlightCard {
    --phone-ink: #182b3b; --phone-muted: #657887; --phone-accent: #087e8b;
    --phone-border: #e1e8ed; --phone-shadow: 0 8px 32px #0004;
    position: fixed !important; top: 72px !important; bottom: auto !important;
    left: var(--flight-card-left, 18px) !important; right: auto !important;
    width: 340px !important; max-width: calc(100vw - var(--flight-card-left, 18px) - 18px);
    max-height: calc(100dvh - 154px); padding: 0 16px 16px;
    margin: 0 !important; transform: none !important;
    overflow: auto; overscroll-behavior: contain;
    box-sizing: border-box; font-family: Inter, 'Segoe UI', system-ui, sans-serif;
    z-index: 100670;
  }
  body:not(.phone-layout).phone-flight-open #phoneFlightCard { display: block; }
  body:not(.phone-layout) #leftHamburgerMenu { z-index: 100730 !important; }
  body:not(.phone-layout) #leftHamburgerButton { z-index: 100740 !important; }
  body.clock-mode #phoneFlightCard { display: none !important; }
  body:not(.phone-layout) #phoneFlightCard.phone-flight-compact { padding-bottom: 2px; }
  body:not(.phone-layout) .phone-flight-waiting :is(#phoneFlightRoute, .phoneFlightStats) { display: none !important; }
}
#phonePhotoCredit a { color: inherit; text-decoration: none; }
#phonePhotoCredit a:hover { text-decoration: underline; }

@media (max-width: 700px) {
  body.phone-layout #phoneBasemap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0; border: 0; background: transparent; }
  body.phone-layout #phoneBasemap button { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; padding: 10px; text-align: left; border: 2px solid #dce5eb; border-radius: 14px; background: white; color: #193347; }
  body.phone-layout #phoneBasemap button[aria-pressed="true"] { border-color: #087f8b; background: #edf8f8; box-shadow: 0 0 0 1px #087f8b; }
  body.phone-layout #phoneBasemap button:focus-visible { outline: 3px solid #087f8b; outline-offset: 3px; }
  #phoneBasemap strong { font: 650 13px system-ui; }
  #phoneBasemap small { color: #5a7180; font: 11px/1.4 system-ui; }
  .basemapPreview { height: 38px; margin-bottom: 4px; border-radius: 7px; }
  .basemapStreets { background: linear-gradient(28deg, transparent 42%, white 43% 48%, transparent 49%), linear-gradient(110deg, #deebd7 35%, #b9dcec 36% 48%, #e8eedf 49%); }
  .basemapSatellite { background: linear-gradient(28deg, transparent 40%, #ada995 41% 43%, transparent 44%), linear-gradient(110deg, #536d38 35%, #315e75 36% 48%, #6e8048 49% 72%, #8c8061 73%); }
}

/* Mobile navigation tools live in a left-side menu, separate from settings. */
#phoneMenuButton, #phoneMenuSheet { display: none; }
@media (max-width: 700px) {
  #phoneMenuButton { display: grid; place-items: center; flex: 0 0 44px; height: 44px; padding: 0; border: 1px solid var(--phone-border); border-radius: 14px; background: #fff; color: var(--phone-ink); font-size: 23px; box-shadow: 0 3px 12px #102c4014; }
  .phoneBrandRow .phoneBrand { width: clamp(110px, 34vw, 152px); min-width: 0; }
  #phoneConnection { margin-left: auto; }
  #phoneMenuSheet { box-sizing: border-box; position: fixed; left: 12px; top: calc(72px + env(safe-area-inset-top, 0px)); width: min(310px, calc(100vw - 24px)); max-height: calc(100dvh - var(--phone-nav) - 90px); overflow: auto; overscroll-behavior: contain; padding: 16px; border: 1px solid var(--phone-border); border-radius: 22px; background: #fff; color: var(--phone-ink); box-shadow: var(--phone-shadow); z-index: 100720 !important; font-family: system-ui, sans-serif; }
  body.phone-layout.phone-menu-open #phoneMenuSheet { display: flex; flex-direction: column; gap: 8px; }
  #phoneMenuSheet button { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; min-height: 48px; padding: 12px 14px; border: 1px solid #e7edf1; border-radius: 13px; background: #f6f8fa; color: var(--phone-ink); font: 600 14px system-ui, sans-serif; text-align: left; cursor: pointer; touch-action: manipulation; }
  #phoneMenuSheet [data-phone-more]::after { content: '›'; color: #8496a3; font-size: 20px; }
  #phoneMenuSheet .phoneSheetClose { justify-content: center; width: 44px; padding: 0; border: 0; font-size: 24px; }
  #phoneMenuSheet button:focus-visible, #phoneMenuButton:focus-visible { outline: 3px solid #087e8b; outline-offset: 2px; }
}
/* One scrollable results area and a consistent foreground for mobile queries. */
#phoneResultStack { display: none; }
@media (max-width: 700px) {
  body.phone-layout {
    /* Kaydırma kabı kenarlara kadar uzanıyor, boşluk iç dolgudan geliyor:
       inset ile 12px içeride durunca sağdaki şeride —kaydırma çubuğunun
       göründüğü yere— dokunmak kartı değil haritayı kaydırıyordu. */
    & #phoneResultStack { display: flex; flex-direction: column; gap: 10px; position: fixed; inset: 50% 0 auto; padding: 0 12px; box-sizing: border-box; transform: translateY(-50%); max-height: calc(100dvh - var(--phone-nav) - env(safe-area-inset-top, 0px) - 130px); overflow: auto; overscroll-behavior: contain; z-index: 100690; pointer-events: auto; scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb, #8aabb7) transparent; }
    /* Kart yokken kap ekranı kaplamasın: boşken haritaya dokunulabilsin. */
    & #phoneResultStack:empty { pointer-events: none; }
    /* Telefonda kartlar hiç kaydırılamıyordu: html/body üzerindeki genel
       "touch-action: none" (radar jestleri için konmuştu) parmağı bütün
       sayfada kilitliyor, kaydırma kabına hiç ulaştırmıyordu. Jestler
       zaten radar tuvalinin kendi dokunma işleyicilerinde ele alınıyor,
       bu yüzden kilidi tuvalde bırakıp gövdede dikey kaydırmayı açıyoruz. */
    touch-action: pan-y;
    & #radar, & #radarWorldMap, & .maplibregl-canvas-container, & .maplibregl-canvas { touch-action: none; }
  }
  /* :has() yerine doğrudan medya sorgusu: phone-layout sınıfı JS ile
     geldiği için ilk boyamada kilit açık kalmasın. */
  html { touch-action: pan-y; }
  body.phone-layout {

    /* Yığındaki kartlar kendi kaydırma kabı olmasın: içlerinde
       overflow-y:auto + overscroll-behavior:contain kalırsa kaydıracak
       şeyleri olmadığı hâlde parmağı yutuyor ve hareket dıştaki
       #phoneResultStack'e hiç geçmiyordu — kartın gövdesinde kaydırma
       durur, yalnızca kenardaki şerit çalışırdı. */
    & #phoneResultStack > :is(#phoneFlightCard, #phoneAirportStack, #routeInfoCard, #routePlanningToolbar, #routeAirportPopup, #emergencyAlertCard, #starlinkCard),
    & #phoneResultStack #metarPinnedCard,
    & #phoneResultStack #airportVideosCard,
    & #phoneResultStack #airportTrafficCard { overflow: visible !important; overscroll-behavior: auto !important; -webkit-overflow-scrolling: auto !important; max-height: none !important; }
    & #phoneResultStack > :is(#phoneFlightCard, #phoneAirportStack, #routeInfoCard, #routePlanningToolbar, #routeAirportPopup, #emergencyAlertCard, #starlinkCard) { position: relative !important; inset: auto !important; width: 100% !important; min-width: 0 !important; max-width: none !important; max-height: none !important; margin: 0 !important; transform: none !important; flex: 0 0 auto; box-sizing: border-box; pointer-events: auto; }
    & #phoneResultStack > [hidden] { display: none !important; }
    & #phoneResultStack :is(#routeInfoCard, #routeAirportPopup, #emergencyAlertCard, #starlinkCard) { padding: 16px !important; border: 1px solid #dce5eb !important; border-radius: 22px !important; background: #fff !important; color: #193448 !important; box-shadow: 0 4px 18px #102c4014 !important; font: 14px/1.5 system-ui, sans-serif !important; }
    & #phoneResultStack :is(#routeInfoCard, #routeAirportPopup, #emergencyAlertCard, #starlinkCard) :is(div, span, strong, small, p, h2, a) { color: #345266 !important; text-shadow: none !important; font-family: system-ui, sans-serif !important; overflow-wrap: anywhere; }
    & #phoneResultStack :is(.routeInfoGrid > div, #routeAirportPopupRunways) { padding: 10px; border-radius: 12px; border-color: #dce5eb !important; background: #f3f7f9 !important; }
    & #routePlanningToolbar { padding: 10px !important; flex-wrap: wrap; gap: 8px; border: 1px solid #dce5eb !important; border-radius: 18px !important; background: white !important; }
    & #phoneResultStack :is(#routeInfoCard, #routeAirportPopup, #routePlanningToolbar, #emergencyAlertCard, #starlinkCard) button { min-width: 44px; min-height: 44px; border: 1px solid #dce5eb !important; border-radius: 12px; background: #edf4f6 !important; color: #193448 !important; font: 600 13px system-ui, sans-serif; touch-action: manipulation; }
    & #activeRouteBar { display: none !important; }
    &.phone-sheet-open #phoneResultStack { visibility: hidden !important; }
    & :is(#findAirportModal, #trackModal, #metarSearchModal, #airportVideoModal, #routeFinderModal, #routeResultModal, #emergencyWatchModal, #viewSettingsModal, #liveVideoModal, #simVideoModal) { position: fixed !important; inset: 0 !important; width: 100% !important; height: 100dvh !important; padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)) !important; box-sizing: border-box !important; align-items: center !important; justify-content: center !important; overflow: auto !important; z-index: 100820 !important; background: #122b4166 !important; backdrop-filter: blur(5px); transform: none !important; }
    & :is(#findAirportBox, #trackBox, #metarSearchBox, #airportVideoBox, #routeFinderPanel, #routeResultPanel, #emergencyWatchBox, #viewSettingsBox, #liveVideoBox, #simVideoBox) { position: relative !important; inset: auto !important; width: 100% !important; min-width: 0 !important; max-width: 520px !important; max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 24px) !important; box-sizing: border-box !important; overflow: auto !important; overscroll-behavior: contain; margin: 0 !important; padding: 20px !important; border: 1px solid #dce5eb !important; border-radius: 24px !important; background: #fff !important; color: #193448 !important; box-shadow: 0 16px 50px #102c4030 !important; transform: none !important; font: 14px/1.5 system-ui, sans-serif !important;
      & :is(div, span, label, strong, p, h2, th, td) { color: #345266 !important; font-family: system-ui, sans-serif !important; text-shadow: none !important; letter-spacing: normal !important; }
      & h2, & .routeFinderTitle, & .routeResultTitle { margin-top: 0; font-size: 20px !important; font-weight: 750 !important; }
      & input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; padding: 12px !important; border: 1px solid #c7d9e2 !important; border-radius: 12px !important; background: #f3f7f9 !important; color: #193448 !important; font: 16px system-ui, sans-serif !important; }
      & button { min-height: 44px; min-width: 44px; padding: 10px 12px; border: 1px solid #dce5eb !important; border-radius: 12px !important; background: #edf4f6 !important; color: #193448 !important; font: 600 13px system-ui, sans-serif !important; touch-action: manipulation; }
      & :is(input, button):focus-visible { outline: 3px solid #087e8b; outline-offset: 2px; }
      & :is(.primary, #metarGetButton, #routeFinderCreate, #routeResultDone) { background: #087e8b !important; color: #fff !important; }
      & :is(.routeFinderSummary, #routeResultSummary, #routeResultString, .routeFinderResults, .findAirportItem, .emergencyWatchItem) { border: 1px solid #dce5eb !important; border-radius: 12px; background: #f3f7f9 !important; padding: 12px; }
    }
    /* Live panels share the phone's light modal theme, including radar mode. */
    & :is(#liveVideoBox, #simVideoBox) {
      overflow: hidden !important;
      & > h2, & > p, & > .metarActions { flex-shrink: 0; }
      & .metarActions button { width: 100%; }
      & :is(#liveVideoResults, #simVideoResults) {
        min-height: 0;
        max-height: none;
        flex: 1 1 auto;
        overflow-y: auto;
      }
      & .liveVideoRow {
        display: grid;
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 6px 10px;
        box-sizing: border-box;
        flex-shrink: 0;
        background: #fff !important;
      }
      & .liveVideoThumb { grid-column: 1; grid-row: 1 / 3; background: #eef3f6; }
      & .liveVideoText { grid-column: 2; overflow-wrap: anywhere; }
      & .liveVideoText strong { white-space: normal; font: 650 13px/1.4 system-ui, sans-serif; }
      & .liveVideoText small, & .liveVideoEmpty { color: #657c8c !important; font: 12px/1.4 system-ui, sans-serif; }
      & .liveVideoBadge {
        grid-column: 2;
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: anywhere;
        color: #fff !important;
        font: 650 10px/1.4 system-ui, sans-serif !important;
      }
    }
    & .routeFinderFields { display: flex !important; flex-direction: column; gap: 10px; }
    & .routeFinderField { width: 100%; min-width: 0; }
    & .routeFinderResults { position: relative !important; inset: auto !important; max-height: 180px; overflow: auto; }
    & :is(.routeFinderActions, .routeResultActions, .trackActions, .metarActions) { display: flex; flex-wrap: wrap; gap: 8px; }
    & .routeResultTableWrap { max-width: 100%; overflow-x: auto; border-radius: 12px; }
    & #routeResultTable :is(th, td) { background: #f3f7f9 !important; border-color: #dce5eb !important; padding: 10px; font-size: 12px; }
    & #routeResultString { overflow-wrap: anywhere; }
    & #photoLightbox { z-index: 100840 !important; }

    /* VIDEO SATIRLARI — dokunma hedefi büyütülüyor, kapak telefonda daha
       geniş; kart zaten dar olduğu için başlık iki satırda kalıyor. */
    & #metarAirportVideos { gap: 8px; margin-top: 12px; }
    & .metarLandingVideo { padding: 10px; gap: 12px; min-height: 64px; border-radius: 14px; }
    & .metarLandingVideoThumb { width: 104px; height: 59px; border-radius: 10px; }
    & .metarLandingVideoText { font-size: 12px !important; letter-spacing: .06em; }
    & .metarLandingVideoCaption { font-size: 12px !important; line-height: 1.35; }
    & .metarLandingVideoHint { font-size: 10px !important; }
    /* Arama penceresindeki satırlar da kartla aynı ölçüde olsun. */
    & #airportVideoResults { gap: 8px; }

    /* OYNATICI — telefon katmanlarının (bottom nav 100710, sheet 100720,
       modal 100820) üstünde olmalı, yoksa kartın arkasında kalıyor. */
    & #landingVideoLightbox { z-index: 100850 !important; padding: 0 !important; background: #05121bef !important; align-items: stretch !important; }
    & #landingVideoBox { width: 100% !important; height: 100dvh !important; box-sizing: border-box; display: flex; flex-direction: column; border: 0 !important; border-radius: 0 !important; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
    & #landingVideoHeader { padding: 14px 16px; }
    & #landingVideoTitle { font-size: 14px; }
    & #landingVideoClose { min-width: 44px; min-height: 44px; font-size: 30px; }
    & #landingVideoFrameWrap { flex: 0 0 auto; }
    & #landingVideoFooter { flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
    & #landingVideoFooter button, & #landingVideoOpen { min-height: 44px; padding: 10px 14px; font-size: 12px; touch-action: manipulation; }
    & #landingVideoOpen { flex: 1 1 100%; justify-content: center; }
    /* Tam ekranda altta kalan boşluk imza alanı: logo dibe yaslanıyor. */
    & #landingVideoBrand { margin-top: auto; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  }
}
@media (max-width: 700px) and (max-height: 520px) {
  body.phone-layout .phoneBrandRow { display: block; padding: 0; }
  body.phone-layout .phoneBrandRow :is(.phoneBrand, #phoneConnection) { display: none; }
  body.phone-layout #phoneMenuButton { position: absolute; top: 5px; left: 0; }
  body.phone-layout #phoneSearchWrap { margin-left: 54px; }
}
@media (max-width: 700px) {
  body.phone-layout :is(#findAirportBox, #trackBox, #metarSearchBox, #routeFinderPanel, #routeResultPanel, #emergencyWatchBox) p { font-size: 13px !important; line-height: 1.5 !important; }
  body.phone-layout :is(.routeFinderResult, .emergencyWatchRow) { border-color: #dce5eb !important; background: #f3f7f9 !important; border-radius: 12px; min-height: 44px; }
}

@media (max-width: 700px) {
  body.phone-layout :is(#phoneTrafficSheet, #phoneLiveSheet, #phoneMoreSheet) { top: 50%; bottom: auto; transform: translateY(-50%); }
}

@media (max-width: 700px) {
  body.phone-layout #displaySettingsPanel .aircraftIconSetting { display: none !important; }
}

.installShortLabel { display: none; }
@media (min-width: 701px) and (max-width: 1366px) {
  body #deskAtcInstallBanner { left: auto; right: 18px; width: min(360px, calc(100vw - 36px)); box-sizing: border-box; padding: 10px; gap: 10px; }
  body #deskAtcInstallBanner .installIcon { width: 36px; height: 36px; border-radius: 9px; }
  body #deskAtcInstallBanner .installCopy { flex: 1; padding: 0; }
  body #deskAtcInstallBanner .installCopy small, body #deskAtcInstallBanner .installFullLabel { display: none; }
  body #deskAtcInstallBanner .installShortLabel { display: inline; }
  body #deskAtcInstallBanner #deskAtcInstallAccept { width: auto; padding: 0 16px; }
  body #deskAtcInstallBanner #deskAtcInstallDismiss { position: static; flex: 0 0 44px; }
  body #deskAtcInstallHelp { order: 1; }
}

@media (max-width: 700px) {
  body.phone-layout #phoneMenuSheet { display: flex; flex-direction: column; gap: 2px; left: 12px; top: calc(124px + env(safe-area-inset-top, 0px)); bottom: auto; width: min(264px, calc(100vw - 36px)); max-height: calc(100dvh - var(--phone-nav) - env(safe-area-inset-top, 0px) - 144px); padding: 12px; border: 1px solid #dce5eb; border-radius: 18px; box-shadow: 8px 0 24px #19344818; transform: translateX(-100%); visibility: hidden; pointer-events: none; transition: transform 180ms ease, visibility 180ms; }
  body.phone-layout.phone-menu-open #phoneMenuSheet { transform: translateX(0); visibility: visible; pointer-events: auto; gap: 2px; }
  body.phone-layout #phoneMenuSheet [data-phone-more] { border: 0; border-radius: 8px; background: transparent; font-weight: 500; color: #345266; }
  body.phone-layout #phoneMenuSheet [data-phone-more]:hover { background: #edf4f6; }
  body.phone-layout.phone-menu-open #phoneBackdrop { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) { body.phone-layout #phoneMenuSheet { transition: none; } }

@media (max-width: 700px) and (max-height: 520px) {
  body.phone-layout #phoneMenuSheet { top: calc(76px + env(safe-area-inset-top, 0px)); max-height: calc(100dvh - var(--phone-nav) - 90px); }
}
/* Compact mobile search and flight information above the map center. */
#phoneSearchToggle { display: flex; align-items: center; justify-content: center; flex: 0 0 24px; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
#phoneSearchToggle svg { width: 19px; height: 19px; }
@media (max-width: 700px) {
  body.phone-layout #phoneSearchWrap { width: 44px; height: 44px; box-sizing: border-box; padding: 0; margin-left: auto; }
  body.phone-layout #phoneSearchToggle { flex: 0 0 44px; height: 44px; color: var(--phone-accent); }
  body.phone-layout:not(.phone-search-expanded) #phoneSearchWrap > :not(#phoneSearchToggle) { display: none !important; }
  body.phone-layout.phone-search-expanded #phoneSearchWrap { width: 100%; gap: 6px; padding-right: 10px; }
  body.phone-layout #phoneFlightCard.phone-flight-tracking.phone-flight-compact {
    transform: none !important;
    top: calc(var(--phone-header-bottom, 120px) + 8px) !important;
    bottom: auto !important;
    max-height: max(90px, calc(50dvh - var(--phone-header-bottom, 120px) - 20px)) !important;
  }
}
