* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #f6f7f9;
  color: #1d1f23;
  line-height: 1.45;
}
a { color: #003b73; }

.topbar {
  background: #003b73;
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h1 { font-size: 20px; margin: 0; }
.topbar nav button {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  margin-left: 6px;
}
.topbar nav button.active { background: white; color: #003b73; border-color: white; }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.filters {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
  padding: 12px;
  background: white;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
}
.filters .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.filters .row:last-child { margin-bottom: 0; }
.filters label.inline { display: inline-flex; align-items: center; gap: 6px; color: #586069; font-size: 14px; }
.filters input[type=search], .filters select, .filters input[type=date] {
  padding: 7px 10px; border: 1px solid #cdd2d8; border-radius: 6px; font: inherit; background: white;
}
.filters input[type=search] { flex: 1 1 220px; min-width: 200px; }
.filters .ghost { background: white; color: #003b73; border: 1px solid #cdd2d8; }
.filters button {
  padding: 8px 16px; background: #003b73; color: white;
  border: none; border-radius: 6px; cursor: pointer; font: inherit;
}
#cabin-hint { margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: white; border: 1px solid #cdd2d8;
  border-radius: 999px; cursor: pointer; font-size: 14px;
}
.chip input { accent-color: #003b73; }
.chip:has(input:checked) { background: #003b73; color: white; border-color: #003b73; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.card {
  background: white; border: 1px solid #e3e6ea; border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.card h3 { margin: 0; font-size: 16px; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .meta { color: #586069; font-size: 13px; }
.card .price {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-top: auto; padding-top: 8px; border-top: 1px dashed #e3e6ea;
}
.card .price strong { font-size: 20px; color: #003b73; }
.card .price small { color: #888; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card .actions a, .card .actions button {
  padding: 6px 12px; border-radius: 6px; font: inherit; cursor: pointer;
  border: 1px solid #003b73; text-decoration: none;
}
.card .actions a { background: white; color: #003b73; }
.card .actions button { background: #003b73; color: white; border: 1px solid #003b73; }
.card .actions button.remove { background: #b00020; border-color: #b00020; }
.card .actions button.primary { background: #003b73; }
.campaign-head { display: flex; gap: 6px; flex-wrap: wrap; }

.tag { display: inline-block; background: #eef3fa; color: #003b73; border-radius: 999px; font-size: 12px; padding: 2px 8px; margin-left: 4px; white-space: nowrap; }
.tag.drop { background: #e7f7ec; color: #0a7d32; }
.tag.warn { background: #fdf3e7; color: #a35900; }
.tag.err  { background: #fde8e8; color: #b00020; }
.tag.scope { background: #f1f2f4; color: #586069; }
.tag.flight-with { background: #e7f0fa; color: #003b73; }
.tag.flight-without { background: #f1f2f4; color: #586069; }
.tag.campaign { background: #fff5d8; color: #8a6300; font-weight: 500; }

.muted { color: #586069; }
.small { font-size: 12px; }

dialog {
  border: none; border-radius: 10px; padding: 0;
  max-width: 480px; width: 90%; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}
dialog::backdrop { background: rgba(0,0,0,0.4); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
dialog h3 { margin: 0; }
dialog input[type=email] { padding: 8px; border: 1px solid #cdd2d8; border-radius: 6px; font: inherit; width: 100%; }
dialog menu { display: flex; gap: 8px; justify-content: flex-end; padding: 0; margin: 0; }
dialog menu button {
  padding: 8px 14px; border-radius: 6px; border: 1px solid #cdd2d8;
  background: white; cursor: pointer; font: inherit;
}
dialog menu button[value=default] { background: #003b73; color: white; border-color: #003b73; }
dialog fieldset { border: 1px solid #e3e6ea; border-radius: 6px; padding: 10px 12px; }
dialog fieldset legend { padding: 0 4px; color: #586069; font-size: 13px; }
dialog .chips { margin-top: 4px; }
dialog label.inline { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; }

.watchlist-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.watchlist-form input { padding: 8px 10px; border: 1px solid #cdd2d8; border-radius: 6px; font: inherit; min-width: 220px; }
.watchlist-form button { padding: 8px 16px; background: #003b73; color: white; border: none; border-radius: 6px; cursor: pointer; font: inherit; }

.link-btn { background: none; border: none; color: #003b73; cursor: pointer; font: inherit; padding: 0; margin-bottom: 16px; }
.link-btn:hover { text-decoration: underline; }

/* Route detail */
.detail-head h2 { margin: 0; }
.detail-head .actions { margin-top: 12px; }
.aggregate-section, section { margin-top: 24px; }
.aggregate {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  background: white; padding: 16px; border-radius: 10px; border: 1px solid #e3e6ea;
}
.aggregate label { display: block; color: #586069; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.aggregate strong { display: block; color: #003b73; font-size: 22px; margin: 4px 0 2px; }
.aggregate small { color: #586069; font-size: 12px; }

.journeys { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.journey {
  background: white; border: 1px solid #e3e6ea; border-radius: 10px; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.journey-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.journey-head small { display: block; color: #888; font-size: 12px; }
.journey-best strong { font-size: 18px; color: #003b73; }
.journey .campaigns { display: flex; gap: 4px; flex-wrap: wrap; }
.prices-detail { font-size: 13px; }
.prices-detail summary { cursor: pointer; color: #586069; }
.price-list { list-style: none; padding: 8px 0 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.price-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #f0f1f4; }
.price-list strong { color: #1d1f23; }
.price-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.price-table th { text-align: left; color: #586069; font-weight: 500; padding: 4px 8px; border-bottom: 1px solid #e3e6ea; }
.price-table td { padding: 6px 8px; border-bottom: 1px dashed #f0f1f4; }
.price-table th:not(:first-child), .price-table td:not(:first-child) { text-align: right; }
.price-table strong { color: #1d1f23; }
.price-table small { color: #888; font-weight: normal; }
.tag.muted-ai { background: #f1f2f4; color: #586069; font-size: 11px; }
.journey .actions { display: flex; gap: 8px; }
.journey .actions a, .journey .actions button {
  padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 13px;
  cursor: pointer; border: 1px solid #003b73; text-decoration: none;
}
.journey .actions a { background: white; color: #003b73; }
.journey .actions button { background: #003b73; color: white; }
