/* Vietnam Flights — one-way UK → Hanoi / Ho Chi Minh City */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --hover: #f2f6fb;
  --text: #14181f;
  --muted: #59616f;
  --muted-2: #8b93a1;
  --line: #e1e6ee;
  --line-soft: #edf1f6;
  --accent: #1565d8;
  --accent-bg: #1565d8;
  --accent-fg: #ffffff;
  --accent-weak: #e7effe;
  --good: #0f7a53;
  --warn: #b4401c;
  --amber: #96600a;
  --track: #e4e9f1;
  --lay: #d8dee8;
  --lay-long: #f2cd92;
  --lay-night: #e8a6a0;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px -16px rgba(16, 24, 40, .18);
  --radius: 14px;
  --tab: "tabular-nums" 1, "tnum" 1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1015;
    --surface: #151920;
    --surface-2: #1a1f27;
    --hover: #1c222b;
    --text: #e9edf4;
    --muted: #9ca6b6;
    --muted-2: #727d8d;
    --line: #252c36;
    --line-soft: #1e242d;
    --accent: #7fb2ff;
    --accent-bg: #2f6fd0;
    --accent-fg: #ffffff;
    --accent-weak: #1a2b45;
    --good: #5cd3a2;
    --warn: #ff9d7b;
    --amber: #efb55f;
    --track: #2a323d;
    --lay: #313a46;
    --lay-long: #6f4f1d;
    --lay-night: #6d2c2c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 32px -18px rgba(0, 0, 0, .8);
  }
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
.mut { color: var(--muted); }
.small { font-size: 12px; }

.page {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}

/* ---------------------------------------------------------------- header */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 4px 2px 2px;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand .mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(140deg, #1565d8, #0f8a6a);
  color: #fff;
  font-size: 19px;
  box-shadow: 0 6px 16px -8px rgba(21, 101, 216, .8);
}

.brand h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.brand .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.stats { display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap; }

.stat { display: flex; flex-direction: column; align-items: flex-start; }
.stat .v { font-size: 16px; font-weight: 650; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); }

.sources { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0 16px; }

