/* The Airspace page (scripts/airspace.js); its map, popups and NOTAMs use preflight.css's .nt-map */

.as-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.as-layers { display: flex; flex-wrap: wrap; gap: 6px; }
.as-toggle {
  display: inline-flex; align-items: center; gap: 6px; background: var(--inset); border: 1px solid var(--line-light); color: var(--muted);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 700; cursor: pointer; box-shadow: none;
}
.as-toggle i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: .45; }
.as-toggle.on { color: var(--text); border-color: var(--blue); background: var(--blue-light); }
.as-toggle.on i { opacity: 1; }
.as-toggle-notams i { background: var(--danger); }
.as-ceiling { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.as-ceiling select { font-size: 12px; padding: 5px 8px; }
/* The point layers (navaids, reporting points, obstacles...) on their own row under the airspace's */
.as-point-layers { order: 3; flex-basis: 100%; }
.as-point-icon { background: none; border: 0; }
.as-point-icon svg { display: block; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .8)); }
.as-point-legend svg { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; }
.as-pop .as-facts { margin-top: 6px; font-size: 12px; }
.as-pop .as-facts a { color: #93c5fd; }

.as-map { height: 640px; }
.as-map.as-picking { cursor: crosshair; }
.as-map.as-picking .leaflet-interactive { cursor: crosshair; }

/* Airspace Here: the stack above the point, then each airspace */
.as-stack-svg { width: 100%; height: auto; display: block; }
.as-grid { stroke: var(--line); stroke-width: 1; }
.as-tick { stroke: var(--line-light); stroke-width: 1; stroke-dasharray: 2 4; }
.as-axis { fill: var(--muted); font-size: 12px; text-anchor: end; }
.as-profile .as-axis { font-size: 13px; }
.as-bar-label { fill: #fff; font-size: 12px; font-weight: 800; pointer-events: none; }
.as-profile .as-bar-label { font-size: 12px; }
.as-alt { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 6 4; }
.as-alt-label { fill: #fff; font-size: 12px; font-weight: 800; }
.as-profile .as-alt-label { font-size: 13px; }
.as-stack.lit rect { fill-opacity: .55; stroke-width: 2.5; }

.as-list { display: grid; gap: 6px; margin-top: 10px; }
.as-item { border: 1px solid var(--line); border-radius: 10px; background: var(--inset); min-width: 0; }
.as-item.open { border-color: var(--blue); }
.as-item-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text); padding: 8px 10px; cursor: pointer; box-shadow: none; border-radius: 10px;
}
.as-item-head span b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.as-item-head span small { display: block; font-size: 12px; color: var(--muted); }
.as-item-head em { font-style: normal; font-size: 12px; color: var(--text); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.as-badge {
  display: inline-block; min-width: 26px; text-align: center; padding: 2px 6px; border-radius: 6px; font-size: 12px; font-weight: 800;
  color: #fff; background: color-mix(in srgb, var(--as-c) 35%, transparent); border: 1.5px solid var(--as-c);
}
.as-item-body { display: none; padding: 0 12px 10px; }
.as-item.open .as-item-body { display: block; }
.as-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 12px; }
.as-facts dt { color: var(--muted); font-weight: 700; }
.as-facts dd { margin: 0; word-break: break-word; }
.as-summary { font-size: 12px; margin: 6px 0 4px; line-height: 1.5; }
.as-rules { margin: 0 0 6px; padding-left: 18px; font-size: 12px; line-height: 1.5; }
.as-rules li + li { margin-top: 3px; }
.as-rules cite, .as-summary cite { display: inline-block; font-style: normal; font-size: 12px; color: #93c5fd; background: var(--blue-light); border-radius: 4px; padding: 0 5px; margin-left: 2px; white-space: nowrap; }

/* Route Through Airspace */
.as-route-form { display: flex; gap: 8px; flex-wrap: wrap; }
.as-route-form input[type=text] { flex: 1 1 260px; min-width: 0; font-size: 14px; padding: 9px 12px; }
.as-route-form button.active { background: var(--blue-light); border-color: var(--blue); color: #bfdbfe; }
.as-route-points { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.as-route-points:empty { display: none; }
.as-point { display: inline-flex; align-items: center; gap: 4px; }
.as-point button { background: transparent; border: 0; color: var(--muted); padding: 0 2px; font-size: 14px; line-height: 1; cursor: pointer; box-shadow: none; }
.as-point button:hover { color: #fff; }
.as-arrow { color: var(--muted); font-size: 12px; }
.as-to-navlog { text-decoration: none; }
.as-alt-field { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 4px; font-size: 12px; color: var(--muted); font-weight: 700; }
.as-alt-field input { width: 100px; font-size: 14px; padding: 6px 8px; }
.as-route-tiles { margin-top: 12px; }
.as-profile { margin-top: 12px; background: #0b1220; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.as-profile svg { width: 100%; height: auto; display: block; }
.as-table-wrap { overflow-x: auto; margin-top: 12px; }
.as-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.as-table th { text-align: left; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line-light); }
.as-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.as-table td small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.as-table td:first-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.as-table tr.as-row-in td:last-child { color: #fcd34d; font-weight: 700; }
.as-table tr.as-row-below td:last-child, .as-table tr.as-row-above td:last-child { color: var(--muted); }

@media (max-width: 900px) {
  #asMapCard, #asInspectCard { grid-column: span 12; }
}
@media (max-width: 640px) {
  .as-map { height: 420px; }
  .as-controls { gap: 8px; }
  .as-toggle { padding: 5px 9px; font-size: 12px; }
  .as-route-tiles .stat { grid-column: span 12; }
}
