/* Amount in Numbers to Words – base styles
   Palette is taken from cheque stock: pale security-print mint, bank ink blue, a teal pen, and a rubber-stamp red. */
:root {
  --paper: #edf4f2;
  --sheet: #fafdfc;
  --ink: #0f2b3d;
  --ink-2: #3d5565;
  --line: #bfd3d0;
  --brand: #0b6e5f;
  --brand-ink: #064a40;
  --brand-wash: #d9ece8;
  --stamp: #c8372d;
  --focus: #1a73e8;
  --radius: 6px;
  --font-ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-words: "Newsreader", Georgia, "Times New Roman", serif;
  --font-num: "Spline Sans Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --max: 1120px;
}
:root[data-theme="dark"] {
  --paper: #0a1b24;
  --sheet: #102631;
  --ink: #e3efee;
  --ink-2: #a3bbbb;
  --line: #25424e;
  --brand: #3fbfa6;
  --brand-ink: #7fe0cb;
  --brand-wash: #12342f;
  --stamp: #f0705f;
  --focus: #7ab4ff;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: min(100% - 2.5rem, var(--max)); margin-inline: auto; }

h1, h2, h3, h4 { font-family: var(--font-ui); line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.2rem); font-weight: 750; margin-top: 0; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1.1em; max-width: 72ch; overflow-wrap: anywhere; }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 60ch; }
ul, ol { padding-left: 1.3em; max-width: 72ch; }
li { margin-bottom: .4em; }
strong { font-weight: 700; }
code, kbd { font-family: var(--font-num); font-size: .92em; background: var(--brand-wash); padding: .1em .35em; border-radius: 3px; }

/* grid children may shrink, so wide tables scroll inside their own box instead of stretching the page */
.cols > *, .cols-3 > *, .tool-split > *, .row > *, .stat-grid > * { min-width: 0; }

/* ---------- header ---------- */
.site-header { background: var(--sheet); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--ink-2); letter-spacing: 0; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav > a, .nav-group > button { font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink); background: none; border: 0; padding: .55rem .75rem; border-radius: var(--radius); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.nav > a:hover, .nav-group > button:hover, .nav a[aria-current="page"] { background: var(--brand-wash); color: var(--brand-ink); }
.nav-group { position: relative; }
.nav-group > button::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.menu { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; box-shadow: 0 12px 30px rgba(15, 43, 61, .14); }
.nav-group.open .menu { display: block; }
.menu a { display: block; padding: .5rem .7rem; border-radius: 4px; text-decoration: none; color: var(--ink); font-size: .95rem; font-weight: 500; }
.menu a:hover, .menu a[aria-current="page"] { background: var(--brand-wash); color: var(--brand-ink); }
.menu a span { display: block; font-size: .8rem; color: var(--ink-2); font-weight: 400; }
.icon-btn { background: none; border: 1px solid var(--line); width: 40px; height: 40px; border-radius: var(--radius); color: var(--ink); cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; }
.icon-btn:hover { background: var(--brand-wash); }
.burger { display: none; }

/* ---------- hero ---------- */
.hero { padding: clamp(2rem, 5vw, 3.5rem) 0 2.5rem; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 8%, rgba(11,110,95,.10), transparent 40%),
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(11,110,95,.045) 14px 15px);
}
.hero .lead { margin-bottom: 1.6rem; }
.crumbs { font-size: .88rem; color: var(--ink-2); margin-bottom: 1rem; }
.crumbs a { color: var(--ink-2); }
.crumbs span { margin: 0 .35rem; }
.page-hero { padding: 2.2rem 0 1.6rem; }

/* ---------- sections ---------- */
section.block { padding: clamp(2.2rem, 5vw, 3.6rem) 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.cols-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.2rem, 3vw, 2.2rem); }
.article { max-width: 780px; }
.article h2 { margin-top: 2.2rem; }
.article h3 { margin-top: 1.6rem; }

/* tool directory: a ruled list, not a card grid */
.tool-list { list-style: none; padding: 0; margin: 0; max-width: none; border-top: 1px solid var(--ink); }
.tool-list li { margin: 0; border-bottom: 1px solid var(--line); }
.tool-list a { display: grid; grid-template-columns: minmax(180px, 280px) 1fr auto; gap: 1rem; padding: 1rem .25rem; text-decoration: none; color: var(--ink); align-items: baseline; }
.tool-list a:hover { background: var(--brand-wash); }
.tool-list b { font-size: 1.1rem; letter-spacing: -.01em; }
.tool-list span { color: var(--ink-2); font-size: .98rem; }
.tool-list i { font-style: normal; color: var(--brand); font-weight: 700; }

/* steps */
.steps { list-style: none; padding: 0; counter-reset: s; max-width: none; display: grid; gap: 1.2rem; }
.steps li { counter-increment: s; padding-left: 3.2rem; position: relative; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -.1rem; width: 2.2rem; height: 2.2rem; border: 2px solid var(--brand); border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--brand); font-family: var(--font-num); }
.steps b { display: block; font-size: 1.08rem; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sheet); margin: 1rem 0 1.6rem; }
table { width: 100%; border-collapse: collapse; font-size: .97rem; }
th, td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--brand-wash); font-weight: 700; font-size: .9rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { font-family: var(--font-num); white-space: nowrap; }
td.words { font-family: var(--font-words); font-size: 1.08rem; }

/* faq */
.faq details { border-bottom: 1px solid var(--line); padding: .2rem 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: .85rem 0; list-style: none; display: flex; justify-content: space-between; gap: 1rem; font-size: 1.08rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--brand); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 1rem; color: var(--ink-2); }
.faq details > div p { max-width: 70ch; }

.callout { border-left: 4px solid var(--brand); background: var(--brand-wash); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; max-width: 72ch; }
.callout p:last-child { margin-bottom: 0; }
.link-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.link-row a { border: 1px solid var(--line); padding: .45rem .85rem; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: .94rem; background: var(--sheet); }
.link-row a:hover { background: var(--brand-wash); }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cfe0df; padding: 3rem 0 1.5rem; margin-top: 0; }
:root[data-theme="dark"] .site-footer { background: #06121a; }
.site-footer a { color: #cfe0df; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; font-size: .95rem; }
.site-footer p { font-size: .93rem; }
.foot-base { border-top: 1px solid rgba(255,255,255,.15); margin-top: 2rem; padding-top: 1.2rem; font-size: .87rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 20px); background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: var(--radius); font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .cols, .cols-3 { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .tool-list a { grid-template-columns: 1fr auto; }
  .tool-list span { grid-column: 1 / -1; grid-row: 2; }
  .burger { display: grid; margin-left: auto; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--sheet); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: .6rem 1.25rem 1rem; max-height: calc(100vh - 64px); overflow: auto; margin: 0; }
  .nav.open { display: flex; }
  .nav-group > button { width: 100%; justify-content: space-between; }
  .menu { position: static; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin-left: .6rem; }
}
@media (max-width: 700px) {
  .hero { padding: 1rem 0 1.6rem; }
  .hero .wrap { display: flex; flex-direction: column; }
  .hero h1 { font-size: 1.75rem; margin-bottom: .7rem; order: 1; }
  .hero .cheque { order: 2; }
  .hero .lead { order: 3; font-size: 1.02rem; margin: 1.4rem 0 0; }
  .brand small { display: none; }
  .brand { font-size: .98rem; }
  .bar { min-height: 56px; }
}
@media (max-width: 560px) {
  .foot-grid { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Responsive overflow fix */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

.wrap,
.cols,
section,
main,
header,
footer {
  min-width: 0;
  max-width: 100%;
}