/* ==========================================================================
   soletrader.nz — stylesheet
   Brand tokens follow the Moreweb NZ system.
   RULE: Shamrock green (--green) is reserved for success / available /
   positive states only. It is never used decoratively. Primary actions
   use Baltic Blue.
   ========================================================================== */

/* --- 1. Tokens ----------------------------------------------------------- */

:root {
  /* Brand */
  --blue: #115E92;
  --blue-dark: #0D4A73;
  --blue-tint: #E7EFF5;
  --green: #1E9E60;          /* RESERVED: success / available only */
  --green-tint: #E6F4ED;
  --anthracite: #232B36;
  --slate: #5C6770;
  --amber: #F2B63D;
  --amber-tint: #FDF4E0;
  --platinum: #F4F6F8;
  --platinum-2: #E4E8EC;
  --paper: #FFFFFF;
  --red: #D64550;
  --red-tint: #FBEBEC;

  /* Type */
  --display: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Scale */
  --step--1: clamp(0.83rem, 0.81rem + 0.1vw, 0.89rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.14rem + 0.3vw, 1.4rem);
  --step-2: clamp(1.44rem, 1.33rem + 0.55vw, 1.8rem);
  --step-3: clamp(1.73rem, 1.53rem + 1vw, 2.4rem);
  --step-4: clamp(2.07rem, 1.72rem + 1.75vw, 3.2rem);

  /* Space */
  --gap: 1rem;
  --gap-l: 1.75rem;
  --gap-xl: 3rem;
  --radius: 10px;
  --radius-s: 6px;
  --measure: 68ch;
  --shell: 1180px;

  --shadow: 0 1px 2px rgba(35, 43, 54, .06), 0 8px 24px rgba(35, 43, 54, .07);
  --shadow-s: 0 1px 2px rgba(35, 43, 54, .08);
}

/* --- 2. Reset ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--anthracite);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--anthracite);
  margin: 0 0 .5em;
  text-wrap: balance;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); margin-top: 2.2em; }
h3 { font-size: var(--step-1); margin-top: 1.8em; letter-spacing: -0.01em; }
h4 { font-size: var(--step-0); margin-top: 1.5em; letter-spacing: 0; }

p, ul, ol, dl, table { margin: 0 0 1.1em; }
p, li { max-width: var(--measure); }
p, li, h1, h2, h3, h4, td, th, dd, dt, summary { overflow-wrap: break-word; }

a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { color: var(--blue-dark); }

strong { font-weight: 600; }

code, kbd, samp { font-family: var(--mono); font-size: .9em; }

hr { border: 0; border-top: 1px solid var(--platinum-2); margin: var(--gap-xl) 0; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- 3. Layout ----------------------------------------------------------- */

.shell {
  width: min(100% - 2.5rem, var(--shell));
  margin-inline: auto;
}

/* Grid and flex children default to min-width:auto, which means they refuse
   to shrink below their content's intrinsic minimum. That is what pushes
   wide tables and long tokens past the viewport edge. */
.layout > *, .tool > *, .aside-col > *, .grid > *, .balance > *,
.figure-row > *, .pager > *, .footer__cols > *, .by-moreweb__inner > *,
.masthead__row > *, .field-row > *, .line-row > *, .invoice__parties > * {
  min-width: 0;
}

.skip {
  position: absolute; left: -9999px;
  background: var(--anthracite); color: #fff;
  padding: .7rem 1.1rem; z-index: 100; border-radius: 0 0 var(--radius-s) 0;
}
.skip:focus { left: 0; top: 0; }

.section { padding-block: var(--gap-xl); }
.section--tint { background: var(--platinum); }
.section--edge { border-top: 1px solid var(--platinum-2); }

/* --- 4. Header ----------------------------------------------------------- */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--platinum-2);
}

.masthead__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--gap); min-height: 62px;
}

.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.12rem;
  letter-spacing: -0.03em; color: var(--anthracite); text-decoration: none;
  display: inline-flex; align-items: baseline; gap: .1em; flex: none;
}
.brand span { color: var(--blue); }
.brand em { font-style: normal; font-family: var(--mono); font-size: .78em; color: var(--slate); font-weight: 500; }

