/* RC Max design system: quiet neutrals, one brand crimson for value, one blue for interaction.
   Numbers are tabular and right-aligned so columns read like a statement, not a poster. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --surface-3: #e8eaee;
  --ink: #111318;
  --ink-2: #4a505c;
  --ink-3: #868c98;
  --line: #e6e8ec;
  --line-2: #d3d7de;
  --accent: #2d4fb5;
  --accent-soft: #e9eefb;
  --dark: #111318;
  --dark-ink: #ffffff;
  --red: #c4122f;
  --red-soft: #fbe8eb;
  --good: #177245;
  --good-soft: #e4f2ea;
  --warn: #a35f00;
  --warn-soft: #fbf0dc;
  --gold: #c08a00;
  --t-japan: #f8eef0; --t-europe: #edf0f8; --t-usa: #eaf3f7; --t-oceania: #f7f1e6;
  --shadow: 0 1px 2px rgba(17, 19, 24, .05);
  --shadow-2: 0 1px 2px rgba(17, 19, 24, .04), 0 12px 32px -8px rgba(17, 19, 24, .12);
  --radius: 12px;
  --r: 8px;
  --sans: "Inter", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  --num: "Inter", "Noto Sans TC", "PingFang TC", system-ui, sans-serif;
}
/* light by default; dark only when the visitor picks it (theme.js sets data-theme) */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0e11; --surface: #15171b; --surface-2: #1b1d22; --surface-3: #262930;
  --ink: #eceef2; --ink-2: #a9aeb8; --ink-3: #757b86; --line: #262930; --line-2: #383c45;
  --accent: #8ea6ff; --accent-soft: #1f2640; --dark: #ededf0; --dark-ink: #17171b;
  --red: #ff5c72; --red-soft: #3a1820; --good: #5ccf8f; --good-soft: #15291e;
  --warn: #f0b55a; --warn-soft: #33270f; --gold: #e8b93c;
  --t-japan: #2b2024; --t-europe: #1f2433; --t-usa: #1c2a31; --t-oceania: #2c261b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 28px rgba(0, 0, 0, .4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.tnum, td.num, .num { font-variant-numeric: tabular-nums; }

/* ---------- top nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.nav-in { max-width: 1440px; margin: 0 auto; padding: 0 24px; height: 54px; display: flex; align-items: center; gap: 28px; }
.logo { display: flex; align-items: center; gap: 8px; color: var(--red); font: 700 17px/1 var(--sans); letter-spacing: -.02em; white-space: nowrap; }
.logo span { color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo svg { width: 24px; height: 24px; }
.nav nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.nav nav::-webkit-scrollbar { display: none; }
.nav nav a { color: var(--ink-2); font-weight: 500; font-size: 13.5px; padding: 0 11px; white-space: nowrap; display: flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nav nav a:hover { color: var(--ink); text-decoration: none; }
.nav nav a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--red); }

.wrap { max-width: 1440px; margin: 0 auto; padding: 28px 24px 64px; }

/* ---------- page header ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-h h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }
.lede { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; max-width: 720px; }
.lede a { white-space: nowrap; }
.page-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }

/* ---------- newbie banner (guide CTA) ---------- */
.newbie { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); color: var(--ink); margin-bottom: 16px; }
.newbie:hover { text-decoration: none; border-color: var(--line-2); }
.nb-emoji { font-size: 22px; }
.nb-text { flex: 1; font-size: 14px; color: var(--ink-2); }
.nb-text b { color: var(--ink); margin-right: 6px; }
.nb-go { font-weight: 600; color: var(--accent); white-space: nowrap; }