.src {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.src .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.src-warn .dot { background: var(--amber); }
.src-bad .dot { background: var(--warn); }
.src-idle .dot { background: var(--muted-2); }
.src em { font-style: normal; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- panels */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.main { display: flex; flex-direction: column; gap: 16px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px 6px;
}

.panel-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-title h2 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.hint { font-size: 11.5px; color: var(--muted-2); font-weight: 400; }

.grid-tools { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------ price grid */

.grid-scroll { overflow-x: auto; padding: 0 8px; }

.price-grid {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 3px;
  margin: 2px 0 0;
}

.price-grid thead th {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-2);
  padding: 2px 6px 5px;
  text-align: center;
  white-space: nowrap;
}
.price-grid thead th .dow { display: block; font-size: 9.5px; color: var(--muted-2); }
.price-grid thead th .dm { display: block; font-size: 12px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.price-grid thead .corner { text-align: left; padding-left: 8px; }

.price-grid tbody th.origin {
  text-align: left;
  font-weight: 400;
  padding: 2px 10px 2px 6px;
  white-space: nowrap;
  vertical-align: middle;
}
.origin-cell { display: flex; align-items: baseline; gap: 7px; }
.price-grid .origin .code { font-size: 12.5px; font-weight: 700; letter-spacing: .01em; }
.price-grid .origin .nm { font-size: 12.5px; color: var(--muted); }
.price-grid .origin .gnd { font-size: 10.5px; color: var(--muted-2); }

.price-grid tr.section th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted-2);
  padding: 9px 8px 2px;
}

.cell {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  cursor: pointer;
  transition: transform .08s ease, border-color .12s ease;
}
.cell:hover { border-color: var(--accent); transform: translateY(-1px); }
.cell.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cell.empty {
  cursor: default;
  border: 0;
  color: var(--muted-2);
  background: transparent;
  font-weight: 400;
  padding: 0;
  height: 33px;
  align-content: center;
  opacity: .5;
}
.cell.empty:hover { transform: none; border-color: transparent; }

.grid-foot { display: flex; align-items: center; gap: 8px; padding: 4px 14px 12px; }
.grid-foot .legend-label { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.grid-foot .ramp {
  height: 8px;
  width: 130px;
  border-radius: 4px;
  background: linear-gradient(90deg, hsl(156 46% 92%), hsl(82 60% 88%), hsl(8 72% 80%));
}
.grid-foot .hint { margin-left: 6px; }

@media (prefers-color-scheme: dark) {
  .grid-foot .ramp { background: linear-gradient(90deg, hsl(156 46% 26%), hsl(82 44% 22%), hsl(8 56% 22%)); }
}

/* ------------------------------------------------------- history strip */

.history-panel { padding: 12px 14px; }
.history-inner { display: flex; flex-direction: column; gap: 6px; }
.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.history-head h3 { font-size: 13px; font-weight: 650; }
.history-head h3 .hint { margin-left: 6px; }
.history-delta { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.history-delta.down { color: var(--good); }
.history-delta.up { color: var(--warn); }
.spark { width: 100%; max-width: 420px; height: 54px; display: block; }
.spark-area { fill: var(--accent-weak); }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-dot { fill: var(--accent); }
.history-axis { display: flex; justify-content: space-between; max-width: 420px; font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- workspace */

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* ------------------------------------------------------------- filters */

.filters {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.filters-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-soft);
}

.filters-head h2 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }

.fcount {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-fg);
  font-size: 10.5px;
  font-weight: 700;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.fcount.on { display: inline-grid; }

.fhead-actions { display: flex; align-items: center; gap: 4px; }

.linkbtn {
  background: none;
  border: 0;
  padding: 4px 6px;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  border-radius: 6px;
}
.linkbtn:hover { background: var(--accent-weak); }

.iconbtn {
  display: none;
  background: none;
  border: 0;
  padding: 4px 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 6px;
}
.iconbtn:hover { background: var(--hover); }

.f-sec { padding: 11px 14px; border-top: 1px solid var(--line-soft); }
.f-sec:first-child { border-top: 0; }
.f-sec h3 {
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .075em;
  color: var(--muted-2);
  margin-bottom: 7px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}
.check:hover { background: var(--hover); }
.check input { accent-color: var(--accent-bg); margin: 0; }
.check .code { font-size: 11.5px; font-weight: 700; min-width: 32px; color: var(--muted); }
.check .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  min-width: 18px;
  text-align: right;
}
.check em.zero { opacity: .45; }
.check.inline { margin-top: 6px; font-size: 12.5px; }

.apt-group { padding-bottom: 6px; }
.apt-group + .apt-group { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.apt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.mini-actions { display: flex; gap: 2px; }
.mini-actions button {
  background: none;
  border: 0;
  font-size: 10.5px;
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 5px;
  cursor: pointer;
}
.mini-actions button:hover { background: var(--accent-weak); }

.seg {
  display: inline-flex;
  padding: 2px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  flex-wrap: wrap;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
}
.seg button em { font-style: normal; font-size: 10px; color: var(--muted-2); margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg button em.zero { opacity: .45; }
.seg.small button { padding: 3px 8px; font-size: 11.5px; }

.date-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.dchip { position: relative; cursor: pointer; }
.dchip input { position: absolute; opacity: 0; width: 0; height: 0; }
.dchip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}
.dchip em { font-style: normal; font-size: 10px; color: var(--muted-2); font-variant-numeric: tabular-nums; min-width: 10px; text-align: right; }
.dchip em.zero { opacity: .45; }
.dchip input:checked + span { border-color: var(--accent); background: var(--accent-weak); color: var(--text); font-weight: 600; }
.dchip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.slider-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 2px; }
.slider-head h3 { margin-bottom: 0; }
.slider-head output { font-size: 11.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
  margin: 2px 0 0;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent-bg) var(--fill, 50%), var(--track) var(--fill, 50%));
}
input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent-bg) var(--fill, 50%), var(--track) var(--fill, 50%));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent-bg);
  box-shadow: 0 1px 3px rgba(16, 24, 40, .25);
}
input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent-bg);
}
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.dual { display: grid; gap: 0; }
.dual-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.search {
  width: 100%;
  padding: 5px 8px;
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 5px;
}
.search:focus { outline: 2px solid var(--accent-weak); border-color: var(--accent); }

.scrolllist { max-height: 200px; overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px; }
.scrolllist .check { font-size: 12.5px; }
.scrolllist .check .nm { flex: 0 1 auto; max-width: 118px; }
.scrolllist .alogo { flex: none; transform: scale(.85); transform-origin: left center; }