.nav-toggle {
  display: inline-flex; align-items: center; gap: .45rem;
  font: inherit; font-size: var(--step--1); font-weight: 600;
  background: var(--paper); color: var(--anthracite);
  border: 1px solid var(--platinum-2); border-radius: var(--radius-s);
  padding: .5rem .7rem; cursor: pointer;
}
.nav-toggle:hover { border-color: var(--slate); }
.nav-toggle svg { width: 16px; height: 16px; }

.nav { display: none; }
.nav[data-open="true"] {
  display: block;
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--paper);
  border-bottom: 1px solid var(--platinum-2);
  box-shadow: var(--shadow);
  padding: .6rem 0 1rem;
  max-height: 78vh; overflow-y: auto;
}
.nav ul { list-style: none; margin: 0; padding: 0; width: min(100% - 2.5rem, var(--shell)); margin-inline: auto; }
.nav li { max-width: none; }
.nav a {
  display: block; padding: .6rem .2rem; text-decoration: none;
  color: var(--anthracite); font-weight: 500;
  border-bottom: 1px solid var(--platinum);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--blue); }
.nav a[aria-current="page"] { font-weight: 600; }
.nav__label {
  font-family: var(--mono); font-size: .68rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--slate);
  padding: 1rem .2rem .3rem; display: block;
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav, .nav[data-open="true"] {
    display: block; position: static; box-shadow: none; border: 0;
    padding: 0; max-height: none; overflow: visible; background: none;
  }
  .nav ul { display: flex; gap: 1.4rem; width: auto; align-items: center; }
  .nav a { border: 0; padding: .2rem 0; font-size: var(--step--1); }
  .nav__label, .nav li.nav--sub { display: none; }
  .nav a.nav__cta {
    background: var(--blue); color: #fff; padding: .45rem .9rem;
    border-radius: var(--radius-s); font-weight: 600;
  }
  .nav a.nav__cta:hover { background: var(--blue-dark); color: #fff; }
}

/* --- 5. Hero ------------------------------------------------------------- */

