/* LuxPoints Awards: premium dark navy + gold. No web fonts (the server CSP is style-src 'self'), so local stacks only.
   Every text/background pair below is >= 4.5:1 (checked with the dataviz validator's contrast()). */
:root {
  color-scheme: dark;
  --bg: #0b1426;            /* page */
  --bg-2: #0e1a31;
  --panel: #111d35;         /* cards, panels */
  --panel-2: #16264a;       /* raised: inputs, hover */
  --line: #24365c;
  --line-strong: #34507f;
  --text: #eef1f7;          /* 14.8:1 on panel */
  --muted: #a9b4c8;         /* 8.0:1 on panel */
  --gold: #e6c36a;          /* accent text, 9.9:1 on panel */
  --gold-strong: #d4a94a;
  --gold-ink: #0b1426;      /* text on gold, 10.8:1 */
  --ok: #6fdc9a; --ok-bg: rgba(111, 220, 154, .12);
  --warn: #ff8a80; --warn-bg: rgba(255, 138, 128, .12);
  --info: #f5cf72; --info-bg: rgba(245, 207, 114, .12);
  /* calendar: one-hue gold ordinal ramp, cheapest = brightest (validated: monotone L, light end 2.03:1 vs panel) */
  --s1: #f5cf72; --s2: #d4a94a; --s3: #a8853a; --s4: #836932; --s5: #5e4c25;
  --s1t: #0b1426; --s2t: #0b1426; --s3t: #0b1426; --s4t: #f4f1e8; --s5t: #f4f1e8;
  /* program badges: categorical, fixed order, dark-mode slots (validated on #111d35: CVD ΔE >= 8.4) */
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; --c6: #008300; --c7: #9085e9; --c8: #e66767; --c0: #5b6b88;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--gold); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--gold); color: var(--gold-ink); padding: 8px 12px; border-radius: 8px; z-index: 10; font-weight: 600; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- header + hero ---------- */
.top { max-width: 1160px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 1.1rem/1 var(--serif);
  color: var(--gold-ink); background: radial-gradient(circle at 30% 30%, #f8dc8f, var(--gold-strong) 70%); box-shadow: 0 0 0 1px rgba(230, 195, 106, .4), 0 0 18px rgba(230, 195, 106, .25); }
.word { font: 600 1.3rem/1 var(--serif); letter-spacing: .01em; }
.word em { font-style: normal; color: var(--gold); font: 600 .78rem/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; margin-left: 4px; vertical-align: 3px; }
.hero { background:
    radial-gradient(1200px 400px at 80% -10%, rgba(230, 195, 106, .14), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(57, 135, 229, .14), transparent 55%),
    linear-gradient(180deg, #0f1d3a 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line); padding: 28px 24px 36px; }
.hero > * { max-width: 1112px; margin-left: auto; margin-right: auto; }
.hero h1 { font: 600 clamp(1.7rem, 3.6vw, 2.6rem)/1.15 var(--serif); margin-top: 8px; margin-bottom: 6px; letter-spacing: -.01em; }
.lede { color: var(--muted); margin-top: 0; margin-bottom: 22px; }

/* ---------- buttons, inputs ---------- */
button { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); min-height: 40px; padding: 6px 14px; }
button:hover { border-color: var(--gold-strong); }
button.primary { background: linear-gradient(180deg, #f0cf7c, var(--gold-strong)); color: var(--gold-ink); border-color: transparent; font-weight: 700; letter-spacing: .02em; }
button.primary:hover { background: linear-gradient(180deg, #f6da93, #ddb456); }
button.ghost { background: transparent; }
button.icon { flex: 0 0 auto; width: 40px; padding: 0; }
button:disabled { opacity: .6; cursor: default; }
input, select { font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 10px; min-height: 42px; width: 100%; color-scheme: dark; }
input::placeholder { color: #8291ab; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-size: .78rem; color: var(--muted); margin-bottom: 6px; padding: 0; text-transform: uppercase; letter-spacing: .12em; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); flex: 1 1 140px; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips legend { width: 100%; }
.chip { border-radius: 999px; min-height: 34px; padding: 4px 14px; font-size: .88rem; background: transparent; border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: transparent; font-weight: 600; }

/* ---------- search bar ---------- */
.searchbar { background: rgba(17, 29, 53, .92); border: 1px solid var(--line-strong); border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.sb-main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1.7fr) auto; gap: 8px; align-items: stretch; }
.sb-cell { display: flex; flex-direction: column; justify-content: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-width: 0; }
.sb-cell:focus-within { border-color: var(--gold); }
.sb-label { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; }
.sb-cell input { background: transparent; border: 0; padding: 2px 0 0; min-height: 30px; font-size: 1.15rem; font-weight: 600; }
.sb-cell input:focus { outline: none; }
.sb-from input, .sb-to input { font: 600 1.35rem/1.2 var(--serif); letter-spacing: .04em; text-transform: uppercase; }
.sb-dates { flex-direction: row; align-items: flex-end; gap: 8px; }
.sb-dates label { flex: 1 1 0; min-width: 0; }
.sb-dates input { font-size: .98rem; }
.sb-dash { color: var(--muted); padding-bottom: 6px; }
.swap { align-self: center; width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 50%; color: var(--gold); font-size: 1.1rem; background: var(--panel); }
.sb-go { min-width: 132px; font-size: 1.05rem; border-radius: 12px; }
.sb-sub { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: flex-start; padding: 12px 6px 2px; }
details.programs { min-width: 0; }
details.programs summary { cursor: pointer; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; padding: 2px 0 8px; }
details.programs summary span { text-transform: none; letter-spacing: 0; }
.sb-status { margin: 6px 6px 0; min-height: 1.3em; font-size: .88rem; color: var(--muted); }

/* ---------- layout ---------- */
main { max-width: 1160px; margin: 0 auto; padding: 24px 24px 40px; display: grid; gap: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.panel:focus { outline: none; }
h2 { font: 600 1.35rem/1.2 var(--serif); margin: 0 0 8px; }
h2 .muted { font: 400 .95rem var(--sans); }
.res-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.tabs button { border: 0; background: transparent; min-height: 36px; border-radius: 9px; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--gold); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sortbar { display: flex; align-items: center; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.sortbar label { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.sortbar select { width: auto; min-height: 38px; }
.empty { padding: 32px 8px; text-align: center; color: var(--muted); }
.note { font-size: .86rem; color: var(--muted); margin: 14px 0 0; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 28px; }

/* ---------- cheapest-per-day strip ---------- */
.strip-wrap { margin-top: 14px; }
.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 6px; }
.strip-head .legend { text-transform: none; letter-spacing: 0; margin: 0; }
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x proximity; scrollbar-color: var(--line-strong) transparent; }
.sd { flex: 0 0 78px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; text-align: left; min-height: 64px; }
.sd .dw { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.sd .dd { font-weight: 700; font-size: .95rem; }
.sd .dv { font-variant-numeric: tabular-nums; font-size: .82rem; font-weight: 600; }
.sd.none { background: transparent; border-color: var(--line); color: var(--muted); cursor: default; }
.sd[aria-pressed="true"] { outline: 2px solid var(--text); outline-offset: 2px; }

/* gold ramp classes shared by strip + month calendar */
.lv1 { background: var(--s1); color: var(--s1t); } .lv2 { background: var(--s2); color: var(--s2t); }
.lv3 { background: var(--s3); color: var(--s3t); } .lv4 { background: var(--s4); color: var(--s4t); }
.lv5 { background: var(--s5); color: var(--s5t); }

/* ---------- result cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: start; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); min-width: 0; transition: border-color .15s; }
.card:hover { border-color: var(--line-strong); }
.pbadge { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 800 .82rem/1 var(--sans); letter-spacing: .04em;
  color: var(--gold-ink); background: var(--c0); box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px rgba(255, 255, 255, .08); grid-row: span 2; }
.pbadge.c1 { background: var(--c1); } .pbadge.c2 { background: var(--c2); } .pbadge.c3 { background: var(--c3); } .pbadge.c4 { background: var(--c4); }
.pbadge.c5 { background: var(--c5); } .pbadge.c6 { background: var(--c6); color: #fff; } .pbadge.c7 { background: var(--c7); } .pbadge.c8 { background: var(--c8); }
.pbadge.c0 { color: #fff; }
.card .prog { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.card .sub { font-size: .84rem; color: var(--muted); }
.price { grid-column: 3; grid-row: 1 / span 2; text-align: right; }
.price .mi { display: block; font: 600 1.7rem/1.05 var(--serif); color: var(--gold); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.price .mi small { font: 500 .72rem var(--sans); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; margin-left: 3px; }
.price .tx { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.card .details { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .86rem; }
.card .details .when { font-weight: 600; }
.card .foot-line { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; font-size: .84rem; }
.flights { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84rem; letter-spacing: .02em; }
.seat { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.seat.ok::before { background: var(--ok); } .seat.low::before { background: var(--warn); }
.seat.low { color: var(--warn); }

/* ---------- table ---------- */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); white-space: nowrap; background: var(--bg-2); font-weight: 600; }
th button { background: none; border: 0; min-height: 0; padding: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
th[aria-sort] button { color: var(--gold); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num.mi { color: var(--gold); font-weight: 700; }
.tprog { display: inline-flex; align-items: center; gap: 8px; }
.tprog .pbadge { width: 26px; height: 26px; font-size: .62rem; grid-row: auto; box-shadow: none; flex: 0 0 auto; }

/* ---------- badges ---------- */
.badge { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-strong); }
.badge.low { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.seats { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.day { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.new { background: var(--gold); color: var(--gold-ink); border-color: transparent; }
.links { display: inline-flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.links a { white-space: nowrap; font-weight: 600; text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* ---------- month calendar ---------- */
.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.month h3 { font: 600 1.05rem var(--serif); margin: 0 0 8px; }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { font-size: .68rem; color: var(--muted); text-align: center; padding-bottom: 2px; text-transform: uppercase; letter-spacing: .08em; }
.cd { min-height: 50px; border-radius: 8px; border: 1px solid var(--line); padding: 4px 5px; font-size: .72rem; display: flex; flex-direction: column; justify-content: space-between; background: transparent; color: var(--muted); text-align: left; }
.cd.pad { border: 0; }
.cd.has { cursor: pointer; border-color: transparent; min-height: 50px; }
.cd .d { font-size: .7rem; }
.cd .v { font-weight: 700; font-size: .8rem; font-variant-numeric: tabular-nums; }
.cd.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.cd.lv1 { background: var(--s1); color: var(--s1t); } .cd.lv2 { background: var(--s2); color: var(--s2t); } .cd.lv3 { background: var(--s3); color: var(--s3t); }
.cd.lv4 { background: var(--s4); color: var(--s4t); } .cd.lv5 { background: var(--s5); color: var(--s5t); }
.legend { display: flex; align-items: center; gap: 4px; font-size: .78rem; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.legend i { width: 20px; height: 10px; border-radius: 3px; display: inline-block; }
.legend .l1 { background: var(--s1); } .legend .l2 { background: var(--s2); } .legend .l3 { background: var(--s3); }
.legend .l4 { background: var(--s4); } .legend .l5 { background: var(--s5); }

/* ---------- live search + runners ---------- */
.livebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }
#jsources { margin-top: 4px; }
.progress { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.switch { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.src { border-top: 1px solid var(--line); padding: 12px 0; }
.src h3 { font-size: .98rem; margin: 0 0 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.joblist { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font-size: .86rem; }
.joblist li { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.st { border-radius: 999px; padding: 0 8px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.st.running, .st.pending { background: var(--info-bg); color: var(--info); border-color: transparent; }
.st.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.st.failed { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
pre.tail { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: .74rem; overflow-x: auto; max-height: 160px; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.err { color: var(--warn); overflow-wrap: anywhere; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .sb-main { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .sb-dates { grid-column: 1 / -1; }
  .sb-go { grid-column: 1 / -1; min-height: 48px; }
}
@media (max-width: 520px) {
  .top { padding: 14px 16px; }
  .word { font-size: 1.12rem; }
  .hero { padding: 16px 16px 24px; }
  .lede { font-size: .92rem; margin-bottom: 16px; }
  main { padding: 16px 16px 32px; gap: 16px; }
  .panel { padding: 14px; }
  .searchbar { padding: 8px; border-radius: 16px; }
  .sb-main { gap: 6px; }
  .sb-cell { padding: 6px 10px; }
  .sb-from input, .sb-to input { font-size: 1.2rem; }
  .sb-dates { flex-wrap: wrap; }
  .sb-dash { display: none; }
  .swap { width: 38px; height: 38px; min-height: 38px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; gap: 2px 10px; }
  .pbadge { width: 38px; height: 38px; font-size: .74rem; }
  .price .mi { font-size: 1.4rem; }
  .sd { flex-basis: 70px; padding: 6px 8px; }
  .cd { min-height: 42px; padding: 2px 3px; }
  .cd.has { min-height: 42px; }
  .cd .v { font-size: .68rem; }
  .cal-months { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .pbadge, .sd, .cd.has, .chip[aria-pressed="true"] { forced-color-adjust: none; border: 1px solid CanvasText; } }

/* ---------- login ---------- */
main.login { max-width: 400px; padding-top: 12vh; }
main.login form { display: grid; gap: 14px; padding: 28px; box-shadow: var(--shadow); }
main.login .brand { margin-bottom: 6px; }
main.login h1 { margin: 0; font: 600 1.5rem/1.2 var(--serif); }
