/* First Class airport card: one card with airfield-sign tabs (Overview, Weather, Traffic, ATC) and the Ground map
   action. The selected tab is an airfield location sign (yellow letters and frame on black); the others are calmer
   direction signs (black letters on dimmed sign yellow) whose arrows point to where they sit in the row. */
.airport-info-floating-popup .leaflet-popup-content:has(> .aic) {
  width: 590px;
  min-width: 0;
  max-width: none;
}
/* A bigger card than before, so it is nearly solid: map labels must not show through the text. */
.airport-info-floating-popup .leaflet-popup-content-wrapper:has(> .leaflet-popup-content > .aic) {
  background: rgba(14, 20, 32, 0.97);
}

.aic .airport-info-popup-head { gap: 10px; }
.aic-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Ground map action: a small airfield location sign as its icon. */
.aic-head-actions .gl-open {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  height: 26px;
  margin: 0;
  padding: 0 11px 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.aic-head-actions .gl-open:hover { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.32); }
.aic-head-actions .gl-open i { grid-row: auto; width: 30px; height: 16px; }
.aic-head-actions .gl-open span { display: none; }

/* The sign row: panels butted together on one black frame, as on an airfield sign array. */
.aic-signs {
  display: flex;
  gap: 3px;
  margin: 0 0 12px;
  padding: 3px;
  border-radius: 4px;
  background: #050505;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05), 0 3px 8px rgba(0, 0, 0, 0.35);
}
.aic-sign {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 2px;
  background: #ad9545;
  color: #16130a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.aic-sign:hover { background: #c7a945; }
.aic-sign[aria-selected="true"] {
  background: #0b0b0b;
  box-shadow: inset 0 0 0 2px #ffd21f;
  color: #ffd21f;
  cursor: default;
}
.aic-sign:focus-visible { outline: 2px solid #ffffff; outline-offset: 1px; }
.aic-arrow {
  display: none;
  flex: 0 0 auto;
  width: 13px;
  height: 11px;
  overflow: visible;
}
.aic-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: square;
}
.aic-sign[data-dir="left"] .aic-arrow:first-child { display: block; transform: scaleX(-1); }
.aic-sign[data-dir="right"] .aic-arrow:last-child { display: block; }

.aic-panels { min-height: 196px; }
.aic-panel[hidden] { display: none; }
.aic-panel { animation: aic-panel-in 180ms cubic-bezier(0.22, 0.61, 0.36, 1) 1; }
@keyframes aic-panel-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.aic-sub {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(178, 194, 214, 0.78);
}
.aic-sub span {
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 500;
  color: rgba(178, 194, 214, 0.6);
}

/* Overview: the facts beside the raw report. */
.aic-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 22px;
  align-items: start;
}
.aic-facts .airport-info-popup-row { padding: 5px 0; font-size: 12.5px; }
.aic-metar .airport-info-popup-value-metar {
  display: block;
  max-width: none;
  margin: 7px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  text-align: left;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(232, 238, 246, 0.95);
}

