/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

/* Full-viewport map */
#map {
  width: 100%;
  height: 100%;
  /* PWA safe area for notch/home indicator */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* Legend panel */
.panel {
  position: absolute;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 12px 16px;
  font-size: 13px;
}

.panel.minimized { display: none; }

/* Minimized panel icon */
.panel-mini {
  display: none;
  position: absolute;
  z-index: 1000;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  font-size: 18px;
  line-height: 34px;
  text-align: center;
  color: #555;
  user-select: none;
}
.panel-mini:hover { background: #e8e8e8; }
.panel-mini.visible { display: block; }
.panel-mini-left { bottom: 30px; left: 10px; }
.panel-mini-feedback { bottom: 74px; left: 10px; }
.panel-mini-help { bottom: 118px; left: 10px; font-weight: 700; font-size: 22px; }
.panel-mini-right { bottom: 70px; right: 10px; }

/* Help modal */
.help-modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 5000; display: flex; align-items: center; justify-content: center;
  padding: 16px; box-sizing: border-box;
}
.help-modal {
  background: #fff; color: #222; max-width: 640px; width: 100%;
  max-height: 88vh; overflow-y: auto; border-radius: 10px; padding: 20px 22px;
  font-family: system-ui, -apple-system, sans-serif; line-height: 1.5;
  font-size: 14px; box-shadow: 0 6px 28px rgba(0,0,0,0.35);
  position: relative;
}
.help-modal h2 { margin: 0 0 14px; font-size: 18px; }
.help-modal h3 { margin: 18px 0 6px; font-size: 14px; color: #0066cc; }
.help-modal p { margin: 0; white-space: pre-line; }
.help-modal-img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid #d8d8d8; border-radius: 6px;
  margin: 6px 0 10px;
}
.help-modal-close {
  position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 28px; line-height: 1;
  color: #888; cursor: pointer; padding: 0 6px;
}
.help-modal-close:hover { color: #222; }
@media (prefers-color-scheme: dark) {
  .help-modal { background: #1f2326; color: #e8e8e8; }
  .help-modal h3 { color: #5aa9ff; }
  .help-modal-close { color: #aaa; }
  .help-modal-close:hover { color: #fff; }
}

/* Minimize button inside legend */
#legend .panel-minimize {
  position: absolute;
  top: 6px;
  right: 6px;
  border: none;
  background: none;
  font-size: 16px;
  color: #aaa;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
#legend .panel-minimize:hover { color: #555; }

/* Airport search box */
#airport-search {
  top: 12px;
  left: 54px;
  z-index: 1000;
  padding: 0;
  overflow: visible;
}

#search-input {
  width: 220px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  outline: none;
  color: #333;
}

#search-input::placeholder {
  color: #999;
}

#search-results {
  display: none;
  max-height: 360px;
  overflow-y: auto;
  border-top: 1px solid #e0e0e0;
}

#search-results.visible {
  display: block;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-height: 40px;
  cursor: pointer;
  transition: background 0.1s;
}

.search-item:hover,
.search-item.active {
  background: #f0f4ff;
}

.search-item-code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 700;
  font-size: 13px;
  color: #2980b9;
  flex-shrink: 0;
  width: 48px;
}

.search-item-info {
  flex: 1;
  min-width: 0;
}

.search-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-city {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#legend {
  position: fixed;
  bottom: 30px;
  left: 10px;
  /* Cap to viewport height with a small margin so the legend can never
     exceed the screen. Body becomes scrollable when content overflows;
     the minimize button is sticky so it stays reachable. */
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  /* Tighter padding to fit more rows. */
  padding: 8px 12px 10px;
  font-size: 12px;
  /* Reserve a little space at the top so the sticky minimize button
     doesn't overlap the first heading. */
  padding-top: 26px;
  width: 260px;
}

/* Minimize button sticks to the top-right of the scroll viewport so it's
   always reachable, even when many layer sections push the content past
   the viewport height. */
#legend .panel-minimize {
  position: sticky;
  top: 0;
  float: right;
  margin-top: -22px;
  margin-right: -6px;
  z-index: 5;
  /* Solid bg so the button always fully obscures text behind it as the
     user scrolls (the float reserves only the top corner; sticky keeps
     the button on screen). */
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #555;
}
#legend .panel-minimize:hover { background: #f5f5f5; color: #333; }

#legend h3 {
  margin: 0 0 6px 0;
  font-size: 13px;
  color: #333;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  color: #444;
  font-size: 12px;
}

.legend-dot {
  display: inline-block;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-section {
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #555;
  border-top: 1px solid #e0e0e0;
  padding-top: 5px;
}

/* Tighten per-layer sections inserted into #legend-layer-controls so
   eight active layers still fit comfortably above the time bar. */
#legend-layer-controls > .legend-section {
  margin-top: 8px;
  padding-top: 6px;
}
#legend-layer-controls h3 {
  margin: 0 0 4px 0;
  font-size: 12px;
}
#legend-layer-controls .icing-hint,
#legend-layer-controls .turb-hint,
#legend-layer-controls .clouds-hint,
#legend-layer-controls .precip-hint,
#legend-layer-controls .thunder-hint,
#legend-layer-controls .cbts-hint,
#legend-layer-controls .pressure-hint,
#legend-layer-controls .fog-hint {
  font-size: 10.5px;
  color: #888;
  line-height: 1.3;
  margin-top: 3px;
}
#legend-layer-controls .icing-symbols-toggle,
#legend-layer-controls .clouds-opt {
  display: block;
  font-size: 11px;
  margin: 4px 0 2px;
}
#legend-layer-controls .icing-legend,
#legend-layer-controls .turb-legend,
#legend-layer-controls .clouds-legend-density,
#legend-layer-controls .precip-legend,
#legend-layer-controls .thunder-legend-row,
#legend-layer-controls .cbts-sev-row,
#legend-layer-controls .winds-legend,
#legend-layer-controls .fog-legend {
  margin: 2px 0;
}
#legend-layer-controls .winds-mode-row {
  margin: 4px 0;
}


/* Airport tooltip */
.leaflet-tooltip {
  white-space: nowrap;
  font-size: 12px;
  padding: 4px 8px;
}

/* ACC sector labels */
.acc-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 11px;
  font-weight: 600;
  color: #c0392b;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  line-height: 1.3;
}
.acc-label::before { display: none; }

/* Airspace labels */
.airspace-lbl {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  font-size: 10px;
  font-weight: 600;
  color: #2980b9;
  white-space: pre-line;
  text-align: center;
}
.airspace-lbl::before { display: none; }

/* CTR/TMA border labels (rotated along polygon edges) */
.ctr-tma-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
  overflow: visible !important;
}
.ctr-tma-label::before { display: none; }
.ctr-tma-text {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.6;
  white-space: nowrap;
  line-height: 1.25;
  text-align: left;
  text-shadow:
    -1px -1px 0 rgba(255,255,255,0.8),
     1px -1px 0 rgba(255,255,255,0.8),
    -1px  1px 0 rgba(255,255,255,0.8),
     1px  1px 0 rgba(255,255,255,0.8);
}

/* IFR point markers */
.ifr-point-marker { background: none !important; border: none !important; }
.ifr-point-icon {
  width: 8px; height: 8px;
  background: #999;
  transform: rotate(45deg);
  position: absolute; top: 1px; left: 1px;
}
.ifr-point-label {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #333;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
  margin-left: 14px;
  white-space: nowrap;
}

