:root {
  --bg: #eef1f6;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e5e7eb;
  --row-alt: #f9fafb;
  --hero-from: #0b1428;
  --hero-to: #1e3a8a;
  --hero-accent: #93b4ff;
  --code-bg: #f1f3f6;
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.page { max-width: 1240px; margin: 0 auto; padding: 24px 16px 48px; display: grid; gap: 28px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); scroll-margin-top: 16px; }
.dot { color: var(--faint); margin: 0 10px; }

/* ---------- overview hero ---------- */
.hero { background: linear-gradient(110deg, var(--hero-from) 0%, var(--hero-to) 100%); color: #fff; padding: 36px 44px 30px; }
.hero h1 { font-size: clamp(24px, 3.6vw, 38px); font-weight: 600; margin: 0 0 14px; letter-spacing: .01em; }

/* ---------- region cards ---------- */
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px 28px 28px; }
.rcard {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); overflow: hidden;
  border-radius: 14px; padding: 24px 22px 18px; transition: transform .15s, box-shadow .15s, background .15s;
}
.rcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--c), var(--c2)); }
.rcard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(16, 24, 40, .08); }
.rcard h2 { color: var(--c); font-size: 22px; font-weight: 600; margin: 0; }
.rcard .en { color: var(--faint); letter-spacing: .08em; font-size: 13px; text-transform: uppercase; margin-bottom: 10px; }
.pill { display: inline-block; background: var(--soft); color: var(--c); font-weight: 600; font-size: 14px; border-radius: 999px; padding: 2px 12px; margin-bottom: 8px; }
.rcard .ranges { color: var(--muted); font-size: 14px; margin: 0; }

