﻿:root {
  --blue: #1a73e8;
  --blue-dark: #1765cc;
  --blue-soft: #d3e3fd;
  --blue-tint: #e8f0fe;
  --ink: #404040;
  --grey: #5f6368;
  --grey-2: #70757a;
  --line: #dadce0;
  --line-soft: #e8eaed;
  --chip-bg: #f1f3f4;
  --hover: #f8f9fa;
  --surface: #ffffff;
  --green-bg: #e6f4ea;
  --green: #0d652d;
  --violet-bg: #ede7f6;
  --violet: #4527a0;
  --gold-bg: #fef7e0;
  --gold: #9a5b00;
  --radius-card: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

.msr {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  display: inline-block;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-variation-settings: "FILL" 0, "wght" 500, "GRAD" 0, "opsz" 24;
  font-size: 20px;
  user-select: none;
}

button, input, select { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.topbar.is-scrolled { border-bottom-color: var(--line-soft); }

.topbar-in {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
}

.logo-mark {
  color: var(--blue);
  font-size: 26px !important;
}

.logo-text { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.logo-text span { color: var(--blue); }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.updated-tag { font-size: 12.5px; color: var(--grey); }

.topbar-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.topbar-link:hover { background: var(--blue-tint); }

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.topnav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--grey);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav-link:hover { background: var(--hover); color: var(--ink); }
.topnav-link.is-active { background: var(--blue-tint); color: var(--blue); font-weight: 600; }

/* ---------- Hero ---------- */

.hero { text-align: center; padding: 44px 20px 26px; }

.hero h1 {
  font-size: clamp(27px, 3.6vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 640px;
  margin: 10px auto 0;
  color: var(--grey);
  font-size: 15px;
}

/* ---------- Search card ---------- */

.searchzone { margin-top: 6px; }

.search-card {
  display: flex;
  align-items: stretch;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 8px;
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.08);
  transition: box-shadow 0.18s ease;
}

.search-card:focus-within {
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.14), 0 4px 16px rgba(11, 87, 208, 0.08);
}

.sz-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  min-height: 48px;
  flex: 0 0 auto;
}

.sz-grow { flex: 1 1 auto; }

.sz-icon { color: var(--grey); font-size: 22px !important; }

.sz-field input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
}

.sz-field input::placeholder { color: var(--grey-2); }

.sz-field select {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  min-width: 128px;
}

.sz-divider {
  width: 1px;
  background: var(--line-soft);
  margin: 8px 2px;
}

.sz-go {
  align-self: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.1s ease;
  margin-left: 4px;
}

.sz-go:hover { background: var(--blue-dark); }
.sz-go:active { transform: scale(0.96); }
.sz-go .msr { font-size: 22px; }

/* ---------- Filter chips ---------- */

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: var(--chip-bg);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chip .gi { font-size: 17px !important; color: var(--grey); transition: color 0.15s ease; }

.chip .ck { display: none; font-size: 16px !important; }

