/* One light theme on purpose: white paper, black ink, one blue for links. */
:root {
  --paper: #ffffff;
  --receipt: #f7f6f1;
  --ink: #161616;
  --ink-2: #3b3b3b;
  --muted: #696969;
  --rule: #e2e2e2;
  --rule-mid: #c9c9c9;
  --field-border: #a8a8a8;
  --link: #1b4d9b;
  --link-hover: #0e2f66;
  --mark: #fff0a0;
  --loss: #b3261e;
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--link-hover);
}
:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}
.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px;
}
.muted {
  color: var(--muted);
  font-weight: 400;
}
.small {
  font-size: 0.875rem;
}
.help {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-top: 4px;
  line-height: 1.45;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* Header */
.site-header {
  border-top: 4px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 6px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.wordmark:hover {
  color: var(--ink);
}
.masthead-note {
  font-size: 0.8125rem;
  color: var(--muted);
}
@media (max-width: 520px) {
  .masthead-note {
    display: none;
  }
}
.platform-nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.platform-nav ul::-webkit-scrollbar {
  display: none;
}
.platform-nav a {
  display: block;
  padding: 8px 0 9px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.platform-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--rule-mid);
}
.platform-nav a[aria-current='page'] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--ink);
}

/* Page head */
.page-head {
  padding: 32px 0 4px;
}
.breadcrumbs {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.breadcrumbs a {
  color: var(--muted);
}
h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
  margin: 0 0 12px;
}
.lede {
  font-size: 1.125rem;
  color: var(--ink-2);
  margin: 0;
  max-width: 64ch;
}
.checked {
  margin: 12px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.versions {
  margin: 6px 0 0;
  font-size: 0.9375rem;
}

/* Calculator */
.calc {
  display: grid;
  gap: 28px;
  margin: 28px 0 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}
@media (min-width: 860px) {
  .calc {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    gap: 48px;
    align-items: start;
  }
  .calc-side {
    position: sticky;
    top: 20px;
  }
}
.fieldset + .fieldset {
  margin-top: 22px;
}
.fieldset-title {
  font-size: 1.0625rem;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}
.fieldset-title .muted {
  font-family: var(--sans);
  font-size: 0.875rem;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 5px;
}
.field-check label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
}
.field-check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  flex: none;
  accent-color: var(--ink);
}
.input {
  position: relative;
}
.affix {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.affix-end {
  left: auto;
  right: 11px;
}
input[type='number'],
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--field-border);
  border-radius: 3px;
  padding: 9px 11px;
  min-height: 44px;
}
input[type='number'] {
  font-family: var(--mono);
  font-size: 0.9375rem;
}
.has-prefix input {
  padding-left: 26px;
}
.has-suffix input {
  padding-right: 30px;
}
input[type='number']:hover,
select:hover {
  border-color: var(--ink-2);
}
input[type='number']:focus,
select:focus {
  border-color: var(--link);
  outline: 2px solid var(--link);
  outline-offset: -1px;
}
.calc-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  font: inherit;
  font-size: 0.875rem;
  padding: 7px 14px;
  border-radius: 3px;
  border: 1px solid var(--field-border);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.btn:hover {
  border-color: var(--ink);
}