/* ---------- controls ---------- */
.chiprow, .chips, .tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: var(--r); padding: 6px 11px; font: 500 13px/1.2 var(--sans); cursor: pointer;
}
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip.on { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.chip .ce { font-size: 14px; line-height: 1; }
.tab { border: 1px solid transparent; background: transparent; color: var(--ink-2); border-radius: 7px; padding: 5px 10px; font: 500 13px/1.25 var(--sans); cursor: pointer; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.on { background: var(--surface); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow); }
.tab small { display: block; font-weight: 400; font-size: 11px; color: var(--ink-3); }
.linkbtn { border: 0; background: none; color: var(--accent); font: 500 12.5px var(--sans); cursor: pointer; padding: 2px 4px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 14px; }
.tb-l { font-size: 12px; color: var(--ink-3); font-weight: 500; white-space: nowrap; }
.tb-group { display: inline-flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.sg { border: 0; background: transparent; color: var(--ink-2); border-radius: 7px; padding: 5px 11px; font: 500 13px/1.25 var(--sans); white-space: nowrap; cursor: pointer; display: inline-flex; align-items: baseline; gap: 5px; }
.sg small { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sg:hover { color: var(--ink); }
.sg.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(23, 23, 27, .12), 0 0 0 .5px rgba(23, 23, 27, .06); }
.tb-end { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.switch { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 4px 2px; font: 500 13px/1 var(--sans); color: var(--ink-2); cursor: pointer; }
.switch .sw { position: relative; width: 28px; height: 16px; border-radius: 8px; background: var(--line-2); flex: none; transition: background .15s; }
.switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch.on { color: var(--ink); }
.switch.on .sw { background: var(--good); }
.switch.on .sw::after { transform: translateX(12px); }

/* ---------- account strip: balances typed in, what they reach ---------- */
.acct { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.acct-cap { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 16px 0; font-size: 12px; color: var(--ink-3); }
.acct-cap b { color: var(--ink); font-weight: 600; font-size: 13px; white-space: nowrap; }
.kpi { flex: 1 1 130px; padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; position: relative; }
.kpi + .kpi::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.kpi > span { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.kpi input { width: 100%; border: 1px solid transparent; border-radius: 7px; background: var(--surface-2); padding: 3px 9px; margin-top: 3px; font: 600 17px/1.4 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--ink); }
.kpi input::placeholder { color: var(--ink-3); opacity: .55; font-weight: 500; }
.kpi input:hover { border-color: var(--line-2); }
.kpi input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.kpi b { font: 650 20px/1.3 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.out { background: var(--surface-2); }
.kpi.out b { color: var(--good); }

/* ---------- section headers ---------- */
.sechead { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin: 28px 0 10px; }
.sechead h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.h-ico { display: none; }
.sechead .meta { color: var(--ink-3); font-size: 12.5px; }
.explain { margin: 0 0 12px; color: var(--ink-3); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
.explain b { color: var(--ink-2); font-weight: 600; }
.explain .hot { color: var(--red); font-weight: 600; }
.legend { display: inline-flex; gap: 12px; align-items: center; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.meta-line { margin: 10px 0 0; text-align: right; font-size: 12px; }
.datepick { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; flex: none; }
.dot.y { background: var(--good); } .dot.p { background: var(--gold); } .dot.n { background: var(--red); opacity: .75; } .dot.u { background: var(--ink-3); opacity: .45; }

/* ---------- region tiles: each region's best, every destination as a tick ---------- */
.regtiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; }
.rt { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 12px 14px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .12s; }
.rt:hover { border-color: var(--line-2); }
.rt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.rt.on { border-color: var(--ink); box-shadow: inset 0 0 0 .5px var(--ink); }
.rt[disabled] { opacity: .5; cursor: default; }
.rt-k { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; }
.rt-k small { font-size: 11.5px; font-weight: 400; color: var(--ink-3); white-space: nowrap; }
.rt-v { font: 650 24px/1.3 var(--num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rt-s { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-strip { position: relative; height: 12px; margin-top: 10px; border-bottom: 1px solid var(--line-2); }
.rt-strip i { position: absolute; bottom: 0; width: 2px; height: 7px; margin-left: -1px; background: var(--ink-3); opacity: .5; border-radius: 1px 1px 0 0; }
.rt-strip i.b { background: var(--red); opacity: 1; height: 12px; }
.rt-cap { grid-column: 1 / -1; margin: 0; font-size: 11.5px; color: var(--ink-3); }

/* ---------- leaderboards: ranked statements ---------- */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; align-items: start; }
.board { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.board > header { display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px; align-items: end; gap: 0 10px; padding: 12px 14px 8px 14px; border-bottom: 1px solid var(--line); }
.bh-t { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.board h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.005em; white-space: nowrap; }
.board header p { margin: 0; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.board header .linkbtn { padding: 0; margin-left: auto; white-space: nowrap; flex: none; }
.bh-c { font-size: 11px; color: var(--ink-3); text-align: right; white-space: nowrap; }
.board.watch h3::before { content: "★"; color: var(--gold); margin-right: 5px; }
.board-empty { margin: 0; padding: 12px 14px 14px; font-size: 13px; color: var(--ink-2); }
.b-ico { display: none; }

.bi { all: unset; box-sizing: border-box; display: grid; width: 100%; grid-template-columns: 18px minmax(0, 1fr) 64px 76px; grid-template-rows: auto auto; gap: 1px 10px; align-items: baseline; cursor: pointer; padding: 8px 14px; min-width: 0; }
.bi + .bi { border-top: 1px solid var(--line); }
.bi:hover { background: var(--surface-2); }
.bi:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.bi-rank { grid-row: 1; font: 500 12px/1.4 var(--num); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.bi-l1, .bi-l2 { grid-column: 2; display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.bi-l1 { grid-row: 1; font-size: 14px; line-height: 1.4; }
.bi-l1 b { font-weight: 600; flex: none; }
.bi-l1 > span { flex: none; }
.bi-l1 > .bi-short { flex: 0 1 auto; min-width: 0; }
.bi-code { font: 500 11px/1 var(--num); color: var(--ink-3); letter-spacing: .04em; }
.bi-cab { font-size: 11.5px; color: var(--ink-3); }
.bi-l2 { grid-row: 2; font-size: 12px; color: var(--ink-3); line-height: 1.4; }
.bi-pg { color: var(--ink-2); flex: none; }
.bi-l2 > span:not(.bi-pg):not(.al) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bi-av { display: inline-block; white-space: nowrap; }
.bi-l2 .conf { padding: 0 4px; margin: 0; }
.bi-c1, .bi-c2 { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bi-c1 { grid-row: 1; font: 600 13.5px/1.4 var(--num); font-variant-numeric: tabular-nums; }
.bi-c2 { grid-row: 2; font: 400 11.5px/1.4 var(--num); font-variant-numeric: tabular-nums; color: var(--ink-3); }
.bi-c1.k { font-weight: 700; }
.x3 { grid-column: 3; } .x4 { grid-column: 4; }
.bi-rc.ok { color: var(--good); }
.bi-c2.save { color: var(--red); }
.bi-short { font: 500 11px/1 var(--sans); color: var(--warn); overflow: hidden; text-overflow: ellipsis; }
.delta { font: 600 11px/1 var(--num); }
.delta.up { color: var(--good); }
.delta.dn { color: var(--ink-3); }
/* airline: livery square + code, quiet */
.al { display: inline-flex; align-items: center; gap: 4px; font: 600 11px/1 var(--num); color: var(--ink-2); letter-spacing: .02em; white-space: nowrap; flex: none; }
.al::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* multiplier: type, not stickers; a soft tint only when it is really worth it */
.badge { display: inline-block; font: 700 13px/1.3 var(--num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-great { color: var(--red); background: var(--red-soft); padding: 0 5px; border-radius: 5px; margin-right: -5px; }
.m-good { color: var(--red); }
.m-ok { color: var(--ink-2); font-weight: 600; }
.m-bad { color: var(--ink-3); font-weight: 500; text-decoration: line-through; }

/* guide-page item bits (calculator picks, step examples) */
.thumb { width: 64px; height: 64px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: none; background: var(--surface-2); }
.thumb .fl { font-size: 24px; line-height: 1; }
.thumb b { font: 600 12px/1 var(--num); letter-spacing: .05em; color: var(--ink-2); }
.t-Japan { background: var(--t-japan); } .t-Europe { background: var(--t-europe); } .t-USA { background: var(--t-usa); }
.t-Oceania { background: var(--t-oceania); }
.t-Asia { background: color-mix(in srgb, var(--good) 9%, var(--surface)); }
.it-brand { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-prog { font-size: 12.5px; color: var(--ink-2); }
.it-av { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; }

/* ---------- panels ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card.empty { grid-column: 1 / -1; text-align: center; color: var(--ink-2); padding: 34px; }
.fold { padding: 0; }
.fold > summary { cursor: pointer; padding: 13px 18px; font-weight: 600; font-size: 14px; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; margin-left: auto; width: 7px; height: 7px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); align-self: center; transition: transform .15s; }
.fold[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }
.fold > summary .muted { font-weight: 400; }
.fold > :not(summary) { padding: 0 18px 16px; }
.settings { display: flex; flex-wrap: wrap; gap: 16px 28px; }
.group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.group.small input { width: 100px; }
.gl { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input, select, button { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 9px; }
input:focus-visible, select:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 0; border-color: var(--accent); }
select { font-size: 13px; }
button { cursor: pointer; }
button.primary { background: var(--dark); border-color: var(--dark); color: var(--dark-ink); font-weight: 600; }
.bonus { display: flex; gap: 12px; flex-wrap: wrap; }
.bonus label { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.bonus input { width: 64px; padding: 4px 7px; }
.job { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.bar { flex: 0 0 240px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.notes { font-size: 13.5px; color: var(--ink-2); }
.notes ul { margin: 0; padding: 0 18px 16px 36px; }
.notes li { margin: 5px 0; }

/* ---------- table ---------- */
.tablecard { padding: 0 0 4px; overflow: hidden; }
.tablebar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; padding: 12px 16px; }
.tablebar input { flex: 1 1 260px; max-width: 420px; padding: 7px 11px; border-radius: var(--r); background: var(--surface-2); border-color: transparent; }
.tablebar .tabs { gap: 4px; }
.scroller { overflow-x: auto; }
.fbar { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.fg { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.fg-l { font-size: 12px; font-weight: 500; color: var(--ink-3); margin-right: 4px; white-space: nowrap; }
.fchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: 3px 8px; font: 500 12.5px/1.3 var(--sans); cursor: pointer; white-space: nowrap; }
.fchip:hover { color: var(--ink); border-color: var(--line-2); }
.fchip small { font: 500 10.5px/1 var(--num); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fchip.on { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.fchip.on small { color: inherit; opacity: .7; }
.fchip.zero:not(.on) { opacity: .45; }
.fchip .dot { margin-right: 1px; vertical-align: 0; }
.fg-picks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.fsel select { font: 500 12.5px/1.3 var(--sans); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); max-width: 200px; }
.tab.reset { color: var(--red); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; vertical-align: top; }
th { font-size: 11.5px; font-weight: 500; color: var(--ink-3); position: sticky; top: 0; background: var(--surface); cursor: pointer; user-select: none; z-index: 1; vertical-align: bottom; padding-top: 10px; padding-bottom: 8px; }
th:hover { color: var(--ink); }
th.sorted { color: var(--ink); font-weight: 600; }
th .arr { font-size: 9px; margin-left: 3px; }
th.num, td.num { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }
td.num { font-weight: 500; }
th:first-child, td:first-child { padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
.sticky { position: sticky; left: 0; background: var(--surface); z-index: 1; }
th.sticky { z-index: 2; }
tbody tr.r { cursor: pointer; }
tbody tr.r:hover td, tbody tr.r.open td { background: var(--surface-2); }
tbody tr.off td { color: var(--ink-3); }
td .sub { display: block; font-size: 11.5px; color: var(--ink-3); font-family: var(--sans); font-weight: 400; max-width: 190px; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
td.num .sub { margin-left: auto; font-variant-numeric: tabular-nums; }
td.c-dest { font-weight: 600; }
td.c-dest .tag { font-weight: 500; }
td.c-avail { white-space: normal; min-width: 150px; max-width: 210px; }
td.c-avail .sub { max-width: none; }
td.c-rc.w-ok { color: var(--good); }
td.c-rc.w-short .sub { color: var(--warn); white-space: normal; max-width: 112px; }
td .sub.when-md { display: none; max-width: none; white-space: normal; margin-top: 3px; color: var(--ink-2); }
.empty-row { text-align: center; padding: 28px 16px; color: var(--ink-3); cursor: default; }
td .fl { display: none; }
.tag { display: inline-block; font: 500 11px/1.4 var(--num); letter-spacing: .03em; padding: 0 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-3); margin-left: 4px; }
.tag.ns { background: var(--accent-soft); color: var(--accent); letter-spacing: 0; }
.neg { color: var(--ink-3); }
.pos { color: var(--red); }
.avail { font-size: 12.5px; display: inline-flex; flex-direction: column; }
.avail .dot { display: inline-block; }
.conf { font-size: 10.5px; font-weight: 500; padding: 0 5px; border-radius: 4px; margin-left: 4px; white-space: nowrap; line-height: 1.5; }
.conf.low { background: var(--warn-soft); color: var(--warn); }
.conf.med { background: var(--surface-3); color: var(--ink-2); }
.tablehint { padding: 8px 16px 6px; margin: 0; }
.star { border: 0; background: none; padding: 0 6px 0 0; margin-left: -2px; font-size: 14px; line-height: 1; color: var(--line-2); vertical-align: 0; }
.star:hover { color: var(--gold); }
.star.on { color: var(--gold); }

/* columns drop out as the screen narrows; the first cell picks up the airline and programme */
@media (max-width: 1240px) { .h-lg { display: none; } }
@media (max-width: 1040px) { .h-md { display: none; } tr.r td .sub.when-md { display: block; } table th, table td { padding: 8px 7px; } }
@media (max-width: 690px) { .h-sm { display: none; } }
@media (max-width: 440px) {
  .h-xs { display: none; }
  table th:first-child, table td:first-child { padding-left: 12px; }
  td.c-avail { min-width: 112px; }
  td .sub { max-width: 150px; }
}

tr.detail td { background: var(--surface-2); white-space: normal; padding: 18px 18px 20px; }
.det { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px 32px; position: sticky; left: 18px; max-width: min(1400px, calc(100vw - 80px)); }
.det h4 { margin: 4px 0 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: none; letter-spacing: .02em; }
.det dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: 13px; }
.det dt { color: var(--ink-3); }
.det dd { margin: 0; font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 500; }
.det p, .det li { font-size: 13px; color: var(--ink-2); margin: 4px 0; }
.det ol, .det ul { padding-left: 20px; margin: 4px 0; }
.links { display: flex; flex-wrap: wrap; gap: 6px; }
.links a { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 3px 9px; font-size: 12.5px; font-weight: 500; }
.days { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.days span { font: 500 11px var(--num); font-variant-numeric: tabular-nums; padding: 2px 6px; border-radius: 4px; background: var(--good-soft); color: var(--good); }
.days span.p { background: var(--warn-soft); color: var(--warn); }
.days span.none { background: none; color: var(--ink-3); font-weight: 400; }
.splitbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; }
.seg-b { min-width: 4px; }
.s-tax { background: var(--line-2); } .s-rc { background: var(--ink-2); } .s-save { background: var(--red); }
.splitlegend { display: flex; gap: 12px; font-size: 12px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.splitlegend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }

.foot { color: var(--ink-3); font-size: 12px; text-align: center; padding: 28px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .nav-in { padding: 0 16px; gap: 14px; height: 50px; }
  .logo span { display: none; }
  .wrap { padding: 18px 16px 40px; }
  .page-h h1 { font-size: 22px; }
  .lede { font-size: 13.5px; }
  .nb-text { font-size: 13px; }
  .nb-go { display: none; }
  .chiprow, .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chiprow::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
  .chip, .tab { flex: none; }
  .toolbar { gap: 8px; }
  .tb-end { margin-left: 0; width: 100%; justify-content: space-between; flex-wrap: wrap; row-gap: 6px; }
  .switch { white-space: nowrap; }
  .kpi { flex-basis: 30%; }
  .tb-group { width: 100%; }
  .tb-group .seg { flex: 1; }
  .sg small { display: none; }
  .board header p { display: none; }
  .kpi { padding: 6px 12px 10px; }
  .kpi input, .kpi b { font-size: 17px; }
  /* balances 3 across, then monthly earn + expiry, then the two answers side by side */
  .kpi:nth-child(n + 5) { flex-basis: 40%; }
  .acct:has([data-w="em"]) .kpi:not(.out) { flex-basis: 30%; } /* six inputs: 3 + 3 */
  .kpi:nth-child(2)::before, .kpi:nth-child(5)::before, .kpi:not(.out) + .kpi.out::before { display: none; }
  .kpi small { white-space: normal; }
  .regtiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rt { padding: 10px 12px; }
  .rt-v { font-size: 20px; }
  .boards { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 92%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .boards::-webkit-scrollbar { display: none; }
  .board { scroll-snap-align: center; }
  .bar { flex-basis: 120px; }
  .det { left: 12px; max-width: calc(100vw - 58px); grid-template-columns: 1fr; }
  .meta-line { text-align: left; }
}

/* =================== guide page =================== */
/* Editorial: one confident headline, the product's own numbers beside it, numbered
   sections, hairline-ruled panels. Weight tops out at 650; colour is for value only. */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 540px); gap: 48px; align-items: center; padding: 24px 0 36px; }
.eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 500; color: var(--red); letter-spacing: .02em; }
.hero h1 { margin: 0 0 18px; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.12; font-weight: 650; letter-spacing: -.03em; }
.hero-sub { margin: 0 0 26px; max-width: 32em; color: var(--ink-2); font-size: 16px; line-height: 1.75; }
.hero-sub b { color: var(--ink); font-weight: 600; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 14px/1 var(--sans); white-space: nowrap; cursor: pointer; }
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn.primary { background: var(--dark); border-color: var(--dark); color: var(--dark-ink); }
.btn.primary:hover { opacity: .88; }

/* hero panel: what 1 RC is worth, drawn from today's fares */
.vpanel { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); overflow: hidden; --vl: 140px; --vv: 72px; }
.vp-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vp-h b { font-size: 14px; font-weight: 600; color: var(--ink); }
.vp-body { padding: 10px 20px 4px; }
.vp-r { display: grid; grid-template-columns: var(--vl) minmax(0, 1fr) var(--vv); align-items: center; gap: 14px; }
.vp-l { display: flex; flex-direction: column; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.35; padding: 9px 0; }
.vp-l small { font-size: 11.5px; font-weight: 400; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vp-bar { position: relative; align-self: stretch; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); background-size: calc(100% / var(--n, 4)) 100%; box-shadow: inset -1px 0 var(--line); }
.vp-bar i { position: absolute; left: 0; top: 50%; height: 12px; width: var(--w); transform: translateY(-50%); background: var(--ink-3); border-radius: 0 4px 4px 0; }
.vp-r.hot .vp-bar i { background: var(--red); }
.vp-v { text-align: right; font: 600 15px/1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.vp-axis { display: flex; justify-content: space-between; margin: 0 calc(var(--vv) + 14px) 0 calc(var(--vl) + 14px); padding: 6px 0 10px; font: 11px/1 var(--num); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vp-axis span { flex: 0 0 0; width: 0; display: flex; justify-content: center; }
.vp-foot { margin: 0; padding: 11px 20px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--ink-3); }

/* table of contents: a ruled index, numbers match the section heads */
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 196px), 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 18px; }
.toc a { display: flex; align-items: baseline; gap: 10px; padding: 11px 16px; color: var(--ink); font-size: 13.5px; font-weight: 500; box-shadow: 1px 0 var(--line), 0 1px var(--line); }
.toc a:hover { background: var(--surface-2); text-decoration: none; }
.toc a i, .gh i { font: 500 12px/1 var(--num); font-style: normal; color: var(--red); letter-spacing: .03em; font-variant-numeric: tabular-nums; }

.gsec { margin: 56px 0 0; }
.gh { display: flex; align-items: baseline; gap: 12px; font-size: clamp(20px, 2.4vw, 24px); font-weight: 650; letter-spacing: -.02em; margin: 0 0 16px; }
.gh.sub { margin-top: 40px; font-size: 18px; }
.lead { color: var(--ink-2); margin: -6px 0 16px; max-width: 62em; }
.center { text-align: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.tile h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.tile p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* three definitions in one ruled panel */
.defs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.defs > div { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.defs > div + div { border-left: 1px solid var(--line); }
.df-k { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.df-v { font: 650 26px/1.2 var(--num); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.df-v small { font-size: 13px; font-weight: 400; color: var(--ink-3); letter-spacing: 0; }
.defs .hot .df-v { color: var(--red); }
.defs p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

.callout { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin: 14px 0; border: 1px solid transparent; }
.callout.tip { background: var(--accent-soft); color: var(--ink); border-color: color-mix(in srgb, var(--accent) 14%, transparent); }
.callout.warn { background: var(--warn-soft); color: var(--ink); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }

/* calculator */
.calc { padding: 22px 24px; }
.calc h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.calc-in { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; align-items: start; }
.rcin { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; font-weight: 500; font-size: 15px; color: var(--ink-2); }
.rcin input { width: 180px; font: 600 24px/1.1 var(--num); font-variant-numeric: tabular-nums; padding: 8px 12px; border-radius: 10px; color: var(--ink); }
.calc-out { display: grid; gap: 8px; }
.mo { background: var(--surface-2); border-radius: 10px; padding: 11px 14px; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; }
.mo span { font-weight: 500; font-size: 13.5px; }
.mo b { font: 650 22px/1.1 var(--num); font-variant-numeric: tabular-nums; text-align: right; letter-spacing: -.01em; }
.mo small { grid-column: 1 / -1; color: var(--ink-3); font-size: 12px; }
.calc-picks h3 { font-size: 14px; font-weight: 600; margin: 20px 0 10px; }
.picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pk { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); }
.pk:hover { text-decoration: none; border-color: var(--ink-3); }
.pk .thumb { width: 48px; height: 48px; }
.pk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 13.5px; }
.pk-info b { font-weight: 600; }
.pk .badge { align-self: flex-start; }

/* formula + worked example */
.example { padding: 0; overflow: hidden; }
.formula { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.f-name { font: 650 18px/1.2 var(--sans); color: var(--red); }
.f-op { font: 400 20px/1 var(--num); color: var(--ink-3); }
.f-frac { display: inline-flex; flex-direction: column; align-items: center; font: 500 15px/1.3 var(--sans); }
.f-frac span:first-child { border-bottom: 1.5px solid var(--ink); padding: 0 8px 4px; }
.f-frac span:last-child { padding-top: 4px; }
.f-note { flex: 1 1 260px; color: var(--ink-2); font-size: 13.5px; padding-left: 18px; margin-left: 4px; border-left: 1px solid var(--line-2); }
.ex-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 20px 22px 0; }
.ex-k { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.ex-head h3 { margin: 2px 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.ex-head p { margin: 0; }
.ex-big { display: flex; flex-direction: column; align-items: flex-end; }
.ex-big b { font: 650 36px/1 var(--num); color: var(--red); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ex-big span { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.ex-split { padding: 20px 22px 0; }
.xs-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.xs-top b { font: 600 15px var(--num); font-variant-numeric: tabular-nums; color: var(--ink); }
.xs-bar { display: flex; gap: 2px; height: 14px; }
.xs-bar i { min-width: 3px; }
.xs-bar i:first-child { border-radius: 4px 0 0 4px; }
.xs-bar i:last-child { border-radius: 0 4px 4px 0; }
.xs-legend { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.xs-legend span { display: inline-flex; align-items: center; gap: 6px; }
.xs-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.xs-legend b { font: 600 13px var(--num); font-variant-numeric: tabular-nums; color: var(--ink); }
.ex-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; border-top: 1px solid var(--line); }
.ex-rows > div { padding: 12px 22px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-rows > div + div { border-left: 1px solid var(--line); }
.ex-rows span { font-size: 12px; color: var(--ink-3); }
.ex-rows b { font: 600 14.5px/1.4 var(--num); font-variant-numeric: tabular-nums; }
.ex-rows em { font-style: normal; color: var(--red); }
.red { color: var(--red); }

/* route map: typed nodes, edges labelled with the ratio */
.fmap { background-color: var(--surface); background-image: radial-gradient(var(--line) 1px, transparent 1.2px); background-size: 14px 14px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px 20px; }
.fm-cols, .fm-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr) 76px minmax(0, 1fr); align-items: stretch; }
.fm-cols { font-size: 11.5px; color: var(--ink-3); font-weight: 500; letter-spacing: .04em; padding-bottom: 10px; }
.fm-row + .fm-row { margin-top: 14px; }
.fm-node { background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 13px; display: flex; flex-direction: column; gap: 1px; min-width: 0; box-shadow: var(--shadow); }
.fm-node small { font-size: 11px; color: var(--ink-3); }
.fm-node b { font-size: 14px; font-weight: 600; }
.fm-node span { font-size: 12px; color: var(--ink-2); }
.fm-edge { position: relative; display: flex; align-items: center; justify-content: center; min-height: 40px; --e: var(--ink-3); }
.fm-edge.hi { --e: var(--red); }
.fm-edge::before { content: ""; position: absolute; left: 4px; right: 6px; top: 50%; border-top: 1.5px solid var(--e); }
.fm-edge::after { content: ""; position: absolute; right: 2px; top: calc(50% + .75px); transform: translateY(-50%); border: 4.5px solid transparent; border-left: 6px solid var(--e); border-right: 0; }
.fm-edge span { position: relative; transform: translateY(-12px); font: 600 12px/1.3 var(--num); color: var(--e); white-space: nowrap; }
.fm-edge:not(.hi) span { color: var(--ink-2); }

/* ratio + spend tables */
.tbl-card { padding: 4px 0; }
.gtable th, .gtable td { white-space: normal; }
.gtable th { cursor: default; position: static; }
.gtable small { font-weight: 400; }
.ratio { display: inline-block; font: 600 12.5px/1.5 var(--num); font-variant-numeric: tabular-nums; padding: 0 7px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); }
.ratio.hi { background: var(--red-soft); color: var(--red); }
.gtable td.best { color: var(--red); font-weight: 600; }
.facts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; color: var(--ink-2); font-size: 13.5px; }
.facts li { padding-left: 14px; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }

/* steps: one ruled panel, 01–08 down the left */
.stepper { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stepper li { display: grid; grid-template-columns: 52px minmax(0, 1fr); padding: 18px 22px 18px 20px; }
.stepper li + li { border-top: 1px solid var(--line); }
.sn { font: 600 13px/1.7 var(--num); color: var(--red); letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.sc { min-width: 0; }
.sc h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -.005em; }
.sc p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.mini-item { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 12px; flex-wrap: wrap; }
.mini-item .thumb { width: 48px; height: 48px; }
.mi-info { display: flex; flex-direction: column; gap: 1px; min-width: 140px; }
.mi-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.pin { font-size: 11.5px; font-weight: 500; color: var(--ink-3); }
.legend-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.legend-cards div { background: var(--surface-2); border-radius: 9px; padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 4px; font-size: 13.5px; }
.legend-cards b { font-weight: 600; }
.legend-cards span { grid-column: 2; color: var(--ink-3); font-size: 12.5px; }
.logos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.logos > span { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-size: 13px; font-weight: 500; }
.calcline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 500; margin: 10px 0; }
.calcline span { background: var(--surface-2); padding: 5px 10px; border-radius: 8px; }
.calcline b { color: var(--red); font-weight: 650; }

/* upgrade cards */
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.dc-head { margin-bottom: 12px; }
.dc-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.dc-head p { margin: 2px 0 0; }
.dcard > p { color: var(--ink-2); font-size: 13.5px; margin: 8px 0 0; }
.compare { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 12px; }
.compare > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px; color: var(--ink-2); }
.compare b { font: 600 13.5px var(--num); font-variant-numeric: tabular-nums; color: var(--ink); }
.cbar { grid-column: 1 / -1; height: 8px; border-radius: 0 4px 4px 0; overflow: hidden; order: 3; }
.cbar i { display: block; height: 100%; background: var(--ink-3); border-radius: 0 4px 4px 0; }
.cbar.hot i { background: var(--red); }
.yn { list-style: none; padding: 12px 0 0; margin: 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); }

/* timing gantt */
.gantt { padding: 16px 20px; }
.g-months, .g-row { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 10px; }
.g-months { grid-template-columns: 230px repeat(12, minmax(0, 1fr)); gap: 0; font: 500 11.5px var(--num); color: var(--ink-3); text-align: center; margin-bottom: 6px; }
.g-months span:first-child { text-align: left; }
.g-row { padding: 6px 0; border-top: 1px solid var(--line); }
.g-lbl { font-size: 13px; font-weight: 500; }
.g-track { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); height: 14px; background: repeating-linear-gradient(90deg, var(--surface-2) 0 calc(100%/12 - 2px), transparent calc(100%/12 - 2px) calc(100%/12)); border-radius: 4px; }
.g-track i { grid-row: 1; height: 100%; border-radius: 4px; }
.g-bonus { background: var(--good); }
.g-peak { background: color-mix(in srgb, var(--red) 70%, transparent); }
.g-legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }
.g-legend i { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }

/* warnings: a ruled two-column list */
.warns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.w { position: relative; padding: 14px 20px 15px 46px; border-top: 1px solid var(--line); }
.w:nth-child(-n + 2) { border-top: 0; }
.w:nth-child(even) { border-left: 1px solid var(--line); }
.w::before { content: "!"; position: absolute; left: 18px; top: 16px; width: 16px; height: 16px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); font: 700 11px/16px var(--num); text-align: center; }
.w h3 { margin: 0 0 2px; font-size: 14.5px; font-weight: 600; }
.w p { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* FAQ: one panel of hairline-split questions */
.faq { padding: 0; overflow: hidden; }
.faq .fold + .fold { border-top: 1px solid var(--line); }
.faq .fold > summary { padding: 15px 20px; font-weight: 500; }
.faq .fold p { color: var(--ink-2); margin: 0; padding: 0 20px 16px; max-width: 72em; }

.cta { margin: 48px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; padding: 22px 26px; border-radius: 14px; background: var(--dark); color: var(--dark-ink); }
.cta b { font-size: 18px; font-weight: 600; margin-right: 10px; }
.cta span { opacity: .72; }
.cta .btn.primary { background: var(--dark-ink); color: var(--dark); border-color: var(--dark-ink); }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 12px; }
  .calc-in, .grid2 { grid-template-columns: 1fr; }
  .picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hero-sub { font-size: 15px; }
  .vpanel { --vl: 104px; --vv: 64px; }
  .vp-h, .vp-body, .vp-foot { padding-left: 14px; padding-right: 14px; }
  .vp-r { gap: 10px; }
  .vp-axis { margin: 0 calc(var(--vv) + 10px) 0 calc(var(--vl) + 10px); }
  .vp-l { font-size: 13px; }
  .vp-l small { white-space: normal; }
  .gsec { margin-top: 44px; }
  .defs, .ex-rows, .warns { grid-template-columns: 1fr; }
  .defs > div + div, .ex-rows > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .w:nth-child(even) { border-left: 0; }
  .w:nth-child(2) { border-top: 1px solid var(--line); }
  .grid3, .facts, .legend-cards { grid-template-columns: 1fr; }
  .picks { grid-template-columns: 1fr; }
  .f-note { border-left: 0; padding-left: 0; margin-left: 0; }
  .ex-head, .ex-split, .formula { padding-left: 16px; padding-right: 16px; }
  .ex-rows > div { padding-left: 16px; padding-right: 16px; }
  .ex-big { align-items: flex-start; }
  /* the route map runs top to bottom */
  .fmap { padding: 14px; }
  .fm-cols { display: none; }
  .fm-row { grid-template-columns: 1fr; }
  .fm-row + .fm-row { margin-top: 22px; }
  .fm-edge { justify-content: flex-start; min-height: 36px; }
  .fm-edge::before { left: 22px; right: auto; top: 3px; bottom: 9px; border-top: 0; border-left: 1.5px solid var(--e); }
  .fm-edge::after { left: calc(22px - 3.75px); right: auto; top: auto; bottom: 3px; transform: none; border: 4.5px solid transparent; border-top: 6px solid var(--e); border-bottom: 0; }
  .fm-edge span { transform: none; margin-left: 36px; }
  .g-months { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .g-months span:first-child { display: none; }
  .g-row { grid-template-columns: 1fr; gap: 4px; }
  .stepper li { grid-template-columns: 36px minmax(0, 1fr); padding: 16px 16px 16px 14px; }
  .rcin input { width: 150px; }
  .cta { padding: 18px 20px; }
}

/* ---------- trip planner (plan.html) ---------- */
.dot.o { background: #2f7de1; }
.pctl { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.pctl .fsel select { max-width: 240px; }
.planner { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 16px; align-items: start; }
.cals { display: grid; gap: 12px; position: sticky; top: 64px; }
.cals .card { margin-bottom: 0; }
.pres { min-width: 0; }
.cal { padding: 14px; min-width: 0; }
.cal-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 14px; }
.pill { background: var(--dark); color: var(--dark-ink); border-radius: 999px; padding: 2px 10px; font: 700 12.5px/1.5 var(--sans); }
.linkbtn { border: 0; background: none; color: var(--accent); font: 600 12.5px var(--sans); cursor: pointer; padding: 2px 4px; }
.linkbtn.more { display: block; margin: 8px auto 0; }
.months { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.cal-nav { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.cal-nav .fchip { padding: 2px 9px; font-size: 15px; }
.cal-nav .fchip:disabled { opacity: .35; cursor: default; }
.mon-h { font: 800 13px/1.4 var(--sans); margin-bottom: 4px; }
.wk, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.wk i { font: 600 10.5px/1.6 var(--sans); color: var(--ink-3); text-align: center; font-style: normal; }
.cd { aspect-ratio: 1 / .9; min-width: 0; border: 1px solid transparent; border-radius: 7px; background: var(--surface-2); color: var(--ink-3); padding: 1px 0 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font: 600 12px/1.15 var(--num); }
.cd small { font: 700 9.5px/1.1 var(--num); }
.cd:disabled { opacity: .3; cursor: default; }
.cd.k-u { background: transparent; border-color: var(--line); }
.cd.k-n { background: var(--red-soft); color: color-mix(in srgb, var(--red) 70%, var(--ink-3)); }
.cd.k-y { background: var(--good-soft); color: var(--good); }
.cd.k-p { background: var(--warn-soft); color: var(--warn); }
.cd.k-o { background: color-mix(in srgb, #2f7de1 15%, var(--surface)); color: #2f7de1; }
.cd.trip { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--accent) 45%, transparent); }
.cd.sel { background: var(--dark); color: var(--dark-ink); border-color: var(--dark); }
.cd:not(:disabled):hover { border-color: var(--ink-3); }
.legcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; }
.legs { padding: 14px; }
.legs-h { font-size: 14.5px; font-weight: 800; margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.legs-h .muted { font-weight: 500; }
.legs-h input { width: 52px; font: 600 12.5px var(--num); padding: 2px 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); }
.pad { margin: 6px 2px; }
.lo { border-top: 1px solid var(--line); padding: 10px 2px; display: grid; gap: 6px; }
.lo.on { background: color-mix(in srgb, var(--accent-soft) 60%, transparent); border-radius: 10px; padding: 10px 8px; }
.lo-t { font: 600 14px/1.3 var(--num); }
.lo-t sup { font-size: 10px; color: var(--red); }
.lo-r { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lo-ps { display: flex; flex-wrap: wrap; gap: 6px; }
.lp { display: grid; text-align: left; gap: 1px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 5px 9px; cursor: pointer; font: 12px/1.3 var(--sans); }
.lp:hover { border-color: var(--ink-3); }
.lp.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.lp-n { font-weight: 800; display: flex; align-items: center; }
.lp-v { font: 700 12.5px/1.3 var(--num); }
.lp-s { color: var(--ink-3); font-size: 11px; }
.trip { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.trip-h { font-size: 16px; margin-bottom: 6px; }
.tl { border-top: 1px solid var(--line); padding: 8px 0; display: grid; gap: 3px; font-size: 13.5px; }
.tl-r { font-size: 12.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tl-p a { margin-left: 6px; white-space: nowrap; }
.trip-tot { border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; line-height: 1.8; }
.trip-tot .pos { color: var(--good); }
.trip-tot .neg { color: var(--red); }
.combo { width: 100%; display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; color: var(--ink); padding: 9px 4px; cursor: pointer; font: 13px/1.5 var(--sans); }
.combo:hover { background: var(--surface-2); }
.cb-d small, .cb-v small { display: block; color: var(--ink-3); font-size: 11.5px; }
.cb-l { font-size: 12.5px; min-width: 0; }
.cb-v { text-align: right; font-family: var(--num); }
.cb-v .badge { margin-top: 3px; }
.trip-tot .badge { vertical-align: 1px; }
@media (max-width: 1100px) {
  .planner { grid-template-columns: 1fr; }
  .cals { position: static; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
}
@media (max-width: 480px) {
  .months { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .combo { grid-template-columns: 1fr auto; }
  .cb-l { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- 儲分 · EveryMile (earn.html) ---------- */
.earn { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 14px; align-items: start; }
.ein { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 6px; }
.ch { margin: 4px 0 8px; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ch .muted { font-weight: 400; }
.ein .ch:not(:first-child) { margin-top: 14px; }
.spend { display: flex; flex-direction: column; }
.sp { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.sp:first-child { border-top: 0; padding-top: 2px; }
.sp > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.sp b { font-weight: 500; font-size: 13.5px; }
.sp small { color: var(--ink-3); font-size: 11.5px; }
.sp-in { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.sp-in input { width: 108px; text-align: right; font: 600 15px/1.3 var(--num); font-variant-numeric: tabular-nums; padding: 5px 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opts .sg { flex-direction: column; align-items: flex-start; gap: 0; }
.assume { border: 0; margin-top: 10px; border-top: 1px solid var(--line); border-radius: 0; }
.assume > summary { padding: 12px 0 8px; font-size: 13px; }
.assume > :not(summary) { padding: 0 0 4px; }
.agrid { display: grid; gap: 6px; }
.ar { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.ar input { text-align: right; font: 500 13px var(--num); font-variant-numeric: tabular-nums; padding: 3px 7px; }
.ar input.ovr { border-color: var(--warn); background: var(--warn-soft); }
.eout { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.earn .card { margin-bottom: 0; }
.earn { margin-bottom: 14px; }
.verdict { padding: 18px 20px; }
.v-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.v-tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.v-good .v-tag { background: var(--good-soft); color: var(--good); }
.v-bad .v-tag { background: var(--surface-3); color: var(--ink-2); }
.v-net { font: 650 32px/1.1 var(--num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.v-good .v-net { color: var(--good); }
.v-bad .v-net { color: var(--ink-2); }
.v-net small { font-size: 14px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.v-why { margin: 8px 0 14px; color: var(--ink-2); font-size: 13.5px; }
.v-why b { color: var(--ink); font-variant-numeric: tabular-nums; }
.v-eq { display: grid; grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr) auto minmax(0, 1fr); gap: 0 14px; align-items: start; border-top: 1px solid var(--line); padding-top: 12px; }
.v-eq > div { display: flex; flex-direction: column; min-width: 0; }
.v-eq > i { font: 400 20px/1 var(--num); font-style: normal; color: var(--ink-3); align-self: center; }
.v-eq span { font-size: 12px; color: var(--ink-3); }
.v-eq b { font: 600 19px/1.3 var(--num); font-variant-numeric: tabular-nums; }
.v-eq small { font-size: 11.5px; color: var(--ink-3); }
.v-eq + .v-why { margin: 12px 0 0; }
.v-sub { margin: 16px 0 4px; font-size: 13.5px; font-weight: 600; }
.v-sub .muted { font-weight: 400; font-size: 12px; margin-left: 6px; }
.v-tix { width: 100%; }
.v-tix td:first-child small { display: block; }
.etable th { cursor: default; position: static; }
.etable th small { font-weight: 400; }
.etable td { vertical-align: middle; }
.etable tr.tot td { font-weight: 600; background: var(--surface-2); }
.pick-em { color: var(--good); font-weight: 500; }
.pick-red { color: var(--ink-2); }
#chart { position: relative; }
.bechart { width: 100%; height: auto; display: block; touch-action: none; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-ax { fill: var(--ink-3); font: 11px var(--num); font-variant-numeric: tabular-nums; }
.c-lbl { fill: var(--ink-2); font: 500 11.5px var(--sans); }
.c-feel { fill: var(--red); }
.c-line { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.c-fee { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 5 4; }
.c-be { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; }
.c-you { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.c-cross { stroke: var(--ink-3); stroke-width: 1; }
.c-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.c-tipbox { position: absolute; top: 0; transform: translateX(-50%); background: var(--dark); color: var(--dark-ink); font-size: 12px; padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-2); }
.grid-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.note { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.note h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.note p { margin: 0; font-size: 13px; color: var(--ink-2); }
@media (max-width: 960px) {
  .earn { grid-template-columns: minmax(0, 1fr); }
  .ein { position: static; }
  /* one column: the answer first, then the inputs that drive it, then the detail */
  .eout { display: contents; }
  .eout > .verdict { order: -1; }
  .eout > :not(.verdict) { order: 1; }
}
@media (max-width: 560px) {
  .v-eq { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; }
  .v-eq > i { display: none; }
  .v-eq > div:first-child { grid-column: 1 / -1; }
  .c-tipbox { white-space: normal; width: 220px; }
}
.w-ok { color: var(--good); font-weight: 600; }
.w-short { color: var(--warn); font-weight: 600; }
/* guide: type-led, emoji-free */
.yn li { position: relative; padding-left: 18px; }
.yn li::before { position: absolute; left: 0; font-weight: 700; }
.yn li.y::before { content: "✓"; color: var(--good); }
.yn li.n::before { content: "✕"; color: var(--red); }
.gtable.rules { table-layout: fixed; width: 100%; }
.gtable.rules th:first-child { width: 10%; }
.gtable.rules td { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); vertical-align: top; padding: 9px 8px; }
.gtable.rules td b { color: var(--ink); }
.gtable.rules td:first-child small { display: block; color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.unc { color: var(--ink-3); font-size: 11.5px; }
.rnote { margin: 0 0 12px; padding: 12px 16px 12px 32px; background: var(--surface-2); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 6px 28px; }
.rnote b { color: var(--ink); }
@media (max-width: 1000px) {
  /* each programme becomes a card of label / value rows */
  .gtable.rules, .gtable.rules tbody, .gtable.rules tr, .gtable.rules td { display: block; width: auto; }
  .gtable.rules thead { display: none; }
  .gtable.rules tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .gtable.rules td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 3px 0; border: 0; }
  .gtable.rules td::before { content: attr(data-l); color: var(--ink-3); font-size: 12px; }
  .gtable.rules td:first-child { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; font-size: 14px; }
  .gtable.rules td:first-child::before { content: none; }
}
.exp-warn { margin-left: auto; color: var(--warn); font-weight: 600; font-size: 12px; }
.exp-warn:empty { display: none; }
.kpi input[type="month"] { font-size: 14px; min-width: 0; height: 32px; }
.kpi input[type="month"].blank:not(:focus) { color: transparent; }
.kpi input[type="month"].blank:not(:focus)::-webkit-datetime-edit { color: transparent; }
.etable td small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.etable td.num small b { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.etable th, .etable td { white-space: nowrap; }
.etable td:first-child { white-space: normal; min-width: 96px; }
.perks input { width: 90px; }
.m-only { display: none !important; }
@media (max-width: 560px) {
  /* phone: rates fold into the category cell, the table keeps 3 columns */
  .m-only { display: block !important; white-space: normal !important; }
  .etable td:first-child { min-width: 0; }
  #split th:nth-child(n+2):nth-child(-n+4), #split td:nth-child(n+2):nth-child(-n+4) { display: none; }
  #vpmTable th:nth-child(3), #vpmTable td:nth-child(3), #vpmTable th:nth-child(6), #vpmTable td:nth-child(6) { display: none; }
  .v-tix th:nth-child(2), .v-tix td:nth-child(2), .v-tix th:nth-child(4), .v-tix td:nth-child(4) { display: none; }
  .etable th { white-space: normal; }
  .etable th, .etable td { padding-left: 6px; padding-right: 6px; }
}
@media (max-width: 560px) {
  /* "RC per HK$100" repeats the % column, so phones drop it */
  .gtable.earnrate th:nth-child(3), .gtable.earnrate td:nth-child(3) { display: none; }
  .gtable.earnrate th, .gtable.earnrate td { padding-left: 5px; padding-right: 5px; }
  .tabs { flex-wrap: wrap; overflow: visible; }
}

/* 新放位: award days first seen in the last NEW_HOURS */
.days span.new { box-shadow: inset 0 0 0 1.5px currentColor; font-weight: 700; }

/* 行動倒數 (leaderboard detail): date | step */
.tl { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 5px; }
.tl li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 13px; }
.tl time { font: 600 12px var(--num); font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }
.tl small { display: block; font-size: 11.5px; color: var(--ink-3); }
.tl li.warn small { color: var(--warn); }
.tl-acc { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.tl-acc .chk { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }

/* theme switch (theme.js adds it to the end of the nav bar) */
.theme-btn { flex: none; margin-left: auto; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.theme-btn:hover { color: var(--ink); border-color: var(--line-2); }
.theme-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
