/* card.sg — design tokens */
:root {
  --bg: #f6f6f3; --surface: #ffffff; --surface-2: #fafaf8; --ink: #14161a; --ink-2: #3b4048; --muted: #6b7079;
  --line: #e4e4df; --line-2: #d6d6d0; --accent: #d7263d; --accent-ink: #a5122a; --accent-soft: #fdecee;
  --good: #0f7a4f; --good-soft: #e7f5ee; --miles: #1d4ed8; --miles-soft: #e8eefc; --cash: #0f7a4f; --cash-soft: #e7f5ee;
  --warn: #9a5b00; --warn-soft: #fff4e0; --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20,22,26,.04), 0 4px 16px rgba(20,22,26,.05);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1114; --surface: #171a1f; --surface-2: #1c2026; --ink: #f1f2f4; --ink-2: #c9ccd2; --muted: #9298a2;
    --line: #2a2f37; --line-2: #353b44; --accent: #ff5a6e; --accent-ink: #ff8a98; --accent-soft: #3a1a20;
    --good: #4ad596; --good-soft: #13291f; --miles: #8fb0ff; --miles-soft: #1a2440; --cash: #4ad596; --cash-soft: #13291f;
    --warn: #ffc163; --warn-soft: #33270f; --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo svg { width: 30px; height: 22px; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14.5px; padding: 8px 10px; border-radius: 8px; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
@media (max-width: 640px) { .nav a.hide-sm { display: none; } .nav a { padding: 8px 7px; font-size: 14px; } }

/* hero */
.hero { padding: 36px 0 18px; }
.hero h1 { font-size: clamp(28px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.025em; font-weight: 800; max-width: 22ch; }
.hero p { color: var(--ink-2); font-size: clamp(16px, 1.8vw, 18px); margin-top: 10px; max-width: 60ch; }
.trust { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.trust span::before { content: '✓'; color: var(--good); font-weight: 800; margin-right: 6px; }

/* layout */
.finder { display: grid; grid-template-columns: 1fr; gap: 20px; padding-bottom: 96px; }
@media (min-width: 980px) { .finder { grid-template-columns: 430px 1fr; align-items: start; } .panel-in { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-in { padding: 18px; }
.step { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 4px 0 10px; }
.step + .step { margin-top: 22px; }

/* goal segmented */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.goal-btn { font: inherit; font-weight: 700; font-size: 14.5px; border: 0; background: transparent; color: var(--ink-2); padding: 10px 6px; border-radius: 9px; cursor: pointer; }
.goal-btn.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* presets */
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { font: inherit; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.preset.is-on { border-color: var(--ink); background: var(--ink); color: var(--surface); }

/* spend rows */
.sp-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 0 8px; }
.sp-total { font-weight: 800; font-size: 15px; }
.sp-row { display: grid; grid-template-columns: 1fr 118px; grid-template-rows: auto auto; column-gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.sp-label { font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.sp-hint { display: block; font-weight: 500; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sp-ctrl { position: relative; align-self: center; }
.sp-cur { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; font-weight: 600; pointer-events: none; }
.sp-num { width: 100%; font: inherit; font-weight: 700; font-size: 16px; text-align: right; padding: 9px 11px 9px 36px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); }
.sp-num:focus { border-color: var(--ink); }
.sp-range { grid-column: 1 / -1; width: 100%; margin-top: 8px; accent-color: var(--accent); height: 22px; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--accent-ink); padding: 10px 0; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: '+ '; } details.more[open] summary::before { content: '− '; }

/* options */
.opts { display: grid; gap: 12px; }
.sw { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; cursor: pointer; }
.sw input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.sw small { display: block; color: var(--muted); font-size: 12.5px; }
.opt-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 14.5px; }
.opt-row input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--miles); }
.inc { display: grid; grid-template-columns: 1fr 140px; gap: 8px; }
.inc input, .inc select { font: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); color: var(--ink); width: 100%; }
#sp-help, .fine { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* results */
.res-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 12px; scroll-margin-top: 76px; }
.res-head h2 { font-size: 20px; letter-spacing: -.01em; }
#summary { color: var(--ink-2); font-size: 14.5px; }
.btn { font: inherit; font-weight: 700; font-size: 14px; border-radius: 10px; padding: 9px 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn-primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn-primary:hover { color: var(--surface); opacity: .9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
#results { list-style: none; display: grid; gap: 12px; }
.res { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.res.is-top { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.res.is-dim { opacity: .62; }
.res-main { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: start; }
.res-rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.is-top .res-rank { background: var(--accent); color: #fff; border-color: var(--accent); }
.res-bank { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.res-name { font-size: 18px; line-height: 1.25; letter-spacing: -.01em; }
.res-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tag-miles { background: var(--miles-soft); color: var(--miles); border-color: transparent; }
.tag-cashback { background: var(--cash-soft); color: var(--cash); border-color: transparent; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.res-val { text-align: right; }
.res-net { font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.res-net span { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.res-sub, .res-fee { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.res-why { margin: 10px 0 0 46px; font-size: 14px; color: var(--ink-2); }
.res-actions { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 10px 0 0 46px; }
.lnk { font: inherit; font-size: 14px; font-weight: 700; background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 4px 0; text-decoration: none; }
.lnk:hover { text-decoration: underline; }
.cmp { font-size: 14px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; cursor: pointer; color: var(--ink-2); }
.cmp input { width: 17px; height: 17px; accent-color: var(--ink); }
@media (max-width: 560px) {
  .res-main { grid-template-columns: 30px 1fr; } .res-val { grid-column: 2; text-align: left; margin-top: 6px; }
  .res-why, .res-actions { margin-left: 42px; }
}
.bd-wrap { margin: 14px 0 0; border-top: 1px dashed var(--line-2); padding-top: 12px; }
.bd { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.bd th, .bd td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.bd th { font-size: 12px; color: var(--muted); font-weight: 700; }
.bd .n { text-align: right; white-space: nowrap; }
.bd tfoot td { font-weight: 800; border-bottom: 0; }
.bd .is-cap td { color: var(--warn); }
.bd-note, .bd-links { font-size: 13.5px; margin-top: 8px; }
.bd-cav { margin: 8px 0 0 18px; font-size: 13px; color: var(--ink-2); }
.bd-cav li { margin-bottom: 4px; }

/* sticky bars */
.sticky-m { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
.sticky-m p { font-size: 13.5px; line-height: 1.3; } .sticky-m strong { display: block; font-size: 14.5px; }
@media (min-width: 980px) { .sticky-m { display: none; } }
.cmpbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 76px; z-index: 30; background: var(--ink); color: var(--surface); border-radius: 999px; padding: 8px 8px 8px 18px; display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-size: 14px; font-weight: 600; }
@media (min-width: 980px) { .cmpbar { bottom: 24px; } }
.cmpbar .btn { padding: 7px 12px; } .cmpbar .btn-primary { background: var(--accent); border-color: var(--accent); }
.cmpbar .btn-ghost { background: transparent; color: var(--surface); border-color: rgba(255,255,255,.35); }
[hidden] { display: none !important; }
#toast { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: 10px; font-size: 14px; z-index: 40; }
dialog#cmp-dlg { border: 0; border-radius: var(--radius); padding: 0; width: min(980px, 96vw); max-height: 88vh; background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(10,12,16,.5); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.dlg-body { padding: 8px 18px 18px; overflow: auto; }
.cmp-t { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp-t th, .cmp-t td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.cmp-t tbody th { font-size: 12.5px; color: var(--muted); width: 22%; }
.cmp-t ul { margin-left: 16px; } .cmp-t li { margin-bottom: 4px; }

/* content pages */
.page { max-width: 820px; margin: 0 auto; padding: 28px 16px 64px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 12px; } .crumbs a { color: var(--muted); }
.page h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 8px; }
.page h2 { font-size: 21px; margin: 28px 0 10px; letter-spacing: -.01em; }
.page h3 { font-size: 17px; margin: 18px 0 6px; }
.page p, .page li { color: var(--ink-2); } .page p { margin-bottom: 12px; }
.page ul, .page ol { margin: 0 0 14px 20px; } .page li { margin-bottom: 6px; }
.lede { font-size: 18px; color: var(--ink-2); }
.facts { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0 8px; font-size: 15px; }
.facts th, .facts td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 38%; color: var(--muted); font-weight: 700; font-size: 14px; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }
.note { background: var(--warn-soft); color: var(--ink); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14.5px; margin: 12px 0; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; list-style: none; margin: 12px 0 0 !important; }
.card-grid li { margin: 0; }
.card-grid a { display: block; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); height: 100%; }
.card-grid a:hover { border-color: var(--ink); }
.card-grid .cg-bank { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.card-grid .cg-name { font-weight: 800; font-size: 16px; margin: 2px 0 6px; }
.card-grid .cg-sum { font-size: 13.5px; color: var(--ink-2); }
.src { font-size: 13.5px; word-break: break-word; }
.tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.tool label { display: block; font-weight: 700; font-size: 14.5px; margin: 10px 0 6px; }
.tool input, .tool select { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; width: 100%; background: var(--surface); color: var(--ink); }
.tool .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .tool .row2 { grid-template-columns: 1fr; } }
.big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 4px; font-variant-numeric: tabular-nums; }
.awards { width: 100%; border-collapse: collapse; font-size: 14.5px; margin-top: 10px; }
.awards th, .awards td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; } .awards .n { text-align: right; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: 26px 0 90px; font-size: 14px; color: var(--muted); }
@media (min-width: 980px) { .foot { padding-bottom: 32px; } }
.foot .wrap { display: grid; gap: 14px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot a { color: var(--ink-2); text-decoration: none; } .foot a:hover { text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* SEO sections */
.home-more { padding-top: 36px; padding-bottom: 24px; }
.home-more h2 { font-size: 22px; letter-spacing: -.01em; margin: 26px 0 6px; }
.res-name a { color: inherit; text-decoration: none; } .res-name a:hover { text-decoration: underline; }
.faq { display: grid; gap: 8px; margin: 12px 0 16px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 13px 0; list-style: none; color: var(--ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--muted); font-weight: 600; } .faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 14px; color: var(--ink-2); }
.rank-list { list-style: none; display: grid; gap: 12px; margin: 14px 0 18px !important; padding: 0; }
.rank-list .res-why, .rank-list .res-actions { margin-left: 46px; }
.prof { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0 8px; font-variant-numeric: tabular-nums; }
.prof th, .prof td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.prof td.n, .prof th.n { text-align: right; }
.prof thead th { font-size: 13px; color: var(--muted); }
.prof tr:last-child td { border-bottom: 0; }
