:root {
  color-scheme: light;
  --page: #f4f4f1;
  --surface: #ffffff;
  --ink: #191919;
  --ink-2: #5f5f5f;
  --line: #e4e4e0;
  --line-strong: #c9c9c4;
  --fees: #257de0;
  --impact: #f47230;
  --other: #00b894;
  --warn-bg: #fff4d6;
  --warn-ink: #6b4700;
  --warn-mark: #fbb315;
  --bad-bg: #fdecec;
  --bad-ink: #8a1f1f;
  --button: #191919;
  --button-ink: #ffffff;
  --focus: #257de0;
  --shadow: 0 1px 2px rgba(11, 11, 11, .06), 0 8px 24px rgba(11, 11, 11, .05);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b0b0b;
    --surface: #191919;
    --ink: #efefef;
    --ink-2: #a3a3a3;
    --line: #2c2c2c;
    --line-strong: #474747;
    --fees: #338ced;
    --impact: #e76624;
    --other: #00a888;
    --warn-bg: #3a2c05;
    --warn-ink: #ffd98a;
    --bad-bg: #3a1414;
    --bad-ink: #ffb4b4;
    --button: #efefef;
    --button-ink: #111111;
    --focus: #6aabf1;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0b0b; --surface: #191919; --ink: #efefef; --ink-2: #a3a3a3; --line: #2c2c2c; --line-strong: #474747;
  --fees: #338ced; --impact: #e76624; --other: #00a888; --warn-bg: #3a2c05; --warn-ink: #ffd98a; --bad-bg: #3a1414;
  --bad-ink: #ffb4b4; --button: #efefef; --button-ink: #111111; --focus: #6aabf1; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 15px; margin-top: 22px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.wrap { width: min(960px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 9; background: var(--surface); padding: 10px 14px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* header and footer */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; text-decoration: none; }
.top nav { display: flex; gap: 2px; }
.top nav a { padding: 10px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); background: var(--page); }
footer { padding: 28px 0 44px; color: var(--ink-2); font-size: 14px; }
footer p { margin: 6px 0; }

/* the form */
.intro { padding: 48px 0 20px; max-width: 700px; }
.intro h1 { font-size: clamp(34px, 6vw, 52px); font-weight: 750; }
.lead { font-size: 18px; color: var(--ink-2); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin: 0 0 18px; box-shadow: var(--shadow); }
label, legend { display: block; font-weight: 650; font-size: 15px; margin-bottom: 6px; padding: 0; }
input[type=text] { width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: 15px/1.3 ui-monospace, Consolas, monospace; }
fieldset { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.choices { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 12px; background: var(--page); }
.choices input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choices label { margin: 0; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.choices input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.choices input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; margin-top: 20px; border: 0; border-radius: 10px; background: var(--button); color: var(--button-ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.button.quiet { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.button:disabled { opacity: .5; cursor: wait; }
.hint { color: var(--ink-2); font-size: 14px; margin: 8px 0 0; overflow-wrap: anywhere; }
.source { color: var(--ink-2); font-size: 13px; margin: 16px 0 0; }
.alert { margin: 0 0 18px; padding: 14px 16px; border-radius: 10px; background: var(--bad-bg); color: var(--bad-ink); font-weight: 600; }

/* progress */
progress { width: 100%; height: 10px; accent-color: var(--fees); }
.steps { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 6px; }
.steps li { color: var(--ink-2); font-size: 15px; }
.steps li[aria-current] { color: var(--ink); font-weight: 650; }
.steps li.done::before { content: "\2713  "; }

/* the receipt */
.eyebrow { margin: 0; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.hero { margin: 4px 0 2px; font-size: clamp(44px, 9vw, 64px); font-weight: 750; line-height: 1.05; letter-spacing: -.02em; }
.bar { display: flex; gap: 2px; height: 8px; margin: 18px 0 6px; }
.bar span { display: block; min-width: 0; height: 100%; }
.bar span:first-child { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.bar span:last-child { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.bar.empty { background: var(--line); border-radius: 999px; }
.fees { background: var(--fees); }
.impact { background: var(--impact); }
.other { background: var(--other); }
.lines { list-style: none; margin: 10px 0 0; padding: 0; }
.lines li { display: grid; grid-template-columns: 14px 1fr auto auto; align-items: baseline; gap: 4px 12px; padding: 9px 0; border-bottom: 1px dashed var(--line-strong); }
.lines li.plain { grid-template-columns: 1fr auto; }
.lines li.plain .why { display: block; margin-top: 2px; }
.lines .key { width: 12px; height: 12px; border-radius: 3px; align-self: center; }
.lines .share { color: var(--ink-2); font-size: 14px; min-width: 60px; text-align: right; }
.lines .total { font-weight: 750; border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 4px; }
.lines .why { grid-column: 2 / -1; color: var(--ink-2); font-size: 13px; margin-top: -2px; }
.notes { margin-top: 18px; display: grid; gap: 8px; }
.note { padding: 10px 12px; border-radius: 10px; background: var(--page); font-size: 14px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.mark { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--warn-mark); color: #0b0b0b; font-size: 12px; font-weight: 800; vertical-align: -3px; }

/* the swaps */
.list-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
select { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.swaps { list-style: none; margin: 8px 0 0; padding: 0; }
.swap { padding: 16px 0; border-top: 1px solid var(--line); }
.swap-top { display: flex; justify-content: space-between; gap: 16px; }
.swap-top > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.swap .cost { text-align: right; flex: none; }
.swap .cost strong { display: block; font-size: 18px; }
.swap .bar { margin: 10px 0 0; height: 4px; }
.tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: 12px; font-weight: 700; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--ink-2); font-size: 14px; font-weight: 600; padding: 4px 0; }
.working { margin: 8px 0 0; padding: 14px; border-radius: 10px; background: var(--page); font-size: 14px; }
.working p { margin: 0 0 8px; }
.working .lines li { padding: 6px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.reasons { list-style: none; margin: 0; padding: 0; }
.reasons > li { padding: 12px 0; border-top: 1px solid var(--line); }
.reasons .count { font-weight: 750; margin-right: 8px; }
.reasons ul { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* how it works */
.prose { max-width: 760px; }
.prose h2 { margin-top: 30px; }
.prose li { margin: 6px 0; }
.prose code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; }
.defs { margin: 14px 0; display: grid; gap: 12px; }
.defs div { padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.defs dt { font-weight: 700; display: flex; align-items: center; gap: 10px; }
.defs dd { margin: 4px 0 0 22px; color: var(--ink-2); }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 12px 0; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-size: 13px; font-weight: 650; }
tbody th { color: var(--ink); font-size: 15px; font-weight: 700; }
td.num, th.num { text-align: right; }
.table-scroll { overflow-x: auto; }

@media (max-width: 620px) {
  .brand { font-size: 17px; gap: 8px; }
  .top nav a { padding: 8px 9px; font-size: 15px; }
  .intro { padding-top: 28px; }
  .card { padding: 18px 16px; }
  .swap-top { flex-direction: column; gap: 4px; }
  .swap .cost { text-align: left; }
  .lines li { grid-template-columns: 14px 1fr auto; }
  .lines .share { grid-column: 2; text-align: left; }
  table { font-size: 14px; }
  th, td { padding: 8px 5px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .bar span, .key { forced-color-adjust: none; border: 1px solid CanvasText; }
}
