/* Ratefold. Fury Goods family, with a folded-sheet identity: navy, paper and amber. */
:root {
  color-scheme: light;
  --ink: #1e3a4c;
  --text: #1b2832;
  --paper: #f7f5ef;
  --card: #ffffff;
  --muted: #4d5f6b;
  --line: #cfd6da;
  --amber: #e0a43a;
  --teal: #0d6b63;
  --soft: #dfe6ea;
  --note: #fff6e3;
  --band: #eceee9;
  --error: #a4161a;
  --focus: #0d6b63;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 1rem/1.6 system-ui, -apple-system, 'Segoe UI', sans-serif; overflow-wrap: anywhere; }
a { color: var(--teal); text-decoration: underline; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0; }
code, pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; }
.wrap { width: min(100% - 3rem, 72rem); margin-inline: auto; }
.muted { color: var(--muted); }
.skip { position: absolute; top: 0; left: .75rem; transform: translateY(-125%); padding: .65rem 1rem; background: var(--amber); color: var(--ink); z-index: 5; }
.skip:focus { transform: translateY(0); }

/* header and footer */
.site-header, .site-footer { background: var(--ink); color: var(--paper); }
.site-header { border-top: 6px solid var(--amber); }
.site-header a, .site-footer a { color: inherit; }
.site-header :focus-visible, .site-footer :focus-visible, .hero :focus-visible, .page-hero :focus-visible { outline-color: var(--amber); }
.header-inner, .footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem 1.5rem; }
.header-inner { min-height: 4.2rem; padding-block: .4rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; text-decoration: none; font-weight: 750; font-size: 1.2rem; white-space: nowrap; }
.site-header nav, .site-footer nav { display: flex; flex-wrap: wrap; gap: .1rem 1.2rem; font-size: .95rem; }
.site-header nav a, .site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; }
.site-header nav a:hover, .site-footer nav a:hover { text-decoration: underline; }
.footer-inner { min-height: 5rem; padding-block: 1.2rem; font-size: .92rem; }
.footer-inner p { max-width: 44rem; color: #e9edf0; }
.footer-inner p a { text-decoration: underline; }

/* home */
.hero { background: var(--ink); color: var(--paper); }
.hero h1 { color: var(--paper); max-width: 22ch; }
.hero-inner { padding-block: clamp(2rem, 6vw, 4.2rem); }
.kicker { font-weight: 650; color: var(--amber); margin-bottom: .6rem; }
.hero-inner > p:not(.kicker) { max-width: 42rem; margin-top: 1.1rem; font-size: clamp(1.02rem, 1.6vw, 1.18rem); color: #e9edf0; }
.hero-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); gap: .5rem 1.5rem; margin: 1.6rem 0 0; padding: 0; list-style: none; max-width: 52rem; }
.hero-points li { padding-left: 1.4rem; position: relative; color: #e9edf0; }
.hero-points li::before { content: ''; position: absolute; left: 0; top: .5em; width: .7rem; height: .7rem; background: var(--amber); clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); }
.catalogue { padding-block: clamp(2.2rem, 6vw, 4rem); display: grid; gap: clamp(2rem, 5vw, 3rem); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); gap: 1rem; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--amber); border-radius: .5rem; padding: 1.1rem 1.2rem 1.25rem; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card:hover { border-color: var(--teal); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.card h3 a:focus-visible { outline: none; }
.card p { margin-top: .45rem; color: var(--muted); }
.band { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--teal); border-radius: .5rem; padding: clamp(1rem, 3vw, 1.6rem); display: grid; gap: .7rem; }
.guide-list, .guide-index { margin: 1rem 0 0; padding-left: 1.2rem; display: grid; gap: .2rem; }
.guide-list a, .guide-index h2 a { display: inline-flex; min-height: 44px; align-items: center; }
.guide-index { list-style: none; padding: 0; gap: 1.2rem; }
.guide-index h2 { font-size: 1.3rem; }
.guide-index p { color: var(--muted); }
.help { background: var(--band); border-top: 1px solid var(--line); }
.help-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 2rem clamp(2rem, 6vw, 5rem); padding-block: clamp(2.2rem, 6vw, 4rem); }
.help h2 { margin-bottom: .8rem; }

