:root {
  --paper: #F3F6F2;
  --surface: #FFFFFF;
  --ink: #12301F;
  --ink-2: #4B5D52;
  --line: #D5DED7;
  --deep: #123524;
  --deep-2: #1C4A33;
  --on-deep: #E8F0EA;
  --on-deep-2: #A9C2B1;
  --saffron: #F2A516;
  --saffron-soft: #FFF2D3;
  --saffron-ink: #6B4500;
  --good: #1F6F4A;
  --fee: #9A3B22;
  --radius-s: 6px;
  --radius-l: 14px;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1A14; --surface: #16241C; --ink: #E4EEE7; --ink-2: #A3B6AA; --line: #2A3D31;
    --deep: #0B2417; --deep-2: #163A27; --saffron-soft: #3A2C0B; --saffron-ink: #FFD27A; --good: #6CC79A; --fee: #F0A08A;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--body); font-variant-numeric: tabular-nums; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 3px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 800; max-width: 18ch; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 700; }
.lede { color: var(--ink-2); max-width: 62ch; margin: .75rem 0 0; font-size: 1.05rem; }
.fine { color: var(--ink-2); font-size: .85rem; margin: .75rem 0 0; }
.empty-state { color: var(--ink-2); padding: 1rem 0; }

/* header */
.site-head { background: var(--deep); color: var(--on-deep); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { font: 800 1.4rem var(--display); text-decoration: none; letter-spacing: -0.02em; }
.brand-dot { color: var(--saffron); font-weight: 500; }
.site-nav { display: flex; gap: .25rem; }
.site-nav a { text-decoration: none; padding: .45rem .75rem; border-radius: 999px; color: var(--on-deep-2); font-weight: 500; font-size: .95rem; }
.site-nav a:hover { color: var(--on-deep); }
.site-nav a[aria-current] { background: var(--deep-2); color: var(--on-deep); }

/* rates hero */
.rates { background: var(--deep); color: var(--on-deep); padding: 2.5rem 0 3rem; }
.rates .lede, .rates .fine { color: var(--on-deep-2); }
.rates-intro { display: grid; gap: .25rem; }
.ticker { display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; margin: 2rem 0 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--deep-2); }
.ticker > div { display: grid; }
.t-label { font-size: .82rem; color: var(--on-deep-2); }
.t-val { font: 700 1.9rem/1.1 var(--display); color: var(--saffron); }
.t-val.small { font-size: 1.05rem; color: var(--on-deep); font-family: var(--body); font-weight: 500; padding-top: .45rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; background: var(--surface); color: var(--ink); border-radius: var(--radius-l); overflow: hidden; }
.matrix th, .matrix td { padding: .8rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix thead th { font-size: .82rem; font-weight: 600; color: var(--ink-2); background: var(--surface); border-bottom: 2px solid var(--line); }
.matrix .num { text-align: right; }
.sort { all: unset; cursor: pointer; white-space: nowrap; }
.sort:hover { color: var(--ink); text-decoration: underline; }
th[aria-sort] .sort { color: var(--ink); }
th[aria-sort] .sort::after { content: ' ↓'; }
.prov { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 150px; }
.prov-h { position: sticky; left: 0; z-index: 2; }
.prov-name { display: block; font: 700 1.05rem var(--display); }
.btn-send { display: inline-block; margin-top: .3rem; font-size: .8rem; color: var(--good); font-weight: 600; text-decoration: none; }
.btn-send:hover { text-decoration: underline; }
.rate { display: block; font: 700 1.3rem/1.2 var(--display); }
.fee { display: block; font-size: .8rem; color: var(--fee); }
.fee.free { color: var(--good); }
td.best { background: var(--saffron-soft); box-shadow: inset 0 3px 0 var(--saffron); }
.best-mark { display: inline-block; margin-top: .3rem; font-size: .72rem; font-weight: 600; color: var(--saffron-ink); }
td.empty { color: var(--ink-2); }

/* calculator */
.calc { padding: 3.5rem 0; }
.calc-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 5fr 7fr; gap: 3.5rem; align-items: start; } }
.mode { display: inline-flex; margin: 1.5rem 0 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.mode label, .seg label { position: relative; cursor: pointer; }
.mode input, .seg input { position: absolute; opacity: 0; }
.mode label { padding: .45rem 1rem; border-radius: 999px; font-weight: 500; font-size: .95rem; }
.mode label:has(input:checked) { background: var(--deep); color: var(--on-deep); }
.mode label:has(input:focus-visible), .seg label:has(input:focus-visible) { outline: 3px solid var(--saffron); }
.amount { display: flex; align-items: baseline; gap: .25rem; border-bottom: 3px solid var(--ink); padding-bottom: .25rem; max-width: 420px; }
.cur { font: 700 2.4rem var(--display); color: var(--ink-2); }
.amount input { all: unset; width: 100%; font: 800 clamp(2.4rem, 6vw, 3.4rem)/1.1 var(--display); color: var(--ink); }
.presets { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.presets button { font: 500 .9rem var(--body); padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.presets button:hover { border-color: var(--ink-2); }
.results { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.results li { display: grid; grid-template-columns: 1fr auto; gap: .25rem 1rem; align-items: center; padding: .9rem .25rem; border-bottom: 1px solid var(--line); }
.results li.win { background: var(--saffron-soft); padding-left: .75rem; padding-right: .75rem; border-radius: var(--radius-s); border-bottom-color: transparent; }
.results .hint { display: block; color: var(--ink-2); }
.r-name { font: 700 1.1rem var(--display); }
.r-name small { display: block; font: 400 .82rem var(--body); color: var(--ink-2); margin-top: .1rem; }
.r-amt { text-align: right; font: 800 1.35rem var(--display); }
.r-diff, .r-best { display: block; font: 500 .8rem var(--body); color: var(--ink-2); }
.r-best { color: var(--saffron-ink); font-weight: 600; }
.r-link { grid-column: 1 / -1; justify-self: start; font-size: .82rem; font-weight: 600; color: var(--good); text-decoration: none; }
@media (min-width: 560px) { .results li { grid-template-columns: 1fr auto 4rem; } .r-link { grid-column: auto; justify-self: end; } }

/* deals */
.deals { padding: 3.5rem 0 4rem; background: var(--surface); border-top: 1px solid var(--line); }
.deal-cols { display: grid; gap: 2.5rem; margin-top: 2rem; }
@media (min-width: 860px) { .deal-cols { grid-template-columns: 1fr 1fr; gap: 0; } .deal-col + .deal-col { border-left: 1px solid var(--line); padding-left: 2.5rem; } .deal-col:first-child { padding-right: 2.5rem; } }
.col-h { font-size: 1.35rem; padding-bottom: .75rem; border-bottom: 3px solid var(--deep); }
.col-h span { display: block; font: 400 .9rem var(--body); color: var(--ink-2); margin-top: .2rem; }
.deal-list { list-style: none; margin: 0; padding: 0; }
.deal { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.deal-top { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.deal-inst { margin: 0; font-size: .85rem; color: var(--ink-2); }
.deal-name { font-size: 1.15rem; font-weight: 700; margin-top: .1rem; }
.deal-bonus { margin: 0; font: 800 1.5rem var(--display); color: var(--good); white-space: nowrap; }
.deal-req { margin: .5rem 0 0; color: var(--ink-2); font-size: .93rem; }
.deal-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .75rem; flex-wrap: wrap; }
.deal-meta { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-2); }
.tag { background: var(--paper); border: 1px solid var(--line); padding: .05rem .5rem; border-radius: 999px; text-transform: capitalize; }
.btn-ghost { font-weight: 600; font-size: .9rem; padding: .45rem .9rem; border: 1.5px solid var(--deep); border-radius: 999px; text-decoration: none; }
.btn-ghost:hover { background: var(--deep); color: var(--on-deep); }

/* history */
.hist { padding: 2.5rem 0 4rem; }
.hist-controls { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin: 1.75rem 0 1.25rem; }
.seg { display: flex; flex-wrap: wrap; gap: .35rem; }
.seg label { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; background: var(--surface); }
.seg label:has(input:checked) { background: var(--deep); color: var(--on-deep); border-color: var(--deep); }
.chart-box { position: relative; height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1rem; }
@media (max-width: 600px) { .chart-box { height: 340px; padding: .5rem; } }
.hist-h { margin: 2.5rem 0 1rem; font-size: 1.5rem; }
.daily { width: 100%; min-width: 560px; border-collapse: collapse; background: var(--surface); }
.daily th, .daily td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.daily th { font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.daily .num { text-align: right; }

/* footer */
.site-foot { border-top: 1px solid var(--line); padding: 2rem 0 3rem; font-size: .85rem; color: var(--ink-2); }
.site-foot p { max-width: 80ch; }

/* admin */
.admin-main { padding: 2rem 16px 4rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 1.5rem; margin-bottom: 1.5rem; }
.panel h1 { font-size: 1.8rem; margin-bottom: .5rem; }
.panel h2 { font-size: 1.3rem; margin: .5rem 0 1rem; }
.panel-sub { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: 1rem; }
.help { color: var(--ink-2); font-size: .9rem; }
.flash { background: var(--saffron-soft); color: var(--saffron-ink); padding: .75rem 1rem; border-radius: var(--radius-s); }
.btn { font: 600 .95rem var(--body); background: var(--deep); color: var(--on-deep); border: 0; border-radius: 999px; padding: .6rem 1.2rem; cursor: pointer; margin-top: .75rem; }
.grid-form { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: end; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form label, .admin-t td { font-size: .88rem; }
.grid-form label { display: grid; gap: .3rem; color: var(--ink-2); }
.grid-form label.check { display: flex; gap: .5rem; align-items: center; }
.admin input:not([type=checkbox]), .admin select, .admin textarea { font: 400 .95rem var(--body); padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); width: 100%; }
.admin input.w-s { width: 5rem; }
.admin-t { width: 100%; border-collapse: collapse; }
.admin-t th, .admin-t td { padding: .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.admin-t th { font-size: .8rem; color: var(--ink-2); }
.admin-t small { display: block; color: var(--ink-2); }
.admin-t tr.off { opacity: .55; }
.admin-t .msg { font-size: .8rem; color: var(--ink-2); max-width: 340px; }
.actions { display: flex; gap: .75rem; align-items: center; }
.actions form { margin: 0; }
.link-btn { all: unset; cursor: pointer; color: var(--fee); text-decoration: underline; }
.st { font-size: .8rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; background: var(--paper); }
.st-ok { color: var(--good); } .st-failed { color: var(--fee); } .st-partial { color: var(--saffron-ink); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
.more { margin-top: 1rem; background: none; color: var(--ink); cursor: pointer; font-family: var(--body); }