.hero {
  background: linear-gradient(168deg, #0E5182 0%, var(--blue) 46%, #1A76B4 100%);
  color: #fff; padding-block: 5rem 3.25rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -55% 45%;
  height: 120%; background: radial-gradient(closest-side, rgba(255,255,255,.09), transparent);
  pointer-events: none;
}
.hero > .shell { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p { color: #DCE9F2; font-size: var(--step-1); max-width: 56ch; }
.hero__eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: #C6DFEE; margin-bottom: .9rem; display: block;
}
.hero--slim { padding-block: 2.25rem 2.5rem; }
.hero--slim h1 { font-size: var(--step-3); max-width: 22ch; }
.hero--slim p { font-size: var(--step-0); }

/* --- 6. Signature: domain checker --------------------------------------- */

.checker { margin-top: 1.75rem; max-width: min(640px, 100%); }

.checker__field {
  display: flex; align-items: stretch;
  background: var(--paper); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  border: 2px solid transparent;
}
.checker__field:focus-within { border-color: var(--amber); }

.checker__input {
  flex: 1 1 auto; min-width: 0;
  font-family: var(--mono); font-size: 1.05rem; font-weight: 500;
  color: var(--anthracite); background: transparent;
  border: 0; padding: .95rem 0 .95rem 1rem;
}
.checker__input::placeholder { color: #98A2AC; font-weight: 400; }
.checker__input:focus { outline: 0; }

.checker__tld {
  font-family: var(--mono); font-size: 1.05rem; color: var(--slate);
  display: flex; align-items: center; padding-right: .6rem; flex: none;
}

.checker__btn {
  flex: none; font-family: var(--body); font-size: .95rem; font-weight: 600;
  background: var(--blue); color: #fff; border: 0; cursor: pointer;
  padding: 0 1.3rem; transition: background .15s ease;
}
.checker__btn:hover { background: var(--blue-dark); }

.checker__preview {
  margin: .85rem 0 0; font-family: var(--mono); font-size: .92rem;
  color: #DCE9F2; min-height: 1.5em; max-width: none;
}
.checker__preview b { color: #fff; font-weight: 600; }
.checker__note { margin: .35rem 0 0; font-size: var(--step--1); color: #C6DFEE; max-width: 70ch; }

/* Checker on light backgrounds */
.checker--light .checker__field { border-color: var(--platinum-2); box-shadow: var(--shadow-s); }
.checker--light .checker__preview { color: var(--slate); }
.checker--light .checker__preview b { color: var(--anthracite); }
.checker--light .checker__note { color: var(--slate); }

/* Stacked: input on its own full-width row, button beneath. Used in narrow
   columns and on small screens so the input is never squeezed to a stub. */
.checker--stack .checker__field { flex-wrap: wrap; }
.checker--stack .checker__input { flex: 1 1 auto; }
.checker--stack .checker__btn { flex: 1 0 100%; padding: .7rem; order: 3; }

@media (max-width: 520px) {
  .checker__field { flex-wrap: wrap; }
  .checker__input { flex-basis: 60%; }
  .checker__btn { flex-basis: 100%; padding: .8rem; order: 3; }
}

/* --- 7. Buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--body); font-size: .95rem; font-weight: 600;
  padding: .72rem 1.25rem; border-radius: var(--radius-s);
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--blue); border-color: var(--platinum-2); }
.btn--ghost:hover { border-color: var(--blue); }
.btn--onblue { background: #fff; color: var(--blue); }
.btn--onblue:hover { background: var(--blue-tint); color: var(--blue-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; }

/* --- 8. Content page shape ---------------------------------------------- */

.layout { display: grid; gap: var(--gap-xl); padding-block: var(--gap-xl); }

@media (min-width: 1000px) {
  .layout { grid-template-columns: 190px minmax(0, 1fr) 340px; gap: 2.5rem; align-items: start; }
  /* pages with no table of contents: prose is the main column */
  .layout--wide { grid-template-columns: minmax(0, 1fr) 360px; }
}

.toc { display: none; }
@media (min-width: 1000px) {
  .toc { display: block; position: sticky; top: 86px; font-size: var(--step--1); }
  .toc h2 {
    font-family: var(--mono); font-size: .68rem; font-weight: 500;
    letter-spacing: .1em; text-transform: uppercase; color: var(--slate);
    margin: 0 0 .7rem;
  }
  .toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
  .toc li { max-width: none; border-left: 2px solid var(--platinum-2); }
  .toc a {
    display: block; padding: .32rem 0 .32rem .8rem; text-decoration: none;
    color: var(--slate); line-height: 1.4;
  }
  .toc a:hover { color: var(--blue); }
  .toc li:has(a[data-active="true"]) { border-left-color: var(--blue); }
  .toc a[data-active="true"] { color: var(--blue); font-weight: 600; }
}

.prose > *:first-child { margin-top: 0; }
.prose h2 { scroll-margin-top: 84px; }
.prose h3 { scroll-margin-top: 84px; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose li::marker { color: var(--slate); }

.aside-col { display: grid; gap: var(--gap); }
@media (min-width: 1000px) { .aside-col { position: sticky; top: 86px; } }

/* --- 9. Components ------------------------------------------------------- */

.eyebrow {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--slate);
  display: block; margin-bottom: .8rem;
}

.lede { font-size: var(--step-1); color: var(--slate); max-width: 58ch; }

.card {
  background: var(--paper); border: 1px solid var(--platinum-2);
  border-radius: var(--radius); padding: 1.4rem;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }

.card--cta { background: var(--blue-tint); border-color: #C9DCEA; }
.card--cta h3 { color: var(--blue-dark); }

.grid { display: grid; gap: var(--gap); }
@media (min-width: 620px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 620px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 620px) { .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* Topic tiles */
.tile {
  display: block; text-decoration: none; color: inherit;
  background: var(--paper); border: 1px solid var(--platinum-2);
  border-radius: var(--radius); padding: 1.25rem;
  transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--blue); transform: translateY(-2px); color: inherit; }
.tile h3 { font-size: var(--step-0); margin: 0 0 .35rem; }
.tile p { font-size: var(--step--1); color: var(--slate); margin: 0; max-width: none; }
.tile__num {
  font-family: var(--mono); font-size: .72rem; color: var(--slate);
  display: block; margin-bottom: .55rem;
}

/* Callouts */
.note {
  border-left: 3px solid var(--blue); background: var(--platinum);
  padding: 1rem 1.15rem; border-radius: 0 var(--radius-s) var(--radius-s) 0;
  margin: 1.6rem 0; font-size: .97rem;
}
.note p:last-child, .note ul:last-child { margin-bottom: 0; }
.note strong:first-child { display: block; font-family: var(--display); letter-spacing: -0.01em; }
.note--warn { border-left-color: var(--amber); background: var(--amber-tint); }
.note--good { border-left-color: var(--green); background: var(--green-tint); }

/* Key figure */
.figure-row { display: grid; gap: .8rem; margin: 1.6rem 0; }
@media (min-width: 620px) { .figure-row { grid-template-columns: repeat(3, 1fr); } }
.figure {
  border: 1px solid var(--platinum-2); border-radius: var(--radius);
  padding: 1rem 1.1rem; background: var(--paper);
}
.figure b {
  display: block; font-family: var(--mono); font-size: 1.45rem;
  font-weight: 600; color: var(--blue); letter-spacing: -0.02em; line-height: 1.2;
}
.figure span { display: block; font-size: var(--step--1); color: var(--slate); margin-top: .25rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; min-width: 460px; }
.invoice table, .result table { min-width: 0; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--platinum-2); vertical-align: top; }
th { font-family: var(--display); font-weight: 600; font-size: .88rem; color: var(--anthracite); background: var(--platinum); }
td:first-child { font-weight: 500; }

/* Steps (only where order genuinely matters) */
.steps { list-style: none; padding: 0; counter-reset: step; margin: 1.6rem 0; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 1.4rem 3rem; max-width: var(--measure);
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: .1rem;
  font-family: var(--mono); font-size: .82rem; font-weight: 600;
  color: var(--blue); background: var(--blue-tint);
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  display: grid; place-items: center;
}
.steps > li::after {
  content: ""; position: absolute; left: 1.05rem; top: 2.5rem; bottom: .3rem;
  width: 1px; background: var(--platinum-2);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 0 0 .35rem; font-size: var(--step-0); }
.steps p:last-child { margin-bottom: 0; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 1.5rem 0; }
.checklist li {
  display: flex; gap: .8rem; align-items: flex-start;
  padding: .85rem 0; border-bottom: 1px solid var(--platinum-2);
  max-width: var(--measure);
}
.checklist input[type="checkbox"] {
  flex: none; width: 1.25rem; height: 1.25rem; margin-top: .18rem;
  accent-color: var(--green); cursor: pointer;
}
.checklist label { cursor: pointer; }
.checklist strong { display: block; }
.checklist span { font-size: var(--step--1); color: var(--slate); }
.checklist input:checked + label { color: var(--slate); }
.checklist input:checked + label strong { text-decoration: line-through; }

/* Pros / cons */
.balance { display: grid; gap: var(--gap); margin: 1.6rem 0; }
@media (min-width: 700px) { .balance { grid-template-columns: 1fr 1fr; } }
.balance ul { list-style: none; padding: 0; margin: 0; }
.balance li { padding: .45rem 0 .45rem 1.5rem; position: relative; font-size: .96rem; }
.balance li::before { position: absolute; left: 0; top: .45rem; font-family: var(--mono); font-weight: 600; }
.balance__good li::before { content: "+"; color: var(--green); }
.balance__bad li::before { content: "−"; color: var(--red); }
.balance h3 { margin-top: 0; font-size: var(--step-0); }

/* FAQ */
.faq { margin: 1.6rem 0; border-top: 1px solid var(--platinum-2); }
.faq details { border-bottom: 1px solid var(--platinum-2); }
.faq summary {
  cursor: pointer; padding: 1rem 2rem 1rem 0; position: relative;
  font-family: var(--display); font-weight: 600; letter-spacing: -0.01em;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .4rem; top: .9rem;
  font-family: var(--mono); font-size: 1.3rem; color: var(--blue); line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 0 1.1rem; }
.faq details > div > *:last-child { margin-bottom: 0; }

/* Mono inline token, used for domains and figures */
.tok {
  font-family: var(--mono); font-size: .92em; background: var(--platinum);
  color: var(--blue);
  border: 1px solid var(--platinum-2); border-radius: 4px; padding: .08em .35em;
  overflow-wrap: anywhere;
}
.tok--good { background: var(--green-tint); border-color: #BFE3D1; color: #14764A; }
td:first-child .tok,
.lateInvoice td:first-child .tok {
  text-wrap: nowrap;
}
.ACCPlans td:first-child {
  width: 100px;
}
/* Breadcrumb */
.crumbs { font-size: var(--step--1); color: #C6DFEE; margin-bottom: .9rem; }
.crumbs a { color: #DCE9F2; text-decoration: none; }
.crumbs a:hover { color: #fff; text-decoration: underline; }
.crumbs span { opacity: .6; padding: 0 .35rem; }

/* Next / prev */
.pager { display: grid; gap: var(--gap); margin-top: var(--gap-xl); }
@media (min-width: 620px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--platinum-2); border-radius: var(--radius); padding: 1rem 1.2rem;
}
.pager a:hover { border-color: var(--blue); }
.pager span {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--slate); display: block; margin-bottom: .25rem;
}
.pager b { font-family: var(--display); font-weight: 600; color: var(--anthracite); }
.pager .pager__next { text-align: right; }

/* --- 10. Tools ----------------------------------------------------------- */

.tool { display: grid; gap: var(--gap-l); }
@media (min-width: 860px) { .tool { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }

.panel h2 { font-size: var(--step-1); margin-top: 0; }
.panel {
  background: var(--platinum); border: 1px solid var(--platinum-2);
  border-radius: var(--radius); padding: 1.5rem;
}
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .35rem; }
.field .hint { display: block; font-size: var(--step--1); color: var(--slate); font-weight: 400; margin-top: .15rem; }
.field input[type="text"], .field input[type="number"], .field input[type="date"],
.field select, .field textarea {
  width: 100%; font-family: var(--mono); font-size: 1rem;
  padding: .65rem .75rem; border: 1px solid var(--platinum-2);
  border-radius: var(--radius-s); background: var(--paper); color: var(--anthracite);
}
.field textarea { font-family: var(--body); resize: vertical; min-height: 5rem; }
.field select { font-family: var(--body); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 94, 146, .15);
}
.field-row { display: grid; gap: .9rem; }
@media (min-width: 560px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }

.result {
  background: var(--paper); border: 1px solid var(--platinum-2);
  border-radius: var(--radius); padding: 1.3rem;
}
.result dl { display: grid; gap: .55rem; margin: 0; }
.result .row { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.result dt { color: var(--slate); font-size: .93rem; }
.result dd { margin: 0; font-family: var(--mono); font-weight: 500; text-align: right; }
.result .row--total { border-top: 1px solid var(--platinum-2); padding-top: .7rem; margin-top: .3rem; }
.result .row--total dt { color: var(--anthracite); font-weight: 600; font-size: 1rem; }
.result .row--total dd { font-size: 1.25rem; font-weight: 600; color: var(--blue); }

.seg { display: flex; gap: 0; border: 1px solid var(--platinum-2); border-radius: var(--radius-s); overflow: hidden; }
.seg button {
  flex: 1; font: inherit; font-size: .9rem; font-weight: 600; padding: .55rem .5rem;
  background: var(--paper); color: var(--slate); border: 0; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--platinum-2); }
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* Invoice builder output */
.invoice {
  background: #fff; border: 1px solid var(--platinum-2); border-radius: var(--radius);
  padding: 2rem; font-size: .93rem;
}
.invoice h2 { margin: 0; font-size: 1.5rem; }
.invoice__head { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.invoice__meta { font-family: var(--mono); font-size: .82rem; color: var(--slate); text-align: right; }
.invoice__parties { display: grid; gap: 1.2rem; margin-bottom: 1.6rem; }
@media (min-width: 560px) { .invoice__parties { grid-template-columns: 1fr 1fr; } }
.invoice__parties h3 {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--slate); margin: 0 0 .3rem; font-weight: 500;
}
.invoice__parties p { margin: 0; white-space: pre-line; }
.invoice table { min-width: 0; font-size: .9rem; }
.invoice td.num, .invoice th.num { text-align: right; font-family: var(--mono); }
.invoice__totals { margin-left: auto; max-width: 300px; }
.invoice__pay { margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--platinum-2); }
.line-row { display: grid; gap: .5rem; grid-template-columns: 1fr 4.5rem 6rem 2rem; align-items: start; margin-bottom: .5rem; }
.line-row input { font-size: .9rem !important; padding: .5rem !important; }
.line-row .x {
  background: none; border: 0; color: var(--slate); cursor: pointer; font-size: 1.2rem;
  padding: .4rem; line-height: 1;
}
.line-row .x:hover { color: var(--red); }
@media (max-width: 520px) { .line-row { grid-template-columns: 1fr 3rem 4.5rem 1.6rem; gap: .35rem; } }

/* --- 11. Footer ---------------------------------------------------------- */

.footer {
  background: var(--anthracite); color: #C3CAD2;
  padding-block: var(--gap-xl) 2rem; margin-top: 0;
}
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { text-decoration: underline; color: #fff; }
.footer h3 {
  font-family: var(--mono); font-size: .68rem; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: #8A939D; margin: 0 0 .8rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .45rem; font-size: .93rem; line-height: 1.45; }
/* Five columns: brand blurb + four link lists. Steps down gracefully rather
   than leaving an orphan column on a second row. */
.footer__cols { display: grid; gap: var(--gap-l); }
@media (min-width: 560px) { .footer__cols { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px) { .footer__cols { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1080px) { .footer__cols { grid-template-columns: 1.5fr repeat(4, 1fr); } }
.footer__brand { font-family: var(--display); font-weight: 700; font-size: 1.15rem; color: #fff; letter-spacing: -0.03em; }
.footer__brand span { color: #6FB1DC; }
.footer p { font-size: .93rem; max-width: 38ch; }
.footer__base {
  margin-top: var(--gap-xl); padding-top: 1.4rem; border-top: 1px solid #39424E;
  font-size: .85rem; color: #8A939D; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem;
  justify-content: space-between;
}
.footer__base p { max-width: 70ch; margin: 0; font-size: .85rem; }

/* Moreweb attribution strip */
.by-moreweb {
  background: var(--blue); color: #fff; padding-block: 2.5rem;
}
.by-moreweb h2 { color: #fff; margin-top: 0; }
.by-moreweb p { color: #DCE9F2; max-width: 56ch; }
.by-moreweb__inner { display: grid; gap: var(--gap-l); align-items: center; }
@media (min-width: 860px) { .by-moreweb__inner { grid-template-columns: 1fr 1fr; } }
.perks { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.perks li { display: flex; gap: .65rem; align-items: flex-start; color: #EAF3F9; font-size: .96rem; }
.perks svg { flex: none; width: 20px; height: 20px; margin-top: .15rem; }

@media (max-width: 560px) {
  .invoice { padding: 1.1rem; overflow-x: auto; }
  .invoice table { font-size: .8rem; }
  .invoice th, .invoice td { padding: .45rem .3rem; }
  .invoice__head { gap: .8rem; }
  .invoice__meta { text-align: left; }
}

/* Sidebar search: no card chrome, full column width, so the field can breathe */
.aside-cta {
  border-top: 3px solid var(--blue);
  background: var(--blue-tint);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.1rem 1rem 1.2rem;
}
.aside-cta h3 { margin: 0 0 .3rem; font-size: var(--step-0); color: var(--blue-dark); }
.aside-cta p { font-size: var(--step--1); color: var(--slate); margin: 0 0 .8rem; max-width: none; }
.aside-cta .checker { margin-top: 0; }

/* Print */
@media print {
  .masthead, .footer, .by-moreweb, .no-print, .toc, .aside-col, .pager { display: none !important; }
  body { font-size: 11pt; }
  .invoice { border: 0; padding: 0; }
  a { color: #000; text-decoration: none; }
}