/* The receipt */
.receipt {
  --tooth: 14px;
  background: var(--receipt);
  padding: 22px 22px calc(22px + var(--tooth) / 2);
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / var(--tooth) 100%;
}
.receipt-head {
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px dashed var(--rule-mid);
}
.receipt-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
}
.receipt-big {
  display: block;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2.75rem;
  line-height: 1.1;
  margin: 2px 0 4px;
  font-variant-numeric: tabular-nums;
}
.receipt-sub {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.receipt-sub b {
  font-family: var(--mono);
  font-weight: 500;
}
.loss {
  color: var(--loss);
}
.ledger {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}
.ledger li {
  padding: 5px 0;
}
.ledger .row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ledger .l {
  min-width: 0;
}
.ledger .l em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8125rem;
  margin-left: 4px;
}
.ledger .dots {
  flex: 1 1 24px;
  min-width: 16px;
  border-bottom: 1px dotted #8f8f8f;
  transform: translateY(-4px);
}
.ledger .v {
  flex: none;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.ledger small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 1px;
}
.ledger .sub {
  color: var(--ink-2);
}
.ledger .total {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 1px solid var(--ink);
  font-weight: 700;
}
.ledger .cost:first-of-type,
.ledger .total + .cost,
.ledger .total + .grand {
  margin-top: 6px;
}
.ledger .grand {
  margin-top: 6px;
  padding-top: 9px;
  border-top: 3px double var(--ink);
  font-weight: 700;
}
.ledger .grand.loss .v {
  color: var(--loss);
}
.receipt-foot {
  margin: 12px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.reverse {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}
.reverse label {
  display: block;
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 5px;
}
.reverse-line {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.reverse-line .input {
  flex: 0 1 150px;
}
.reverse-answer {
  margin: 0;
  font-size: 0.9375rem;
}
.reverse-answer strong {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.125rem;
  background: var(--mark);
  padding: 1px 4px;
}

/* Article */
.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* lets wide tables scroll instead of widening the page */
  gap: 40px;
  margin-bottom: 56px;
  padding-top: 8px;
}
@media (min-width: 860px) {
  .content {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 56px;
  }
}
.prose {
  max-width: 68ch;
  font-size: 1.0625rem;
  line-height: 1.65;
}
.prose h2 {
  font-size: 1.625rem;
  line-height: 1.25;
  margin: 40px 0 12px;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose h3 {
  font-size: 1.25rem;
  margin: 26px 0 8px;
}
.prose li + li {
  margin-top: 6px;
}
.table-scroll {
  overflow-x: auto;
  margin: 16px 0 20px;
}
.prose table,
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.prose th,
.prose td,
table.data th,
table.data td {
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.prose thead th,
table.data thead th {
  font-size: 0.8125rem;
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
}
.prose td:not(:first-child),
table.data td {
  font-variant-numeric: tabular-nums;
}
.note {
  border-left: 3px solid var(--ink);
  padding: 2px 0 2px 14px;
  font-size: 1rem;
  color: var(--ink-2);
}
.sources {
  margin-top: 32px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--muted);
}
details.faq {
  border-bottom: 1px solid var(--rule);
}
details.faq:first-of-type {
  border-top: 1px solid var(--rule);
}
details.faq summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 12px 28px 12px 0;
  position: relative;
}
details.faq summary::-webkit-details-marker {
  display: none;
}
details.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 10px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--muted);
}
details.faq[open] summary::after {
  content: '\2212';
}
details.faq p {
  margin: 0 0 14px;
}
.aside h2 {
  font-size: 1.0625rem;
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.aside ul {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.aside li a {
  display: block;
  padding: 4px 0;
}
.aside p {
  font-size: 0.9375rem;
  margin: 0;
}

/* Home */
.section-title {
  font-size: 1.25rem;
  margin: 36px 0 0;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.index-list li {
  display: grid;
  gap: 2px 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .index-list li {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: baseline;
  }
}
.index-list a {
  font-weight: 600;
}
.index-list span {
  color: var(--ink-2);
  font-size: 0.9375rem;
}
.compare {
  margin: 56px 0 0;
}
.compare h2 {
  font-size: 1.625rem;
  margin: 0 0 6px;
}
.compare-intro {
  margin: 0 0 18px;
  color: var(--ink-2);
}
.compare-form {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.compare-form .field {
  flex: 0 1 200px;
  margin: 0;
}
table.data td:last-child strong {
  font-family: var(--mono);
  font-weight: 500;
}
table.data tr.best th,
table.data tr.best td {
  background: var(--mark);
}
table.data tr.best th {
  padding-left: 8px;
}
table.data th[scope='row'] {
  padding-left: 0;
}
.best-mark {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-2);
  margin-left: 6px;
}
.home-prose {
  margin: 56px 0 64px;
}
.page-prose {
  padding: 32px 0 64px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--ink);
  padding: 28px 0 36px;
  font-size: 0.875rem;
  color: var(--ink-2);
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}
.footer-cols h2 {
  font-size: 1rem;
  margin: 0 0 8px;
}
.footer-cols ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.footer-cols li {
  padding: 2px 0;
}
.footer-cols a {
  color: var(--ink-2);
}
.disclaimer {
  max-width: 80ch;
  color: var(--muted);
  margin: 8px 0 0;
}

/* Quick check on fee guides */
.quick {
  margin: 24px 0 36px;
  padding: 18px 20px;
  background: var(--receipt);
  border-left: 3px solid var(--ink);
}
.quick label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.quick-line {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.quick-line .input {
  flex: 0 1 160px;
}
.quick-answer {
  margin: 0;
  font-size: 1.0625rem;
}
.quick-answer strong {
  font-family: var(--mono);
  font-weight: 500;
}
.quick-answer strong:last-child {
  background: var(--mark);
  padding: 1px 4px;
}
.quick .help {
  margin-top: 10px;
}
.aside h2 + ul + h2 {
  margin-top: 18px;
}
