/* Airport detail page */

.ap { max-width: 1520px; margin: 0 auto; padding: 18px 20px 10px; display: flex; flex-direction: column; gap: 16px; }

.ap-hero { display: grid; grid-template-columns: minmax(260px, 1fr) 2.2fr; gap: 20px; align-items: stretch; }
.ap-id { display: flex; align-items: center; gap: 16px; }
.ap-code { font-family: var(--mono); font-size: 44px; font-weight: 800; letter-spacing: 0.01em; line-height: 1; }
.ap-name { font-size: 17px; font-weight: 600; }
.ap-meta { font-size: 12.5px; color: var(--text-3); margin-top: 3px; }
.ap-meta a { color: var(--text-2); }

.ap-now { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; }
.now-box { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.now-box .h { display: flex; align-items: center; justify-content: space-between; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; gap: 8px; }
.now-big { display: flex; align-items: baseline; gap: 10px; }
.now-big .cat-pill { height: 26px; font-size: 13px; min-width: 56px; }
.now-vals { font-family: var(--mono); font-size: 13px; color: var(--text-1); }
.now-sub { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); margin-top: 6px; overflow-wrap: anywhere; }
.now-raw { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--border); overflow-wrap: anywhere; line-height: 1.45; }
.now-verdict { display: flex; flex-direction: column; gap: 6px; }
.now-verdict ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--text-2); }
.now-verdict .trend { font-size: 12.5px; }

