:root {
  --bg: #f3f7fd;
  --card: #ffffff;
  --line: #d4deea;
  --text: #112033;
  --muted: #5f738a;
  --accent: #0f62fe;
  --ok: #0d7a4e;
  --warn: #ad7b00;
  --bad: #a23535;
  --mono: "IBM Plex Mono", monospace;
  --sans: "IBM Plex Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 10% -20%, #dce9ff 0%, transparent 45%),
    radial-gradient(circle at 85% -10%, #e8f5ff 0%, transparent 40%),
    var(--bg);
}

.search-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.search-header {
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
}

.subhead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.header-links {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.header-links a {
  color: inherit;
  text-underline-offset: 2px;
}

/* ─── Search card ─── */
.search-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 14px;
}

.search-form {
  display: grid;
  gap: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: 160px 1fr 150px auto;
  gap: 10px;
  align-items: end;
}

.field {
  display: grid;
  gap: 5px;
  position: relative;
}

.field > span {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

input,
select {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  padding: 10px 12px;
}

.destination-field {
  /* typeahead dropdown needs position context */
}

.dest-input-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 4px 6px;
  min-height: 42px;
  cursor: text;
}

.dest-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(15, 98, 254, 0.12);
}

.dest-input-wrap input {
  flex: 1;
  min-width: 80px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  font-size: 14px;
  outline: none;
}

.dest-input-wrap .chips {
  display: contents;
}

.dest-input-wrap .chip {
  font-size: 11px;
  padding: 3px 7px;
  gap: 4px;
}

.dest-input-wrap .chip button {
  font-size: 12px;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 8;
  margin: 4px 0 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 8px 20px rgba(13, 33, 66, 0.12);
}

.suggestion {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  cursor: pointer;
}

.suggestion:hover,
.suggestion:focus-visible {
  background: #eef4ff;
}

.suggestion-line {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfd1ef;
  background: #eef4ff;
  color: #0d3a8f;
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 9px;
}

.chip button {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn[disabled] {
  opacity: 0.65;
  cursor: default;
}

.status {
  font-size: 12px;
  color: var(--muted);
}

.status:empty {
  display: none;
}

/* ─── Results ─── */
.results {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.results[hidden] {
  display: none;
}

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}

.result-summary {
  font-size: 14px;
  color: var(--muted);
}

.result-errors {
  border: 1px solid #f0c8c8;
  border-radius: 10px;
  background: #fef5f5;
  padding: 10px 14px;
  color: var(--bad);
  font-size: 13px;
}

.result-errors[hidden] {
  display: none;
}

/* Currency toggle — matches home page */
.currency-toggle {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: #f7faff;
  flex-shrink: 0;
}

.currency-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
}

.currency-btn.active {
  color: #fff;
  background: var(--accent);
}

.result-groups {
  display: grid;
  gap: 14px;
}

/* Destination group */
.result-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}

.group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px 0;
  gap: 8px;
}

.group-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.group-sub {
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  white-space: nowrap;
}

/* Flight card */
.flight-list {
  padding: 8px 10px 10px;
  display: grid;
  gap: 0;
}

.flight {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid #eef2f8;
}

.flight:last-child {
  border-bottom: none;
}

.flight-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.flight-airline {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-code {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.flight-times {
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.flight-arrow {
  color: var(--muted);
  font-size: 12px;
}

.flight-stops {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  background: #f3f7fd;
  border-radius: 4px;
  padding: 1px 6px;
}

.flight-stops.nonstop {
  color: var(--ok);
  background: #e8f6ef;
}

.flight-right {
  text-align: right;
  display: grid;
  gap: 4px;
  justify-items: end;
}

.flight-price {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.flight-currency {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.flight-book {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.flight-book:hover {
  background: var(--accent);
  color: #fff;
}

.no-flights {
  padding: 20px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ─── FR24 badges ─── */
.flight-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  vertical-align: middle;
}

.flight-badge-verified {
  color: var(--ok);
  background: #e8f6ef;
}

.flight-badge-schedule {
  color: #3b6fb5;
  background: #edf3fb;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  letter-spacing: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.flight-badge-schedule:hover {
  color: #1a4f8c;
  background: #dce8f8;
}

/* FR24-only flight cards — slightly muted */
.flight-schedule {
  opacity: 0.85;
}

.flight-schedule:hover {
  opacity: 1;
}

/* ─── Booking pills ─── */
.booking-pills {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 4px;
}

.booking-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
}

.booking-pill:hover {
  color: var(--text);
  border-color: #b0bfcf;
  background: #f7faff;
}

/* Brand-color hovers */
.pill-google:hover {
  color: #1a73e8;
  border-color: #a8c7fa;
  background: #e8f0fe;
}

.pill-skyscanner:hover {
  color: #0770e3;
  border-color: #9cc5f8;
  background: #e5f1ff;
}

.pill-kayak:hover {
  color: #e46400;
  border-color: #f5c89a;
  background: #fef6ed;
}

.pill-airline:hover {
  color: var(--accent);
  border-color: #a8c7fa;
  background: #eef4ff;
}

/* ─── Mobile ─── */
@media (max-width: 760px) {
  .field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .field-dest {
    grid-column: 1 / -1;
    order: 3;
  }

  .field-action {
    grid-column: 1 / -1;
    order: 4;
  }

  .field-action > span {
    display: none;
  }

  .field-action .btn {
    width: 100%;
  }

  h1 {
    font-size: 24px;
  }

  .subhead {
    font-size: 13px;
  }

  .results-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .group-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 12px 12px 0;
  }

  .group-title {
    font-size: 15px;
    white-space: normal;
  }

  .flight-list {
    padding: 6px 6px 6px;
  }

  .flight {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 6px;
  }

  .flight-right {
    text-align: left;
    justify-items: start;
    flex-direction: row;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .flight-price {
    font-size: 16px;
  }

  .booking-pills {
    gap: 4px;
    padding-top: 2px;
  }

  .booking-pill {
    font-size: 10px;
    padding: 2px 7px;
  }

  .flight-badge {
    font-size: 9px;
    padding: 1px 5px;
  }

  .flight-badge-schedule {
    font-size: 12px;
    padding: 3px 8px;
  }
}