.via-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.vchip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  letter-spacing: .02em;
}
.vchip em { font-style: normal; font-size: 10px; font-weight: 400; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.vchip:hover { border-color: var(--accent); }
.vchip.inc { background: var(--accent-weak); border-color: var(--accent); color: var(--text); }
.vchip.exc { background: rgba(180, 64, 28, .08); border-color: var(--warn); color: var(--warn); text-decoration: line-through; }
.vchip em.zero { opacity: .5; }

.src-list .check { font-size: 12.5px; }

/* --------------------------------------------------------- sort bar */

.results { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.sortbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 6px;
  margin: -7px 0 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px;
}

.sort-buttons { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }

.sortbtn {
  border: 0;
  background: transparent;
  font-size: 12.5px;
  color: var(--muted);
  padding: 5px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.sortbtn:hover { background: var(--surface); color: var(--text); }
.sortbtn.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }

.sort-right { display: flex; align-items: center; gap: 10px; }
.count { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.filters-btn {
  display: none;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip span { color: var(--muted-2); font-size: 13px; line-height: 1; }
.chip.clear { border-style: dashed; color: var(--muted-2); }

/* ------------------------------------------------------------- list */

.list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.list-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 0 4px; }

.row { border-top: 1px solid var(--line-soft); }
.row:first-child { border-top: 0; }
.row:hover { background: var(--hover); }
.row.open { background: var(--surface-2); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.row-main {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 4px 16px;
  padding: 11px 14px;
  cursor: pointer;
}

.price-col { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.price { font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price-sub { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.journey { min-width: 0; display: flex; flex-direction: column; gap: 5px; }

.times { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; min-width: 0; }
.times .tt { font-size: 15.5px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.times .ap { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.times .arrow { color: var(--muted-2); font-size: 13px; }
.times .dur { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.times .plus {
  font-size: 10px;
  font-weight: 700;
  color: var(--warn);
  vertical-align: super;
  margin-left: 1px;
}

.bar { display: flex; gap: 2px; height: 8px; align-items: stretch; }
.bseg { border-radius: 2px; min-width: 3px; opacity: .92; }
.blay { background: var(--lay); border-radius: 2px; min-width: 2px; }
.blay.long { background: var(--lay-long); }
.blay.night {
  background-color: var(--lay);
  background-image: repeating-linear-gradient(45deg, var(--lay-night) 0 3px, transparent 3px 6px);
}

.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.meta .dot { color: var(--muted-2); }
.meta .stops { font-weight: 600; color: var(--text); }
.meta .laychips { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.meta .metaline { margin-left: auto; color: var(--muted-2); font-size: 11.5px; }

.laychip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.laychip.long { border-color: var(--lay-long); color: var(--amber); background: rgba(150, 96, 10, .07); }
.laychip.night { border-color: var(--lay-night); color: var(--warn); background: rgba(180, 64, 28, .07); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .01em;
}
.badge.warn { background: rgba(180, 64, 28, .1); color: var(--warn); border: 1px solid rgba(180, 64, 28, .25); }
.badge.amber { background: rgba(150, 96, 10, .1); color: var(--amber); border: 1px solid rgba(150, 96, 10, .25); }
.badge.ghost { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.badge.tiny { font-size: 9.5px; padding: 0 4px; }

.offers { display: flex; flex-wrap: wrap; gap: 4px; }
.offer {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.offer b { color: var(--text); font-weight: 650; }
.offer:hover { border-color: var(--accent); text-decoration: none; }
.offer.cheap { border-color: var(--accent); background: var(--accent-weak); }

.side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }

.logos { display: flex; align-items: center; gap: 3px; }

.alogo, .alogo-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  min-width: 26px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.alogo-img { height: 20px; width: auto; max-width: 34px; object-fit: contain; display: block; }
.alogo-code { display: none; font-size: 9.5px; font-weight: 700; color: #333; padding: 0 4px; }
.alogo-code.show, .alogo.failed .alogo-code { display: inline-flex; }
.alogo-more { font-size: 10.5px; color: var(--muted-2); margin-left: 2px; }

.book {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
}
.book:hover { background: var(--accent-weak); border-color: var(--accent); text-decoration: none; }
.book .ext { opacity: .65; font-size: 11px; }
.book.disabled { color: var(--muted-2); }

.chev {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted-2);
  border-bottom: 1.5px solid var(--muted-2);
  transform: rotate(45deg);
  transition: transform .16s ease;
  justify-self: center;
  margin-top: -3px;
}
.row.open .chev { transform: rotate(225deg); margin-top: 3px; }

/* --------------------------------------------------------- expanded */

.row-more { padding: 0 14px 14px; }

.more-inner { border-top: 1px dashed var(--line); padding-top: 10px; }

.segtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.segtable th {
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-2);
  padding: 4px 8px;
  border-bottom: 1px solid var(--line-soft);
}
.segtable td { padding: 6px 8px; vertical-align: top; }
.segtable td .mut, .segtable td span.mut { display: block; font-size: 11px; color: var(--muted-2); }
.segtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.segtable .seg-logo { width: 34px; }
.segtable b { font-weight: 650; }
.layrow td { padding: 2px 8px 4px; }
.laypill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}
.laypill.long { border-color: var(--lay-long); color: var(--amber); }
.laypill.night { border-color: var(--lay-night); color: var(--warn); }

.more-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.mini-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mini-card h4 {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-2);
  margin-bottom: 1px;
}
.mini-card p { color: var(--text); }
.mini-card .mut { color: var(--muted); font-size: 11.5px; }
.mini-card .small { font-size: 11.5px; color: var(--muted); }
.warn-text { color: var(--warn); }

.offers-block { margin-top: 12px; }
.offers-block h4 {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.offer-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.offer-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 10px;
}
.offer-row.best { border-color: var(--accent); }
.offer-line { display: flex; align-items: baseline; gap: 10px; font-size: 12.5px; flex-wrap: wrap; }
.offer-src { font-weight: 600; flex: 1; min-width: 0; }
.offer-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.offer-line a { font-size: 11.5px; white-space: nowrap; }
.sellers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.seller {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  white-space: nowrap;
}
.seller b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.sites {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.offer .st {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--warn);
  border: 1px solid rgba(180, 64, 28, .35);
  border-radius: 3px;
  padding: 0 2px;
  line-height: 1.2;
}

/* --------------------------------------------------------- states */

.state-card {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.state-card h3 { font-size: 15px; color: var(--text); }
.state-card code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

.empty { padding: 44px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); }

.btn {
  border: 1px solid var(--accent);
  background: var(--accent-bg);
  color: var(--accent-fg);
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-foot {
  margin-top: 26px;
  padding: 0 2px;
  font-size: 11.5px;
  color: var(--muted-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.backdrop { display: none; }

.noscript {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--warn);
  color: #fff;
  padding: 10px;
  text-align: center;
}

/* ------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .workspace { grid-template-columns: 268px minmax(0, 1fr); }
  .scrolllist .check .nm { max-width: 100px; }
}

@media (max-width: 940px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }

  .filters {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(340px, 90vw);
    max-height: none;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--line);
    transform: translateX(-103%);
    transition: transform .22s ease;
    z-index: 60;
    display: flex;
    flex-direction: column;
    padding-bottom: 24px;
  }
  body.drawer-open .filters { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .filters-head { border-radius: 0; }
  .iconbtn { display: inline-flex; }
  .filters-btn { display: inline-flex; }

  .backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 18, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 55;
  }
  body.drawer-open .backdrop { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }

  .sortbar { padding: 7px 2px; }
}

@media (max-width: 760px) {
  .page { padding: 14px 12px 40px; }
  .brand h1 { font-size: 19px; }
  .mark { width: 34px; height: 34px; font-size: 17px; }

  .stats { gap: 14px; }
  .stat .v { font-size: 14.5px; }
  .stat .l { font-size: 10.5px; }

  .panel-head { padding: 10px 12px 4px; }
  .grid-scroll { padding: 0 4px; }
  .price-grid { min-width: 560px; }
  .price-grid .origin .nm { display: none; }
  .grid-foot { padding: 2px 12px 10px; flex-wrap: wrap; }

  .row-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding: 10px 12px;
  }
  .price-col { flex-direction: row; align-items: baseline; gap: 8px; }
  .price { font-size: 17px; }
  .times .tt { font-size: 14.5px; }
  .times .dur { font-size: 12px; }
  .side { justify-content: space-between; }
  .chev { display: none; }
  .meta .metaline { margin-left: 0; }
  .segtable { font-size: 11.5px; }
  .segtable th, .segtable td { padding: 4px 5px; }
  .segtable .mut { display: none; }
  .segtable td b + span.mut { display: block; }
  .row-more { padding: 0 12px 12px; }
  .more-cards { grid-template-columns: 1fr; }
  .sort-right .count { display: none; }
  .sortbar { gap: 6px; }
  .sort-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sort-buttons::-webkit-scrollbar { display: none; }
  .sortbtn { flex: none; }
  .history-panel { padding: 10px 12px; }

  .segtable .col-aircraft { display: none; }
  .segtable td span.mut { font-size: 10.5px; }
  .segtable td .carrier-name { display: none; }
  .segtable b { font-size: 12px; }
  .segtable .seg-logo { width: 26px; padding-right: 0; }
  .segtable .alogo { transform: scale(.9); transform-origin: left center; }

  .sources { margin: 10px 0 12px; }
}

@media (max-width: 420px) {
  .sortbtn { padding: 4px 6px; font-size: 12px; }
  .filters-btn { padding: 5px 8px; }
}

/* sort bar: "then by", price/time weight, trade-off toggle */
.sort-then, .sort-weight, .sort-tradeoffs {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); margin-left: 10px; white-space: nowrap;
}
.sort-then select {
  font: inherit; color: inherit; background: transparent;
  border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px;
}
.sort-weight input[type=range] { width: 90px; }
.sort-tradeoffs input { margin: 0; }
.sort-weight[hidden] { display: none; }