/* inner pages */
.page-hero { background: var(--ink); color: var(--paper); padding-block: clamp(1.2rem, 4vw, 2.6rem) clamp(1.4rem, 4vw, 2.4rem); }
.page-hero h1 { color: var(--paper); }
.page-hero a { color: var(--amber); }
.crumbs { font-size: .9rem; margin-bottom: .6rem; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs li + li::before { content: '\203A'; padding-inline: .5rem; }
.crumbs a { display: inline-flex; min-height: 44px; align-items: center; }
.lede { margin-top: 1rem; max-width: 46rem; font-size: clamp(1rem, 1.5vw, 1.15rem); }
.page-hero .lede { color: #e9edf0; }
.status-wrap { display: grid; gap: .8rem; padding-top: clamp(1.2rem, 3vw, 2rem); }
.notice { background: var(--note); border-left: 5px solid var(--amber); border-radius: .4rem; padding: .85rem 1.1rem; max-width: 52rem; }
.tag { display: inline-block; padding: 0 .45rem; border-radius: .3rem; font-size: .78rem; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--text); vertical-align: .1em; }
.tag-announced { background: #fde7c2; }
.tag-proposed { background: #e4ddf4; }
.tag-law { background: #d6eee8; }

/* calculator */
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; padding-block: clamp(1.4rem, 4vw, 2.4rem); }
.calc-form { display: grid; gap: 1rem; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: .6rem; padding: clamp(1rem, 2.5vw, 1.5rem); }
.field { display: grid; gap: .3rem; align-content: start; min-width: 0; }
.field[hidden] { display: none; }
.field > label { font-weight: 650; }
.hint { color: var(--muted); font-size: .9rem; }
input[type='text'], select {
  width: 100%; min-height: 44px; padding: .5rem .65rem; font: inherit; color: var(--text);
  background: #fff; border: 2px solid #6e7d87; border-radius: .35rem;
}
input[type='text']:focus, select:focus { border-color: var(--teal); }
.input-affix { display: flex; align-items: stretch; }
.input-affix input { flex: 1 1 auto; min-width: 0; }
.affix { display: inline-flex; align-items: center; justify-content: center; padding: 0 .65rem; min-width: 2.4rem; background: var(--band); border: 2px solid #6e7d87; color: var(--muted); font-weight: 650; white-space: nowrap; }
.affix:first-child { border-right: 0; border-radius: .35rem 0 0 .35rem; }
.affix:last-child { border-left: 0; border-radius: 0 .35rem .35rem 0; }
.input-affix .affix:first-child + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-affix input:has(+ .affix) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
[aria-invalid='true'] { border-color: var(--error) !important; box-shadow: 0 0 0 1px var(--error); }
.field-error { color: var(--error); font-weight: 650; font-size: .92rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem 1.1rem; font: inherit; font-weight: 700; border-radius: .4rem; border: 2px solid var(--ink); background: var(--card); color: var(--ink); cursor: pointer; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--teal); border-color: var(--teal); }
.btn.small { min-height: 44px; font-size: .95rem; }
.btn:hover { text-decoration: underline; }
.results { min-width: 0; display: grid; gap: .9rem; background: var(--card); border: 2px solid var(--ink); border-radius: .6rem; padding: clamp(1rem, 2.5vw, 1.5rem); box-shadow: 8px 8px 0 var(--amber); }
#results-body { display: grid; gap: .9rem; min-width: 0; }
.summary { font-size: 1.08rem; }
.note { color: var(--muted); font-size: .95rem; }
.general-info { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .8rem; }
.tools { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.tools[hidden] { display: none; }
.error-summary { border: 3px solid var(--error); border-radius: .4rem; padding: .8rem 1rem; background: #fff; }
.error-summary h3 { color: var(--error); }
.error-summary a { color: var(--error); font-weight: 650; }
#share-link { margin-top: .4rem; }

/* tables */
.table-scroll { max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: min(100%, 26rem); font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 700; padding-bottom: .4rem; color: var(--ink); }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; overflow-wrap: normal; word-break: normal; }
th[scope='row'], thead th:first-child { text-align: left; font-weight: 600; }
thead th { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }
.compare td:nth-child(3), .compare thead th:nth-child(3) { background: #f3f7f6; }
tr.total th, tr.total td { font-weight: 800; border-top: 2px solid var(--ink); color: var(--ink); }
tr.subtotal th, tr.subtotal td { font-weight: 700; }
.prose table td, .prose table th { text-align: left; }
details.working-box { border: 1px solid var(--line); border-radius: .4rem; padding: 0 1rem; }
details.working-box summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 650; color: var(--teal); }
details.working-box h3 { margin-top: .6rem; font-size: 1rem; }
details.working-box p { margin-top: .3rem; font-size: .95rem; }
.working { margin: .4rem 0 .8rem; padding-left: 1.2rem; font-size: .95rem; }

/* prose */
.prose { padding-block: clamp(1.6rem, 5vw, 3rem); display: grid; gap: 1rem; max-width: 50rem; margin-inline: auto; }
.prose.wide { max-width: 72rem; }
.wrap.prose { width: min(100% - 3rem, 50rem); }
.wrap.prose.wide { width: min(100% - 3rem, 72rem); }
.prose section { display: grid; gap: .9rem; margin-top: 1rem; }
.prose h2 { margin-top: 1rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .35rem; }
.simple-top { padding-top: clamp(1rem, 3vw, 2rem); }
.simple-top .crumbs a { color: var(--teal); }
.formula { margin: 0; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: .4rem; overflow-x: auto; white-space: pre; }
.sources { font-size: .95rem; }
.related a { display: inline-flex; min-height: 44px; align-items: center; }
.dates strong { color: var(--ink); }
.faq h3 { margin-top: .4rem; }

/* injected adverts: full width, never squeeze a grid, hidden when unfilled or printed */
.google-auto-placed, ins.adsbygoogle { display: block; max-width: 100%; grid-column: 1 / -1; margin-block: 1rem; clear: both; }
ins.adsbygoogle[data-ad-status='unfilled'] { display: none !important; }
iframe { max-width: 100%; }

@media (max-width: 56rem) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .site-footer, .calc-form, .tools, .skip, .related, .google-auto-placed, ins.adsbygoogle { display: none !important; }
  .results { box-shadow: none; border: 1px solid #000; }
  body { background: #fff; color: #000; }
  details.working-box { display: block; }
}
