/* Sky — Airport view (sky-airport.js). Works in both Skys: it is its own
   full-screen layer with its own map, above everything else on the page. */
#sgAp{ display:none }
#sgAp.show{
  display:block; position:fixed; top:0; right:0; bottom:0; left:0; z-index:60;
  background:#0B0D12; color:#F7F8FA; font-family:var(--body, system-ui, sans-serif);
  --ap-tint:rgba(12,14,18,.78); --ap-edge:rgba(255,255,255,.14);
}
:root[data-sky-glass]:not([data-sky-dark]) #sgAp.show{ background:#E6E8EB }
#sgApMap{ position:absolute; top:0; right:0; bottom:0; left:0 }
#sgAp .leaflet-container{ background:inherit }
/* Everything under the layer stops animating behind it. */
:root.sg-airport-on body > *:not(#sgAp):not(#sgCv){ visibility:hidden }

#sgAp .ap-top{
  position:absolute; z-index:1000; top:max(12px, env(safe-area-inset-top)); left:12px; right:12px;
  display:flex; align-items:center; gap:8px; flex-wrap:wrap; pointer-events:none;
}
#sgAp .ap-top > *{ pointer-events:auto }
#sgAp .ap-back, #sgAp .ap-pick{
  font-weight:600; font-size:14px; line-height:1.2; font-family:inherit; color:#F7F8FA; background:var(--ap-tint); border:1px solid var(--ap-edge);
  border-radius:10px; padding:10px 14px; cursor:pointer; box-shadow:inset 0 -3px 0 #FF3D77;
}
#sgAp .ap-pick{ box-shadow:inset 0 -3px 0 #2F7BFF; max-width:240px; margin-left:auto }
#sgAp .ap-title{
  display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; min-width:0;
  background:var(--ap-tint); border:1px solid var(--ap-edge); border-radius:12px; padding:8px 14px;
}
#sgAp .ap-code{ font-size:24px; letter-spacing:.02em }
#sgAp .ap-name{ font-size:13px; color:#C9CFD8; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:40vw }
#sgAp .ap-rwy{ font:600 13px/1.2 "IBM Plex Mono",ui-monospace,monospace; color:#FF8FB1 }
#sgAp .ap-rwy:empty{ display:none }

/* The list: a column on the right; a sheet along the bottom on narrow screens. */
#sgAp .ap-side{
  position:absolute; z-index:1000; top:84px; right:12px; bottom:24px; width:min(340px, 36vw);
  overflow:auto; background:var(--ap-tint); border:1px solid var(--ap-edge); border-radius:14px; padding:12px 14px;
}
@media (max-width:760px){
  #sgAp .ap-side{ top:auto; left:12px; right:12px; width:auto; max-height:42vh; bottom:12px }
  #sgAp .ap-name{ display:none }
}
#sgAp h3{ margin:10px 0 6px; font-weight:700; font-size:11px; line-height:1.2; font-family:inherit; letter-spacing:.12em; text-transform:uppercase; color:#A8AFBA }
#sgAp h3 .n{ color:#F7F8FA; margin-left:4px }
#sgAp section:first-of-type h3{ margin-top:2px }
#sgAp ol{ list-style:none; margin:0; padding:0 }
#sgAp li{
  display:grid; grid-template-columns:1fr auto auto; gap:2px 8px; align-items:baseline;
  padding:8px 8px; margin:0 -8px; border-radius:8px; cursor:pointer;
}
#sgAp li:hover, #sgAp li.on{ background:rgba(255,255,255,.08) }
#sgAp li .cs{ font:700 15px/1.2 "IBM Plex Mono",ui-monospace,monospace }
#sgAp li .rw{ font:700 11px/1 "IBM Plex Mono",monospace; padding:3px 6px; border-radius:5px; background:#FF3D77; color:#fff }
#sgAp .ap-sec-dep li .rw{ background:#00E0C6; color:#0F1115 }
#sgAp li .eta{ font:700 15px/1.2 "IBM Plex Mono",monospace; color:#FFD37A; text-align:right; grid-column:3 }
#sgAp li .meta{ grid-column:1 / -1; font-size:12px; color:#A8AFBA }
#sgAp .ap-sec-arr li{ box-shadow:inset 3px 0 0 #FF3D77; padding-left:11px }
#sgAp .ap-sec-dep li{ box-shadow:inset 3px 0 0 #00E0C6; padding-left:11px }
#sgAp .ap-landed li{ cursor:default; box-shadow:inset 3px 0 0 #FFD37A; padding-left:11px }
#sgAp .ap-empty, #sgAp .ap-gnd, #sgAp .ap-note, #sgAp .ap-status{ font-size:12px; color:#A8AFBA; margin:6px 0 }
#sgAp .ap-status:empty, #sgAp .ap-gnd:empty{ display:none }
#sgAp .ap-note{ margin-top:14px; opacity:.75 }
#sgAp [hidden]{ display:none !important }