/* METAR visual tooltip */
.metar-tip { line-height: 1.4; }
.metar-tip-hdr { font-weight: 700; margin-bottom: 1px; }
.metar-tip-elev { font-size: 11px; color: #666; margin-bottom: 2px; }
.metar-tip-row { display: flex; align-items: center; gap: 6px; }
.metar-cat { color: #fff; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; line-height: 1.4; }
.metar-tip-cv { display: flex; gap: 10px; margin-top: 3px; font-size: 11px; }
.metar-cv-item { display: flex; align-items: center; gap: 3px; }
.metar-cv-lbl { font-size: 10px; color: #888; }
.metar-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.metar-tip-wx { margin-top: 2px; font-size: 11px; color: #c0392b; font-weight: 600; }

/* Airport marker - the leaflet wrapper div */
.airport-marker {
  background: none !important;
  border: none !important;
  overflow: visible !important;
}

/* Inner icon: dot + code side by side */
.airport-icon {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.airport-dot {
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.wx-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 10px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #fff;
  line-height: 1;
  padding: 0;
  text-align: center;
}

.airport-code-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1;
}

.airport-fog-badge {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.3px;
  line-height: 1;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 1px;
}

.airport-code {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-weight: 700;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff,
     0   -1px 0 #fff,
     0    1px 0 #fff,
    -1px  0   0 #fff,
     1px  0   0 #fff;
  pointer-events: none;
  letter-spacing: 0.3px;
}

/* Popup styling */
.airport-popup .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.airport-popup .leaflet-popup-content {
  margin: 12px 16px;
  line-height: 1.5;
}

.popup-content .popup-name {
  font-weight: 700;
  font-size: 15px;
  color: #222;
  margin-bottom: 2px;
}

.popup-content .popup-codes {
  font-size: 13px;
  color: #555;
  margin-bottom: 4px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.popup-content .popup-detail {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
}

/* METAR section in popup */
.popup-metar {
  margin: 8px 0;
  padding: 8px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  font-size: 12px;
  position: relative;
}

/* Extra tabs row (TAF / Weather / NOTAMs / Charts) */
.popup-extra-tabs {
  display: flex;
  gap: 0;
  margin: 6px 0 0 0;
  border-bottom: 1px solid #ddd;
}

.popup-extra-tab {
  flex: 1;
  padding: 5px 0;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  text-align: center;
}
.popup-extra-tab:hover { color: #555; }
.popup-extra-tab.active {
  color: #2980b9;
  border-bottom-color: #2980b9;
}

.popup-extra-content {
  margin-top: 6px;
}

.popup-weather {
  margin: 0 0 8px 0;
  padding: 8px 10px;
  background: #f0f6ff;
  border-radius: 6px;
  border: 1px solid #d6e4f0;
}

/* When .popup-weather is nested inside the TAF panel, give it breathing room
   below the TAF content to make the two sections visually distinct. */
.popup-taf .popup-taf-weather {
  margin-top: 10px;
}
.popup-taf .popup-taf-weather:empty {
  display: none;
}

.metar-cat {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.metar-chips {
  margin: 4px 0;
  flex-wrap: wrap;
}
.metar-raw {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  color: #555;
  word-break: break-all;
  line-height: 1.4;
  margin: 4px 0;
}

.metar-decoded {
  font-size: 11px;
  color: #555;
  margin-top: 4px;
}

.metar-loading {
  color: #999;
  font-style: italic;
}

/* TAF forecast bar in popup */
.popup-taf {
  margin: 4px 0 8px;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  font-size: 12px;
}

.taf-header {
  font-weight: 700;
  font-size: 11px;
  color: #555;
  margin-bottom: 4px;
}

.data-age-wrap {
  float: right;
}

.data-age {
  font-size: 10px;
  font-weight: 600;
}

.taf-table {
  border-collapse: separate;
  border-spacing: 4px 2px;
  width: auto;
}

.taf-table td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.taf-row-label {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  text-align: right !important;
  padding-right: 5px !important;
  width: 24px;
  white-space: nowrap;
}

.taf-td-label {
  font-size: 10px;
  color: #555;
  font-weight: 600;
  font-family: 'SF Mono', 'Menlo', monospace;
  padding: 0 4px 1px !important;
  white-space: nowrap;
}

.taf-row-cat td,
.taf-row-tempo td {
  padding: 1px 4px !important;
}

.taf-hour {
  min-width: 24px;
  height: 20px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.taf-hour-tempo {
  opacity: 0.7;
}

.taf-td-data {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10px;
  color: #666;
  padding: 1px 4px !important;
}

.taf-tempo-val {
  color: #e67e22;
  font-size: 9px;
}

.taf-td-wx {
  font-size: 8px;
  color: #888;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.taf-raw {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  color: #333;
  word-break: break-all;
  line-height: 1.4;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e0e0e0;
}

/* Info grid: ATC, Fuel, Hours, Parking */
.popup-info-grid {
  margin: 8px 0;
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
}

.info-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.4;
}

.info-row-freqs {
  align-items: flex-start;
}
/* Stack multiple frequencies vertically inside a row (especially "Other"
   which can list several ground / approach / arrival channels). */
.info-row-freqs .freq-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.info-row-freqs .freq-item {
  display: flex;
  gap: 4px;
  align-items: baseline;
}
.info-row-freqs .freq-label {
  font-weight: 600;
  color: #555;
}
.info-row-freqs .freq-num {
  font-variant-numeric: tabular-nums;
  color: #333;
}
.info-row-freqs .freq-callsign {
  color: #888;
  font-size: 10px;
  font-style: italic;
}

/* Hours row merges AIP scheduled hours + active NOTAMs into one line */
.info-row-hours {
  align-items: flex-start;
}
.info-hours-value {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}
.info-hours-text {
  flex: 1 1 auto;
  min-width: 0;
}
.info-hours-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
}
.info-hours-badge-adj {
  background: #fff3cd;
  color: #7d5a00;
  border: 1px solid #ffe69c;
}
.info-hours-badge-clean {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* Procedures tab: GA-relevant Departure + Arrival briefings */
.popup-procedures {
  font-size: 12px;
  color: #333;
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 4px;
}
.proc-section {
  margin: 0 0 12px 0;
  padding: 8px 10px;
  background: #f8f9fa;
  border-left: 3px solid #2980b9;
  border-radius: 4px;
}
.proc-section + .proc-section {
  border-left-color: #27ae60;
}
.proc-heading {
  margin: 0 0 4px 0;
  font-size: 12px;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: 0.2px;
}
.proc-text {
  margin: 0;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
}
.proc-footer {
  font-size: 10px;
  color: #888;
  font-style: italic;
  margin-top: 8px;
  padding: 4px 0;
  border-top: 1px solid #eee;
}

/* Per-day tower schedule table (Info tab) */
.info-tower-schedule {
  margin: 6px 0 2px 0;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 4px;
  border: 1px solid #e6e6e6;
}
.tower-schedule-title {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}
.tower-schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.tower-schedule-table td {
  padding: 2px 6px 2px 0;
  vertical-align: top;
}
.tower-schedule-table .ts-day {
  font-weight: 600;
  width: 36px;
  color: #333;
}
.tower-schedule-table .ts-date {
  width: 44px;
  color: #888;
}
.tower-schedule-table .ts-hours {
  font-weight: 600;
  color: #2c3e50;
}
/* Row highlight by source */
.tower-schedule-table tr.tower-src-notam .ts-hours,
.tower-schedule-table tr.tower-src-mixed .ts-hours {
  background: #fff3cd;
  color: #7d5a00;
  padding: 1px 5px;
  border-radius: 3px;
}
.tower-schedule-table tr.tower-src-aip .ts-hours {
  color: #2c3e50;
}
.tower-schedule-footer {
  margin-top: 4px;
  font-size: 10px;
  color: #888;
  font-style: italic;
}

.info-label {
  flex-shrink: 0;
  width: 52px;
  font-weight: 600;
  color: #555;
}

.info-value {
  color: #333;
}

.info-unknown {
  color: #aaa;
  font-style: italic;
}

/* ATC level badges */
.atc-app  { color: #c0392b; font-weight: 600; }
.atc-twr  { color: #2980b9; font-weight: 600; }
.atc-afis { color: #8e44ad; font-weight: 600; }
.atc-ctaf { color: #e67e22; font-weight: 600; }
.atc-none { color: #888; }

/* Frequency list */
.freq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}

.freq-item {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: #555;
}

/* NOTAMs & AIP links row */
.popup-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
  padding: 8px 0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.popup-link {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s;
}

.popup-link:hover {
  opacity: 0.8;
}

.google-link {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #17a2b8;
}

.oa-link {
  background: #e2e3e5;
  color: #383d41;
  border: 1px solid #adb5bd;
}

.sv-link {
  background: #d4edda;
  color: #155724;
  border: 1px solid #28a745;
}



.windy-link {
  background: #e8f4fd;
  color: #1a73a7;
  border: 1px solid #4fc3f7;
}

.aip-link {
  background: #f3e5f5;
  color: #6a1b9a;
  border: 1px solid #ab47bc;
}

.lp-link {
  background: #e3f2fd;
  color: #0d47a1;
  border: 1px solid #42a5f5;
}

.map-link {
  background: #fce4ec;
  color: #b71c1c;
  border: 1px solid #ef5350;
}

/* Charts toggle link */
.popup-charts {
  margin: 4px 0 8px;
}

.charts-container {
  font-size: 11px;
}

.charts-section {
  border-top: 1px solid #eee;
}

.charts-section-hdr {
  padding: 4px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  color: #444;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}

.charts-section-hdr:hover {
  color: #6a1b9a;
}

.charts-count {
  font-weight: 400;
  color: #888;
}

.charts-chevron {
  margin-left: auto;
  font-size: 10px;
  color: #999;
}

.charts-section-list {
  padding: 0 0 4px 12px;
}

.charts-doc {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 4px;
  margin: 1px 0;
  text-decoration: none;
  color: #2c3e50;
  border-radius: 3px;
  font-size: 11px;
  transition: background 0.1s;
}

.charts-doc:hover {
  background: #f3e5f5;
}

.charts-doc-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.charts-doc-size {
  flex-shrink: 0;
  margin-left: 8px;
  font-size: 10px;
  color: #999;
}

.popup-content .popup-runways {
  padding-top: 8px;
}

.popup-content .popup-runways-title {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  margin-bottom: 4px;
}

/* Runway table */
.runway-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.runway-table th {
  text-align: left;
  font-weight: 600;
  color: #444;
  padding: 3px 8px 3px 0;
  border-bottom: 1px solid #ddd;
}

.runway-table td {
  padding: 3px 8px 3px 0;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
}

.runway-table tr:last-child td {
  border-bottom: none;
}

/* Runway wind combined table */
.runway-table-wind td {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
}

.runway-table-wind td[rowspan] {
  vertical-align: middle;
  border-bottom: 1px solid #e0e0e0;
}

.rwy-diagram-wrap {
  text-align: center; margin: 6px 0 2px;
}
.rwy-diagram {
  width: 180px; height: 180px;
  background: #f5f7fa; border: 1px solid #e0e0e0; border-radius: 4px;
}

.rwy-wind-desig {
  font-weight: 700;
  color: #333;
}

.rwy-active {
}

.rwy-active .rwy-wind-desig {
  color: #2e7d32;
}

.rwy-worst {
}

.rwy-worst .rwy-wind-desig {
  color: #c0392b;
}

.rwy-worst-badge {
  font-size: 8px;
  font-weight: 700;
  background: #e74c3c;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 2px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.rwy-inuse {
  font-size: 8px;
  font-weight: 700;
  background: #27ae60;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 2px;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.rwy-head {
  color: #27ae60;
}

.rwy-tail {
  color: #e74c3c;
}

.rwy-xw-caution {
  color: #e67e22;
}

.rwy-xw-warn {
  color: #e74c3c;
  font-weight: 700;
}

/* METAR category inline with airport code */
.metar-cat-inline {
  font-weight: 700;
}

/* Push top controls below status bar / notch on mobile */
@supports (padding-top: env(safe-area-inset-top)) {
  .leaflet-top {
    top: env(safe-area-inset-top) !important;
  }
}
@media (max-width: 768px) {
  .leaflet-top {
    top: max(12px, env(safe-area-inset-top, 12px)) !important;
  }
}


/* Layer control styling */
.leaflet-control-layers {
  border-radius: 8px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

/* Unified top-right control button size */
.map-layer-control .leaflet-control-layers-toggle,
.wx-layer-control .leaflet-control-layers-toggle,
.radar-layer-control .leaflet-control-layers-toggle,
.swc-control a {
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  background-image: none;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  color: #333;
  background-color: #fff;
}

/* Globe icon for map/overlay layer control */
.map-layer-control .leaflet-control-layers-toggle::after {
  content: '\1F310';  /* globe 🌐 */
}

/* Partly-cloudy icon for weather layer control. */
.wx-layer-control .leaflet-control-layers-toggle::after {
  content: '\26C5';  /* sun behind cloud ⛅ */
}

/* ========================================================================
   Slim vs beta mode. <html class="beta"> = full feature set; default = slim.
   Beta mode is enabled by adding ?beta=true to the URL (see inline boot
   script in index.html). Add new "advanced" UI elements here as the
   feature set grows. */
html:not(.beta) .map-layer-control,
html:not(.beta) #da62-min,
html:not(.beta) #da62-panel,
html:not(.beta) #filters-min,
html:not(.beta) #filters-panel,
html:not(.beta) .route-wx-panel-tab[data-rwtab="rw-gramet"],
html:not(.beta) .route-wx-panel-tab[data-rwtab="rw-briefing"],
html:not(.beta) .route-wx-panel-tab[data-rwtab="rw-flcomp"] {
  display: none !important;
}

/* Slim radar/satellite control: keep only Sat. Image, Sat. (Daily), Radar. */
html:not(.beta) .radar-layer-control label[data-layer]:not([data-layer="Sat. Image"]):not([data-layer="Sat. (Daily)"]):not([data-layer="Radar"]) {
  display: none !important;
}

/* Slim airport popup: in non-beta mode show TAF (default), Info, Hours and
   NOTAMs tabs — AIP / Procedures / Charts / Airgram / Briefing / Perf remain
   hidden. The NOTAM-warning badge attached to the popup name is suppressed
   too. Beta mode keeps the full set. */
html:not(.beta) .popup-extra-tab:not([data-panel="popup-taf"]):not([data-panel="popup-info"]):not([data-panel="popup-hours"]):not([data-panel="popup-notam"]) {
  display: none !important;
}
html:not(.beta) .popup-name .notam-warning {
  display: none !important;
}

/* Slim Info tab links: keep only Lentopaikat (if shown) and Map. */
html:not(.beta) .popup-links .aip-link,
html:not(.beta) .popup-links .google-link,
html:not(.beta) .popup-links .sv-link,
html:not(.beta) .popup-links .oa-link,
html:not(.beta) .popup-links .windy-link {
  display: none !important;
}

/* Small "beta" badge shown only in beta mode. Top-left corner so it
   doesn't crowd the right-edge control stacks. */
#beta-badge { display: none; }
html.beta #beta-badge {
  display: block;
  position: fixed;
  top: max(6px, env(safe-area-inset-top, 6px));
  left: 6px;
  z-index: 9999;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(231, 76, 60, 0.85);
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Radar dish icon for observation/radar layer control */
.radar-layer-control .leaflet-control-layers-toggle::after {
  content: '\1F4E1';  /* satellite antenna 📡 */
}


/* Separator between radio and checkbox groups */
.wx-layer-control .leaflet-control-layers-overlays {
  border-top: 1px solid #ddd;
  margin-top: 4px;
  padding-top: 4px;
}

/* DA62 panel (Range + Route tabs) */
#da62-panel {
  position: fixed;
  bottom: 30px;
  right: 10px;
  width: 280px;
  z-index: 2000;
}

/* Panel tabs */
.panel-tabs {
  display: flex;
  gap: 0;
  margin: -12px -16px 10px -16px;
  border-bottom: 1px solid #ddd;
}

.panel-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.panel-tab:first-child {
  border-radius: 8px 0 0 0;
}

.panel-tab:last-child {
  border-radius: 0 8px 0 0;
}

.panel-tab:hover {
  color: #555;
}

.panel-tab.active {
  color: #2980b9;
  border-bottom-color: #2980b9;
}

.panel-tab-spacer {
  flex: 1;
}

.panel-io-btn {
  border: none;
  background: none;
  font-size: 13px;
  color: #aaa;
  cursor: pointer;
  padding: 4px 4px;
  line-height: 1;
  transition: color 0.15s;
}

.panel-io-btn:hover {
  color: #2980b9;
}

/* Tab content visibility */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.range-toggle-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.range-toggle-row label {
  font-size: 12px;
  color: #444;
  cursor: pointer;
  margin: 0 !important;
}

.range-toggle-row input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

#da62-panel .range-hint {
  font-size: 11px;
  color: #888;
  margin-bottom: 8px;
}

#da62-panel label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 2px;
  margin-top: 6px;
}

#da62-panel input[type="number"],
#da62-panel select {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}

#da62-panel input[type="number"]:focus,
#da62-panel select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

#range-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  min-height: 18px;
}

.range-max {
  color: #e74c3c;
}

.range-safe {
  color: #27ae60;
}

#range-clear {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 5px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f8f9fa;
  font-size: 12px;
  font-family: inherit;
  color: #555;
  cursor: pointer;
  transition: background 0.15s;
}

#range-clear:hover {
  background: #e9ecef;
}

/* Weather detail popup */
.wx-popup {
  font-size: 13px;
  line-height: 1.5;
}

.wx-place-name {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

.wx-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.wx-icon {
  width: 52px;
  height: 52px;
  background: #87CEEB;
  border-radius: 50%;
  flex-shrink: 0;
}

.wx-desc {
  font-size: 12px;
  color: #666;
  text-transform: capitalize;
}

.wx-temp-big {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  line-height: 1.1;
}

.wx-chips {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  overflow-x: auto;
}

.wx-chip {
  display: inline-block;
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 10px;
  font-size: 11px;
  color: #444;
  white-space: nowrap;
}

.wx-hourly {
  display: flex;
  gap: 0;
  border-top: 1px solid #e0e0e0;
  padding-top: 6px;
}

.wx-hour {
  flex: 1 1 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.3;
}

.wx-hour-time {
  font-weight: 600;
  color: #555;
  font-size: 10px;
  margin-bottom: 2px;
}

.wx-hour-icon {
  width: 36px;
  height: 36px;
  display: block;
  margin: 2px auto;
  background: #87CEEB;
  border-radius: 50%;
}

.wx-hour-temp {
  font-weight: 700;
  color: #222;
}

.wx-hour-wind {
  color: #666;
  font-size: 10px;
}

.wx-hour-pop {
  color: #2980b9;
  font-size: 10px;
  font-weight: 600;
}

.wx-overview {
  margin-top: 8px;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #e9ecef;
  font-size: 11px;
  line-height: 1.45;
  color: #444;
}

.popup-weather .wx-icon { width: 40px; height: 40px; }
.popup-weather .wx-temp-big { font-size: 18px; }

/* Route planner */
.route-btn {
  display: block;
  width: 100%;
  padding: 6px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f8f9fa;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.route-btn:hover:not(:disabled) {
  background: #e9ecef;
}

.route-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Airgram-line toggle — matches panel-mini dimensions (34×34) and visual,
   stacked above the DA62 minimized icon. Click to enter draw-line mode;
   then drag on the map to define A→B. Releases the line + opens the
   airgram panel automatically. */
.airgram-line-toggle {
  position: absolute;
  z-index: 1000;
  /* Mobile-friendly: 44 px tap target (Apple HIG / Material spec); leaves
     room for the iPhone home indicator + browser chrome via env(). */
  bottom: max(30px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  right: 10px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 44px;
  text-align: center;
  color: #555;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}

.airgram-line-toggle:hover { background: #e8e8e8; }
.airgram-line-toggle:active { transform: scale(0.96); }

/* Active (draw-line mode on) — red highlight while waiting for the user
   to drag on the map. */
.airgram-line-toggle.active {
  background: #e74c3c;
  color: #fff;
}
.airgram-line-toggle.active:hover { background: #c0392b; }

/* Hide while DA62 panel is expanded — paneeli vie oikean alanurkan tilan. */
#da62-panel:not(.minimized) ~ .airgram-line-toggle { display: none; }

/* Crosshair cursor while in draw-line mode so the user knows clicks/drags
   on the map will draw a line instead of panning. */
.leaflet-container.airgram-drawing { cursor: crosshair !important; touch-action: none; }
.leaflet-container.airgram-drawing .leaflet-grab { cursor: crosshair !important; }
.leaflet-container.airgram-drawing .leaflet-dragging .leaflet-grab { cursor: crosshair !important; }
/* touch-action:none on the map during draw mode tells the browser that we
   handle touch events ourselves — without this, iOS/Android Safari/Chrome
   convert touchmove into a scroll/zoom gesture and cancel the pointer
   events mid-drag, so pointerup never fires and the airgram never opens. */

/* Floating banner shown while in airgram-draw mode. Tells the user what's
   expected — drag a line — and how to cancel. Mounted/unmounted by the
   _agEnter / _agExit pair in app.js. */
.airgram-hint-banner {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  background: rgba(231, 76, 60, 0.95);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* --- Mobile popup sizing -------------------------------------------------
   Override Leaflet's inline minWidth/maxWidth on small screens so the
   airport popup never overflows the viewport. The popup-content also gets
   a max-height + scroll so a tall popup (TAF + weather + 6-period
   forecast) doesn't push the close button off-screen. */
@media (max-width: 500px) {
  .airport-popup .leaflet-popup-content-wrapper {
    /* Fixed width (not just max-width) so the popup never shrinks below the
       viewport when a narrower tab (Info, Hours) becomes active — Leaflet
       sizes the wrapper to its content otherwise, causing visible width
       jumps when switching tabs. */
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    min-width: 0 !important;
  }
  .airport-popup .leaflet-popup-content {
    width: auto !important;
    min-width: 0 !important;
    max-height: 75vh;
    overflow-y: auto;
  }
  /* Make the Leaflet × close button bigger and easier to tap on mobile. */
  .airport-popup .leaflet-popup-close-button {
    width: 32px !important;
    height: 32px !important;
    font-size: 22px !important;
    line-height: 32px !important;
  }
  /* Raw METAR/TAF strings can be long; horizontal scroll keeps them
     readable without forcing a wider popup. */
  .metar-raw, .taf-raw {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
  }
}

/* Block the browser's native pull-to-refresh on the map area — otherwise
   panning the map down at the top of the screen accidentally reloads the
   PWA. body-level overscroll-behavior is the cleanest fix. */
html, body { overscroll-behavior: none; }

.route-btn-start {
  background: #2980b9;
  color: #fff;
  border-color: #2472a4;
}

.route-btn-start:hover:not(:disabled) {
  background: #2472a4;
}

.route-btn-stop {
  background: #e74c3c;
  color: #fff;
  border-color: #c0392b;
}

.route-btn-stop:hover:not(:disabled) {
  background: #c0392b;
}

.route-btn-sm {
  display: inline-block;
  width: auto;
  flex: 1;
  padding: 4px 0;
  font-size: 11px;
}

.route-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

#route-settings {
  font-size: 11px;
  color: #666;
  margin-top: 8px;
}

#route-waypoints {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.route-waypoint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
}

.route-wp-num {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2980b9;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.route-wp-info {
  flex: 1;
  min-width: 0;
}

.route-wp-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-wp-code {
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #2980b9;
}

.route-wp-code-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
}

.route-wp-code-link:hover {
  color: #1a5276;
  text-decoration-style: solid;
}

.route-wp-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: none;
  background: none;
  color: #aaa;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 18px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.route-wp-remove:hover {
  color: #e74c3c;
  background: #fdecea;
}

.route-leg-info {
  font-size: 11px;
  color: #777;
  padding: 2px 0 4px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.route-leg-arrow {
  color: #2980b9;
  margin-right: 2px;
}
.route-wp-freq {
  font-size: 10px;
  color: #555;
  margin-top: 1px;
}
.route-leg-freq {
  font-size: 10px;
  color: #c0392b;
  margin-top: 1px;
}

#route-totals {
  margin-top: 8px;
  font-size: 12px;
}

.route-totals-line {
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.route-remaining {
  color: #27ae60;
  font-weight: 600;
}

.route-fuel-warning {
  color: #e74c3c !important;
  font-weight: 700;
}

.route-terrain-warning {
  color: #e74c3c;
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 6px;
  background: #fdecea;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.route-wx-warning {
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 6px;
  background: #fdecea;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.route-icing-warning {
  color: #2980b9;
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 6px;
  background: #d6eaf8;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}

/* Route map markers */
.route-number-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2980b9;
  color: #2980b9;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.route-arrow-marker {
  width: 12px;
  height: 12px;
  color: #2980b9;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Alternate airport */
.route-wp-num-alt { background: #e67e22; }

.route-alt-toggle {
  flex-shrink: 0;
  border: 1px solid #ddd;
  background: #f8f9fa;
  color: #888;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  margin-right: 2px;
}

.route-alt-toggle:hover { border-color: #e67e22; color: #e67e22; }

.route-alt-toggle.active {
  background: #e67e22; color: #fff; border-color: #d35400;
}

.route-alt-separator {
  border-top: 1px dashed #e67e22;
  margin: 4px 0;
  font-size: 10px;
  color: #e67e22;
  padding-top: 2px;
}

.route-number-marker-alt {
  border-color: #e67e22; color: #e67e22;
}

.route-wp-label {
  font-size: 11px;
  font-weight: 700;
  color: #2980b9;
  white-space: nowrap;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
    0 -1px 0 #fff, 0 1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff;
}

.route-totals-sub { color: #888; font-weight: 400; font-size: 11px; }
.route-totals-alt { color: #e67e22; font-weight: 600; }

.route-rwy-label span {
  font-size: 12px; font-weight: 700; color: #222;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
    0 -1px 0 #fff, 0 1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff;
  white-space: nowrap; display: block; text-align: center;
}
.route-rwy-elev span {
  font-size: 9px; font-weight: 600; color: #666;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  white-space: nowrap; display: block; text-align: center;
}
.route-apt-freq {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.route-apt-freq span {
  display: block;
  position: relative;
  left: 14px;
  top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  line-height: 1.35;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
    0 -1px 0 #fff, 0 1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff;
  pointer-events: none;
}
.route-freq-marker {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}
.route-freq-marker span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #c0392b;
  white-space: nowrap;
  text-align: center;
  line-height: 1.3;
  transform: translate(-50%, -50%);
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff,
    0 -1px 0 #fff, 0 1px 0 #fff, -1px 0 0 #fff, 1px 0 0 #fff;
  pointer-events: none;
}

/* Weight & Balance */
.wb-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  color: #555;
}

.wb-row label {
  flex-shrink: 0;
  width: 68px;
  font-size: 11px;
  font-weight: 600;
  margin: 0 !important;
}

.wb-input {
  width: 52px;
  padding: 3px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
  font-family: inherit;
  text-align: right;
}

.wb-input-sm { width: 56px; }

.wb-max {
  font-size: 9px;
  color: #aaa;
  white-space: nowrap;
}

.wb-input:focus {
  outline: none;
  border-color: #3498db;
}

.wb-fuel-line {
  font-size: 11px;
  color: #666;
  margin: 6px 0;
  padding: 4px 0;
  border-top: 1px solid #eee;
}

#wb-results {
  font-size: 12px;
  margin: 4px 0;
}

.wb-result-ok { color: #27ae60; font-weight: 600; }
.wb-result-warn { color: #e74c3c; font-weight: 700; }

#wb-envelope {
  margin-top: 4px;
  border: 1px solid #eee;
  border-radius: 4px;
  background: #fafafa;
}

#wb-envelope svg { display: block; }

/* Route flight info inputs */
#route-flight-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-top: 8px;
  font-size: 11px;
}

#route-flight-info label {
  display: inline;
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin: 0 !important;
}

#route-flight-info input[type="text"],
#route-flight-info input[type="number"] {
  width: 56px;
  padding: 3px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
  font-family: inherit;
}

#route-flight-info input[type="number"] {
  width: 52px;
  text-align: right;
}

.route-wx-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  margin-left: 2px;
}
.route-wx-toggle input { margin: 0; }

/* Route weather badge inline with waypoint */
.route-wp-wx {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  flex-shrink: 0;
  margin-left: 2px;
}

.route-wp-wx-none {
  background: #ccc;
  color: #888;
  font-size: 9px;
}

/* GRAMET link button */
.route-gramet-link {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  background: #e8f4fd;
  color: #1a73a7;
  border: 1px solid #4fc3f7;
  transition: opacity 0.15s;
}

.route-gramet-link:hover {
  opacity: 0.8;
}

/* Wind indicator badges */
.wind-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 3px;
  background: #e67e22;
  color: #fff;
  margin-left: 3px;
  vertical-align: middle;
}

.taf-td-wind {
  font-size: 9px;
  white-space: nowrap;
}

.taf-wind-strong {
  color: #e67e22;
  font-weight: 700;
}

.taf-wind-dot {
  color: #e67e22;
  display: inline-flex;
  align-items: center;
}

.taf-ice-dot {
  color: #5dade2;
  display: inline-flex;
  align-items: center;
}

.wind-svg {
  width: 14px;
  height: 10px;
}

.taf-ws-dot {
  color: #e74c3c;
  display: inline-flex;
  align-items: center;
}

.ws-svg {
  width: 14px;
  height: 14px;
}

/* Icing indicator badges */
.ice-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 3px;
  background: #5dade2;
  color: #fff;
  margin-left: 3px;
  vertical-align: middle;
}

.ice-svg {
  width: 12px;
  height: 12px;
}

/* NOTAM toggle link */
/* NOTAM section in popup */
.popup-notam {
  margin: 4px 0 8px;
  padding: 6px 10px;
  background: #fef9e7;
  border-radius: 6px;
  border: 1px solid #f0e0a0;
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.notam-header {
  font-size: 12px;
  color: #e67e22;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.notam-header-critical {
  color: #e74c3c;
}

.notam-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notam-item {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  line-height: 1.4;
  color: #333;
  padding: 4px 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 3px;
  border-left: 3px solid #e0c860;
}

.notam-critical {
  border-left-color: #e74c3c;
  background: #fdecea;
}

.notam-id {
  font-weight: 700;
  font-size: 10px;
  color: #555;
  margin-bottom: 1px;
}

.notam-text {
  word-break: break-word;
}

/* NOTAM badge (route planner) */
.notam-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 3px;
  background: #f0ad4e;
  color: #fff;
  margin-left: 3px;
  vertical-align: middle;
}

.notam-badge-critical {
  background: #e74c3c;
}
.notam-badge .notam-svg {
  color: #856404;
}
.notam-badge-critical .notam-svg {
  color: #a02020;
}

/* NOTAM SVG icon */
.notam-svg {
  width: 12px;
  height: 12px;
}

/* NOTAM warning in popup title */
.notam-warning {
  color: #e67e22;
  vertical-align: middle;
  margin-left: 4px;
}
.notam-warning-critical {
  color: #e74c3c;
}
.notam-warning .notam-svg {
  width: 16px;
  height: 16px;
}

/* AMA grid overlay labels */
.ama-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 13px;
  font-weight: 700;
  font-style: italic;
  color: #444;
  text-shadow:
    -1px -1px 0 rgba(255,255,255,0.85),
     1px -1px 0 rgba(255,255,255,0.85),
    -1px  1px 0 rgba(255,255,255,0.85),
     1px  1px 0 rgba(255,255,255,0.85),
     0   -1px 0 rgba(255,255,255,0.85),
     0    1px 0 rgba(255,255,255,0.85);
  text-align: center;
  line-height: 1;
  pointer-events: none;
}

.ama-label sup {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}

/* AMA obstacle markers */
.obs-marker {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

/* AMA popup on cell click */
.ama-popup-content {
  font-size: 13px;
  font-style: italic;
  color: #333;
  padding: 2px 0;
}

/* Wind barb markers */
.wind-barb-marker {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.wind-barb-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Route weather timeline */
#rw-timeline {
  margin-bottom: 8px;
  overflow-x: auto;
}

.route-wx-table {
  border-collapse: collapse;
  width: auto;
}

.route-wx-table td {
  padding: 1px 3px;
  text-align: center;
  vertical-align: middle;
  font-size: 10px;
  white-space: nowrap;
}

.route-wx-time {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 9px;
  color: #888;
  font-weight: 600;
}

.route-wx-code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 700;
  font-size: 9px;
  color: #2980b9;
}

.route-wx-enroute {
  color: #ccc;
  font-size: 9px;
}

.route-wx-cond {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 700;
  font-size: 10px;
}

.route-wx-vis {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-weight: 600;
  font-size: 9px;
  border-radius: 3px;
  padding: 1px 3px;
  color: #fff;
  display: inline-block;
}

.route-wx-wind {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 9px;
  color: #555;
}

.route-wx-arrow {
  display: inline-block;
  font-size: 10px;
  line-height: 1;
}

.route-wx-temp {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 9px;
  color: #666;
}

.route-wx-label {
  font-size: 9px;
  font-weight: 600;
  color: #999;
  text-align: right !important;
  padding-right: 4px !important;
  width: 22px;
}

/* Auto Route (IFR) button */
.route-btn-auto {
  display: inline-block;
  width: auto;
  padding: 3px 8px;
  font-size: 10px;
  background: #8e44ad;
  color: #fff;
  border-color: #7d3c98;
}

.route-btn-auto:hover:not(:disabled) {
  background: #7d3c98;
}

.route-btn-auto:disabled {
  opacity: 0.5;
}

/* GRAMET cross section */
.route-gramet-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #eee;
}

.route-gramet-label {
  font-size: 10px;
  font-weight: 600;
  color: #888;
  margin-bottom: 3px;
}

.route-gramet-img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: border-color 0.15s;
}

.route-gramet-img:hover {
  border-color: #2980b9;
}

/* Weather time control bar */
.wx-time-bar {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  font-size: 13px;
  user-select: none;
}

/* Shared altitude / level selector — sits just above the time bar. Each
   active altitude-aware layer (Icing first, others to follow) reads the
   selected key via window.AirportApp.altitudeKey and a broadcast event. */
/* Loading indicator — small floating pill above the time bar, shown while
   any Open-Meteo fetch is in flight. */
.wx-loading-indicator {
  position: fixed;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  user-select: none;
}
.wx-loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wx-spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes wx-spin {
  to { transform: rotate(360deg); }
}

.wx-altitude-bar {
  position: fixed;
  bottom: 78px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.95);
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  font-size: 12px;
  user-select: none;
  flex-wrap: wrap;
  max-width: calc(100vw - 24px);
  justify-content: center;
}
.wx-alt-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  line-height: 1;
  transition: background 0.1s;
}
.wx-alt-btn:hover { background: #ddd; }
.wx-alt-btn.active {
  background: #2980b9;
  color: #fff;
  border-color: #2472a4;
}
.wx-alt-sep {
  width: 1px;
  height: 18px;
  background: #ccc;
  margin: 0 4px;
}

.wx-time-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
  line-height: 1;
  transition: background 0.1s;
}

.wx-time-btn:hover {
  background: #ddd;
}

.wx-time-play {
  font-size: 12px;
  padding: 4px 8px;
  margin-left: 4px;
  background: #27ae60;
  color: #fff;
  border-color: #1e8449;
}
.wx-time-play:hover {
  background: #1e8449;
}

.wx-time-now {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  margin-left: 4px;
  background: #2980b9;
  color: #fff;
  border-color: #2471a3;
}

.wx-time-now:hover {
  background: #2471a3;
}

.wx-time-label {
  min-width: 110px;
  text-align: center;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.wx-time-label-main {
  font-weight: 600;
  font-size: 13px;
}
.wx-time-label-sub {
  font-size: 10px;
  color: #888;
  font-weight: 500;
  margin-top: 1px;
}

/* SWC control button */
.swc-control a {
  font-size: 11px !important;
  font-weight: 700;
}

.swc-control a:hover {
  background: #f0f0f0;
}

/* Locate control */
.locate-control a {
  font-size: 18px !important; line-height: 30px !important;
  text-align: center; color: #555;
}
.locate-control a:hover { background: #f0f0f0; }
.locate-active a { color: #4285f4; }

/* SWC floating panel */
.swc-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.swc-panel-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
}

.swc-panel-title {
  font-weight: 700;
  font-size: 13px;
}

.swc-region-tabs {
  display: flex;
  gap: 2px;
}

.swc-region-btn {
  background: #e8e8e8;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: #555;
}

.swc-region-btn:hover {
  background: #ddd;
}

.swc-region-btn.swc-region-active {
  background: #2980b9;
  color: #fff;
  border-color: #2471a3;
}

.swc-panel-time {
  font-size: 11px;
  color: #666;
}

.swc-panel-pdf {
  font-size: 11px;
  font-weight: 600;
  color: #2980b9;
  text-decoration: none;
  margin-left: auto;
}

.swc-panel-pdf:hover {
  text-decoration: underline;
}

.swc-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}

.swc-panel-close:hover {
  color: #333;
}

.swc-panel-body {
  padding: 8px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.swc-chart-img {
  max-width: 85vw;
  max-height: 80vh;
  display: block;
}

/* Route Weather floating panel */
.route-wx-panel {
  position: fixed;
  /* Sit above the time-bar (bottom:30) + altitude-bar (bottom:78,
     height ~32) + loading-indicator (bottom:130) so the user can still
     see the time controls when the airgram is open. */
  bottom: 130px;
  right: 300px;
  width: 720px;
  max-height: calc(100vh - 160px);
  z-index: 2000;
  background: rgba(255,255,255,0.97);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Narrower screens: the 720 × right:300 layout would slide the panel off
   the left edge. Anchor it to the bottom centre and let it span the
   viewport with a small inset, so the airgram chart fills available space
   on phones, tablets, and small laptops. */
@media (max-width: 1100px) {
  .route-wx-panel {
    right: 12px;
    left: 12px;
    width: auto;
    max-width: 100%;
    bottom: max(140px, calc(env(safe-area-inset-bottom, 0px) + 140px));
  }
}

/* Per-tab control toolbar inside the airgram pane (FL / Dep / End). */
.airgram-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 6px 10px;
  align-items: center;
  background: #f5f7fa;
  border-bottom: 1px solid #e0e0e0;
  font-size: 12px;
  color: #333;
  flex-shrink: 0;
}
.airgram-controls label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.airgram-controls input {
  width: 56px;
  padding: 3px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
  background: #fff;
}
.airgram-controls input[type="number"] { text-align: right; }

.route-wx-panel-hdr {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 8px;
  background: #f5f5f5;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

.route-wx-panel-tab {
  padding: 8px 14px;
  border: none;
  background: none;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.route-wx-panel-tab:hover { color: #555; }

.route-wx-panel-tab.active {
  color: #2980b9;
  border-bottom-color: #2980b9;
}

.route-wx-panel-close,
.route-wx-panel-max {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}

.route-wx-panel-close:hover,
.route-wx-panel-max:hover { color: #333; }

/* Maximized state — fills almost the entire viewport. Content (canvas) re-
   measures on toggle and re-renders so the chart scales smoothly. */
.route-wx-panel.maximized {
  inset: 12px;
  bottom: 12px;
  right: 12px;
  top: 12px;
  left: 12px;
  width: auto;
  max-height: none;
  height: auto;
}

.route-wx-panel-body {
  padding: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.route-wx-panel-content {
  /* shown/hidden via display:none */
}

.popup-briefing {
  max-height: 270px;
  overflow-y: auto;
}

/* AI Briefing content */
.briefing-content {
  font-size: 13px;
  line-height: 1.6;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding: 4px 0;
  min-height: 40px;
}

.briefing-content h4.briefing-heading {
  font-size: 13px;
  font-weight: 700;
  color: #2980b9;
  margin: 10px 0 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.briefing-content h4.briefing-heading:first-child {
  margin-top: 0;
}

.briefing-content h5.briefing-subheading {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin: 6px 0 2px 0;
}

.briefing-cursor {
  display: inline-block;
  width: 6px;
  height: 14px;
  background: #2980b9;
  vertical-align: text-bottom;
  margin-left: 1px;
  animation: briefing-blink 0.7s step-end infinite;
}

@keyframes briefing-blink {
  50% { opacity: 0; }
}

/* Route panel weather/gramet buttons */
.route-wx-btns {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.route-wx-btn {
  flex: 1;
  padding: 5px 0;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f0f6ff;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  color: #2980b9;
  cursor: pointer;
  transition: background 0.15s;
}

.route-wx-btn:hover {
  background: #d6e8f8;
}

.route-wx-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Airgram vertical profile chart */
.airgram-container { position: relative; margin: 6px 0; }
.airgram-container canvas { width: 100%; display: block; border-radius: 4px; }
.airgram-legend { display: flex; gap: 8px; font-size: 10px; color: #555; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.airgram-legend-item { display: flex; align-items: center; gap: 3px; }
.airgram-legend-swatch { width: 14px; height: 10px; border-radius: 2px; border: 1px solid #ccc; }
.airgram-legend-icing {
  background: rgba(41,128,185,0.18);
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(41,128,185,0.35) 2px,
    rgba(41,128,185,0.35) 3px
  );
  border-color: rgba(41,128,185,0.5);
}
.airgram-legend-turb {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 2px,
    rgba(220,50,50,0.85) 2px,
    rgba(220,50,50,0.85) 4px
  );
  border-color: rgba(170,40,40,0.7);
}
.airgram-tip { position: absolute; pointer-events: none; background: rgba(0,0,0,0.85); color: #fff; font-size: 11px; padding: 5px 8px; border-radius: 4px; white-space: nowrap; z-index: 10; font-family: -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.35; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.airgram-tip-row { padding: 0; }
.airgram-tip-row + .airgram-tip-row { margin-top: 1px; padding-top: 2px; border-top: 1px solid rgba(255,255,255,0.12); }

/* Wind-adjusted totals in route list */
.route-wind-line {
  font-size: 11px;
  font-weight: 600;
  color: #2980b9;
  padding: 3px 0;
  border-top: 1px dashed #ccc;
  margin-top: 2px;
}

/* FL Compare table */
.flcomp-ref {
  font-size: 12px;
  font-weight: 700;
  color: #2980b9;
  padding: 6px 8px;
  margin-bottom: 6px;
  background: #e8f0fe;
  border-radius: 4px;
  border-left: 3px solid #2980b9;
}

.flcomp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 11px;
}

.flcomp-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.flcomp-table th {
  background: #f5f5f5;
  padding: 5px 8px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: #555;
  border-bottom: 2px solid #ddd;
  white-space: nowrap;
}

.flcomp-table td {
  padding: 4px 8px;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.flcomp-row:hover {
  background: #f8f9ff;
}

.flcomp-fl {
  font-weight: 700;
  color: #333;
}

.flcomp-sel {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  background: #2980b9;
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 2px;
}

.flcomp-wind {
  color: #666;
}

.flcomp-hw {
  color: #e74c3c;
}

.flcomp-tw {
  color: #27ae60;
}

.flcomp-time {
  color: #333;
}

.flcomp-fuel {
  color: #333;
}

.flcomp-fuel-warn {
  color: #e74c3c;
  font-weight: 700;
}

.flcomp-diff {
  font-size: 10px;
  color: #888;
}

.flcomp-diff-good {
  color: #27ae60;
}

.flcomp-diff-bad {
  color: #e74c3c;
}

.flcomp-current {
  background: #e8f0fe !important;
  border-left: 3px solid #2980b9;
}

.flcomp-best-time {
  background: #e8f8e8 !important;
}

.flcomp-best-fuel:not(.flcomp-best-time) {
  background: #fef9e7 !important;
}

.flcomp-legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 10px;
  color: #666;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.flcomp-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.flcomp-legend-swatch {
  width: 12px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid #ddd;
}

.flcomp-best-time-swatch {
  background: #e8f8e8;
}

.flcomp-best-fuel-swatch {
  background: #fef9e7;
}

.flcomp-current-swatch {
  background: #e8f0fe;
  border-left: 2px solid #2980b9;
}

.wind-barb-label {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #333;
  text-shadow:
    -1px -1px 0 rgba(255,255,255,0.9),
     1px -1px 0 rgba(255,255,255,0.9),
    -1px  1px 0 rgba(255,255,255,0.9),
     1px  1px 0 rgba(255,255,255,0.9);
  line-height: 1;
  margin-top: -2px;
  pointer-events: none;
}

/* Route weather barb markers on map */
.route-wx-barb-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.8;
}
.route-wx-barb-icon .wind-barb-label {
  font-size: 9px;
}
.route-wx-barb-row {
  display: flex;
  align-items: center;
  gap: 1px;
}

/* SIGMET popup */
.sigmet-popup {
  font-size: 12px;
  line-height: 1.5;
}

.sigmet-hazard-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.sigmet-alt {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin: 4px 0;
}

.sigmet-valid {
  font-size: 11px;
  color: #666;
  margin: 2px 0;
}

.sigmet-fir {
  font-size: 11px;
  color: #888;
  margin: 2px 0;
}

.sigmet-raw {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  color: #444;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 6px 8px;
  margin-top: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
}

/* Airspace R/D/P popup */
.airspace-popup {
  font-size: 12px;
  line-height: 1.5;
}

.airspace-type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.airspace-name {
  font-weight: 700;
  font-size: 14px;
  color: #222;
  margin-bottom: 4px;
}

.airspace-limits {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin: 4px 0;
}

.airspace-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.3px;
  vertical-align: middle;
}

.airspace-status-active {
  background: #27ae60;
  color: #fff;
}

.airspace-status-potential {
  background: #e0e0e0;
  color: #666;
}

.airspace-bynotam-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  background: #f39c12;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.3px;
  vertical-align: middle;
}

.airspace-country {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.airspace-validity {
  font-size: 11px;
  color: #666;
  margin: 4px 0 2px;
  font-weight: 600;
}

.airspace-hours-today {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  margin: 4px 0 2px;
}

.airspace-hours-weekly {
  font-size: 11px;
  color: #888;
  margin: 2px 0;
}

.airspace-frequencies {
  margin: 4px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.airspace-freq {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #2980b9;
  background: #e8f0fe;
  padding: 1px 6px;
  border-radius: 3px;
}

.airspace-freq-name {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 400;
  color: #666;
}

.airspace-remarks {
  font-size: 11px;
  color: #888;
  margin-top: 4px;
  font-style: italic;
}

.airspace-notam {
  margin-top: 6px;
  padding: 6px 8px;
  background: #fef9e7;
  border-radius: 4px;
  border: 1px solid #f0e0a0;
  border-left: 3px solid #e67e22;
}

.airspace-notam-hdr {
  font-size: 11px;
  font-weight: 700;
  color: #e67e22;
  margin-bottom: 2px;
}

.airspace-notam-schedule {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 2px;
}

.airspace-notam-validity {
  font-size: 10px;
  color: #888;
  margin-bottom: 4px;
}

.airspace-notam-text {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  color: #444;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.airspace-notam-alt {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 10px;
  color: #666;
  margin-top: 2px;
}

/* IFR Waypoints: Navaids + Fixes */
.wp-marker {
  background: none !important;
  border: none !important;
  overflow: visible !important;
}

.wp-icon {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

/* VOR / VOR-DME / DVOR / DVOR-DME / DVORTAC / VORTAC hexagon */
.wp-icon-vor {
  width: 13px;
  height: 13px;
  background: #2980b9;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
}

/* NDB circle */
.wp-icon-ndb {
  width: 10px;
  height: 10px;
  background: #c0392b;
  border-radius: 50%;
  flex-shrink: 0;
}

/* DME / TACAN square */
.wp-icon-dme {
  width: 10px;
  height: 10px;
  background: #27ae60;
  flex-shrink: 0;
}

/* Fix / Reporting point triangle */
.wp-icon-fix {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #999;
  flex-shrink: 0;
}

.wp-icon-fix-compulsory {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid #8e44ad;
  flex-shrink: 0;
}

/* Small monospace label next to marker */
.wp-label {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #333;
  text-shadow:
    -1px -1px 0 #fff,
     1px -1px 0 #fff,
    -1px  1px 0 #fff,
     1px  1px 0 #fff;
  pointer-events: none;
  letter-spacing: 0.2px;
}

/* Waypoint popup content */
.waypoint-popup .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.waypoint-popup .leaflet-popup-content {
  margin: 10px 14px;
  line-height: 1.5;
  font-size: 12px;
}

.wp-popup-name {
  font-weight: 700;
  font-size: 14px;
  color: #222;
  margin-bottom: 2px;
}

.wp-popup-ident {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  color: #2980b9;
  font-weight: 600;
}

.wp-popup-type {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.wp-popup-freq {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

.wp-popup-elev {
  font-size: 11px;
  color: #666;
}

/* OpenAIP enrichment badges */
.oaip-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  vertical-align: middle;
  margin: 1px 2px 1px 0;
}

.oaip-vfr { background: #e8f5e9; color: #2e7d32; border: 1px solid #81c784; }
.oaip-ifr { background: #e3f2fd; color: #1565c0; border: 1px solid #64b5f6; }
.oaip-ppr { background: #fff3e0; color: #e65100; border: 1px solid #ffb74d; }
.oaip-private { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }

.fuel-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  margin: 1px 2px 1px 0;
}

.oaip-service {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  background: #f5f5f5;
  color: #555;
  border: 1px solid #ddd;
  margin: 1px 2px 1px 0;
}

.oaip-ils {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
  margin: 1px 2px 1px 0;
}

.oaip-visual {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
  margin: 1px 2px 1px 0;
}

.rwy-aids-th {
  font-size: 11px;
  white-space: nowrap;
}

.rwy-aids-cell {
  white-space: normal;
  line-height: 1.6;
  max-width: 160px;
}

.oaip-cond {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #e67e22;
  margin-left: 4px;
}

.oaip-cond-warn {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #e74c3c;
  margin-left: 4px;
}

.oaip-no-fuel {
  font-size: 10px;
  font-style: italic;
  color: #999;
}

/* LLF time step bar */
.llf-time-bar {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.95);
  padding: 5px 10px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  font-size: 12px;
  user-select: none;
}

.llf-time-label {
  font-weight: 700;
  font-size: 11px;
  color: #555;
  margin-right: 4px;
}

.llf-time-btn {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
  cursor: pointer;
  color: #333;
  transition: background 0.1s;
}

.llf-time-btn:hover {
  background: #ddd;
}

.llf-time-btn.llf-time-active {
  background: #2980b9;
  color: #fff;
  border-color: #2471a3;
}

/* LLF popup */
.llf-popup {
  font-size: 12px;
  line-height: 1.5;
}

.llf-area-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.llf-valid {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
}

.llf-detail-row {
  display: flex;
  gap: 6px;
  margin-bottom: 3px;
  font-size: 11px;
}

.llf-detail-label {
  flex-shrink: 0;
  width: 40px;
  font-weight: 600;
  color: #555;
}

.llf-detail-value {
  color: #333;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
}

.llf-overview {
  margin-top: 6px;
  padding: 6px 8px;
  background: #f8f9fa;
  border-radius: 5px;
  border: 1px solid #e9ecef;
  font-size: 11px;
  line-height: 1.45;
  color: #444;
}

.llf-wx {
  font-size: 11px;
  color: #e67e22;
  font-weight: 600;
  margin-bottom: 2px;
}

/* LLF title row with crosses */
.llf-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}

.llf-crosses {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  align-items: flex-end;
}

.llf-cross-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.llf-cross-label {
  font-size: 9px;
  font-weight: 700;
  color: #888;
  line-height: 1;
}

/* LLF weather crosses on map */
.llf-cross-icon {
  background: none !important;
  border: none !important;
}
.llf-map-cross {
  display: flex;
  gap: 3px;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  padding: 2px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  pointer-events: none;
}
.llf-map-cross-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.llf-map-cross-lbl {
  font-size: 8px;
  font-weight: 700;
  color: #666;
  line-height: 1;
}

/* Performance calculator (DA62 Perf tab) */
.perf-container {
  font-size: 12px;
  color: #333;
}

.perf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.perf-title {
  font-weight: 700;
  font-size: 13px;
  color: #2c3e50;
}

.perf-weight-box {
  font-size: 11px;
  color: #555;
}

.perf-weight-input {
  width: 60px;
  padding: 2px 4px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
  text-align: right;
  background: #fafafa;
}

.perf-weight-input:focus {
  outline: none;
  border-color: #2980b9;
  background: #fff;
}

.perf-atmo {
  font-size: 11px;
  color: #555;
  background: #f4f6f8;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.perf-atmo-manual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.perf-no-metar {
  color: #e67e22;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.perf-manual-input {
  width: 50px;
  padding: 1px 3px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
  text-align: right;
}

.perf-manual-input:focus {
  outline: none;
  border-color: #2980b9;
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.perf-table th {
  text-align: left;
  font-weight: 600;
  color: #555;
  padding: 3px 6px 3px 0;
  border-bottom: 1px solid #ddd;
  font-size: 10px;
  white-space: nowrap;
}

.perf-table td {
  padding: 3px 6px 3px 0;
  color: #444;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.perf-table tr:last-child td {
  border-bottom: none;
}

.perf-table tr.perf-best {
  background: #f0faf0;
}

.perf-rwy {
  font-weight: 700;
  color: #2c3e50;
}

.perf-best-label {
  font-size: 9px;
  font-weight: 700;
  color: #27ae60;
  background: #e8f5e9;
  padding: 0 3px;
  border-radius: 2px;
  margin-left: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.perf-tw {
  font-size: 9px;
  font-weight: 700;
  color: #e74c3c;
  background: #fdeaea;
  padding: 0 3px;
  border-radius: 2px;
  margin-left: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.perf-ok {
  color: #27ae60;
  font-weight: 600;
}

.perf-warn {
  color: #e74c3c;
  font-weight: 700;
}

.perf-detail-row td {
  border-bottom: 1px solid #f0f0f0;
}

.perf-detail {
  font-size: 10px;
  color: #888;
  padding-top: 0 !important;
  padding-bottom: 4px !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.perf-wind {
  margin-top: 6px;
  font-size: 11px;
  color: #555;
  font-family: 'SF Mono', 'Menlo', monospace;
}

.perf-no-data {
  color: #999;
  font-style: italic;
  padding: 8px 0;
}

.perf-climb-low {
  color: #e67e22;
  font-weight: 600;
}

.perf-oei {
  margin-top: 8px;
  padding: 5px 8px;
  background: #fdf2e9;
  border-radius: 4px;
  border-left: 3px solid #e67e22;
  font-size: 11px;
}

.perf-oei-title {
  font-weight: 700;
  color: #e67e22;
  display: block;
  margin-bottom: 2px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.perf-oei-data {
  font-family: 'SF Mono', 'Menlo', monospace;
  color: #555;
}

.route-oei-warning {
  color: #e67e22;
  font-weight: 700;
  margin-top: 4px;
  padding: 4px 6px;
  background: #fdf2e9;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}

/* ===== AIP AD summary panel ===== */
.popup-aip {
  font-size: 12px;
  color: #333;
  max-height: 50vh;
  overflow-y: auto;
  /* Slight inner padding so the scrollbar doesn't overlap section content */
  padding-right: 4px;
}

/* NOTAM-aware hours augmentation */
.ad-hours-pending {
  color: #888;
  font-style: italic;
  font-size: 11px;
}
.ad-hours-clean {
  color: #27ae60;
  font-size: 11px;
  font-style: italic;
}
.ad-summary-refined {
  /* Make clear this is the NOTAM-adjusted version, not the raw AIP line */
  background: linear-gradient(to right, #fff8e1 0%, #fff8e1 100%);
  padding: 4px 6px;
  border-left: 3px solid #f39c12;
  border-radius: 3px;
}
.ad-hours-badge {
  margin-top: 4px;
  padding: 3px 6px;
  background: #fff3cd;
  color: #7d5a00;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block;
}
.ad-hours-badge-ids {
  font-weight: 400;
  opacity: 0.8;
}

.ad-header {
  margin-bottom: 6px;
  padding: 4px 8px;
  background: #f5f7fa;
  border-radius: 4px;
  font-size: 11px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ad-airac { font-weight: 600; color: #2c3e50; }
.ad-effective { color: #888; }
.ad-source-link {
  margin-left: auto;
  color: #2980b9;
  text-decoration: none;
  font-size: 11px;
}
.ad-source-link:hover { text-decoration: underline; }

.ad-ppr-badge {
  margin: 6px 0;
  padding: 5px 10px;
  background: #fff3cd;
  border-left: 3px solid #f39c12;
  color: #7d5a00;
  font-weight: 600;
  border-radius: 3px;
  font-size: 12px;
  letter-spacing: 0.3px;
}

.ad-summary {
  margin: 8px 0 0 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.ad-summary-dt {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #546e7a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ad-summary-icon {
  font-size: 13px;
  opacity: 0.75;
}
.ad-summary-label {
  flex: 1;
}
.ad-summary-dd {
  margin: 2px 0 0 22px;
  font-size: 12px;
  line-height: 1.45;
  color: #333;
  word-break: break-word;
}
.ad-summary-unset {
  color: #b0b0b0;
  font-style: italic;
}

.ad-no-summary {
  margin: 10px 0;
  padding: 8px 10px;
  background: #f8f9fa;
  border: 1px dashed #ccc;
  border-radius: 4px;
  color: #666;
  font-size: 11px;
  line-height: 1.4;
}

.ad-footer {
  margin: 10px 0 2px 0;
  padding-top: 6px;
  border-top: 1px solid #eee;
  font-size: 10px;
  color: #999;
  font-style: italic;
  text-align: center;
}


/* ===== Route Stops auto-planner ===== */
.route-stops-panel {
  margin-top: 8px;
  padding: 8px;
  background: #f0f6ff;
  border: 1px solid #d6e4f0;
  border-radius: 4px;
  font-size: 12px;
}
.route-stops-title {
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 6px;
  font-size: 12px;
}
.route-stops-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.route-stops-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #555;
}
.route-stops-row input[type="text"] {
  width: 56px;
  padding: 2px 4px;
  font-family: ui-monospace, monospace;
  text-transform: uppercase;
}
.route-stops-row input[type="number"] {
  width: 50px;
  padding: 2px 4px;
}
.route-stops-row #rs-plan-btn {
  padding: 3px 12px;
  background: #2980b9;
  color: white;
  border: none;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
}
.route-stops-row #rs-plan-btn:hover { background: #1f5f8a; }
.route-stops-result {
  margin-top: 8px;
}
.rs-summary {
  padding: 6px 8px;
  background: #fff;
  border-radius: 3px;
  margin-bottom: 6px;
  font-size: 12px;
}
.rs-profile {
  font-size: 10px;
  color: #888;
}
.rs-applied {
  color: #27ae60;
  font-weight: 600;
}
.rs-legs {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rs-airport {
  font-weight: 700;
  color: #2c3e50;
  padding: 4px 6px;
  background: #fff;
  border-radius: 3px;
  margin: 2px 0;
}
.rs-airport.rs-final {
  background: #d4edda;
}
.rs-name {
  font-weight: 400;
  color: #666;
  font-size: 10px;
  font-style: italic;
}
.rs-leg {
  margin: 0 0 0 16px;
  font-size: 11px;
  color: #888;
  font-variant-numeric: tabular-nums;
}
.rs-ppr {
  background: #fff3cd;
  color: #7d5a00;
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
}
.rs-refuel {
  background: #d4edda;
  color: #155724;
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
  border: 1px solid #c3e6cb;
}
.rs-transit {
  background: #e8eef4;
  color: #4a5a6a;
  padding: 1px 5px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 500;
  border: 1px solid #d6dde6;
}
.rs-fuel-state {
  color: #888;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}
#rs-apply-btn {
  margin-top: 8px;
  padding: 4px 14px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 3px;
  font-weight: 600;
  cursor: pointer;
}
#rs-apply-btn:hover { background: #1e8449; }
.rs-err {
  padding: 6px 8px;
  background: #f8d7da;
  color: #721c24;
  border-radius: 3px;
  font-size: 11px;
}
.rs-loading {
  color: #888;
  font-style: italic;
  padding: 4px;
}


/* --- Filters panel --------------------------------------------------------
   Top-left floating panel built dynamically by js/filters.js.
   ----------------------------------------------------------------------- */
/* Mini gear sits to the right of the search box (search ends ~294px). */
.panel-mini-tl  { top: 12px;  left: 304px; }
.panel.panel-tl { top: 56px;  left: 12px;  max-width: 260px; max-height: 75vh; overflow-y: auto; padding: 10px 12px; }
#filters-panel .panel-minimize {
  position: absolute; top: 6px; right: 6px;
  border: none; background: none; font-size: 16px; color: #aaa;
  cursor: pointer; padding: 0 4px; line-height: 1;
}
#filters-panel .panel-minimize:hover { color: #555; }
#filters-panel h3 { margin: 0 0 10px 0; font-size: 14px; color: #2c3e50; }
.filter-section {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid #eee;
}
.filter-section:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.filter-section h4 { margin: 0 0 6px 0; font-size: 12px; color: #555; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.filter-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #444; margin: 3px 0; cursor: pointer; }
.filter-row input[type="checkbox"] { margin: 0; cursor: pointer; }
.filter-row input[type="range"] { flex: 1; min-width: 70px; }
.filter-row input[type="number"] { width: 70px; padding: 2px 4px; font-size: 12px; }
#f-country, #f-fuel { width: 100%; padding: 4px 6px; font-size: 12px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 3px; }
#f-rwy-min-val { font-weight: 600; color: #2980b9; min-width: 50px; }
.filter-hint { font-size: 10px; color: #999; margin-top: 3px; font-style: italic; }
.filter-footer {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between;
}
.filter-count { font-size: 11px; color: #666; font-variant-numeric: tabular-nums; }
#f-reset {
  padding: 4px 10px; font-size: 11px; background: #f0f0f0;
  border: 1px solid #ccc; border-radius: 3px; cursor: pointer; color: #555;
}
#f-reset:hover { background: #e0e0e0; }

/* --- Airgram side/top view toggle (Route → Airgram tab) ----------------- */
.airgram-view-toggle {
  display: flex;
  gap: 4px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #eee;
}
.agv-btn {
  padding: 4px 14px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 600;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  color: #555;
}
.agv-btn:hover { background: #e8e8e8; }
.agv-btn.active {
  background: #2980b9;
  color: white;
  border-color: #2980b9;
}
.airgram-render-area { /* canvas + legend mount point */ }

/* --- Open-Meteo surface weather popup ----------------------------------- */
.wx-panel {
  /* Anchor a min-width so 6 forecast cells × ~50 px have room without
     clipping the day/period labels at the new (larger) font sizes. */
  min-width: 290px;
}
.leaflet-popup-content:has(.wx-panel) { min-width: 290px; }
.wx-now-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0 6px; border-bottom: 1px solid #eee;
  margin-bottom: 6px;
}
.wx-now-row .wx-temp { font-size: 22px; font-weight: 700; color: #2c3e50; line-height: 1; }
.wx-now-row .wx-cond { font-size: 12px; color: #444; flex: 1; }
.wx-pills {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
  font-size: 11px;
  margin-bottom: 6px;
}
.wx-pill {
  display: inline-flex; align-items: baseline; gap: 3px;
  padding: 1px 6px;
  background: #f1f5f9; border-radius: 10px;
  white-space: nowrap;
}
.wx-pill-lbl { color: #888; font-weight: 600; font-size: 10px; }
.wx-pill-val { color: #2c3e50; font-weight: 600; }
.wx-forecast-strip { border-top: 1px solid #eee; padding-top: 5px; }
.wx-fs-title { font-size: 10px; color: #888; font-weight: 600; margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
.wx-fs-row { display: flex; gap: 3px; }
.wx-fs-cell {
  flex: 1 1 0; min-width: 0;
  padding: 3px 1px; background: #f7f9fb; border-radius: 3px;
  text-align: center; line-height: 1.2;
  overflow: hidden;
}
.wx-fs-time { font-size: 9px; color: #666; font-weight: 600; white-space: nowrap; }
.wx-fs-day    { font-size: 11px; color: #2c3e50; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.wx-fs-period { font-size: 10px; color: #555; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.wx-fs-icon { font-size: 16px; line-height: 1.15; }
.wx-fs-temp { font-size: 11px; font-weight: 700; color: #2c3e50; white-space: nowrap; }
.wx-fs-wind { font-size: 9.5px; color: #555; white-space: nowrap; font-weight: 600; }

/* METAR Open-Meteo fallback */
.metar-om-fallback {
  font-size: 12px;
  color: #555;
  padding: 4px 6px;
  background: #f0f6ff;
  border-left: 3px solid #2980b9;
  border-radius: 0 3px 3px 0;
  margin-top: 4px;
}

/* --- Animated winds-aloft overlay panel -------------------------------- */
.wind-particle-canvas { mix-blend-mode: screen; }
.winds-panel {
  position: absolute;
  /* Top-left, below the search bar — avoids overlap with the layer/SWC
     controls clustered on the right side. */
  top: 64px; left: 12px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 220px;
}
.winds-panel-hdr {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  color: #bcd6e8;
  text-transform: uppercase;
}
.winds-fl-row { display: flex; gap: 3px; flex-wrap: wrap; margin-bottom: 6px; }
.winds-fl-btn {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  background: rgba(255,255,255,0.08);
  color: #ddd;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  cursor: pointer;
}
.winds-fl-btn:hover { background: rgba(255,255,255,0.18); }
.winds-fl-btn.active {
  background: #2980b9; border-color: #2980b9; color: white;
}
.winds-legend { display: flex; gap: 0; align-items: center; font-size: 10px; }
.winds-legend .wl {
  flex: 1; padding: 2px 0;
  text-align: center; font-weight: 700; color: #1a2330;
}
.winds-legend .wl-1 { background: rgb(140,180,200); }
.winds-legend .wl-2 { background: rgb(80,200,140); }
.winds-legend .wl-3 { background: rgb(220,220,80); }
.winds-legend .wl-4 { background: rgb(255,160,60); }
.winds-legend .wl-5 { background: rgb(255,80,60); color: #fff; }
.winds-legend .wl-unit { padding: 0 4px; color: #aaa; font-weight: 400; }

.winds-mode-row { display: flex; gap: 3px; margin-bottom: 6px; }
.winds-mode-btn {
  flex: 1;
  padding: 4px 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  background: rgba(255,255,255,0.06);
  color: #ccc;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  cursor: pointer;
}
.winds-mode-btn:hover { background: rgba(255,255,255,0.16); }
.winds-mode-btn.active { background: #d63ad6; border-color: #d63ad6; color: white; }

/* --- Thunderstorm overlay panel ---------------------------------------- */
.thunderstorm-canvas { /* placed by JS */ }
.thunder-panel {
  position: absolute;
  /* Below the winds-panel area on the left. */
  top: 220px; left: 12px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 220px;
}
.thunder-panel-hdr {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  color: #ffe04a;
  text-transform: uppercase;
}
.thunder-legend-row {
  display: flex; gap: 0; align-items: center;
  font-size: 10px; margin-bottom: 6px;
}
.tl-cape {
  flex: 1; padding: 2px 0;
  text-align: center; font-weight: 700; color: #1a2330;
}
.tl-1 { background: rgba(255,220,80,0.7); }
.tl-2 { background: rgba(255,160,40,0.85); }
.tl-3 { background: rgba(230,60,40,0.95); color: #fff; }
.tl-4 { background: rgba(160,20,80,1.0); color: #fff; }
.tl-unit { padding: 0 4px; color: #aaa; font-weight: 400; }
.thunder-hint { font-size: 10px; color: #bbb; line-height: 1.4; }

/* --- Cloud cover overlay panel ----------------------------------------- */
.cloudcover-canvas { /* placed by JS */ }
.clouds-panel {
  position: absolute;
  top: 380px; left: 12px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 240px;
}
.clouds-panel-hdr {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  color: #cfe2f0;
  text-transform: uppercase;
}
.clouds-row { display: flex; gap: 3px; margin-bottom: 4px; flex-wrap: wrap; }
.clouds-btn {
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  background: rgba(255,255,255,0.06);
  color: #ddd;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  cursor: pointer;
}
.clouds-btn:hover { background: rgba(255,255,255,0.18); }
.clouds-btn.active { background: #6fa8c8; border-color: #6fa8c8; color: #fff; }
.clouds-legend { display: flex; gap: 0; align-items: center; font-size: 10px; margin-top: 4px; }
.clouds-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 4px; }
.clouds-opts { font-size: 10.5px; color: #ddd; margin-top: 6px; }
.clouds-opt { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.clouds-opt input[type="checkbox"] { margin: 0; cursor: pointer; }
.cl { flex: 1; padding: 2px 0; text-align: center; font-weight: 700; color: #1a2330; }
.cl-1 { background: rgba(228, 232, 240, 0.85); }
.cl-2 { background: rgba(200, 205, 215, 0.92); }
.cl-3 { background: rgba(168, 175, 188, 0.96); }
.cl-4 { background: rgba(132, 140, 155, 1.0); color: #fff; }
.cl-unit { padding: 0 4px; color: #aaa; font-weight: 400; }

/* Density-based legend (cloud renderer paints constant grey, only the
   *fraction* of pixels painted varies). Each swatch is dot-stippled with
   the cloud grey at increasing density. */
.clouds-legend-density {
  display: flex; gap: 4px; align-items: center;
  font-size: 10px; margin-top: 4px;
}
.cd {
  flex: 1; height: 14px; border-radius: 2px;
  background-color: rgba(0, 0, 0, 0.18);
  background-image: radial-gradient(rgb(180,180,180) 60%, transparent 62%);
}
/* Use background-size to vary stipple density: smaller spacing = denser. */
.cd-1 { background-size: 8px 8px; }   /* FEW  */
.cd-2 { background-size: 5px 5px; }   /* SCT  */
.cd-3 { background-size: 3px 3px; }   /* BKN  */
.cd-4 { background-color: rgb(180,180,180); background-image: none; } /* OVC */
.cd-unit { padding: 0 4px; color: #aaa; font-weight: 400; }

/* Two-line cloud-slab buttons (main label + altitude annotation) */
.clouds-btn-2line { padding: 3px 6px; line-height: 1.15; }
.clouds-btn-main { display: block; font-size: 11px; font-weight: 600; }
.clouds-btn-alt  {
  display: block; font-size: 8.5px; font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
  letter-spacing: 0.02em;
}
.clouds-btn.active .clouds-btn-alt { color: rgba(255,255,255,0.85); }

/* --- Precipitation overlay panel --------------------------------------- */
.precipitation-canvas { /* placed by JS */ }
.precip-panel {
  position: absolute;
  top: 540px; left: 12px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 240px;
}
.precip-panel-hdr {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  color: #b0d8f0;
  text-transform: uppercase;
}
.precip-legend { display: flex; gap: 0; align-items: center; font-size: 10px; margin-bottom: 4px; }
.pl { flex: 1; padding: 2px 0; text-align: center; font-weight: 700; color: #1a2330; }
.pl-1 { background: rgb(140, 200, 240); }
.pl-2 { background: rgb(80, 180, 220); color: #fff; }
.pl-3 { background: rgb(60, 200, 130); }
.pl-4 { background: rgb(220, 220, 60); }
.pl-5 { background: rgb(240, 130, 40); color: #fff; }
.pl-6 { background: rgb(220, 40, 60); color: #fff; }
/* Snow ramp — pale white-blue → violet → magenta */
.ps-1 { background: rgb(240, 240, 250); }
.ps-2 { background: rgb(220, 200, 240); }
.ps-3 { background: rgb(200, 160, 230); }
.ps-4 { background: rgb(180, 110, 220); color: #fff; }
.ps-5 { background: rgb(200,  80, 180); color: #fff; }
.ps-6 { background: rgb(220,  60, 160); color: #fff; }
.pl-unit { padding: 0 4px; color: #aaa; font-weight: 400; }
.precip-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 2px; }

/* --- Icing overlay panel ---------------------------------------------- */
.icing-canvas { /* placed by JS */ }
.icing-panel {
  position: absolute;
  top: 700px; left: 12px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 240px;
}
.icing-panel-hdr {
  font-weight: 700; font-size: 12px;
  margin-bottom: 6px; letter-spacing: 0.04em;
  color: #e8d6f0; text-transform: uppercase;
}
.icing-row { display: flex; gap: 3px; margin-bottom: 4px; flex-wrap: wrap; }
.icing-btn {
  padding: 4px 8px;
  font-size: 10px; font-weight: 600;
  font-family: inherit;
  background: rgba(255,255,255,0.06);
  color: #ddd;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  cursor: pointer;
}
.icing-btn:hover { background: rgba(255,255,255,0.18); }
.icing-btn.active { background: #c46fc4; border-color: #c46fc4; color: #fff; }
.icing-btn-2line { padding: 3px 6px; line-height: 1.15; }
.icing-btn-main { display: block; font-size: 11px; font-weight: 600; }
.icing-btn-alt {
  display: block; font-size: 8.5px; font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-top: 1px; letter-spacing: 0.02em;
}
.icing-btn.active .icing-btn-alt { color: rgba(255,255,255,0.85); }
.icing-legend { display: flex; gap: 0; align-items: center; font-size: 10px; margin-top: 4px; }
.il { flex: 1; padding: 2px 0; text-align: center; font-weight: 700; color: #1a2330; }
.il-2 { background: rgba(250, 175,  60, 0.92); color: #1a2330; }
.il-3 { background: rgba(230,  70,  70, 0.96); color: #fff; }
.il-4 { background: rgba(200,  60, 180, 1.0);  color: #fff; }
.icing-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 4px; }
.icing-symbols-toggle { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #ddd; margin-top: 6px; cursor: pointer; user-select: none; }
.icing-symbols-toggle input { margin: 0; cursor: pointer; }

.fog-legend { display: flex; gap: 0; align-items: center; font-size: 10px; margin-top: 4px; }
.fl { flex: 1; padding: 2px 0; text-align: center; font-weight: 700; color: #1a2330; }
.fl-1 { background: rgba(241, 196,  15, 0.55); color: #1a2330; }
.fl-2 { background: rgba(230, 126,  34, 0.75); color: #fff; }
.fl-3 { background: rgba(192,  57,  43, 0.85); color: #fff; }
.fl-4 { background: rgba(155,  89, 182, 0.85); color: #fff; }
.fog-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 4px; }

/* --- CB/TS area overlay panel ----------------------------------------- */
.cbts-canvas { /* placed by JS */ }
.cbts-panel {
  position: absolute;
  top: 220px; right: 60px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 220px;
}
.cbts-panel-hdr {
  font-weight: 700; font-size: 12px;
  margin-bottom: 6px; letter-spacing: 0.04em;
  color: #ffb0a0; text-transform: uppercase;
}
.cbts-sev-row { display: flex; gap: 0; margin-bottom: 6px; font-size: 9.5px; }
.cbts-sev {
  flex: 1;
  padding: 3px 0;
  text-align: center;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}
.cbts-sev-1 { background: rgb(244, 200,  60); color: #5a3e08; }
.cbts-sev-2 { background: rgb(240, 130,  40); color: #fff; }
.cbts-sev-3 { background: rgb(220,  50,  50); color: #fff; }
.cbts-sev-4 { background: rgb(170,  30, 170); color: #fff; }

.cbts-legend { font-size: 10.5px; line-height: 1.65; color: #ddd; margin-bottom: 4px; }
.cbts-key {
  display: inline-block;
  min-width: 38px;
  padding: 1px 5px;
  margin-right: 4px;
  background: rgba(120, 130, 150, 0.6);
  color: #fff;
  border-radius: 3px;
  font-weight: 700; font-size: 9.5px;
  text-align: center;
}
.cbts-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 2px; }

/* --- MSL Pressure overlay panel --------------------------------------- */
.pressure-canvas { /* placed by JS */ }
.pressure-panel {
  position: absolute;
  top: 380px; right: 60px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 240px;
}
.pressure-panel-hdr {
  font-weight: 700; font-size: 12px;
  margin-bottom: 6px; letter-spacing: 0.04em;
  color: #c8d8ee; text-transform: uppercase;
}
.pressure-legend { font-size: 10.5px; line-height: 1.7; color: #ddd; margin-bottom: 4px; }
.pr-key {
  display: inline-block;
  min-width: 22px; padding: 1px 4px;
  margin-right: 5px;
  border-radius: 3px;
  font-weight: 700; font-size: 11px;
  text-align: center;
  color: #fff;
}
.pr-h { background: rgb(190, 30, 30); }
.pr-l { background: rgb(30, 70, 200); }
.pr-iso {
  display: inline-block;
  width: 30px; height: 0;
  margin: 0 6px 2px 2px;
  vertical-align: middle;
}
.pr-iso-thin { border-top: 1px solid rgba(70,90,130,0.85); }
.pr-iso-bold { border-top: 2px solid rgba(50,60,110,0.95); }
.pressure-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 2px; }

/* --- Turbulence overlay panel ----------------------------------------- */
.turbulence-canvas { /* placed by JS */ }
.turb-panel {
  position: absolute;
  top: 540px; right: 60px;
  z-index: 1000;
  background: rgba(20, 28, 38, 0.85);
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  user-select: none;
  min-width: 240px;
}
.turb-panel-hdr {
  font-weight: 700; font-size: 12px;
  margin-bottom: 6px; letter-spacing: 0.04em;
  color: #f0d8c8; text-transform: uppercase;
}
.turb-row { display: flex; gap: 3px; margin-bottom: 4px; flex-wrap: wrap; }
.turb-btn {
  flex: 1; min-width: 50px;
  padding: 3px 6px;
  font-size: 10px; font-weight: 600;
  font-family: inherit;
  background: rgba(255,255,255,0.06);
  color: #ddd;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.15;
}
.turb-btn:hover { background: rgba(255,255,255,0.18); }
.turb-btn.active { background: #c87850; border-color: #c87850; color: #fff; }
.turb-btn-2line { padding: 3px 6px; line-height: 1.15; }
.turb-btn-main { display: block; font-size: 11px; font-weight: 600; }
.turb-btn-alt {
  display: block; font-size: 8.5px; font-weight: 400;
  color: rgba(255,255,255,0.55);
  margin-top: 1px; letter-spacing: 0.02em;
}
.turb-btn.active .turb-btn-alt { color: rgba(255,255,255,0.85); }
.turb-legend { display: flex; gap: 0; align-items: center; font-size: 10px; margin-top: 4px; }
.tb { flex: 1; padding: 2px 0; text-align: center; font-weight: 700; color: #1a2330; }
.tb-1 { background: rgba(200, 220, 110, 0.85); }
.tb-2 { background: rgba(250, 200,  60, 0.92); color: #1a2330; }
.tb-3 { background: rgba(230,  80,  60, 0.96); color: #fff; }
.tb-4 { background: rgba(170,  40, 170, 1.0);  color: #fff; }
.turb-hint { font-size: 10px; color: #bbb; line-height: 1.4; margin-top: 4px; }
