:root {
  color-scheme: dark;
  font: 16px/1.5 system-ui, sans-serif;
  background: #101719;
  color: #ecf3ec;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(100% - 2rem, 65rem); margin: clamp(2rem, 7vw, 6rem) auto; }
header { border-bottom: 1px solid #39484a; margin-bottom: 1.5rem; padding-bottom: 1rem; }
h1 { font-size: clamp(1.9rem, 5vw, 3.3rem); line-height: 1.1; letter-spacing: -.04em; margin: 0 0 .65rem; }
h2 { font-size: 1.15rem; margin: 0; }
p { margin: 0; color: #acbdbb; }

form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: end;
  gap: 1rem;
  background: #182225;
  border: 1px solid #39484a;
  border-radius: .75rem;
  padding: 1.25rem;
}

label { font-size: .9rem; font-weight: 600; }
label span { color: #acbdbb; font-weight: 400; }
form input, button {
  width: 100%;
  min-height: 2.75rem;
  padding: .5rem .75rem;
  border-radius: .4rem;
  font: inherit;
}
form input { display: block; margin-top: .35rem; color: inherit; background: #101719; border: 1px solid #536467; }
#origin { text-transform: uppercase; }
button { padding-inline: 1rem; background: #bbf5c2; border: 1px solid transparent; color: #102318; font-weight: 700; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button:hover:enabled { background: #d8fadd; }
:focus-visible { outline: 2px solid #bbf5c2; outline-offset: 3px; }

#message { margin: 1rem 0; }
#message:empty { display: none; }
#results { margin-top: 1.5rem; }
.result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.toggle { display: flex; align-items: center; gap: .35rem; }
.toggle input { accent-color: #bbf5c2; }
pre {
  background: #131e21;
  border: 1px solid #39484a;
  border-radius: .75rem;
  padding: 1.25rem;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: .86rem/1.55 ui-monospace, Consolas, monospace;
}

.flight-result {
  margin: .9rem 0 1.5rem;
  padding: clamp(.85rem, 3vw, 1.5rem);
  border: 1px solid #39484a;
  border-radius: .75rem;
  background: #131e21;
}
.flight-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .8rem; }
.flight-heading h3 { margin: 0; font-size: 1.45rem; }
.result-section { margin-top: 1.2rem; }
.result-section h4 { margin: 0 0 .45rem; font-size: 1rem; }
.table-note { margin-bottom: .45rem; font-size: .875rem; }
.table-scroll {
  overflow-x: auto;
  border: 1px solid #39484a;
  border-radius: .5rem;
}
.passenger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
.passenger-table :is(th, td) { padding: .48rem .72rem; white-space: nowrap; }
.passenger-table thead { background: #243337; color: #d5e1df; }
.passenger-table tbody tr + tr { border-top: 1px solid #39484a; }
.passenger-table tbody tr:nth-child(even) { background: #182527; }
.passenger-table .upgrade-code { color: #bbf5c2; font-weight: 700; }
.flight-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid #39484a;
  border-radius: .5rem;
  background: #39484a;
}
.flight-facts div { background: #182225; padding: .55rem .72rem; }
.flight-facts dt { color: #acbdbb; font-size: .8rem; }
.flight-facts dd { margin: .12rem 0 0; overflow-wrap: anywhere; }
.flight-result details {
  margin-top: 1rem;
  border: 1px solid #39484a;
  border-radius: .6rem;
}
.flight-result summary {
  padding: .65rem 1rem;
  color: #bbf5c2;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
}
.additional-fields {
  border-top: 1px solid #39484a;
  padding: .85rem 1rem;
  max-height: 28rem;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #b9c7c5;
  font: .82rem/1.55 ui-monospace, Consolas, monospace;
}

.auth-main { max-width: 38rem; }
.auth-main a, .account-nav a { color: #bbf5c2; }
.auth-main p + p, .auth-main :is(form, .invite-link) + p { margin-top: 1rem; }
.auth-form { grid-template-columns: minmax(0, 1fr) auto; }
.auth-form > button:only-of-type { align-self: end; }
.auth-form input[type="hidden"] ~ button { grid-column: 1 / -1; }
.account-nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .8rem; margin-bottom: 1rem; }
.account-nav form { display: block; padding: 0; border: 0; background: none; }
.account-nav button { min-height: 2rem; padding-block: .2rem; width: auto; }
.invite-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; margin-bottom: 1.25rem; }
.invite-link :is(label, p) { grid-column: 1 / -1; }
.invite-link input {
  min-width: 0;
  border: 1px solid #536467;
  border-radius: .4rem;
  padding: .5rem .75rem;
  color: inherit;
  background: #101719;
  font: inherit;
}
.invite-link p:empty, #confirm-message:empty { display: none; }

@media (max-width: 44rem) {
  form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 26rem) {
  form { grid-template-columns: 1fr; }
}