.chip:hover { background: #e4eaf3; }

.chip.is-active {
  background: var(--blue-soft);
  color: #041e49;
  font-weight: 600;
}

.chip.is-active .gi { color: #062e6f; }

.chip.is-active .ck {
  display: inline-block;
  color: #062e6f;
  animation: pop 0.18s ease;
}

@keyframes pop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.results-zone { margin-top: 34px; }

.rz-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.rz-title {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.rz-sub {
  font-size: 13px;
  color: var(--grey);
  margin-top: 3px;
  max-width: 640px;
}

.rcount { color: var(--grey-2); }

.sortsel-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.sortsel-cap { font-size: 13px; color: var(--grey); }

.sortsel-ctl {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px 8px 16px;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.sortsel-ctl:hover { border-color: #c6cace; box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12); }

.sortsel-ctl select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  cursor: pointer;
  padding-right: 2px;
}

.sortsel-ctl .msr { font-size: 18px !important; color: var(--blue); pointer-events: none; }

/* ---------- Flight-style list ---------- */

.gf-list {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06);
  overflow: hidden;
}

.rows { display: block; }

/* ---------- Sortable column header ---------- */

.rows-head {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 0.55fr 0.5fr 0.8fr 0.8fr 0.75fr 0.25fr;
  gap: 0;
  align-items: center;
  padding: 8px 18px;
  background: var(--hover);
  border-bottom: 1px solid var(--line);
}

.hcell {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--grey);
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
  outline: none !important;
}

.hcell:first-child { margin-left: 0; }

.hcell:hover { background: rgba(32, 33, 36, 0.06); color: var(--ink); }

.hcell .h-ar {
  font-size: 15px !important;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.hcell:hover .h-ar { opacity: 0.45; }

.hcell.is-active { color: var(--blue); }
.hcell.is-active .h-ar { opacity: 1; color: var(--blue); }

.hcell.h-right { justify-self: end; flex-direction: row-reverse; }

.hfill { min-height: 1px; }

.plan-card {
  position: relative;
  border: none;
  border-radius: 0;
  background: var(--surface);
  transition: background 0.15s ease;
  animation: rise 0.28s ease both;
}

.plan-card + .plan-card { border-top: 1px solid var(--line-soft); }

.plan-card:hover { background: var(--hover); }

.plan-card.is-open { background: #fafbfe; }

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.pc-main {
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 0.55fr 0.5fr 0.8fr 0.8fr 0.75fr 0.25fr;
  gap: 0;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
}

.badge {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 8px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-cheapest { background: var(--green-bg); color: var(--green); }
.badge-fastest { background: var(--violet-bg); color: var(--violet); }
.badge-value { background: var(--gold-bg); color: var(--gold); }
.badge-best { background: #e8f0fe; color: #1967d2; border: 1px solid #d2e3fc; }

/* ---------- Row cells ---------- */

.cell-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cell-brand .logo-img,
.cell-brand .logo-fallback { width: 34px; height: 34px; border-radius: 8px; flex: 0 0 auto; }

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

.cell-plan { min-width: 0; }

.pl-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-type { font-size: 12px; color: var(--grey); margin-top: 1px; }

.pl-stats {
  font-size: 12px;
  color: var(--grey);
  margin-top: 4px;
}

.col-down b, .col-up b { font-variant-numeric: tabular-nums; }

.col-value { text-align: right; }

.pc-col { min-width: 0; }

.pc-col b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.pc-col > span {
  display: block;
  font-size: 11px;
  color: var(--grey-2);
  margin-top: 0;
  font-weight: 400;
  line-height: 1.2;
}

.pc-cols-m { display: contents; }

.pc-price { text-align: right; min-width: 0; display: flex; flex-direction: column; align-items: flex-end; }

.pc-price .pmain {
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.pc-price b {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.pc-price i {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--grey-2);
  margin-left: 1px;
  line-height: 1.2;
}

.then-note {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--grey);
  line-height: 1.2;
}

.pc-expand {
  width: 38px;
  height: 38px;
  justify-self: center;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--grey);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.pc-expand:hover { background: rgba(32, 33, 36, 0.06); }

.plan-card.is-open .pc-expand { background: var(--blue-soft); color: #041e49; }

.pc-expand .msr { font-size: 22px; transition: transform 0.25s ease; }

.plan-card.is-open .pc-expand .msr { transform: rotate(180deg); }

/* ---------- Expanded detail (flights-style) ---------- */

.pc-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.plan-card.is-open .pc-detail { grid-template-rows: 1fr; }

.pc-detail-in { overflow: hidden; padding: 0 20px; background: var(--surface); }

.plan-card.is-open .pc-detail-in { padding-bottom: 20px; }

.exp-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.exp-title { display: flex; flex-direction: column; min-width: 0; }

.exp-title b { font-size: 14px; font-weight: 600; color: var(--ink); }

.exp-title span { font-size: 12px; color: var(--grey); margin-top: 1px; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag-ok { background: var(--green-bg); color: var(--green); }
.tag-warn { background: var(--gold-bg); color: var(--gold); }
.tag-mute { background: #f1f3f4; color: #5f6368; }

.btn-select {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--blue);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-select:hover { background: var(--blue-tint); box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15); }

.btn-select .msr { font-size: 16px !important; }

.exp-body {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 6px 44px;
  padding: 18px 0 2px;
}

.exp-timeline { position: relative; padding-left: 28px; }

.exp-timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 22px;
  border-left: 2px dotted #bdc1c6;
}

.tl-stop { position: relative; padding-bottom: 18px; }

.tl-stop::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 4px;
  width: 9px;
  height: 9px;
  border: 2px solid #9aa0a6;
  border-radius: 50%;
  background: var(--surface);
}

.tl-stop:last-child { padding-bottom: 4px; }

.tl-amt { font-size: 14px; font-weight: 600; color: var(--ink); }

.tl-cap { display: block; font-size: 12px; color: var(--grey); margin-top: 1px; }

.tl-note { display: block; font-size: 11.5px; font-weight: 600; color: #a35200; margin-top: 1px; }

.tl-meta { font-size: 12.5px; color: var(--grey); padding-top: 10px; line-height: 1.5; }

.exp-facts { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.exp-facts li { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink); line-height: 1.45; }

.exp-facts li b { font-weight: 400; }

.exp-facts .msr { font-size: 17px !important; color: var(--grey); flex: 0 0 auto; margin-top: 1px; }

.exp-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 14px; }

.btn-fill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-fill:hover {
  background: var(--blue-dark);
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.4);
}

.btn-fill .btn-ic { font-size: 15px !important; }

/* ---------- Empty state ---------- */

.empty { text-align: center; padding: 54px 20px; color: var(--grey); }

.empty-glyph { font-size: 40px !important; color: var(--grey-2); }

.empty p + p { font-size: 13.5px; margin-top: 4px; }

.empty strong { color: var(--ink); font-weight: 600; }

.tap-hint {
  text-align: center;
  font-size: 12px;
  color: var(--grey-2);
  padding-top: 14px;
}

/* ---------- Notes ---------- */

.notes { margin: 52px auto 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.notes article {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-card);
  padding: 22px 24px;
}

.notes h2 { font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.01em; }

.notes p { color: var(--grey); font-size: 13.5px; }

/* ---------- Footer ---------- */

.gfoot {
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 40px 0 24px;
  margin-top: 60px;
}

.foot-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line-soft);
}
.foot-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.foot-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.foot-col a {
  font-size: 13px;
  color: var(--grey);
  text-decoration: none;
  line-height: 1.5;
}
.foot-col a:hover { color: var(--blue); }
.foot-about {
  padding: 20px 0;
  border-bottom: 1px solid var(--line-soft);
}
.foot-about p {
  font-size: 13px;
  color: var(--grey);
  margin: 0;
  line-height: 1.7;
}
.foot-about strong {
  color: var(--ink);
}
.foot-bottom { padding-top: 20px; }
.foot-bottom p { font-size: 12px; color: var(--grey-2); margin: 0; line-height: 1.6; }

@media (max-width: 600px) {
  .gfoot { padding: 32px 0 20px; margin-top: 40px; }
  .foot-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .rz-head { align-items: center; }
  .pc-expand { display: none; }
  .exp-body { grid-template-columns: 1fr; gap: 14px; }
  .btn-select { margin-left: 0; }
  .search-card { flex-wrap: wrap; border-radius: 24px; row-gap: 2px; }
  .sz-divider { display: none; }
  .sz-field { flex: 1 1 40%; }
  .sz-go { width: 42px; height: 42px; }
  .notes { grid-template-columns: 1fr; }

  #planRows {
    transform: scale(0.6);
    transform-origin: top left;
    width: 166%;
    margin-bottom: -28%;
  }
}

@media (max-width: 560px) {
  .hero { padding-top: 30px; }
  .topbar-right .updated-tag { display: none; }
  .rz-title { font-size: 18px; }
  .pc-expand { display: none; }
  .sz-field { flex: 1 1 100%; }
  .sz-go { display: none; }
  .sz-divider { display: none; }

  #planRows {
    transform: scale(0.6);
    transform-origin: top left;
    width: 166%;
    margin-bottom: -28%;
  }
}
