:root { --fl-blue: #0d6efd; }

body { background: #f6f8fa; }

.navbar-brand i { transform: rotate(45deg); }

.card { border-color: #e6e9ee; }
.card-header { background: #fff; border-bottom-color: #e6e9ee; font-weight: 600; }

.table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em;
                  color: #6c757d; font-weight: 600; border-bottom-width: 1px; }
.table-hover tbody tr { cursor: pointer; }

.stat { font-variant-numeric: tabular-nums; }
.stat .v { font-size: 1.35rem; font-weight: 600; line-height: 1.1; }
.stat .k { font-size: .78rem; color: #6c757d; }

/* fills the card body edge to edge; only the bottom corners are rounded,
   since a card header sits directly above */
#map {
  height: 540px; position: relative; overflow: hidden;
  border-radius: 0 0 calc(.375rem - 1px) calc(.375rem - 1px);
}
@media (max-width: 767px) { #map { height: 360px; } }

.fl-plane {
  color: #0d6efd; font-size: 30px; line-height: 1;
  text-shadow: 0 0 4px #fff, 0 0 8px rgba(255,255,255,.95);
  cursor: default;
}

/* position marker driven by the chart cursor */
.fl-hover {
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff; border: 3px solid #6f42c1;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

/* short credit line replacing MapLibre's own attribution control */
.fl-attr {
  position: absolute; left: 8px; bottom: 6px; z-index: 2;
  font-size: .68rem; color: #55606d;
  background: rgba(255,255,255,.82); border-radius: .3rem; padding: .1rem .4rem;
}
.fl-attr a { color: #55606d; text-decoration: none; }
.fl-attr a:hover { text-decoration: underline; }

/* zoom buttons, Google-Maps style: separated, square, soft shadow */
.maplibregl-ctrl-bottom-right { margin: 0 10px 10px 0; }
.maplibregl-ctrl-group {
  border-radius: .5rem !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.3) !important;
  background: #fff !important;
}
.maplibregl-ctrl-group button {
  width: 34px !important; height: 34px !important;
}
.maplibregl-ctrl-group button + button {
  border-top: 1px solid #e3e6ea !important;
}
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { opacity: .75; }
.maplibregl-ctrl-group button:hover .maplibregl-ctrl-icon { opacity: 1; }

.chart { height: 200px; }
.uplot { font: inherit; width: 100%; }
/* uPlot stacks the legend under the plot; without room for it the axis
   labels and the legend row collide */
.uplot .u-legend { margin-top: .5rem; font-size: .82rem; }
.uplot .u-legend .u-marker { width: 10px; height: 10px; }
.uplot .u-legend th { font-weight: 500; color: #6c757d; }
.uplot .u-legend td { font-variant-numeric: tabular-nums; }

.thumb { max-height: 160px; border-radius: .5rem; object-fit: cover; display: block; }

.fl-photo { margin: 0; max-width: 15rem; }
.fl-photo a { display: block; }
.fl-photo figcaption {
  font-size: .7rem; color: #8a94a0; margin-top: .3rem; line-height: 1.3;
}
.logo { height: 28px; width: auto; }

.badge-obs { background: #e7f1ff; color: #0a58ca; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; }

.nav-tabs .nav-link { color: #495057; }
.nav-tabs .nav-link.active { font-weight: 600; }

/* ---------------------------------------------------------- search mask -- */

.fl-modes { display: flex; gap: .25rem; margin-bottom: .85rem; }
.fl-mode {
  border: 0; background: none; border-radius: 999px;
  padding: .35rem .9rem; font-size: .86rem; color: #5f6b7a; cursor: pointer;
}
.fl-mode i { margin-right: .4rem; opacity: .8; }
.fl-mode:hover { background: #eef2f7; }
.fl-mode.active { background: #e7f1ff; color: #0a58ca; font-weight: 600; }

.fl-bar { display: flex; align-items: stretch; gap: .5rem; flex-wrap: wrap; }
.fl-pair { display: flex; align-items: stretch; flex: 1 1 26rem; min-width: 0; position: relative; }

.fl-field {
  display: flex; flex-direction: column; justify-content: center;
  border: 1px solid #d4dae2; border-radius: .65rem;
  padding: .35rem .85rem; min-width: 0; flex: 1 1 0; background: #fff;
  cursor: text; transition: border-color .12s, box-shadow .12s;
}
.fl-field:focus-within { border-color: #0d6efd; box-shadow: 0 0 0 3px rgba(13,110,253,.15); }
.fl-field > span { font-size: .72rem; color: #6c757d; letter-spacing: .02em; }
.fl-field > input {
  border: 0; outline: 0; padding: 0; font-size: .98rem; width: 100%;
  background: transparent; color: #212529; min-width: 0;
}
.fl-field > input::placeholder { color: #adb5bd; }

/* the two route fields read as one control, with the swap button straddling */
.fl-pair .fl-field:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.fl-pair .fl-field:last-child  { border-top-left-radius: 0; border-bottom-left-radius: 0;
                                 border-left: 0; }
.fl-swap {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  transform: translate(-50%, -50%);
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid #d4dae2; background: #fff; color: #5f6b7a;
  font-size: .78rem; cursor: pointer; transition: transform .18s, color .12s;
}
.fl-swap:hover { color: #0d6efd; transform: translate(-50%, -50%) rotate(180deg); }

.fl-date { flex: 0 0 11rem; }
.fl-code { flex: 1 1 14rem; }
.fl-date > input { font-size: .95rem; }

.fl-go {
  border: 0; border-radius: .65rem; background: #0d6efd; color: #fff;
  padding: 0 1.4rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: .5rem;
}
.fl-go:hover { background: #0b5ed7; }

/* mode switching */
.fl-search[data-mode="route"] .fl-code { display: none; }
.fl-search[data-mode="code"]  .fl-pair { display: none; }

@media (max-width: 575.98px) {
  .fl-bar { flex-direction: column; gap: .4rem; }

  /* flex-basis follows the main axis. Once the bar stacks, .fl-pair's
     `flex: 1 1 26rem` stopped meaning "26rem wide" and started meaning
     "26rem tall", which stretched both fields to fill it. */
  .fl-pair { flex: 0 0 auto; flex-direction: column; }
  .fl-field { flex: 0 0 auto; }
  .fl-date, .fl-code { flex: 0 0 auto; }

  .fl-pair .fl-field:first-child { border-radius: .65rem .65rem 0 0; }
  .fl-pair .fl-field:last-child  { border-radius: 0 0 .65rem .65rem;
                                   border-left: 1px solid #d4dae2; border-top: 0; }
  /* anchored right rather than centred, so no horizontal centring offset */
  .fl-swap { left: auto; right: .9rem; transform: translate(0, -50%); }
  .fl-swap:hover { transform: translate(0, -50%) rotate(180deg); }

  .fl-go { padding: .7rem; justify-content: center; }

  /* the field captions dominate the control at phone widths */
  .fl-field { padding: .3rem .7rem; }
  .fl-field > span { font-size: .64rem; text-transform: uppercase; opacity: .8; }
  .fl-field > input { font-size: .92rem; }
  .fl-mode { padding: .3rem .7rem; font-size: .8rem; }
}

/* ------------------------------------------------------ airport picker -- */

.fl-ac-host { position: relative; }
.fl-ac {
  position: absolute; z-index: 40; left: -1px; right: -1px; top: calc(100% + 5px);
  background: #fff; border: 1px solid #dfe4ea; border-radius: .6rem;
  box-shadow: 0 8px 26px rgba(16, 24, 40, .16);
  max-height: 19rem; overflow-y: auto; padding: .25rem;
}
.fl-ac-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem .6rem; border-radius: .4rem; cursor: pointer;
}
.fl-ac-item:hover, .fl-ac-item.active { background: #eef4ff; }
.fl-ac-item > i { color: #8a94a0; font-size: .85rem; width: 1rem; text-align: center; }
.fl-ac-txt { min-width: 0; }
.fl-ac-city { font-size: .92rem; color: #212529; white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
.fl-ac-code {
  font-size: .7rem; font-weight: 700; color: #0a58ca;
  background: #e7f1ff; border-radius: .25rem; padding: .05rem .3rem; margin-left: .2rem;
}
.fl-ac-name { font-size: .76rem; color: #6c757d; white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------- hero --- */

.fl-hero {
  /* breaks out of .container to the full viewport width; the inner .container
     keeps the text on the same grid as everything below it */
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: -1.5rem;
  padding: 3.5rem 0 5.5rem;
  background: linear-gradient(135deg, #072f6b 0%, #0b52c9 45%, #2f8bff 100%);
  text-align: center; color: #fff; position: relative; overflow: hidden;
}
.fl-hero::after {
  content: ''; position: absolute; inset: auto -10% -60% -10%; height: 70%;
  background: radial-gradient(ellipse at 50% 0, rgba(255,255,255,.20), transparent 70%);
}
.fl-hero > .container { position: relative; z-index: 1; }
.fl-hero h1 { font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; margin: 0 0 .5rem; }
.fl-hero p { max-width: 40rem; margin: 0 auto; opacity: .92; font-size: 1rem; }
.fl-hero-card { margin-top: -4.25rem; position: relative; z-index: 3; }

/* --------------------------------------------------------- destinations -- */

.fl-dest {
  display: block; height: 100%; text-decoration: none;
  border: 1px solid #e0e5ec; border-radius: .75rem; background: #fff;
  padding: .9rem 1rem; transition: border-color .12s, box-shadow .12s, transform .12s;
}
.fl-dest:hover {
  border-color: #0d6efd; box-shadow: 0 6px 18px rgba(13,110,253,.12);
  transform: translateY(-2px);
}
.fl-dest-code {
  display: inline-block; font-size: .72rem; font-weight: 700; color: #0a58ca;
  background: #e7f1ff; border-radius: .25rem; padding: .1rem .4rem; margin-bottom: .4rem;
}
.fl-dest-city {
  display: block; font-size: 1rem; color: #212529; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fl-dest-country { display: block; font-size: .76rem; color: #6c757d; }

/* ------------------------------------------------------------ sections --- */

.fl-sec {
  font-size: .95rem; font-weight: 600; color: #495057;
  margin: 0 0 .6rem; display: flex; align-items: center; gap: .5rem;
}
.fl-sec i { color: #8a94a0; font-size: .9rem; }

@media (max-width: 575.98px) {
  .fl-hero { padding: 2.5rem 0 4.75rem; }
  .fl-hero h1 { font-size: 1.75rem; }
  .fl-hero p { font-size: .9rem; }
}

/* ------------------------------------------------------------- results -- */

.fl-row td { padding-top: .7rem; padding-bottom: .7rem; }
.fl-logo { width: 30px; height: 30px; object-fit: contain; border-radius: .25rem; }
.fl-logo-blank {
  width: 30px; height: 30px; border-radius: .25rem; background: #eef2f7;
  display: inline-flex; align-items: center; justify-content: center;
  color: #98a2b0; font-size: .7rem;
}
.fl-times { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.fl-sub { font-size: .8rem; color: #6c757d; }
.fl-price { font-size: 1.05rem; font-weight: 700; color: #146c43; }
.fl-sort { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.fl-sort button {
  border: 1px solid #d4dae2; background: #fff; border-radius: 999px;
  padding: .2rem .75rem; font-size: .8rem; color: #5f6b7a; cursor: pointer;
}
.fl-sort button.active { border-color: #0d6efd; color: #0a58ca; background: #e7f1ff; font-weight: 600; }

/* ------------------------------------------------- results timeline ------ */
/* One table carries flown history, live traffic and bookings in sequence:
   past at the top, now in the middle, bookable in the future at the bottom. */

.fl-timeline td { padding-top: .55rem; padding-bottom: .55rem; }
.fl-timeline .fl-c1 { width: 42px; }

.fl-divider td {
  background: #f2f5f9; border-top: 1px solid #e3e8ee; border-bottom: 1px solid #e3e8ee;
  font-size: .78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: #5f6b7a;
  padding: .4rem .75rem !important;
}
.fl-divider td > i { margin-right: .45rem; opacity: .7; }
.fl-divider-live td { background: #e7f1ff; color: #0a58ca; border-color: #cfe2ff; }

.fl-more {
  float: right; text-transform: none; letter-spacing: 0; font-weight: 500;
  font-size: .78rem; text-decoration: none;
}

.fl-dayrow td {
  background: #fafbfc; font-size: .75rem; font-weight: 600; color: #6c757d;
  padding: .3rem .75rem !important;
}

/* ------------------------------------------------------------ sidebar --- */

.fl-side { position: sticky; top: 5rem; }
@media (max-width: 991.98px) { .fl-side { position: static; } }

#route-map {
  height: 260px; position: relative; overflow: hidden;
  border-radius: calc(.375rem - 1px);
}

/* stacked key/value figures, for the sidebar version of route_panel */
.fl-figs { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; margin: 0; }
.fl-figs dt { font-size: .82rem; color: #6c757d; font-weight: 400; }
.fl-figs dd { margin: 0; font-size: .9rem; font-weight: 600; text-align: right; }
