/* Passenger Index dashboard pages (US Intl Arrivals, TSA Checkpoint). */
  /* Luxe template: same dashboard, new skin. Hero photo = one Unsplash shot mirrored so a jet frames
     each side. Swap it via --hero-img (any wide shot with the jet on the left, nose pointing right). */
  :root {
    color-scheme: light;
    --hero-img: url("/web/assets/hero-jets.jpg");
    --page: #f5f3ee;          /* warm ivory */
    --surface: #ffffff;
    --ink: #0f1b2d;           /* deep navy */
    --ink-2: #4a5466;
    --muted: #8a8f99;
    --grid: #e7e4dc;
    --axis: #cfcabd;
    --border: rgba(15,27,45,0.08);
    --border-strong: rgba(15,27,45,0.16);
    --gold: #a8874a;          /* champagne accent - chrome only, never a data series */
    --navy: #13233b;
    --us: #2a78d6;            /* series slot 1 (blue)  — US citizens */
    --nonus: #eda100;         /* series slot 4 (amber) — non-US citizens */
    --up: #006300;
    --down: #d03b3b;
    --warn-bg: #fbf1dc;
    --warn-ink: #6b4b00;
    --live-bg: #e6f3e6;
    --live-ink: #0a4a0a;
    --chip: rgba(15,27,45,0.05);
    --tooltip: #ffffff;
    --shadow: 0 10px 30px rgba(15,27,45,0.12);
    --card-shadow: 0 1px 2px rgba(15,27,45,0.04), 0 8px 24px rgba(15,27,45,0.05);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --page: #0a0f17; --surface: #111a27; --ink: #f4f1ea; --ink-2: #b9bcc4; --muted: #828895;
      --grid: #1f2a3a; --axis: #2c394c; --border: rgba(255,255,255,0.08); --border-strong: rgba(255,255,255,0.16);
      --gold: #c9a96a; --navy: #1b2d49;
      --us: #3987e5; --nonus: #c98500; --up: #0ca30c; --down: #e66767;
      --warn-bg: #3a2e0a; --warn-ink: #ffd97a; --live-bg: #0f2e0f; --live-ink: #9ee89e;
      --chip: rgba(255,255,255,0.06); --tooltip: #182334; --shadow: 0 10px 30px rgba(0,0,0,0.5);
      --card-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
    }
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --page: #0a0f17; --surface: #111a27; --ink: #f4f1ea; --ink-2: #b9bcc4; --muted: #828895;
    --grid: #1f2a3a; --axis: #2c394c; --border: rgba(255,255,255,0.08); --border-strong: rgba(255,255,255,0.16);
    --gold: #c9a96a; --navy: #1b2d49;
    --us: #3987e5; --nonus: #c98500; --up: #0ca30c; --down: #e66767;
    --warn-bg: #3a2e0a; --warn-ink: #ffd97a; --live-bg: #0f2e0f; --live-ink: #9ee89e;
    --chip: rgba(255,255,255,0.06); --tooltip: #182334; --shadow: 0 10px 30px rgba(0,0,0,0.5);
    --card-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
  }

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { margin: 0; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--page); color: var(--ink);
    font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; }
  .wrap { max-width: 1240px; margin: 0 auto; padding: 40px 16px 56px; scroll-margin-top: 40px; }
  @media (min-width: 720px) { .wrap { padding: 64px 32px 72px; } }

  /* ---------- top nav (transparent over the hero, solid once scrolled) ---------- */
  /* the data pages (Intl Arrivals, TSA Checkpoint) have no hero: the nav is a fixed band in the hero's sky blue,
     and the page opens on a header like Airport Data's */
  header.nav.bar, header.nav.bar.solid { background: #1a3b6b; color: #fff; border-bottom: 0; box-shadow: none;
                                         backdrop-filter: none; -webkit-backdrop-filter: none; }
  header.nav.bar .logo .curve { stroke: #d9c39a; }
  .datahead { text-align: center; padding: 116px 16px 22px; }
  @media (min-width: 720px) { .datahead { padding-top: 136px; } }
  .datahead .eyebrow { color: var(--gold); font: 500 11px/1 Jost, sans-serif; letter-spacing: .32em; text-transform: uppercase; margin: 0 0 12px; }
  .datahead h2 { font: 300 clamp(26px, 3.4vw, 36px)/1.15 Jost, sans-serif; margin: 0; }
  .datahead .meta { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; }
  header.nav { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 4px 22px;
               padding: 14px 16px; color: #fff; transition: background .3s, box-shadow .3s, color .3s; }
  @media (min-width: 720px) { header.nav { padding: 18px 40px; } }
  header.nav.solid { background: color-mix(in srgb, var(--page) 92%, transparent); color: var(--ink);
                     backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--border); }
  header.nav h1 { margin: 0; font: 500 15px/1 Jost, sans-serif; letter-spacing: .32em; text-transform: uppercase; white-space: nowrap; }
  header.nav h1 a { text-decoration: none; display: block; color: inherit; }
  /* the logo takes the nav's ink: white over the photo, `ink` once the nav turns solid */
  header.nav .logo { display: block; height: 40px; width: auto; }
  header.nav .logo .curve { stroke: #d9c39a; }
  header.nav.solid .logo .curve { stroke: var(--gold); }
  header.nav .rule { width: 1px; height: 22px; background: currentColor; opacity: .35; }
  header.nav .links { display: flex; gap: 22px; }
  header.nav .links a { font: 400 12px/1 Jost, sans-serif; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; opacity: .88; }
  header.nav .links a:hover { opacity: 1; }
  header.nav .spacer { flex: 1; }
  header.nav .cta { font: 500 11px/1 Jost, sans-serif; letter-spacing: .18em; text-transform: uppercase; text-decoration: none;
                    background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 3px; white-space: nowrap; }
  header.nav .cta:hover { background: #1f3557; }
  header.nav .ghost { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 3px; opacity: .8;
                      font: 400 13px/1 Jost, sans-serif; padding: 8px 10px; cursor: pointer; }
  header.nav .ghost:hover { opacity: 1; }
  @media (max-width: 899px) { header.nav .links, header.nav .rule { display: none; } }
  @media (max-width: 479px) { header.nav { gap: 10px; } header.nav .logo { height: 22px; } header.nav .cta-long { display: none; } header.nav .cta { padding: 10px 10px; letter-spacing: .1em; } }

  /* ---------- hero ---------- */
  .landing { position: relative; height: 100vh; height: 100svh; min-height: 560px; max-height: 1000px; overflow: hidden;
             display: grid; place-items: center; text-align: center; color: #fff;
             background: linear-gradient(180deg, #2f72cf 0%, #4893ef var(--sky-join, 22%)); }  /* sky colour continued above the photo */
  .landing .bg { position: absolute; top: 0; bottom: 0; width: 50%; background-image: var(--hero-img); background-repeat: no-repeat;
                 background-size: auto var(--jet-scale, 80%); background-position: 100% 100%;
                 -webkit-mask-image: linear-gradient(180deg, transparent calc(100% - var(--jet-scale, 80%)), #000 calc(100% - var(--jet-scale, 80%) + 14%));
                 mask-image: linear-gradient(180deg, transparent calc(100% - var(--jet-scale, 80%)), #000 calc(100% - var(--jet-scale, 80%) + 14%)); }
  /* left jet; the right one is the same picture flipped, so the tarmac and sky meet themselves at the centre */
  .landing .bg.l { left: 0; }
  .landing .bg.r { right: 0; transform: scaleX(-1); }
  .landing::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      linear-gradient(rgba(15,27,45,.16), rgba(15,27,45,.16)),
      linear-gradient(180deg, rgba(10,18,32,.5) 0%, rgba(10,18,32,0) 22%),
      radial-gradient(ellipse 40% 46% at 50% 50%, rgba(10,18,32,.42), rgba(10,18,32,0) 72%),
      linear-gradient(0deg, rgba(10,18,32,.45) 0%, rgba(10,18,32,0) 30%); }
  @media (max-width: 719px) {  /* phones: one jet, no mirror */
    .landing .bg.l { width: 100%; background-size: cover; background-position: 62% 50%; -webkit-mask-image: none; mask-image: none; }
    .landing .bg.r { display: none; }
  }
  .landing .copy { position: relative; z-index: 1; max-width: 900px; padding: 0 20px; margin-top: -14vh; }
  .landing .eyebrow { font: 400 12px/1 Jost, sans-serif; letter-spacing: .34em; text-transform: uppercase; opacity: .9; margin: 0 0 18px; }
  .landing h2 { font: 300 clamp(36px, 6vw, 68px)/1.08 Jost, sans-serif; letter-spacing: -.005em; margin: 0;
                text-shadow: 0 2px 24px rgba(0,0,0,.25); }
  .landing p.lede { font: 300 clamp(15px, 1.6vw, 18px)/1.55 Jost, sans-serif; margin: 18px auto 30px; max-width: 560px; opacity: .95;
                    text-shadow: 0 1px 12px rgba(0,0,0,.3); }
  .landing .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
  .landing .actions a { font: 500 11px/1 Jost, sans-serif; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
                        padding: 15px 24px; border-radius: 3px; }
  .landing .actions .primary { background: #fff; color: #13233b; }
  .landing .actions .primary:hover { background: #f1ede4; }
  .landing .actions .secondary { border: 1px solid rgba(255,255,255,.7); color: #fff; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .landing .actions .secondary:hover { background: rgba(255,255,255,.12); }
  .landing .scroll { position: absolute; z-index: 1; bottom: 28px; left: 50%; transform: translateX(-50%); width: 34px; height: 34px;
                     border: 1px solid rgba(255,255,255,.75); border-radius: 50%; display: grid; place-items: center; color: #fff; text-decoration: none; }
  .landing .scroll::before { content: ""; width: 1px; height: 12px; background: currentColor; animation: drift 2.2s ease-in-out infinite; }
  @keyframes drift { 0%, 100% { transform: translateY(-3px); opacity: .5; } 50% { transform: translateY(3px); opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { .landing .scroll::before { animation: none; } html { scroll-behavior: auto; } }
  .landing .credit { position: absolute; z-index: 1; right: 14px; bottom: 10px; font-size: 10px; opacity: .6; letter-spacing: .04em; }
  .landing .credit a { text-decoration: none; }

  /* ---------- section intro ---------- */
  .intro { text-align: center; margin: 0 auto 36px; max-width: 720px; }
  .intro .eyebrow { color: var(--gold); font: 500 11px/1 Jost, sans-serif; letter-spacing: .32em; text-transform: uppercase; margin: 0 0 12px; }
  .intro .title { font: 300 clamp(26px, 3.4vw, 36px)/1.15 Jost, sans-serif; margin: 0; letter-spacing: -.005em; }
  .intro .rule { width: 44px; height: 1px; background: var(--gold); margin: 18px auto 0; }

  .badge { display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
           padding: 3px 9px; border-radius: 999px; }
  .badge.sample { background: var(--warn-bg); color: var(--warn-ink); }
  .badge.live { background: var(--live-bg); color: var(--live-ink); }
  .meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
  .btn { background: transparent; color: var(--ink-2); border: 1px solid var(--border-strong); border-radius: 3px;
         padding: 5px 11px; font: 500 10px/1.4 Inter, sans-serif; letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
  .btn:hover { border-color: var(--ink); color: var(--ink); }
  .btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

  /* tabs */
  .tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 28px; border-bottom: 1px solid var(--border-strong); margin: 0 0 24px; }
  .tabs button { background: transparent; border: 0; border-bottom: 1px solid transparent; margin-bottom: -1px; padding: 12px 2px;
                 font: 400 12px/1 Jost, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; }
  .tabs button:hover { color: var(--ink); }
  .tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); font-weight: 500; }
  section[role="tabpanel"][hidden] { display: none; }
  section[role="tabpanel"] > p.hint:first-child { justify-content: center; text-align: center; margin: 0 0 20px !important; }
  .empty { border: 1px dashed var(--border-strong); border-radius: 6px; padding: 22px; color: var(--ink-2); font-size: 13px; line-height: 1.6; background: var(--surface); }
  .empty code { font-size: 12px; background: var(--chip); padding: 1px 5px; border-radius: 4px; }

  .banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: 4px; padding: 10px 14px; font-size: 13px; margin-bottom: 18px; }
  .banner.err { background: rgba(208,59,59,.12); color: var(--down); }
  .banner code { font-size: 12px; }

  /* filters */
  .filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: center; margin-bottom: 28px; }
  .seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 3px; overflow: hidden; background: var(--surface); }
  .seg button { background: transparent; color: var(--ink-2); border: 0; padding: 7px 13px; font: 500 11px/1.3 Inter, sans-serif; letter-spacing: .08em; cursor: pointer; }
  .seg button + button { border-left: 1px solid var(--border); }
  .seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
  .filters label { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; display: inline-flex; gap: 8px; align-items: center; }
  select { background: var(--surface); color: var(--ink); border: 1px solid var(--border-strong); border-radius: 3px; padding: 7px 10px; font: inherit; font-size: 13px; letter-spacing: 0; text-transform: none; }

  /* grid & cards */
  .grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 20px 22px; min-width: 0; grid-column: span 12;
          box-shadow: var(--card-shadow); }
  .card h2 { font: 500 11px/1.3 Inter, sans-serif; color: var(--ink); margin: 0 0 4px; letter-spacing: .18em; text-transform: uppercase; }
  .hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; }
  .card-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
  .card-head .spacer { flex: 1; }
  @media (min-width: 720px) {
    .kpi { grid-column: span 6; }
    .half { grid-column: span 6; }
  }
  @media (min-width: 1024px) {
    .kpi { grid-column: span 3; }
  }

  /* KPI tiles */
  .kpi { border-top: 2px solid var(--gold); }
  .kpi .label { color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
  .kpi .value { font: 300 38px/1.1 Jost, sans-serif; margin: 10px 0 6px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
  .kpi .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
  .kpi .spark { margin-left: auto; }
  .delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-variant-numeric: tabular-nums;
           padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
  .delta.up { color: var(--up); } .delta.down { color: var(--down); }
  .delta .lbl { color: var(--muted); }

  /* chart chrome */
  .chart { position: relative; width: 100%; }
  .chart svg { display: block; width: 100%; height: auto; overflow: visible; }
  .chart text { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
  .chart .grid line { stroke: var(--grid); stroke-width: 1; }
  .chart .axis line { stroke: var(--axis); stroke-width: 1; }
  .chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .chart .line.py { stroke-width: 1.5; stroke-dasharray: 3 4; opacity: .45; }
  .chart .endlab { font-size: 11px; font-weight: 600; fill: var(--ink-2); }
  .chart .cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0; pointer-events: none; }
  .chart .dot { stroke: var(--surface); stroke-width: 2; opacity: 0; pointer-events: none; }
  .chart .hit { fill: transparent; cursor: crosshair; outline: none; }
  .chart .hit:focus-visible { outline: 2px solid var(--us); outline-offset: -2px; }
  .chart .bar { rx: 0; }
  .tip { position: absolute; z-index: 5; pointer-events: none; background: var(--tooltip); color: var(--ink);
         border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); padding: 9px 11px;
         font-size: 12px; min-width: 150px; display: none; }
  .tip .t { color: var(--muted); margin-bottom: 4px; }
  .tip .r { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
  .tip .r .k { display: inline-block; width: 12px; height: 0; border-top: 2px solid; }
  .tip .r .k.py { border-top-style: dashed; opacity: .55; }
  .tip .r .v { font-weight: 600; margin-left: auto; }
  .tip .r .n { color: var(--ink-2); }
  .legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin: 6px 0 4px; }
  .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .legend i { display: inline-block; width: 14px; height: 0; border-top: 2px solid; }
  .legend i.py { border-top-style: dashed; opacity: .5; }
  /* TSA "Compare years": one chip per year (tsa.gov, 2019 on) */
  .years { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 2px 0 8px; font-size: 12px; color: var(--ink-2); }
  .years .lab { font: 500 10px/1 Jost, sans-serif; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
  .years button { background: var(--surface); color: var(--ink-2); border: 1px solid var(--border-strong); border-radius: 3px;
                  padding: 5px 9px; font: 500 11px/1.2 Inter, sans-serif; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
  .years button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
  .years button:disabled { opacity: .4; cursor: not-allowed; }
  .years button.act { background: transparent; border-style: dashed; }


  /* table */
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th, td { padding: 9px 10px; text-align: right; border-bottom: 1px solid var(--grid); white-space: nowrap; font-variant-numeric: tabular-nums; }
  th { color: var(--muted); font-weight: 500; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; user-select: none; }
  th:hover { color: var(--ink); }
  th.sorted { color: var(--gold); }
  th:first-child, td:first-child, th.l, td.l { text-align: left; }
  td .code { font-weight: 600; letter-spacing: .04em; }
  td .name { color: var(--muted); font-size: 12px; margin-left: 8px; }
  td.spark svg { display: block; }
  tbody tr:hover { background: var(--chip); }
  .tablewrap { overflow-x: auto; }
  .tableview { display: none; margin-top: 8px; max-height: 320px; overflow: auto; }
  .tableview.on { display: block; }
  @media (max-width: 719px) { td .name { display: none; } .hide-sm { display: none; } }

  /* sectors */
  .sectors { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .sector { border: 1px solid var(--border); border-radius: 4px; padding: 14px 16px; background: var(--page); }
  .sector .s { font: 500 15px/1.3 Jost, sans-serif; }
  .sector .g { color: var(--muted); font-size: 12px; margin: 3px 0 8px; }
  .sector .tk { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
  .sector .tk span { font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
                     border-radius: 2px; padding: 1px 6px; font-variant-numeric: tabular-nums; }

  footer { color: var(--muted); font-size: 12px; margin-top: 32px; line-height: 1.7; }
  footer ul { margin: 4px 0 0; padding-left: 18px; }
  footer.site-foot { background: #13233b; color: rgba(255,255,255,.7); text-align: center; padding: 36px 16px; margin: 0; }
  .site-foot .brand { display: flex; justify-content: center; margin-bottom: 16px; }
  .site-foot .brand img { display: block; height: 36px; width: auto; }
  .site-foot a { text-decoration: none; margin: 0 10px; letter-spacing: .14em; text-transform: uppercase; font-size: 11px; display: inline-block; }
  .site-foot a:hover { color: #fff; }
  .site-foot .legal { margin-top: 14px; font-size: 11px; opacity: .75; }
  .site-foot .legal a { margin: 0 6px; letter-spacing: .06em; text-transform: none; font-size: 11px; }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dim { opacity: .5; transition: opacity .2s; }

  /* single-dataset pages (US Intl Arrivals, TSA Checkpoint): a shorter hero */
  .landing.short { height: 46vh; height: 46svh; min-height: 340px; max-height: 520px; }
  .landing.short .copy { margin-top: 4vh; }
  header.nav .links { gap: 18px; flex-wrap: wrap; }
  header.nav .links a { letter-spacing: .14em; }
  @media (max-width: 1079px) { header.nav .links, header.nav .rule { display: none; } }