/* The tab bodies sit straight on the card (no card inside the card) and use two columns. */
.aic .airport-info-popup-pane {
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.aic .airport-weather-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 226px;
  column-gap: 20px;
  align-items: start;
}
.aic .airport-weather-pane > .awp-head { grid-column: 1; justify-content: flex-start; }
.aic .airport-weather-pane > .awp-head .awp-placard { display: none; }
.aic .awp-rows { grid-column: 1; margin-top: 4px; }
.aic .awp-outlook { grid-column: 1; }
.aic .awp-raw-toggle { grid-column: 1; justify-self: start; }
.aic .awp-printout { grid-column: 1 / -1; }
.aic .awp-runway {
  grid-column: 2;
  grid-row: 1 / span 4;
  margin-top: 0;
  padding: 10px 11px 12px;
  border-top: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.aic .awp-rwy-body { grid-template-columns: 1fr; justify-items: center; gap: 8px; margin-top: 8px; }
.aic .awp-diagram { width: 108px; height: 108px; }
.aic .awp-rwy-info { justify-self: stretch; text-align: center; }
.aic .awp-tiles { justify-content: center; }
/* "from ATIS K": the broadcast letter on a split-flap tile, as on the ATC tab. */
.awp-by.is-atis { display: inline-flex; align-items: center; gap: 6px; color: rgba(226, 234, 244, 0.86); }
.awp-by.is-atis b {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 19px;
  border-radius: 2px;
  background: linear-gradient(180deg, #262d38 0 calc(50% - 0.5px), #05080c calc(50% - 0.5px) calc(50% + 0.5px), #1b212b calc(50% + 0.5px) 100%);
  color: #ffc247;
  font-size: 12px;
  font-weight: 800;
}

.aic .airport-traffic-pane {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 24px;
  row-gap: 10px;
}
.aic .atp-head { display: none; }
.aic .atp-flow { grid-column: 1; grid-row: 1; grid-template-columns: 1fr; gap: 4px; margin: 0; padding: 2px 0 0; }
.aic .atp-counts { grid-column: 1; grid-row: 2; align-self: start; margin: 0; }
.aic .atp-counts dt { white-space: nowrap; letter-spacing: 0.08em; }
.aic .atp-counts div + div { padding-left: 9px; }
.aic .atp-arrivals { grid-column: 2; grid-row: 1; margin-top: 0; }
.aic .atp-departures { grid-column: 2; grid-row: 2; margin-top: 0; }

.aic .airport-atc-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 222px;
  column-gap: 20px;
  align-items: start;
}
.aic .aap-head { grid-column: 1; grid-row: 1; }
.aic .aap-head .aap-placard { display: none; }
.aic .aap-caps { grid-column: 1; grid-row: 2; margin-top: 7px; }
.aic .aap-board { grid-column: 1; grid-row: 3; }
.aic .aap-sub { grid-column: 2; grid-row: 1; margin-top: 2px; }
.aic .aap-atis { grid-column: 2; grid-row: 2 / span 2; margin-top: 4px; }
.aic .aap-atis-text { max-height: 204px; }

/* Phone: the same card as a sheet along the right edge, as tall as the free map band; the tab body scrolls. */
.airport-info-floating-popup[data-placement="sheet"] .airport-info-floating-popup-inner { transform: translateX(14px); }
.airport-info-floating-popup[data-placement="sheet"].is-visible .airport-info-floating-popup-inner { transform: none; }
.airport-info-floating-popup[data-placement="sheet"] .leaflet-popup-content {
  box-sizing: border-box;
  height: calc(100% - 20px);
  margin: 10px 12px;
}
html.airshow-mobile-runtime .airport-info-floating-popup .leaflet-popup-content:has(> .aic) { width: 372px; }
html.airshow-mobile-runtime .aic { display: flex; flex-direction: column; height: 100%; }
html.airshow-mobile-runtime .aic .airport-info-popup-titlezone { margin: -10px -12px 7px; padding: 9px 12px 7px; }
html.airshow-mobile-runtime .aic .airport-info-popup-wxline { display: none; }
html.airshow-mobile-runtime .aic .airport-info-popup-name-line { margin: 5px 0 0; }
html.airshow-mobile-runtime .aic .airport-info-popup-name { font-size: 13.5px; }
html.airshow-mobile-runtime .aic-head-actions .gl-open { height: 22px; padding: 0 8px 0 4px; font-size: 10.5px; }
html.airshow-mobile-runtime .aic-head-actions .gl-open i { width: 26px; height: 14px; }
html.airshow-mobile-runtime .aic .airport-info-popup-close { width: 22px; height: 22px; line-height: 20px; }
html.airshow-mobile-runtime .aic-signs { flex: 0 0 auto; margin-bottom: 8px; padding: 2px; gap: 2px; }
html.airshow-mobile-runtime .aic-sign { height: 24px; padding: 0 5px; gap: 4px; font-size: 10.5px; letter-spacing: 0.06em; }
html.airshow-mobile-runtime .aic-arrow { width: 11px; height: 9px; }
html.airshow-mobile-runtime .aic-panels { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
html.airshow-mobile-runtime .aic-overview { grid-template-columns: 1fr; row-gap: 6px; }
html.airshow-mobile-runtime .aic-facts { display: grid; grid-template-rows: repeat(4, auto); grid-auto-flow: column; column-gap: 16px; }
html.airshow-mobile-runtime .aic-facts .airport-info-popup-row { padding: 2px 0; font-size: 11px; }
html.airshow-mobile-runtime .aic-facts .airport-info-popup-row + .airport-info-popup-row:nth-child(5) { border-top: 0; }
html.airshow-mobile-runtime .aic-metar .aic-sub span { display: none; }
html.airshow-mobile-runtime .aic-metar .airport-info-popup-value-metar { margin-top: 4px; padding: 6px 8px; font-size: 10.5px; line-height: 1.45; }
/* Phone weather: the plain-words rows, then the runway in use as one strip (source, painted numbers, wind). */
html.airshow-mobile-runtime .aic .airport-weather-pane { display: block; padding: 0; }
html.airshow-mobile-runtime .aic .awp-runway {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 6px 9px;
}
html.airshow-mobile-runtime .aic .awp-runway > .awp-head { display: flex; flex: 0 0 auto; }
html.airshow-mobile-runtime .aic .awp-runway > .awp-head .awp-placard { display: none; }
html.airshow-mobile-runtime .aic .awp-rwy-body { display: block; flex: 1 1 auto; margin: 0; }
html.airshow-mobile-runtime .aic .awp-rwy-info { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; text-align: left; }
html.airshow-mobile-runtime .aic .awp-tiles { grid-row: 1 / span 2; flex-wrap: nowrap; margin: 0; }
html.airshow-mobile-runtime .aic .awp-comp { font-size: 10.5px; line-height: 1.35; }
html.airshow-mobile-runtime .aic .airport-traffic-pane { grid-template-columns: 116px minmax(0, 1fr); grid-template-rows: none; column-gap: 14px; row-gap: 0; padding: 0; }
html.airshow-mobile-runtime .aic .atp-flow { justify-items: start; }
html.airshow-mobile-runtime .aic .atp-dep:nth-child(3) { display: grid; }
html.airshow-mobile-runtime .aic .airport-atc-pane { display: block; padding: 0; }

/* While the phone sheet is open, the corner controls it would sit under step aside (they return when it closes). */
html.airshow-airport-sheet-open #map-mini-topbar-dock,
html.airshow-airport-sheet-open #bearing-indicator,
html.airshow-airport-sheet-open #bearing-indicator-blocker,
html.airshow-airport-sheet-open #map-zoom-dock {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease, visibility 0s linear 150ms;
}

@media (prefers-reduced-motion: reduce) {
  .aic-panel { animation: none; }
  .aic-sign { transition: none; }
  .airport-info-floating-popup[data-placement="sheet"] .airport-info-floating-popup-inner { transform: none; }
}