.ap-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 52px; z-index: 20; padding: 8px 0; background: linear-gradient(var(--bg) 70%, rgba(11, 13, 16, 0)); }
.ap-nav { display: flex; align-items: center; gap: 6px; }
.ap-end { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.ap-controls .spacer { flex: 1; }
.ap-range { font-size: 12px; font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-verif { grid-template-columns: 1fr 1.3fr; }
.conv-grid { gap: 24px; }
.chart .conv-title { fill: var(--text-2); font-size: 11px; font-weight: 700; }
.chart .pt { cursor: default; }
.chart .pt:hover { stroke: #fff; stroke-width: 2; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart .axis path, .chart .axis line { stroke: var(--baseline); }
.chart .grid line { stroke: var(--grid); }
.chart .row-label { fill: var(--text-2); font-size: 11px; font-weight: 600; font-family: var(--mono); }
.chart .row-label.amd { fill: #ffcf8a; }
.chart .row-label.mos { fill: #b9a7ff; }
.chart .row-label.obs { fill: var(--text-1); font-weight: 800; font-family: var(--font); letter-spacing: 0.06em; }
.chart .group-label { fill: var(--text-3); font-size: 9.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.chart .now-line { stroke: var(--accent); stroke-width: 1.2; }
.chart .now-text { fill: var(--accent); font-weight: 700; font-size: 10px; }
.chart .xhair { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; pointer-events: none; }
/* Marks never take the pointer: the chart's hover layer handles it all. */
.chart circle.metar, .chart circle.ob, .chart circle.gust, .chart .dlabel, .chart .zone-label { pointer-events: none; }
.chart .row-hit:hover { fill: rgba(255, 255, 255, 0.04); }
.chart .row-sel { fill: rgba(92, 200, 255, 0.08); }

.legend-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-2); }
.legend-row .k { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-row .sw { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.legend-row .ln { width: 16px; height: 0; border-top: 2px solid; display: inline-block; }
.legend-row .ln.dash { border-top-style: dashed; }
.legend-row .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-row .hatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; background: repeating-linear-gradient(135deg, rgba(255,255,255,.75) 0 2px, transparent 2px 4px); }

/* Scorecard */
.score-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.stat .v { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.stat .l { font-size: 11.5px; color: var(--text-3); }
.stack { display: flex; height: 16px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--surface-3); }
.stack span { display: block; height: 100%; min-width: 2px; }
.stack-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; margin-top: 10px; font-size: 12px; }
.stack-legend div { display: flex; align-items: center; gap: 7px; color: var(--text-2); }
.stack-legend b { color: var(--text-1); font-variant-numeric: tabular-nums; margin-left: auto; }
.stack-legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.score-wind { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.sw-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.wind-ico { display: inline-flex; width: 13px; height: 13px; color: var(--text-2); }
.wind-ico svg { width: 100%; height: 100%; }
.sw-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sw-cells > div { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.sw-cells b { display: block; font-size: 17px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.sw-cells .hot b { color: var(--sev-miss); }
.legend-row .ln.dot-ln { border-top-style: dotted; border-top-width: 2px; }
.score-mos { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }

/* Revisions */
.revisions { display: flex; flex-direction: column; gap: 4px; }
.rev { display: grid; grid-template-columns: 22px 120px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 12.5px; }
.rev:hover { border-color: var(--border-2); }
.rev .arrow { font-size: 13px; font-weight: 800; text-align: center; }
.rev .arrow.down { color: #ff9d7a; }
.rev .arrow.up { color: #6fe0c8; }
.rev .who { font-family: var(--mono); font-weight: 700; }
.rev .what { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-2); }
.rev .what .cat-pill { min-width: 40px; height: 18px; font-size: 10px; }
.rev .mag { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.rev.big { border-color: rgba(255, 157, 122, 0.45); background: rgba(255, 138, 61, 0.07); }

/* TAF list */
.taf-list { display: flex; flex-direction: column; gap: 8px; }
.taf-item { border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.taf-item.sel { border-color: rgba(92, 200, 255, 0.6); box-shadow: 0 0 0 1px rgba(92, 200, 255, 0.3); }
.taf-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; flex-wrap: wrap; }
.taf-head .when { font-family: var(--mono); font-weight: 700; font-size: 13px; }
.taf-head .tag { font-size: 10px; font-weight: 800; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 4px; background: rgba(255, 207, 138, 0.15); color: #ffcf8a; border: 1px solid rgba(255, 207, 138, 0.4); }
.taf-head .tag.op { background: var(--accent-dim); color: #d8f2ff; border-color: rgba(92, 200, 255, 0.45); }
.taf-head .ribbon { flex: 1; min-width: 160px; height: 10px; border-radius: 3px; overflow: hidden; display: flex; }
.taf-head .ribbon span { height: 100%; }
.taf-head .score { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.taf-head .score b { color: var(--text-1); }
.taf-body { padding: 0 12px 12px; display: none; }
.taf-item.open .taf-body { display: block; }
.taf-raw { font-family: var(--mono); font-size: 12px; line-height: 1.75; background: var(--surface-0); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.taf-raw .grp { display: block; }
.taf-raw .grp-FM, .taf-raw .grp-BASE { color: var(--text-1); }
.taf-raw .grp-TEMPO, .taf-raw .grp-PROB, .taf-raw .grp-BECMG { color: #c9bcff; padding-left: 2.5ch; }
.taf-raw .kw { font-weight: 800; }
.taf-raw .rmk { color: var(--text-3); }
.taf-decoded { margin-top: 8px; display: grid; grid-template-columns: auto auto 1fr; gap: 3px 12px; font-size: 12px; align-items: center; }
.taf-decoded .t { font-family: var(--mono); color: var(--text-2); white-space: nowrap; }
.taf-decoded .d { font-family: var(--mono); color: var(--text-1); }
.taf-decoded .alt { color: #c9bcff; }

/* Observations */
.obs-table { max-height: 520px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.obs-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.obs-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; font-weight: 700; color: var(--text-3); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; padding: 7px 10px; border-bottom: 1px solid var(--border); z-index: 1; }
.obs-table td { padding: 5px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; font-variant-numeric: tabular-nums; }
.obs-table td.raw { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: normal; min-width: 340px; }
.obs-table td .cat-pill { min-width: 40px; height: 18px; font-size: 10px; }
.obs-table tr.metar td { background: rgba(255, 255, 255, 0.02); }
.obs-table .src { font-size: 10px; font-weight: 800; letter-spacing: 0.06em; color: var(--text-3); }
.obs-more { margin: 10px auto 2px; display: flex; }

@media (max-width: 1100px) {
  .ap-hero { grid-template-columns: 1fr; }
  .grid-2, .grid-verif { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ap { padding: 12px 10px; }
  .ap-now { grid-template-columns: 1fr; }
  .ap-code { font-size: 34px; }
  .score-top { grid-template-columns: 1fr 1fr; }
  .stack-legend { grid-template-columns: 1fr 1fr; }
  .ap-controls { position: static; }
}

/* Full-screen charts: the Fullscreen API's :fullscreen, or the .is-max overlay
   where that API doesn't exist. */
.card-head { position: relative; }
.fs-btn { margin-left: auto; align-self: flex-start; }
.card:fullscreen, .card.is-max { background: var(--bg); border-radius: 0; border: 0; padding: 22px 28px; overflow: auto; width: 100%; height: 100%; }
.card.is-max { position: fixed; inset: 0; z-index: 90; }
body.has-max { overflow: hidden; }
.card:fullscreen .sub, .card.is-max .sub { max-width: 90ch; }

/* Forecast horizon + outlook */
.ap-ahead { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ap-ahead[hidden] { display: none; }
.outlook { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.outlook table { border-collapse: collapse; font-size: 12px; min-width: 100%; }
.outlook th, .outlook td { padding: 7px 8px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; vertical-align: top; }
.outlook thead th { font-family: var(--mono); font-weight: 600; color: var(--text-1); background: var(--surface-0); }
.outlook thead th .muted { font-family: var(--font); font-weight: 400; font-size: 10.5px; }
.outlook thead th.day { border-left: 1px solid var(--border-2); }
.outlook tbody th { position: sticky; left: 0; background: var(--surface-1); text-align: left; font-weight: 500; color: var(--text-2); z-index: 1; }
.outlook .cat-pill { min-width: 42px; height: 18px; font-size: 10px; }
.outlook .o-val { font-family: var(--mono); font-size: 11px; color: var(--text-2); margin-top: 3px; }
.outlook .o-none { color: var(--text-3); font-size: 11px; font-style: italic; }
.now-verdict .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.sev-wind svg { width: 12px; height: 12px; }

/* Card header: title left, tools right, legend on its own row under both */
.card-tools { display: flex; align-items: center; gap: 6px; margin-left: auto; order: 2; }
.card-head > .legend-row { order: 3; flex-basis: 100%; margin: -4px 0 8px; }
.help-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.help-btn:hover { color: var(--text-1); background: var(--surface-3); }
.help-btn svg { width: 15px; height: 15px; }
.legend-row .k.strong { color: var(--text-1); }
.legend-row .hatch-taf { width: 16px; height: 10px; display: inline-block; border-bottom: 1.5px dashed #5cc8ff;
  background: repeating-linear-gradient(135deg, rgba(92, 200, 255, 0.6) 0 1.5px, transparent 1.5px 4px); }

/* On-chart labels */
.chart .dlabel { font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; paint-order: stroke; stroke: #111418; stroke-width: 3.5px; stroke-linejoin: round; }
.chart .zone-label { fill: var(--text-3); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; }
.chart .zone-label.fc { fill: var(--accent); }
.chart .era { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.chart .barb-row { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.chart .barb-g { font-size: 8.5px; font-weight: 700; font-family: var(--mono); }
.chart .barb-vrb { font-size: 9px; font-weight: 700; font-family: var(--mono); }

/* Convergence: one-line answer above the two charts */
.conv-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 0 0 12px; padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text-2); }
.cs-item { display: inline-flex; align-items: center; gap: 8px; }
.cs-k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.cs-good { color: var(--text-1); }
.cs-bad { color: #ffb38a; }
.cs-cautious { color: #9fe7dd; }

/* "How to read" drawer */
.help-scrim { position: fixed; inset: 0; z-index: 140; background: rgba(5, 7, 10, 0.55); }
.help-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 150; width: min(470px, 100vw); display: flex; flex-direction: column;
  background: var(--surface-1); border-left: 1px solid var(--border-2); box-shadow: var(--shadow); animation: help-in 0.18s ease-out;
}
@keyframes help-in { from { transform: translateX(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .help-drawer { animation: none; } }
.help-drawer header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.help-drawer h2 { margin: 3px 0 0; font-size: 17px; font-weight: 600; }
.help-k { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.help-body { overflow-y: auto; padding: 16px 18px 28px; }
.help-lede { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.help-fig { margin: 0 0 6px; padding: 10px 10px 8px; background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius); }
.help-fig svg { width: 100%; height: auto; display: block; }
.help-fig figcaption { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.hf text { font-family: var(--font); }
.hf .hf-dl { font-size: 9px; font-weight: 700; letter-spacing: 0.08em; paint-order: stroke; stroke: #0d1013; stroke-width: 3px; }
.hm-mark circle { fill: #0d1013; stroke: var(--text-1); stroke-width: 1.4; }
.hm-mark text { fill: var(--text-1); font-size: 10px; font-weight: 700; }
.help-body h3 { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 18px 0 10px; }
.help-look { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.help-look li { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.help-look.numbered li { display: grid; grid-template-columns: 22px 1fr; gap: 9px; }
.help-look:not(.numbered) li { position: relative; padding-left: 14px; }
.help-look:not(.numbered) li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); }
.help-look b { color: var(--text-1); font-weight: 600; }
.hm { width: 20px; height: 20px; border-radius: 50%; border: 1.4px solid var(--text-1); display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: var(--text-1); margin-top: 1px; }
.help-example { margin-top: 18px; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--accent-dim); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.help-example p { margin: 5px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-1); }
.help-tip { font-size: 12.5px; color: var(--text-3); margin: 12px 0 0; line-height: 1.5; }
.help-more { display: inline-block; margin-top: 16px; font-size: 13px; }
.help-html { margin: 0 0 6px; padding: 12px; background: var(--surface-0); border: 1px solid var(--border); border-radius: var(--radius); }
.hx-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.hx-table th, .hx-table td { padding: 5px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.hx-table th { color: var(--text-3); font-weight: 500; }
.hx-table tr > th:first-child { text-align: left; }
.hx-table .cat-pill { min-width: 40px; height: 18px; font-size: 10px; }
.hx-beyond { font-style: italic; color: var(--text-3); font-size: 11px; }
.hx-stack { height: 14px; }
.hx-rev { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.hx-rev .cat-pill { min-width: 40px; height: 18px; font-size: 10px; }
@media (max-width: 700px) { .help-btn span { display: none; } }
/* Keep the tools beside the title where there's room (half-width cards). */
.card-head > div:first-child { flex: 1 1 260px; min-width: 0; }