/* Runway numbers at each threshold */
.ap-rwy-lbl{ font:700 11px/16px "IBM Plex Mono",ui-monospace,monospace; color:#fff; text-align:center;
  background:#2b313c; border-radius:4px; box-shadow:0 0 0 1px rgba(255,255,255,.5) }

/* Aircraft: colour says what it is doing */
.ap-pl{ background:none; border:0 }
.ap-pl .ap-ic{ display:block; width:24px; height:24px; transition:transform .8s ease }
.ap-pl svg{ width:24px; height:24px; display:block; overflow:visible; filter:drop-shadow(0 0 3px rgba(0,0,0,.85)) }
.ap-pl path{ fill:#8A93A3; stroke:#fff; stroke-width:1 }
.ap-pl.ap-arr path{ fill:#FF3D77 }
.ap-pl.ap-dep path{ fill:#00E0C6 }
.ap-pl.ap-ground path{ fill:#FFD37A }
.ap-pl.ap-ground .ap-ic, .ap-pl.ap-ground svg{ width:16px; height:16px; margin:4px }
.ap-pl.ap-other{ opacity:.55 }
.ap-pl .ap-lbl{ position:absolute; left:26px; top:4px; white-space:nowrap; pointer-events:none;
  font:600 11px/1.2 "IBM Plex Mono",ui-monospace,monospace; color:#F7F8FA;
  padding:2px 6px; border-radius:4px; background:rgba(12,14,18,.72) }
.ap-pl.ap-arr .ap-lbl{ box-shadow:inset 2px 0 0 #FF3D77 }
.ap-pl.ap-dep .ap-lbl{ box-shadow:inset 2px 0 0 #00E0C6 }
.ap-pl.ap-other .ap-lbl, .ap-pl.ap-ground .ap-lbl{ display:none }
#sgAp.ap-far .ap-lbl{ display:none }
.ap-pl.ap-focus{ z-index:9999 !important }
.ap-pl.ap-focus .ap-lbl{ display:block; background:#FF3D77 }
.ap-pl.ap-focus svg{ filter:drop-shadow(0 0 6px #FF3D77) }
@keyframes apFlash{ 0%{ transform:scale(1) } 30%{ transform:scale(2.2) } 100%{ transform:scale(1) } }
.ap-pl.ap-flash .ap-ic svg{ animation:apFlash 1.2s ease }

/* The way in, as one of Glass's camera-bar chips */
:root[data-sky-glass] #sgCam #sgApBtn{ box-shadow:inset 0 -3px 0 #FFD37A }

/* ---- status card: how the airport is running -------------------------------- */
#sgAp .ap-health{ border-radius:12px; padding:10px 12px 8px; margin:0 0 10px; background:rgba(46,204,113,.10);
  box-shadow:inset 3px 0 0 #2ECC71 }
#sgAp .ap-health.ap-minor{ background:rgba(255,211,122,.12); box-shadow:inset 3px 0 0 #FFD37A }
#sgAp .ap-health.ap-bad{ background:rgba(255,140,60,.14); box-shadow:inset 3px 0 0 #FF8C3C }
#sgAp .ap-health.ap-stop{ background:rgba(255,61,119,.16); box-shadow:inset 3px 0 0 #FF3D77 }
#sgAp .ap-pill{ display:inline-block; font-weight:800; font-size:17px; letter-spacing:.01em; color:#2ECC71 }
#sgAp .ap-minor .ap-pill{ color:#FFD37A } #sgAp .ap-bad .ap-pill{ color:#FF8C3C } #sgAp .ap-stop .ap-pill{ color:#FF6A97 }
#sgAp .ap-why{ display:block; font-size:12px; color:#C9CFD8; margin:2px 0 8px; line-height:1.35 }
#sgAp .ap-stats{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px 12px; margin:0 }
#sgAp .ap-stats div{ min-width:0 }
#sgAp .ap-stats dt{ font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:#A8AFBA }
#sgAp .ap-stats dd{ margin:0; font:600 13px/1.25 "IBM Plex Mono",ui-monospace,monospace; overflow-wrap:anywhere }

/* ---- tabs ---------------------------------------------------------------------- */
#sgAp .ap-tabs{ display:flex; gap:4px; margin:0 0 6px; padding:3px; border-radius:10px; background:rgba(255,255,255,.06) }
#sgAp .ap-tabs button{ flex:1; border:0; border-radius:8px; padding:8px; cursor:pointer; background:none; color:#C9CFD8;
  font-weight:700; font-size:13px; font-family:inherit }
#sgAp .ap-tabs button[aria-selected="true"]{ background:#2F7BFF; color:#fff }

/* ---- the Airport tab ---------------------------------------------------------- */
#sgAp .ap-facts{ font-size:12px; color:#C9CFD8; margin:2px 0 8px }
#sgAp .ap-rw{ width:100%; border-collapse:collapse; font:12px/1.3 "IBM Plex Mono",ui-monospace,monospace }
#sgAp .ap-rw th{ text-align:left; font-weight:600; font-size:10px; line-height:1.2; letter-spacing:.08em; text-transform:uppercase; color:#A8AFBA; padding:4px 0 }
#sgAp .ap-rw td{ padding:4px 0; border-top:1px solid rgba(255,255,255,.08) }
#sgAp .ap-lounges{ display:flex; flex-wrap:wrap; gap:6px; margin:0 0 10px }
#sgAp .ap-lounges span{ cursor:pointer; padding:6px 9px; border-radius:8px; background:rgba(183,140,255,.16);
  box-shadow:inset 0 0 0 1px rgba(183,140,255,.5); font-size:12px; font-weight:600 }
#sgAp .ap-lounges small{ font-weight:400; color:#C9CFD8 }
#sgAp .ap-term{ border-top:1px solid rgba(255,255,255,.08) }
#sgAp .ap-term > h4{ margin:0; padding:10px 0; font-size:14px; cursor:pointer; display:flex; justify-content:space-between; gap:8px; align-items:baseline }
#sgAp .ap-term > h4::after{ content:"\25B8"; color:#A8AFBA } #sgAp .ap-term.open > h4::after{ content:"\25BE" }
#sgAp .ap-term > h4 small{ font-weight:400; font-size:11px; color:#A8AFBA; margin-left:auto }
#sgAp .ap-term > ol{ display:none; padding-bottom:8px } #sgAp .ap-term.open > ol{ display:block }
#sgAp .ap-term li{ grid-template-columns:1fr auto }
#sgAp .ap-term li .cs{ font-weight:600; font-size:13px; line-height:1.25; font-family:inherit }
#sgAp .ap-term li.ap-lounge{ box-shadow:inset 3px 0 0 #B78CFF; padding-left:11px }
#sgAp .ap-term li.ap-food{ box-shadow:inset 3px 0 0 #FF9F43; padding-left:11px }
#sgAp .ap-term li.ap-shop{ box-shadow:inset 3px 0 0 #7FA7FF; padding-left:11px }
#sgAp .ap-term li .open{ font:700 10px/1 "IBM Plex Mono",monospace; padding:3px 6px; border-radius:5px; text-transform:uppercase }
#sgAp .ap-term li .open.yes{ background:rgba(46,204,113,.2); color:#5BE08F }
#sgAp .ap-term li .open.no{ background:rgba(255,255,255,.08); color:#A8AFBA }
#sgAp .ap-links{ list-style:none; margin:0; padding:0 }
#sgAp .ap-links li{ display:block; cursor:default; padding:6px 0; margin:0 }
#sgAp .ap-links li:hover{ background:none }
#sgAp .ap-links a, #sgAp .ap-tsa{ font-weight:700; font-size:14px; color:#7FB2FF; text-decoration:none; display:block }
#sgAp .ap-tsa{ color:#F7F8FA }
#sgAp .ap-links li > span:last-child{ font-size:12px; color:#A8AFBA }

/* =============================================================================
   v3 design pass — one type family, a calmer hierarchy, a phone sheet.
   (Later rules here deliberately override the first pass above.)
   ============================================================================= */
#sgAp.show{
  font-family:"Inter","SF Pro Text",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  -webkit-font-smoothing:antialiased; font-variant-numeric:tabular-nums;
  --ap-tint:rgba(16,18,23,.86); --ap-line:rgba(255,255,255,.08); --ap-sub:#9AA3B2;
}
/* Top bar: back, the airport, the picker — one tidy row */
#sgAp .ap-top{ gap:8px; align-items:stretch }
#sgAp .ap-back, #sgAp .ap-pick{
  font-size:14px; font-weight:600; padding:0 14px; height:44px; border-radius:12px;
  box-shadow:none; border:1px solid var(--ap-edge); background:var(--ap-tint);
}
#sgAp .ap-pick{ max-width:220px; appearance:none; -webkit-appearance:none; padding-right:30px;
  background-image:linear-gradient(45deg,transparent 50%,#9AA3B2 50%),linear-gradient(135deg,#9AA3B2 50%,transparent 50%);
  background-position:calc(100% - 16px) 19px, calc(100% - 11px) 19px; background-size:5px 5px; background-repeat:no-repeat }
#sgAp .ap-title{ align-items:center; gap:10px; padding:0 14px; height:44px; border-radius:12px; flex-wrap:nowrap }
#sgAp .ap-code{ font-size:20px; font-weight:800; letter-spacing:.01em }
#sgAp .ap-name{ font-size:13px; color:var(--ap-sub) }
#sgAp .ap-rwy{ font-weight:600; font-size:12px; line-height:1; font-family:inherit; color:#fff; background:#FF3D77; padding:5px 8px; border-radius:6px; white-space:nowrap }

/* The panel */
#sgAp .ap-side{ top:68px; width:min(360px,36vw); padding:14px; border-radius:16px; background:var(--ap-tint);
  -webkit-backdrop-filter:none; backdrop-filter:none; scrollbar-width:thin }
#sgAp .ap-grip{ display:none }

/* Status: one headline, one sentence, then chips */
#sgAp .ap-health{ padding:12px 12px 10px; border-radius:12px; box-shadow:none; background:rgba(46,204,113,.10); margin-bottom:12px }
#sgAp .ap-health.ap-minor{ background:rgba(255,211,122,.12); box-shadow:none }
#sgAp .ap-health.ap-bad{ background:rgba(255,140,60,.14); box-shadow:none }
#sgAp .ap-health.ap-stop{ background:rgba(255,61,119,.16); box-shadow:none }
#sgAp .ap-head{ display:flex; align-items:center; gap:8px }
#sgAp .ap-dot{ width:10px; height:10px; border-radius:50%; background:#2ECC71; box-shadow:0 0 0 4px rgba(46,204,113,.2); flex:none }
#sgAp .ap-minor .ap-dot{ background:#FFD37A; box-shadow:0 0 0 4px rgba(255,211,122,.2) }
#sgAp .ap-bad .ap-dot{ background:#FF8C3C; box-shadow:0 0 0 4px rgba(255,140,60,.2) }
#sgAp .ap-stop .ap-dot{ background:#FF3D77; box-shadow:0 0 0 4px rgba(255,61,119,.25) }
#sgAp .ap-pill{ font-size:20px; font-weight:800; letter-spacing:-.01em }
#sgAp .ap-why{ font-size:13px; line-height:1.4; color:#D5DAE2; margin:4px 0 10px }
#sgAp .ap-stats{ display:flex; flex-wrap:wrap; gap:6px; margin:0 }
#sgAp .ap-stats div{ display:flex; align-items:baseline; gap:6px; padding:6px 9px; border-radius:8px; background:rgba(255,255,255,.07) }
#sgAp .ap-stats dt{ font-size:11px; letter-spacing:0; text-transform:none; color:var(--ap-sub) }
#sgAp .ap-stats dd{ font-weight:600; font-size:13px; line-height:1.2; font-family:inherit; white-space:nowrap }

/* Tabs */
#sgAp .ap-tabs{ margin:0 0 10px; border-radius:10px; background:rgba(255,255,255,.06) }
#sgAp .ap-tabs button{ padding:9px; font-size:13px; font-weight:600; border-radius:8px; color:var(--ap-sub) }
#sgAp .ap-tabs button[aria-selected="true"]{ background:rgba(255,255,255,.14); color:#fff }

/* Section heads and rows */
#sgAp h3{ font-size:11px; font-weight:700; letter-spacing:.1em; color:var(--ap-sub); margin:14px 0 4px }
#sgAp li{ padding:9px 8px; border-radius:10px; gap:1px 10px }
#sgAp li .cs{ font-weight:700; font-size:15px; line-height:1.25; font-family:inherit; letter-spacing:.01em }
#sgAp li .eta{ font-weight:700; font-size:15px; line-height:1.25; font-family:inherit; color:#FFD37A }
#sgAp li .meta{ font-size:12px; color:var(--ap-sub); margin-top:1px }
#sgAp li .rw{ font-weight:700; font-size:11px; line-height:1; font-family:inherit; padding:4px 6px }
#sgAp .ap-sec-arr li, #sgAp .ap-sec-dep li, #sgAp .ap-landed li{ padding-left:12px }
#sgAp .ap-rw, #sgAp .ap-rw th{ font-family:inherit }
#sgAp .ap-term > h4{ font-size:15px }
#sgAp .ap-term li .open{ font-family:inherit; font-size:10px }
#sgAp .ap-note{ font-size:11px; line-height:1.4 }

/* Map: runway numbers only when there is room for them */
.ap-rwy-lbl{ display:none; font-family:"Inter",-apple-system,system-ui,sans-serif; font-weight:700 }
#sgAp.ap-near .ap-rwy-lbl{ display:block }

/* ---- phones: a sheet that peeks, and opens on a tap or a swipe up ---------- */
@media (max-width:760px){
  #sgAp .ap-top{ left:10px; right:10px; top:max(10px, env(safe-area-inset-top)) }
  #sgAp .ap-back{ padding:0 12px }
  #sgAp .ap-title{ flex:1 1 auto; min-width:0; padding:0 12px }
  #sgAp .ap-code{ font-size:18px }
  #sgAp .ap-pick{ flex:0 0 auto; max-width:104px; font-size:13px; order:3 }
  #sgAp .ap-side{
    left:0; right:0; bottom:0; top:auto; width:auto; border-radius:18px 18px 0 0;
    max-height:36vh; padding:6px 14px calc(12px + env(safe-area-inset-bottom));
    transition:max-height .28s ease; box-shadow:0 -10px 30px rgba(0,0,0,.35);
  }
  #sgAp .ap-side.open{ max-height:78vh }
  #sgAp .ap-grip{ display:block; width:100%; height:22px; border:0; background:none; cursor:pointer; padding:0; margin:0 0 4px }
  #sgAp .ap-grip i{ display:block; width:40px; height:5px; border-radius:3px; background:rgba(255,255,255,.3); margin:8px auto 0 }
  #sgAp .ap-health{ padding:10px 12px; margin-bottom:10px }
  #sgAp .ap-pill{ font-size:18px }
  #sgAp .ap-why{ margin:2px 0 8px; font-size:12px }
  /* peeking: the headline and one row of chips; the rest when opened */
  #sgAp .ap-side:not(.open) .ap-stats{ flex-wrap:nowrap; overflow:hidden; mask-image:linear-gradient(90deg,#000 85%,transparent) ; -webkit-mask-image:linear-gradient(90deg,#000 85%,transparent) }
  #sgAp .ap-side:not(.open) .ap-why{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
  #sgAp .leaflet-bottom.leaflet-left{ bottom:calc(36vh + 6px) }
}
#sgAp .ap-stats dt{ white-space:nowrap } #sgAp .ap-stats div{ flex:none }
#sgAp .ap-atc{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px }
#sgAp .ap-atc button{ border:1px solid rgba(255,255,255,.14); background:rgba(255,255,255,.06); color:#F7F8FA; border-radius:9px;
  padding:8px 10px; font-weight:600; font-size:13px; font-family:inherit; cursor:pointer }
#sgAp .ap-atc button:hover{ border-color:#00E0C6 }
