/* Airfield planning section - reuses the site's existing brand palette
   (navy #0b3d63, status-badge conventions from the admin tools) rather
   than introducing a new one. */

.airfields-intro { max-width: 760px; margin: 0 auto 20px; padding: 0 16px; text-align: center; }
.airfields-intro h1 { font-size: 1.8rem; margin-bottom: 8px; }
.airfields-intro .sub { color: #5c6b7a; line-height: 1.5; }
.airfields-intro .sub a { color: #0b3d63; font-weight: 600; }

.airfield-map-container { max-width: 1100px; margin: 0 auto 40px; padding: 0 16px; }
.airfield-map-wrap { position: relative; background: #a9d2e6; border-radius: 16px; overflow: hidden; }
.airfield-map-canvas { height: 560px; width: 100%; }
.airfield-map-canvas, .airfield-map-canvas * { box-sizing: border-box; }

.airfield-map-controls { position: absolute; top: 14px; left: 14px; right: 14px; z-index: 1000; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: #fff; font-size: 0.85rem; pointer-events: none; }
.airfield-map-controls > * { pointer-events: auto; }
.airfield-map-controls label { background: rgba(10,30,45,0.72); padding: 6px 12px; border-radius: 999px; display: flex; align-items: center; gap: 8px; backdrop-filter: blur(2px); }
.airfield-map-smallfields { position: relative; display: flex; align-items: center; flex-wrap: wrap; row-gap: 4px; }
.airfield-map-filters { position: absolute; top: calc(100% + 8px); left: 0; background: #182634; border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 28px rgba(0,0,0,0.4); display: flex; flex-direction: column; gap: 6px; min-width: 190px; z-index: 1001; }
.airfield-map-filters[hidden] { display: none !important; }
.afm-filter-item { background: none !important; padding: 2px 0 !important; border-radius: 0 !important; backdrop-filter: none !important; font-weight: 400; font-size: 0.82rem; display: flex !important; align-items: center; gap: 8px; }
.afm-edit-filters { background: rgba(10,30,45,0.72); color: #fff; border: none; border-radius: 999px; padding: 5px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer; margin-left: 4px; }
.afm-edit-filters:hover { background: rgba(10,30,45,0.9); }
.afm-filters-done { align-self: flex-end; background: #f5a623; color: #182634; border: none; border-radius: 999px; padding: 5px 16px; font-size: 0.78rem; font-weight: 700; cursor: pointer; margin-top: 4px; }
.afm-filters-done:hover { background: #e0941a; }
.amp-closed-tag { display: inline-block; background: #fbeceb; color: #8f2f28; font-size: 0.68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; text-transform: uppercase; vertical-align: middle; }

.airfield-map-basemap { display: flex; align-items: center; gap: 8px; background: rgba(10,30,45,0.72); border-radius: 999px; padding: 6px 8px 6px 16px; }
.airfield-map-basemap .afm-layer-label { background: none; padding: 0; font-weight: 700; font-size: 0.8rem; color: rgba(255,255,255,0.75); }
.airfield-map-basemap select { background: #182634; color: #fff; border: none; border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.airfield-map-basemap select:focus { outline: 2px solid #f5a623; outline-offset: 1px; }

.airfield-map-chart-notice { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 1000; background: rgba(10,30,45,0.9); color: #fff; padding: 8px 18px; border-radius: 999px; font-size: 0.82rem; box-shadow: 0 6px 18px rgba(0,0,0,0.3); }

.airfield-map-search { position: relative; background: rgba(10,30,45,0.72); border-radius: 999px; padding: 6px 14px; min-width: 200px; backdrop-filter: blur(2px); }
.airfield-map-search input[type="text"] { background: transparent; border: none; color: #fff; font-size: 0.85rem; outline: none; width: 100%; }
.airfield-map-search input[type="text"]::placeholder { color: rgba(255,255,255,0.6); }
.airfield-map-search-results { position: absolute; top: calc(100% + 8px); left: 0; min-width: 280px; max-width: 360px; max-height: 320px; overflow-y: auto; background: #182634; border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,0.4); }
.airfield-map-search-result { display: block; width: 100%; text-align: left; background: transparent; border: none; border-bottom: 1px solid rgba(255,255,255,0.08); color: #fff; padding: 10px 14px; cursor: pointer; font-size: 0.85rem; }
.airfield-map-search-result:last-child { border-bottom: none; }
.airfield-map-search-result:hover, .airfield-map-search-result.active { background: rgba(245,166,35,0.18); }
.airfield-map-search-result b { color: #f5a623; }
.afm-sr-sub { display: block; color: rgba(255,255,255,0.6); font-size: 0.78rem; margin-top: 2px; }
.airfield-map-search-empty { padding: 12px 14px; color: rgba(255,255,255,0.6); font-size: 0.82rem; }

/* Red push-pin markers (see js/airfield-map.js pinIcon()) - fixed screen
   size per airfield type, same convention as any standard map, so they
   stay a constant, legible size as you zoom in rather than growing. */
.airfield-pin { background: none; border: none; }
.airfield-pin svg { display: block; filter: drop-shadow(0 0 1px rgba(0,0,0,0.9)) drop-shadow(0 0 1.5px rgba(0,0,0,0.85)) drop-shadow(0 2px 3px rgba(0,0,0,0.45)); }

.airfield-map-popup .amp-name { font-weight: 700; font-size: 0.92rem; color: #182634; margin-bottom: 2px; }
.airfield-map-popup .amp-ident { color: #0b3d63; font-weight: 600; font-size: 0.8rem; }
.airfield-map-popup .amp-loc { color: #5c6b7a; font-size: 0.8rem; margin: 2px 0 8px; }
.airfield-map-popup .amp-link { color: #0b3d63; font-weight: 700; font-size: 0.82rem; text-decoration: none; }
.airfield-map-popup .amp-link:hover { text-decoration: underline; }
.leaflet-popup-content-wrapper { border-radius: 10px; }

/* Inline "Current weather" box in the map popup (js/airfield-map.js
   loadPopupWeather()) - reuses the .wx-* classes from the full-details
   page's weather panel (below) at a more compact scale for the popup. */
.airfield-map-popup .amp-wx { margin-top: 8px; }
.airfield-map-popup .amp-wx-heading { font-size: 0.78rem; font-weight: 700; color: #182634; margin: 4px 0; text-transform: uppercase; letter-spacing: 0.02em; }
.airfield-map-popup .wx-metar, .airfield-map-popup .wx-taf { margin-bottom: 8px; }
.airfield-map-popup .wx-metar code, .airfield-map-popup .wx-taf code { font-size: 0.72rem; padding: 6px 8px; margin-top: 4px; }
.airfield-map-popup .wx-taf h4 { font-size: 0.78rem; margin: 6px 0 2px; }
.airfield-map-popup .wx-badge { font-size: 0.68rem; padding: 2px 8px; margin-right: 6px; }
.airfield-map-popup .wx-decode-btn { padding: 6px 14px; font-size: 0.76rem; margin: 2px 0 6px; }
.airfield-map-popup .wx-decode-panel { padding: 10px 12px; font-size: 0.78rem; line-height: 1.4; margin: 0 0 6px; }
.airfield-map-popup .wx-decode-panel h4 { font-size: 0.78rem; margin: 8px 0 4px; }
.airfield-map-popup .wx-decode-panel ul { padding-left: 16px; }
.airfield-map-popup .wx-decode-panel li { margin-bottom: 5px; }
.airfield-map-popup .wx-decode-intro { margin: 0 0 8px; }
.airfield-map-popup .amp-wx .empty { padding: 2px 0; font-size: 0.78rem; }

/* "View Available IFR Approach Procedures" link + list in the map popup
   (js/airfield-map.js loadPopupApproaches()) - reuses the full-details
   page's .approach-procedures-* classes (below) at the same compact
   scale as the weather box just above it. */
.airfield-map-popup .amp-approach:not(:empty) { margin-top: 6px; }
.airfield-map-popup .approach-procedures-row { margin-top: 0; }
.airfield-map-popup .approach-procedures-link { font-size: 0.78rem; }
.airfield-map-popup .approach-procedures-list { max-height: 160px; }
.airfield-map-popup .approach-list-item { padding: 7px 10px; font-size: 0.76rem; }

/* Cluster bubbles in the site's brand colors instead of markercluster's
   default green/yellow/orange. */
.marker-cluster-small { background-color: rgba(11,61,99,0.5); }
.marker-cluster-small div { background-color: rgba(11,61,99,0.88); color: #fff; }
.marker-cluster-medium { background-color: rgba(245,166,35,0.45); }
.marker-cluster-medium div { background-color: rgba(245,166,35,0.9); color: #182634; }
.marker-cluster-large { background-color: rgba(214,40,31,0.4); }
.marker-cluster-large div { background-color: rgba(214,40,31,0.88); color: #fff; }
.marker-cluster { border-radius: 50%; }
.marker-cluster div { border-radius: 50%; font-weight: 700; }

.airfield-detail-page { max-width: 820px; margin: 0 auto; padding: 24px 16px 60px; }
.back-link a { color: #0b3d63; font-weight: 600; text-decoration: none; }
.back-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.afd-hist-nav-group { display: flex; gap: 6px; }
.afd-hist-nav { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #ccd3da; background: #fff; color: #0b3d63; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.afd-hist-nav:hover:not(:disabled) { background: #f0f4f8; }
.afd-hist-nav:disabled { opacity: .35; cursor: default; }

.weather-modal[hidden] { display: none !important; }
.weather-modal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; }
.weather-modal-backdrop { position: absolute; inset: 0; background: rgba(10,18,26,0.72); }
.weather-modal-window { position: relative; width: min(92vw, 820px); height: min(88vh, 960px); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.weather-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: #182634; color: #fff; flex-shrink: 0; }
.weather-modal-title { display: flex; flex-direction: column; min-width: 0; }
.weather-modal-name { font-weight: 700; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.weather-modal-sub { font-size: 0.74rem; color: #9fb0bf; }
.weather-modal-close { background: rgba(255,255,255,0.12); color: #fff; border: none; width: 34px; height: 34px; border-radius: 999px; font-size: 1.1rem; cursor: pointer; flex-shrink: 0; }
.weather-modal-close:hover { background: rgba(255,255,255,0.24); }
.weather-modal-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.af-header { margin-bottom: 28px; }
.af-header h1 { font-size: 1.6rem; margin-bottom: 2px; }
.af-sub { color: #5c6b7a; margin: 0 0 10px; }
.af-badges { margin-bottom: 10px; }
.af-meta { color: #5c6b7a; font-size: 0.9rem; margin: 2px 0; }

.af-section { background: #fff; border: 1px solid #e3e8ee; border-radius: 12px; padding: 20px 24px; margin-bottom: 20px; }
.af-section h2 { font-size: 1.1rem; margin: 0 0 14px; }
.af-section table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.af-section th, .af-section td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eef2f7; }
.af-section th { color: #5c6b7a; font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; }

.runway-diagram { width: 100%; max-width: 380px; display: block; margin: 16px auto 4px; background: #f6f8fb; border-radius: 12px; }
/* Airport sketch excerpted from an IFR approach procedure plate (see
   showDiagramBox() in js/airfield-detail.js) - shown in the same spot as
   .runway-diagram above, never both at once, so it reuses that sizing but
   keeps its own white background/border since it's a cropped photo of a
   chart rather than a generated SVG. */
.mini-diagram-img { width: 100%; max-width: 300px; display: block; margin: 16px auto 4px; background: #fff; border: 1px solid #e3e8ee; border-radius: 8px; padding: 6px; }
.diagram-caption { color: #5c6b7a; font-size: 0.78rem; text-align: center; margin: 0 0 4px; }
.diagram-empty { color: #5c6b7a; font-size: 0.85rem; }
.diagram-empty-note { color: #5c6b7a; font-size: 0.85rem; margin-top: 8px; }

/* Official FAA airport diagram card: shown instead of the generated
   runway sketch whenever we actually have a real diagram on file. */
.official-diagram-card { background: #f6f8fb; border: 1px solid #e3e8ee; border-radius: 12px; padding: 16px 18px; margin-top: 10px; }
.official-diagram-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.official-diagram-link { display: inline-flex; align-items: center; gap: 6px; color: #0b3d63; font-weight: 700; font-size: 0.95rem; text-decoration: none; }
.official-diagram-link:hover { text-decoration: underline; }
.diagram-popup-toggle { display: inline-flex; align-items: center; gap: 6px; color: #5c6b7a; font-size: 0.82rem; font-weight: 400; cursor: pointer; }
.diagram-stale-warning { background: #fbeceb; color: #8f2f28; border-radius: 8px; padding: 8px 12px; font-size: 0.82rem; font-weight: 600; margin-bottom: 10px; }
.diagram-stale-warning[hidden] { display: none !important; }

/* Page-level banner when the underlying airport data import looks overdue. */
.data-stale-banner { background: #fbeceb; color: #8f2f28; border-radius: 10px; padding: 10px 16px; font-size: 0.85rem; font-weight: 600; margin: 0 0 16px; }

/* "Display as pop-up" modal for the official diagram - lets a pilot keep
   the diagram up for quick reference without navigating away. */
.diagram-popup-modal[hidden] { display: none !important; }
.diagram-popup-modal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; }
.diagram-popup-backdrop { position: absolute; inset: 0; background: rgba(10,18,26,0.72); }
.diagram-popup-window { position: relative; width: min(92vw, 820px); height: min(88vh, 960px); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.diagram-popup-close { position: absolute; top: 8px; right: 10px; z-index: 1; background: rgba(10,30,45,0.8); color: #fff; border: none; width: 32px; height: 32px; border-radius: 999px; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.diagram-popup-close:hover { background: rgba(10,30,45,1); }
.diagram-popup-frame { flex: 1; width: 100%; height: 100%; border: none; }

/* "View Available IFR Approach Procedures" link + its dropdown list of
   every published approach for this airfield, shown right under the
   official-diagram card (or its "no diagram on file" note). */
.approach-procedures-row { margin-top: 10px; position: relative; }
.approach-procedures-link { display: inline-flex; align-items: center; gap: 6px; color: #0b3d63; font-weight: 700; font-size: 0.95rem; text-decoration: none; }
.approach-procedures-link:hover { text-decoration: underline; }
.approach-procedures-list[hidden] { display: none !important; }
.approach-procedures-list { margin-top: 8px; background: #fff; border: 1px solid #e3e8ee; border-radius: 10px; overflow-y: auto; max-height: 260px; }
.approach-list-item { display: block; width: 100%; text-align: left; padding: 9px 14px; background: none; border: none; border-bottom: 1px solid #eef1f5; font-size: 0.88rem; color: #182634; cursor: pointer; }
.approach-list-item:last-child { border-bottom: none; }
.approach-list-item:hover { background: #f6f8fb; }

/* Full-screen approach-procedure viewer: all of an airfield's published
   approaches open together here, starting on whichever one was clicked,
   with Prev/Next to page through the rest without closing the viewer. */
.approach-modal[hidden] { display: none !important; }
.approach-modal { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: center; justify-content: center; }
.approach-modal-backdrop { position: absolute; inset: 0; background: rgba(10,18,26,0.72); }
.approach-modal-window { position: relative; width: min(92vw, 820px); height: min(88vh, 960px); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.45); display: flex; flex-direction: column; }
.approach-modal-close { position: absolute; top: 8px; right: 10px; z-index: 2; background: rgba(10,30,45,0.8); color: #fff; border: none; width: 32px; height: 32px; border-radius: 999px; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.approach-modal-close:hover { background: rgba(10,30,45,1); }
.approach-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 52px; background: #182634; color: #fff; }
.approach-modal-title { display: flex; flex-direction: column; align-items: center; text-align: center; flex: 1; min-width: 0; }
.approach-modal-name { font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.approach-modal-count { font-size: 0.74rem; color: #9fb0bf; }
.approach-modal-nav { background: rgba(255,255,255,0.12); color: #fff; border: none; width: 34px; height: 34px; border-radius: 999px; font-size: 1.1rem; cursor: pointer; flex-shrink: 0; }
.approach-modal-nav:hover:not(:disabled) { background: rgba(255,255,255,0.24); }
.approach-modal-nav:disabled { opacity: 0.35; cursor: default; }
.approach-modal-frame { flex: 1; width: 100%; height: 100%; border: none; }

.status-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.status-active { background: #eaf7f1; color: #14603f; }
.status-disabled { background: #fbeceb; color: #8f2f28; }
.badge-plain { background: #eef2f7; color: #364656; }

.fbo-card { border: 1px solid #eef2f7; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.fbo-name { font-weight: 700; margin: 0 0 4px; }
.fbo-meta { color: #5c6b7a; font-size: 0.85rem; margin: 2px 0; }

.wx-metar, .wx-taf { margin-bottom: 14px; }
.wx-metar code, .wx-taf code { display: block; background: #f6f8fb; padding: 10px 14px; border-radius: 8px; font-size: 0.85rem; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.wx-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; margin-right: 8px; }
.wx-vfr { background: #eaf7f1; color: #14603f; }
.wx-mvfr { background: #e7f0fb; color: #1a4b8f; }
.wx-ifr { background: #fbeceb; color: #8f2f28; }
.wx-lifr { background: #f3e7fb; color: #5a1a8f; }
.wx-unknown { background: #eef2f7; color: #364656; }
.wx-links { color: #5c6b7a; font-size: 0.85rem; }
.wx-links a { color: #0b3d63; font-weight: 600; }

/* Plain-English weather decoder (see js/airfield-detail.js decodeWeather()) */
.wx-decode-btn { display: inline-flex; align-items: center; gap: 6px; background: #0b3d63; color: #fff; border: none; border-radius: 999px; padding: 8px 18px; font-size: 0.82rem; font-weight: 700; cursor: pointer; margin: 4px 0 14px; }
.wx-decode-btn:hover { background: #0a3356; }
.wx-decode-btn:disabled { opacity: 0.6; cursor: default; }
.wx-decode-panel { background: #f6f8fb; border: 1px solid #e3e8ee; border-radius: 10px; padding: 16px 20px; margin: 0 0 16px; font-size: 0.9rem; line-height: 1.55; }
.wx-decode-panel h4 { font-size: 0.95rem; margin: 14px 0 8px; color: #182634; }
.wx-decode-panel h4:first-child { margin-top: 0; }
.wx-decode-panel ul { margin: 0 0 4px; padding-left: 20px; }
.wx-decode-panel li { margin-bottom: 8px; }
.wx-decode-panel li b { color: #0b3d63; }
.wx-decode-intro { margin: 0 0 12px; }

.empty { color: #5c6b7a; padding: 10px 0; }


/* Phase 0 (2026-11-13): full-screen / planning-mode shell for the Airfields map. */
.airfield-map-fullscreen { display: flex; align-items: center; }
.afm-fullscreen-btn {
  background: rgba(10,30,45,0.72);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(2px);
}
.afm-fullscreen-btn:hover { background: rgba(10,30,45,0.9); }
.airfield-map-wrap.afm-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  border-radius: 0;
  width: 100%;
  height: 100%;
}
.airfield-map-wrap.afm-fullscreen .airfield-map-canvas {
  width: 100%;
  height: 100%;
}
.airfield-map-bottombar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 1000;
}

/* ===== Phase 1: flight-planning route builder (added 2026-11-14) ===== */
.airfield-map-bottombar {
  display: none;
  max-height: 46vh;
  overflow-y: auto;
  background: rgba(10, 30, 45, 0.92);
  backdrop-filter: blur(4px);
  color: #fff;
  border-radius: 10px;
  font-size: 0.82rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.airfield-map-wrap.afm-fullscreen .airfield-map-bottombar {
  display: block;
}
.afp-toggle {
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.afp-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
}
.afp-chevron {
  font-size: 0.7rem;
  opacity: 0.8;
}
.afp-panel {
  padding: 0 12px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.afp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  position: relative;
}
.afp-row label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  opacity: 0.85;
}
.afp-row input,
.afp-row select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 0.82rem;
}
.afp-row select {
  background: #000;
}
.afp-row select option {
  background: #000;
  color: #fff;
}
.afp-row input#afpSearch {
  flex: 1 1 260px;
  min-width: 200px;
}
.afp-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: rgba(10, 30, 45, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1100;
}
.afp-result {
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.afp-result:last-child {
  border-bottom: none;
}
.afp-result:hover {
  background: rgba(255, 255, 255, 0.1);
}
.afp-noresults {
  padding: 8px 10px;
  opacity: 0.7;
  font-style: italic;
}
.afp-badge {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  margin-right: 4px;
}
.afp-badge-airfield { background: rgba(80, 160, 255, 0.35); }
.afp-badge-navaid { background: rgba(255, 180, 60, 0.35); }
.afp-badge-fix { background: rgba(140, 220, 140, 0.35); }
.afp-waypoints {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.afp-empty {
  opacity: 0.7;
  font-size: 0.8rem;
  font-style: italic;
}
.afp-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
}
.afp-chip-idx {
  font-weight: 700;
  opacity: 0.7;
  font-size: 0.75rem;
}
.afp-chip-ident {
  font-weight: 600;
}
.afp-chip-btn {
  background: transparent;
  border: none;
  color: #fff;
  opacity: 0.75;
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.7rem;
  border-radius: 4px;
}
.afp-chip-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}
.afp-chip-remove:hover {
  background: rgba(220, 60, 60, 0.5);
}
.afp-summary {
  margin-top: 12px;
}
.afp-rules-note {
  font-size: 0.75rem;
  opacity: 0.75;
  margin-bottom: 6px;
}
.afp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.afp-table th,
.afp-table td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.afp-table th {
  opacity: 0.7;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.afp-totals {
  margin-top: 8px;
  font-weight: 600;
  text-align: right;
}

/* ===== Phase 1: FAA/ICAO flight-plan text generator (added 2026-11-14) ===== */
.afp-planwrap {
  margin-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 10px;
}
.afp-plan-toggle {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  opacity: 0.9;
}
.afp-plan-toggle:hover {
  opacity: 1;
}
.afp-plan-body {
  margin-top: 10px;
}
.afp-plan-note {
  font-size: 0.72rem;
  opacity: 0.75;
  line-height: 1.4;
  margin-bottom: 10px;
  max-width: 820px;
}
.afp-row-wide {
  width: 100%;
}
.afp-label-wide {
  width: 100%;
}
.afp-row textarea {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  width: 100%;
  resize: vertical;
  font-family: inherit;
}
.afp-generate-btn {
  margin-top: 10px;
  background: rgba(255, 122, 0, 0.85);
  border: none;
  color: #1a1a1a;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}
.afp-generate-btn:hover {
  background: rgba(255, 140, 30, 0.95);
}
.afp-plan-output-wrap {
  margin-top: 12px;
}
.afp-plan-output {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.afp-copy-btn {
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
}
.afp-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.afp-copy-status {
  margin-left: 10px;
  font-size: 0.75rem;
  opacity: 0.8;
}


/* ===== Mobile: compact floating top control bar (added 2026-11-14) ===== */
.afm-sf-short {
  display: none;
}
.afm-fs-short {
  display: none;
}
@media (max-width: 640px) {
  .airfield-map-controls {
    top: 8px;
    left: 8px;
    right: 8px;
    gap: 6px;
    font-size: 0.72rem;
    justify-content: flex-start;
  }
  .airfield-map-controls label {
    padding: 5px 10px;
    gap: 5px;
    font-size: 0.72rem;
  }
  .airfield-map-search {
    padding: 5px 12px;
    min-width: 0;
    flex: 1 1 100%;
  }
  .airfield-map-search input[type="text"] {
    font-size: 0.78rem;
  }
  .airfield-map-basemap {
    padding: 4px 6px 4px 10px;
    gap: 5px;
  }
  .airfield-map-basemap .afm-layer-label {
    display: none;
  }
  .airfield-map-basemap select {
    padding: 5px 10px;
    font-size: 0.75rem;
    max-width: 92px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }
  .afm-edit-filters {
    padding: 4px 8px;
    font-size: 0.68rem;
  }
  .afm-fullscreen-btn {
    padding: 5px 9px;
    font-size: 0.75rem;
    min-width: 30px;
    text-align: center;
  }
  .afm-sf-full {
    display: none;
  }
  .afm-sf-short {
    display: inline;
  }
  .afm-fs-full {
    display: none;
  }
  .afm-fs-short {
    display: inline;
  }
}


/* Cluster "N airfields here" list popup (shown when a cluster bubble is
   clicked and the map is already at its zoom ceiling for the current chart
   layer, so Leaflet.markercluster's own zoom/spiderfy can't do anything -
   see js/airfield-map.js clusterclick handler). Styled for Leaflet's default
   light popup background, not the dark search-dropdown theme used elsewhere
   on this page. */
.amp-cluster-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.amp-cluster-list-title {
  font-size: 12px;
  font-weight: 600;
  color: #51606f;
  margin: 0 0 4px;
  padding: 0 2px;
}
.amp-cluster-list-item {
  display: block;
  width: 100%;
  text-align: left;
  background: #f2f5f8;
  border: 1px solid #d6dde3;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 13px;
  font-family: inherit;
  color: #1f2d3a;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.amp-cluster-list-item:hover,
.amp-cluster-list-item:focus {
  background: #e3ecf5;
  border-color: #a9c3da;
  outline: none;
}


/* ===== Recommended-route pathfinder UI (added 2026-11-15) ===== */
.afp-suggest-row {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 8px;
}
.afp-suggest-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  opacity: 0.85;
}
.afp-ident-input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 0.82rem;
  width: 84px;
  text-transform: uppercase;
  font-family: inherit;
}
.afp-swap-btn {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}
.afp-swap-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.afp-aircraft-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
  min-width: 160px;
  font-family: inherit;
}
.afp-suggest-btn,
.afp-viewplan-btn {
  align-self: flex-end;
  background: rgba(255, 122, 0, 0.85);
  border: none;
  color: #1a1a1a;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.afp-suggest-btn:hover,
.afp-viewplan-btn:hover {
  background: rgba(255, 140, 30, 0.95);
}
.afp-suggest-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.afp-viewplan-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.afp-viewplan-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.afp-suggest-banner {
  margin-top: 10px;
  background: rgba(255, 122, 0, 0.1);
  border: 1px solid rgba(255, 122, 0, 0.5);
  border-radius: 8px;
  padding: 10px 12px;
}
.afp-suggest-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 170, 90, 1);
  margin-bottom: 6px;
}
.afp-suggest-route {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 4px;
  word-break: break-word;
}
.afp-suggest-note {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-bottom: 6px;
}
.afp-suggest-stats {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-bottom: 8px;
}
.afp-suggest-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.afp-suggest-use {
  background: rgba(255, 122, 0, 0.85);
  border: none;
  color: #1a1a1a;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
}
.afp-suggest-use:hover {
  background: rgba(255, 140, 30, 0.95);
}
.afp-suggest-dismiss {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.78rem;
}
.afp-suggest-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
}
.afp-suggest-error {
  color: rgba(255, 140, 140, 1);
  font-size: 0.8rem;
  padding: 4px 2px;
}
@media (max-width: 640px) {
  .airfield-map-bottombar {
    font-size: 0.78rem;
  }
  .afp-toggle {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
  .afp-panel {
    padding: 0 10px 10px;
  }
  .afp-row {
    gap: 6px;
    margin-top: 8px;
  }
  .afp-row label {
    font-size: 0.68rem;
  }
  .afp-row input,
  .afp-row select {
    padding: 5px 6px;
    font-size: 0.8rem;
  }
  .afp-suggest-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 8px;
    gap: 6px;
  }
  .afp-suggest-row > .afp-suggest-wrap {
    flex: 1 1 0;
    min-width: 0;
  }
  .afp-suggest-row > .afp-suggest-field {
    flex: 1 1 100%;
  }
  .afp-label-wide {
    font-size: 0.68rem;
  }
  .afp-ident-input,
  .afp-aircraft-select {
    width: 100%;
    min-width: 0;
    padding: 5px 6px;
    font-size: 0.8rem;
  }
  .afp-swap-btn {
    flex: 0 0 auto;
    align-self: flex-end;
    width: 26px;
    height: 26px;
    margin-bottom: 2px;
  }
  .afp-suggest-btn,
  .afp-viewplan-btn {
    flex: 1 1 calc(50% - 3px);
    padding: 6px 8px;
    font-size: 0.72rem;
    white-space: normal;
  }
  .afp-suggest-banner {
    padding: 8px 10px;
  }
  .afp-suggest-note,
  .afp-suggest-stats {
    font-size: 0.68rem;
  }
  .afp-chip {
    padding: 3px 4px 3px 8px;
    font-size: 0.78rem;
  }
  .afp-table {
    font-size: 0.72rem;
  }
  .afp-table th,
  .afp-table td {
    padding: 4px 5px;
  }
  .afp-generate-btn,
  .afp-copy-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .afp-plan-output {
    font-size: 0.68rem;
    padding: 8px 10px;
    max-height: 200px;
  }
}


/* Flight-planning From/To/Alternate autocomplete + fuel/alternate requirements check (added 2026-11-15) */
.afp-suggest-wrap {
  position: relative;
  display: inline-flex;
  flex-direction: column;
}
.afp-suggest-results {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: 4px;
  background: rgba(10, 30, 45, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1200;
}
.afp-result-active {
  background: rgba(255, 255, 255, 0.15);
}
.afp-ident-input {
  width: 130px;
}
.afp-fuel-check {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  max-width: 820px;
}
.afp-fuel-check > div {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
}
.afp-fuel-bad {
  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #ffd7db;
}
.afp-fuel-ok {
  background: rgba(40, 167, 69, 0.16);
  border: 1px solid rgba(40, 167, 69, 0.45);
  color: #d4f7dd;
}
.afp-alt-warn {
  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #ffd7db;
}
.afp-alt-info {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0.85;
}


/* Planning Wizard (added 2026-11-16) */
.afp-wizard {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 122, 0, 0.35);
  border-radius: 6px;
  background: rgba(255, 122, 0, 0.06);
}
.afp-wizard-head {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.afp-wiz-sub {
  font-weight: 400;
  font-size: 0.68rem;
  opacity: 0.75;
  margin-left: 6px;
}
.afp-wizard-setup .afp-row {
  margin-top: 6px;
}
.afp-wiz-checks {
  gap: 10px;
}
.afp-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}
.afp-check input {
  margin: 0;
}
.afp-check-disabled {
  opacity: 0.55;
}
.afp-wiz-note {
  font-size: 0.66rem;
  line-height: 1.4;
  opacity: 0.8;
  margin-top: 6px;
  max-width: 820px;
}
.afp-wiz-start-btn {
  margin-top: 8px;
  padding: 6px 14px;
  font-size: 0.78rem;
  border-radius: 6px;
  border: none;
  background: #ff7a00;
  color: #fff;
  cursor: pointer;
}
.afp-wiz-start-btn:hover {
  background: #e06c00;
}
.afp-wiz-status {
  font-size: 0.75rem;
  line-height: 1.4;
  padding: 6px 0;
}
.afp-wiz-dest,
.afp-wiz-final {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.afp-wiz-dest-text {
  font-size: 0.78rem;
  font-weight: 600;
}
.afp-wiz-btn {
  padding: 5px 10px;
  font-size: 0.72rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 122, 0, 0.5);
  background: #fff;
  cursor: pointer;
}
.afp-wiz-btn:hover {
  background: rgba(255, 122, 0, 0.12);
}
.afp-wiz-complete {
  border-color: rgba(40, 167, 69, 0.6);
  color: #1e7e34;
}
.afp-wiz-cancel {
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 0.68rem;
  border-radius: 6px;
  border: 1px solid rgba(220, 53, 69, 0.4);
  background: #fff;
  color: #dc3545;
  cursor: pointer;
}
.afp-wiz-cancel:hover {
  background: rgba(220, 53, 69, 0.08);
}
.afp-wiz-restart {
  margin-top: 6px;
  margin-left: 8px;
  padding: 4px 10px;
  font-size: 0.68rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 123, 255, 0.4);
  background: #fff;
  color: #007bff;
  cursor: pointer;
}
.afp-wiz-restart:hover {
  background: rgba(0, 123, 255, 0.08);
}

.afp-wiz-fuel-warn {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  line-height: 1.4;
  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.5);
}

/* Planning Wizard checkbox fix: .afp-row label sets flex-direction:column for caption-above-input fields; override with matching specificity for checkbox labels. */
.afp-row label.afp-check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
}

.afp-mode-choice {
  padding: 14px 4px 10px;
  text-align: center;
}
.afp-mode-question {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
.afp-mode-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.afp-mode-btn {
  padding: 10px 18px;
  font-size: 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}
.afp-mode-btn-wizard {
  border: none;
  background: #ff7a00;
  color: #fff;
}
.afp-mode-btn-wizard:hover {
  background: #e06c00;
}
.afp-mode-btn-manual {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}
.afp-mode-btn-manual:hover {
  background: rgba(255, 255, 255, 0.08);
}
.afp-switch-mode {
  text-align: right;
  padding: 4px 4px 2px;
}
.afp-switch-mode-btn {
  background: transparent;
  border: none;
  color: #8fb8ff;
  font-size: 0.72rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 2px 4px;
}
.afp-switch-mode-btn:hover {
  color: #fff;
}
.afp-resume-prompt {
  padding: 14px 4px 10px;
  text-align: center;
}
.afp-resume-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
  line-height: 1.4;
}
.afp-save-loggedout {
  padding: 6px 2px 4px;
}
.afp-save-row {
  display: flex;
  gap: 8px;
  padding: 8px 2px 6px;
  flex-wrap: wrap;
}
.afp-save-name {
  flex: 1 1 180px;
  min-width: 140px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 0.85rem;
}
.afp-save-status {
  min-height: 1.1em;
  padding: 0 2px 4px;
  font-size: 0.82rem;
  color: #9fd89f;
}
.afp-saved-routes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px;
}
.afp-saved-routes-empty {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  padding: 6px 2px;
}
.afp-saved-route-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
}
.afp-saved-route-info {
  min-width: 0;
}
.afp-saved-route-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.afp-saved-route-summary {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
}
.afp-saved-route-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.afp-saved-route-actions .afp-mode-btn {
  padding: 5px 10px;
  font-size: 0.78rem;
}

.afm-cta-wrap {
  margin-top: 18px;
}