.legend-bar { border-top: 1px solid var(--line); background: #f8fafc; padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.legend-bar b { color: #374151; }
.legend-bar .src { margin-left: auto; }

/* ---------- region table panels ---------- */
.rhead { background: linear-gradient(110deg, var(--c) 0%, var(--c2) 100%); color: #fff; padding: 22px 32px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.rhead h2 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.2; }
.rhead .en { font-size: 14px; letter-spacing: .08em; opacity: .85; text-transform: uppercase; }
.rhead .right { text-align: right; display: grid; justify-items: end; gap: 6px; }
.rhead .count { font-size: 26px; font-weight: 600; line-height: 1; }
.rhead .count small { font-size: 14px; font-weight: 400; margin-left: 2px; }
.rhead .rng { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); border-radius: 999px; padding: 2px 12px; font-size: 13px; }


.tscroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { font-weight: 500; color: #374151; }
thead tr.group th { background: var(--soft); color: var(--c); font-weight: 700; letter-spacing: .02em; padding: 12px 8px; border-left: 3px solid color-mix(in srgb, var(--c) 30%, #fff); border-bottom: 2px solid var(--c); }
thead tr.group th.route-h { background: var(--panel); color: #374151; font-weight: 500; letter-spacing: 0; border-left: 0; border-bottom: 1px solid var(--line); }
thead tr.sub th { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--row-alt); }
thead tr.sub th.first { border-left: 3px solid color-mix(in srgb, var(--c) 30%, #fff); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
/* out-and-back pairs: shaded alternately, thin dashed line inside a pair, strong line between pairs */
tbody.pair:nth-of-type(even) td { background: color-mix(in srgb, var(--soft) 45%, #fff); }
tbody.pair tr:not(:last-child) td { border-bottom: 1px dashed var(--line); }
tbody.pair tr:last-child td { border-bottom: 2px solid #94a3b8; }
tbody.pair:last-child tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--soft); }
td.route { white-space: nowrap; padding-left: 16px; font-weight: 500; }
.iata { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; color: var(--faint); font-weight: 400; margin: 0 2px 0 3px; }
.arr { color: var(--c); margin: 0 4px; font-weight: 600; }
td.miles { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; }
td.first { border-left: 3px solid color-mix(in srgb, var(--c) 30%, #fff); }
.fno { display: inline-block; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; background: var(--code-bg); border-radius: 5px; padding: 2px 7px; margin: 2px 6px 2px 0; }
td.bo { color: var(--muted); font-size: 14px; min-width: 150px; }
td.na { color: var(--faint); }

.tfoot { border-top: 1px solid var(--line); background: #f8fafc; padding: 12px 32px; display: flex; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.tfoot b { color: #374151; }
.tfoot .back { margin-left: auto; text-decoration: none; color: var(--c); font-weight: 500; }

/* ---------- notes ---------- */
.notes { padding: 26px 32px; }
.notes h2 { margin: 0 0 10px; font-size: 22px; font-weight: 600; }
.notes ul { margin: 0; padding-left: 20px; }
.notes li { margin-bottom: 8px; color: #374151; }
.disclaimer { color: var(--faint); font-size: 13px; margin: 18px 0 0; }

@media (max-width: 900px) {
  .region-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .page { padding: 12px 0 32px; }
  .panel { border-radius: 0; border-left: 0; border-right: 0; }
  .hero { padding: 26px 16px 22px; }
  .region-grid { grid-template-columns: 1fr; padding: 16px; gap: 14px; }
  .legend-bar, .tfoot, .rhead, .notes { padding-left: 16px; padding-right: 16px; }
  .legend-bar .src, .tfoot .back { margin-left: 0; flex-basis: 100%; }
  .dot { margin: 0 6px; }
}

#tables { display: grid; gap: 28px; }
td.fl { white-space: nowrap; }
td.bo .seg { white-space: nowrap; }

/* language switch */
.hero { position: relative; }
.lang { position: absolute; top: 20px; right: 24px; display: flex; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 3px; background: rgba(255, 255, 255, .06); }
.lang button { border: 0; background: transparent; color: #dbe4ff; font: inherit; font-size: 13px; font-weight: 500; padding: 4px 12px; border-radius: 999px; cursor: pointer; }
.lang button[aria-pressed="true"] { background: #fff; color: var(--hero-from); }
.hero h1 { padding-right: 120px; }
@media (max-width: 620px) {
  .lang { top: 14px; right: 16px; }
  .hero h1 { padding-right: 0; margin-top: 28px; }
}

/* update check + archive */
.archived { background: #fef3c7; color: #92400e; border-bottom: 1px solid #fde68a; padding: 12px 32px; font-size: 14px; }
.archived a { color: #92400e; font-weight: 600; margin-left: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 620px) { .archived { padding: 12px 16px; } }

.panel[role="tabpanel"] { scroll-margin-top: 70px; }

/* hero: stats line + toolbar */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 8px 10px 8px 14px;
}
.edition { display: flex; align-items: center; gap: 10px; }
.tlabel { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--hero-accent); font-weight: 600; }
.edition select {
  font: inherit; font-size: 14px; font-weight: 500; color: #fff; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.edition select:disabled { cursor: default; opacity: .85; }
.edition select option { color: var(--ink); }
.checker { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.check-status { font-size: 13px; color: var(--hero-accent); text-align: right; }
.check-status.good { color: #86efac; }
.check-status.err { color: #fca5a5; }
.check-btn {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--hero-from); background: #fff; border: 0;
  border-radius: 8px; padding: 8px 14px; cursor: pointer; white-space: nowrap;
}
.check-btn:hover:not(:disabled) { background: #e0e7ff; }
.check-btn:disabled { opacity: .7; cursor: progress; }
@media (max-width: 620px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  .checker { margin-left: 0; flex-direction: row-reverse; justify-content: flex-end; }
  .check-status { text-align: left; }
}

/* header bar (check) */
.hbar {
  margin: 0 0 10px; padding: 11px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
}
.hbar:last-child { margin-bottom: 0; }

/* region cards as tabs */
.rcard[aria-selected="true"] {
  background: color-mix(in srgb, var(--soft) 45%, var(--panel)); border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c), 0 10px 24px rgba(16, 24, 40, .10);
}
.rcard .shown {
  position: absolute; right: 16px; bottom: 14px; font-size: 12px; font-weight: 600; color: var(--c);
  background: var(--panel); border: 1px solid var(--c); border-radius: 999px; padding: 1px 10px;
}
.rcard[aria-selected="true"] .ranges { padding-right: 96px; }
.rcard:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }
#tables { scroll-margin-top: 16px; }

/* promotion summary bars, shown with the region cards */
.summary { display: grid; gap: 10px; padding: 24px 28px 0; }
.sbar {
  margin: 0; padding: 11px 16px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--line);
  color: var(--ink); font-size: 15px;
}
.promo-info {
  font-size: 16px; color: #fff; border: 0; padding: 13px 18px;
  background: linear-gradient(110deg, var(--hero-to) 0%, #3b5bcc 100%); box-shadow: 0 4px 14px rgba(30, 58, 138, .18);
}
.promo-info .k { color: #bfdbfe; }
.promo-info b { font-weight: 600; }
.promo-info .dot { color: rgba(255, 255, 255, .45); }
.countdown { font-size: 12px; font-weight: 600; background: rgba(255, 255, 255, .18); color: #fff; border-radius: 999px; padding: 2px 9px; margin-left: 4px; }
.countdown.urgent { background: #dc2626; }
.countdown.closed { background: rgba(15, 23, 42, .35); color: #cbd5e1; }
.deal { display: inline-block; background: #fbbf24; color: #422006; font-weight: 700; font-size: 14px; border-radius: 999px; padding: 2px 12px; }
.promo-stats { background: #eef2ff; border-color: #c7d2fe; color: #1e293b; }
.promo-stats b { color: var(--hero-to); font-size: 16px; }
.promo-stats .dot { color: #a5b4fc; }
.promo-stats a { color: var(--hero-to); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.promo-stats a:hover { color: var(--hero-from); }
@media (max-width: 620px) { .summary { padding: 16px 16px 0; } .region-grid { padding-top: 14px; } }

/* month picker + downloads */
.left-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 22px; }
.downloads { display: flex; align-items: center; gap: 6px; }
.downloads .tlabel { margin-right: 4px; }
.dl-btn {
  font: inherit; font-size: 13px; font-weight: 600; color: #fff; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.dl-btn:hover { background: rgba(255, 255, 255, .2); }
