/* Fifth Wheel — the website.
 *
 * The app's one rule, kept honest on the web: a colour plate only where there is an answer. The
 * home page's load check, a calculator's result and the price get a plate; reading pages do not.
 * The plate's colour says one thing: teal keeps, amber is thin, brick loses.
 *
 * One family, Schibsted Grotesk (variable, self-hosted). Numbers in columns are tabular; a single
 * big figure is not.
 */

:root {
  --ground: #F7F9FA;
  --surface: #FFFFFF;
  --sunk: #ECF0F2;
  --line: #D9E0E3;
  --ink: #1F3038;
  --ink-2: #4E5C63;
  --link: #0B6A75;
  --teal: #0D7480;
  --amber: #9C6400;
  --brick: #973023;
  --slate: #3E5060;
  --good: #00665F;
  --warn: #8A5700;
  --bad: #A72F23;
  --plate: var(--teal);
  --on-plate: #FFFFFF;
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --max: 76rem;
  --text: 42rem;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 8px;
  --shadow: 0 1px 2px rgb(15 26 25 / .06), 0 8px 24px -6px rgb(15 26 25 / .14);
  --phone-shadow: 0 2px 4px rgb(15 26 25 / .1), 0 30px 60px -20px rgb(15 26 25 / .35);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #0A1110;
    --surface: #111B1A;
    --sunk: #172322;
    --line: #26322F;
    --ink: #E7EEED;
    --ink-2: #9DAEAC;
    --link: #7CCBD3;
    --teal: #0B5A63;
    --amber: #6E4706;
    --brick: #702219;
    --slate: #2E3C48;
    --good: #6ED0C2;
    --warn: #EBB25F;
    --bad: #F47C6E;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -6px rgb(0 0 0 / .5);
    --phone-shadow: 0 2px 4px rgb(0 0 0 / .4), 0 30px 60px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #0A1110; --surface: #111B1A; --sunk: #172322; --line: #26322F; --ink: #E7EEED; --ink-2: #9DAEAC;
  --link: #7CCBD3; --teal: #0B5A63; --amber: #6E4706; --brick: #702219; --slate: #2E3C48;
  --good: #6ED0C2; --warn: #EBB25F; --bad: #F47C6E; color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (pointer: fine) { html { overscroll-behavior: none; } }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 4px; }
.plated :focus-visible, .sign :focus-visible { outline-color: currentColor; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); font-weight: 500; letter-spacing: -.036em; line-height: 1.02; font-stretch: 96%; }
h2 { font-size: clamp(1.75rem, 3vw, 2.6rem); font-weight: 500; letter-spacing: -.028em; font-stretch: 96%; }
h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul, ol { padding-left: 1.25em; }
strong { font-weight: 500; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow > * { max-width: var(--text); }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.mono, code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .92em; }
.skip { position: absolute; left: -999px; top: 0; z-index: 99; background: var(--surface); color: var(--ink); padding: .75rem 1rem; }
.skip:focus { left: 1rem; top: 1rem; }
.num, td.num, th.num { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: .65rem 1.25rem; border-radius: 6px;
  font: 500 1rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  touch-action: manipulation;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: #0A606A; border-color: #0A606A; }
.plated .btn-primary, .sign .btn-primary { background: #fff; border-color: #fff; color: #0F1A19; }
.plated .btn-primary:hover, .sign .btn-primary:hover { background: #E9F2F0; }
.btn-block { display: flex; width: 100%; }
.btn .apple { width: 1.05em; height: 1.05em; margin-top: -.15em; }

/* ---------- site bar ---------- */
.top { position: relative; z-index: 5; background: var(--ground); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }
.brand { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none; font-weight: 500; font-size: 1.12rem; letter-spacing: -.02em; }
.brand svg { width: 28px; height: 28px; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a { color: inherit; text-decoration: none; font-weight: 550; padding: .6rem .7rem; border-radius: 8px; }
.nav a:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .35em; text-decoration-thickness: 2px; }
.top .get { display: none; }
@media (min-width: 760px) {
  .top .get { display: inline-flex; min-height: 40px; padding: .45rem .95rem; font-size: .95rem; border-color: var(--teal); background: var(--teal); color: #fff; }
  .top .get:hover { background: #0A606A; }
}
@media (max-width: 440px) { .top-row { gap: .5rem; } .nav a { padding: .55rem .4rem; font-size: .93rem; } .brand { font-size: 1rem; gap: .4rem; } .brand svg { width: 24px; height: 24px; } }

/* ---------- hero: the shoebox and the packet ---------- */
.hero-box { padding: clamp(2rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem); }
.hero-box-grid { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 1000px) { .hero-box-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 30rem); } }
.hero-copy h1 { font-size: clamp(2.7rem, 6.4vw, 5.4rem); max-width: 11ch; margin-bottom: .45em; }
.hero-sub { font-size: clamp(1.15rem, 1.7vw, 1.35rem); color: var(--ink-2); max-width: 34ch; margin-bottom: 2rem; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.hero-cta > a:not(.btn) { font-weight: 500; }
.hero-fine { margin: 1.5rem 0 0; font-size: .92rem; color: var(--ink-2); max-width: 46ch; }

/* The packet: the page the preparer reads, the app's real Schedule C summary shape. */
.packet { margin: 0; background: var(--surface); border-radius: 8px; box-shadow: var(--phone-shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.packet figcaption { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.packet figcaption b { display: block; font-size: 1.25rem; letter-spacing: -.015em; }
.packet figcaption span { color: var(--ink-2); font-size: .92rem; }
.packet table { font-size: .98rem; margin: 0; }
.packet th { font-weight: 560; border-bottom: 1px solid var(--line); padding: .6rem 1rem .6rem 0; }
.packet td { text-align: right; font-weight: 500; white-space: nowrap; padding: .6rem 0; }
.packet small { display: block; color: var(--ink-2); font-size: .82rem; font-weight: 400; margin-top: .1rem; }
.packet .line { display: inline-block; min-width: 2.6em; color: var(--link); font-weight: 500; }
.packet small { padding-left: 3.11em; }
.packet .gross th, .packet .gross td { font-weight: 500; border-bottom: 2px solid var(--line); }
.packet .aside th, .packet .aside td { color: var(--ink-2); border-bottom: 0; }
.packet .aside small { padding-left: 0; }
.packet-foot { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .9rem; color: var(--ink-2); }

/* One receipt fanning out to the load, IFTA and Schedule C. */
.fan { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 860px) { .fan { grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 0; } }
.receipt-card { margin: 0; background: var(--surface); border-radius: 8px; padding: 1.5rem; box-shadow: var(--shadow); }
.receipt-card dd { margin: 0; }
.rc-where { font-weight: 500; font-size: 1.15rem; line-height: 1.3; }
.rc-when, .rc-what { color: var(--ink-2); margin-top: .35rem !important; }
.rc-total { font-size: 2.6rem; font-weight: 500; letter-spacing: -.035em; margin-top: 1rem !important; line-height: 1; }
.fan-out { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.fan-out li { display: grid; gap: .15rem; padding: 1rem 1.25rem; border-radius: 14px; background: var(--sunk); position: relative; }
.fan-out b { font-size: 1.1rem; }
.fan-out span { color: var(--ink-2); }
@media (min-width: 860px) {
  .fan-out { padding-left: 4.5rem; position: relative; }
  .fan-out::before { content: ""; position: absolute; left: 2.25rem; top: 2.2rem; bottom: 2.2rem; border-left: 2px solid var(--link); }
  .fan-out::after { content: ""; position: absolute; left: 0; top: 50%; width: 2.25rem; border-top: 2px solid var(--link); }
  .fan-out li::before { content: ""; position: absolute; left: -2.25rem; top: 50%; width: 2.25rem; border-top: 2px solid var(--link); }
}
@media (max-width: 859px) {
  .fan-out { border-left: 2px solid var(--link); padding-left: 1rem; margin-left: 1.5rem; }
}
.fan-notes { list-style: none; margin: 2.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem 2.5rem; color: var(--ink-2); }
.fan-notes b { color: var(--ink); font-weight: 500; }

/* IFTA example: the inputs, then the answer on a plate. */
.ifta-demo { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 960px) { .ifta-demo { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 2rem; } }
.ifta-table { margin: 0; }
.ifta-table th[scope="row"] { font-weight: 500; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ifta-table thead th { font-size: .9rem; border-bottom: 2px solid var(--ink); }
.ifta-table td { padding: .45rem 0 .45rem .6rem; }
.ifta-table input { text-align: right; min-height: 44px; padding: .5rem .7rem; }
.ifta-answer { background: var(--teal); color: #fff; border-radius: 8px; padding: clamp(1.4rem, 3vw, 2rem); }
.ia-word { display: block; font-weight: 500; font-size: 1.1rem; opacity: .95; }
.ia-amount { display: block; font-size: clamp(3.2rem, 8vw, 5rem); font-weight: 500; letter-spacing: -.045em; line-height: 1; margin: .2rem 0 .8rem; }
.ia-line { margin: 0 0 1.25rem; }
.ia-states { list-style: none; margin: 0; padding: 0; }
.ia-states li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-top: 1px solid rgb(255 255 255 / .25); }
.ia-states b { font-weight: 500; }
.ia-note { margin: 1rem 0 0; font-size: .92rem; opacity: .9; }

/* The filings calendar. */
@media (min-width: 960px) { .dates-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4rem; align-items: start; } }
.dates { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.dates li { display: grid; gap: .1rem 2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 600px) { .dates li { grid-template-columns: 11rem minmax(0, 1fr); } }
.dates b { font-size: 1.12rem; }
.dates span { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  .sign { transition: none !important; }
}

/* ---------- sections ---------- */
.band { padding: clamp(3.5rem, 8vw, 7rem) 0; }
.band + .band { padding-top: 0; }
.band-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.band-head p { font-size: 1.15rem; color: var(--ink-2); margin: 0; }
.band-ink, .foot { --fg: #E7EEED; --dim: #A3B2B0; --rule: #2A3836; background: #0F1A19; color: var(--fg); }
.band-ink .band-head p, .band-ink .muted { color: var(--dim); }
.band-ink a { color: inherit; }

/* Index lists: calculators and guides, big titles, no boxes. */
.index { display: grid; gap: 0 clamp(2rem, 4vw, 4rem); margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .index.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.index a { display: block; padding: 1.15rem 0 1.25rem; border-top: 1px solid var(--line); color: inherit; text-decoration: none; height: 100%; }
.index a:hover .ix-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .2em; }
.ix-title { display: block; font-size: 1.22rem; font-weight: 500; letter-spacing: -.015em; line-height: 1.25; margin-bottom: .3rem; color: var(--ink); }
.ix-sub { display: block; color: var(--ink-2); font-size: 1rem; }
.ix-meta { display: block; color: var(--ink-2); font-size: .88rem; margin-top: .45rem; }

/* Guides grouped by section on the home page and the guides index. */
.shelves { display: grid; gap: 2.5rem clamp(2rem, 4vw, 4rem); }
@media (min-width: 760px) { .shelves { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shelf h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.shelf h3 a { color: inherit; text-decoration: none; }
.shelf ul { list-style: none; margin: 0; padding: 0; }
.shelf li a { display: block; padding: .7rem 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 520; }
.shelf li a:hover { color: var(--link); text-decoration: underline; }
.shelf .more { display: inline-block; margin-top: .7rem; font-weight: 500; }

/* Price: one statement, on a plate, because it is an answer. */
.price-plate { background: var(--teal); color: #fff; border-radius: 8px; padding: clamp(1.75rem, 4vw, 3rem); display: grid; gap: 2rem; }
@media (min-width: 860px) { .price-plate { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; } }
.price-big { font-size: clamp(3rem, 8vw, 5.5rem); font-weight: 500; letter-spacing: -.045em; line-height: .95; margin: 0 0 .75rem; }
.price-big small { font-size: .32em; font-weight: 500; letter-spacing: -.01em; }
.price-or { font-size: 1.25rem; font-weight: 500; margin: 0; }
.price-terms { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.price-terms li { padding: .6rem 0; border-top: 1px solid rgb(255 255 255 / .25); }
.price-terms li:first-child { border-top: 0; padding-top: 0; }
.price-plate a:not(.btn) { color: #fff; }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.15rem 2.5rem 1.15rem 0; font-size: 1.15rem; font-weight: 500; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: .5rem; top: 50%; width: 12px; height: 12px; border-right: 2.5px solid var(--ink-2); border-bottom: 2.5px solid var(--ink-2); transform: translateY(-75%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { margin: 0 0 1.25rem; color: var(--ink-2); max-width: 62ch; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* The closing ask on the home page. */
.closer { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 860px) { .closer { grid-template-columns: minmax(0, 1fr) auto; } }
.closer h2 { margin: 0; max-width: 18ch; }

/* ---------- page heads (reading pages: no plate) ---------- */
.page-head { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 2.75rem); }
.page-head h1 { max-width: 20ch; margin-bottom: .4em; }
.page-head .lede { font-size: clamp(1.15rem, 1.8vw, 1.35rem); color: var(--ink-2); max-width: 46rem; margin: 0; }
.page-head .meta { color: var(--ink-2); margin: 1rem 0 0; }
.crumbs { font-size: .95rem; margin-bottom: 1.25rem; color: var(--ink-2); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: .3rem; color: var(--line); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--link); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }
.sheet section { padding: 0 0 clamp(3rem, 7vw, 5.5rem); }
.lede { font-size: 1.2rem; }

/* ---------- prose (posts, legal, support) ---------- */
.prose { font-size: 1.125rem; line-height: 1.7; }
.prose h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 2.4em 0 .6em; scroll-margin-top: 1.5rem; }
.prose h3 { margin: 1.9em 0 .5em; }
.prose > :first-child { margin-top: 0; }
.prose li { margin-bottom: .45em; }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--teal); color: var(--ink-2); }
.prose img { border-radius: var(--r); }
.prose em { font-style: italic; }
.table-wrap { overflow-x: auto; margin: 1.75em 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: .7rem .8rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 500; border-bottom: 2px solid var(--ink); }
tr:last-child td { border-bottom: 0; }
.prose table td:last-child, .prose table th:last-child { padding-right: 0; }

/* A post: article plus a rail with the contents and the calculator. */
.post { display: grid; gap: 3rem; }
@media (min-width: 1040px) {
  .post { grid-template-columns: minmax(0, var(--text)) minmax(0, 17rem); justify-content: space-between; }
  .rail { position: sticky; top: 1.5rem; align-self: start; }
}
.byline { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; color: var(--ink-2); font-size: .98rem; margin-top: 1.25rem; }
.toc { font-size: .97rem; margin-bottom: 2rem; }
.toc h2 { font-size: 1rem; margin-bottom: .6rem; letter-spacing: -.005em; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: .35rem 0 .35rem 1rem; color: var(--ink-2); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--ink-2); }
@media (max-width: 1039px) { .toc { display: none; } }
.calc-link { display: block; border-radius: var(--r); padding: 1.25rem 1.25rem 1.35rem; background: var(--teal); color: #fff; text-decoration: none; }
.calc-link b { display: block; font-size: 1.15rem; margin-bottom: .2rem; }
.calc-link span { opacity: .9; font-size: .97rem; }
.calc-link:hover b { text-decoration: underline; text-underline-offset: .2em; }
.after-post { margin-top: clamp(3rem, 7vw, 5rem); }
.after-post h2 { font-size: 1.5rem; }
.app-ask { margin-top: 3.5rem; padding-top: 2rem; border-top: 2px solid var(--ink); display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .app-ask { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.app-ask h2 { font-size: 1.6rem; margin-bottom: .3rem; }
.app-ask p { margin: 0; color: var(--ink-2); max-width: 48ch; }

/* ---------- calculators ---------- */
.calc-layout { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 960px) {
  .calc-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 2rem; }
  .calc-layout .result { position: sticky; top: 1.5rem; }
}
.card { background: var(--surface); border-radius: 8px; padding: clamp(1.25rem, 3vw, 2rem); box-shadow: var(--shadow); }
.form-part { font-weight: 500; font-size: 1.05rem; margin: 0 0 .9rem; }
.form-part:not(:first-child) { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.field-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.field { margin-bottom: 1rem; display: flex; flex-direction: column; }
.field label, .row-grid label { font-weight: 500; font-size: .95rem; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; color: var(--ink-2); font-size: .86rem; }
.field input { margin-top: auto; }
input, select, textarea {
  font: 500 1.0625rem/1.3 var(--font); color: var(--ink);
  background: var(--ground); border: 1.5px solid var(--line); border-radius: 10px;
  padding: .7rem .8rem; min-height: 48px; width: 100%;
}
select { background-color: var(--ground); color: var(--ink); }
input:hover, select:hover { border-color: var(--ink-2); }
input:focus, select:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 25%, transparent); }
.row-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 48px; gap: .6rem; align-items: end; margin-bottom: .8rem; }
.row-grid.two { grid-template-columns: 1.4fr 1fr 48px; }
.row-grid > div { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 520px) {
  .row-grid { grid-template-columns: 1fr 1fr 48px; }
  .row-grid > div:first-child { grid-column: 1 / -1; }
  .row-grid.two { grid-template-columns: 1fr 48px; }
  .row-grid.two > div:first-child { grid-column: 1 / -1; }
}
.btn.remove { min-height: 48px; padding: 0; font-size: 1.4rem; line-height: 1; color: var(--ink-2); }
.calc-layout form > .btn-primary { margin-top: .5rem; }
.seg { display: inline-flex; background: var(--sunk); border-radius: 12px; padding: 4px; margin-bottom: 1.25rem; }
.seg button { font: 500 .98rem var(--font); border: 0; background: transparent; color: var(--ink-2); padding: .6rem 1rem; border-radius: 9px; cursor: pointer; min-height: 44px; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* The result is an answer, so it is a plate, and it turns colour with the verdict. */
.sign { background: var(--teal); color: #fff; border-radius: 8px; padding: clamp(1.4rem, 3vw, 2rem); transition: background-color .3s ease; }
.sign:empty { display: none; }
.sign:has(.big.thin) { background: var(--amber); }
.sign:has(.big.loss), .sign:has(.note.bad) { background: var(--brick); }
.sign a { color: #fff; }
.sign .label { font-weight: 500; font-size: 1.02rem; opacity: .92; }
.sign .big { font-size: clamp(2.6rem, 6vw, 4rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; margin: .2rem 0 1.1rem; overflow-wrap: anywhere; }
.sign dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0 0 1rem; }
.sign dt, .sign dd { padding: .55rem 0; border-top: 1px solid rgb(255 255 255 / .22); margin: 0; }
.sign dt { padding-right: 1rem; opacity: .92; }
.sign dd { font-weight: 500; text-align: right; }
.sign hr { border-top: 2px solid rgb(255 255 255 / .5); margin: 1.5rem 0; }
.sign .note { font-size: .95rem; opacity: .92; margin: .75rem 0 0; }
.sign .note.warn, .sign .note.bad { opacity: 1; font-weight: 500; padding: .7rem .85rem; border-radius: 10px; background: rgb(0 0 0 / .18); }
.sign table { font-size: .9rem; color: #fff; }
.sign th { border-bottom-color: rgb(255 255 255 / .7); }
.sign td { border-bottom-color: rgb(255 255 255 / .2); }
.sign .good, .sign .thin, .sign .loss { font-weight: 500; }
.sign dd.loss::before { content: "▼ "; font-size: .7em; }
.how { margin-top: clamp(3rem, 6vw, 4.5rem); }
.how h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); }
.disclaimer { color: var(--ink-2); font-size: .95rem; }
.cta-line { padding-top: 1.25rem; border-top: 1px solid var(--line); }
.related-guides { margin-top: 2.5rem; }
.related-guides h2 { font-size: 1.4rem; }

/* ---------- invite / reset ---------- */
.code-display { font: 500 clamp(2rem, 7vw, 3rem)/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .06em; background: var(--surface); color: var(--ink); border-radius: var(--r); padding: 1rem 1.25rem; text-align: center; margin: 1.5rem 0 1rem; box-shadow: var(--shadow); }
.stack { display: grid; gap: .75rem; max-width: 26rem; }

/* ---------- footer ---------- */
.foot { padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem; margin-top: 0; }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-grid { display: grid; gap: 2.25rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .foot-grid { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); } }
.foot-brand { grid-column: 1 / -1; }
@media (min-width: 900px) { .foot-brand { grid-column: auto; } }
.foot-brand p { color: var(--dim); max-width: 30ch; margin-top: .75rem; }
.foot h2 { font-size: 1rem; margin-bottom: .75rem; letter-spacing: 0; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 0 0 .1rem; }
.foot li a { display: inline-block; padding: .3rem 0; color: var(--fg); opacity: .88; }
.foot-fine { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--dim); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .foot, :root:not([data-theme="light"]) .band-ink { background: #050A09; }
}

@media print {
  .top, .foot, .rail, .app-ask, .after-post { display: none; }
  body { background: #fff; color: #000; }
}

/* White buttons on dark or coloured ground. */
.price-plate .btn-primary, .get-ink { background: #fff; border-color: #fff; color: #0F1A19; }
.price-plate .btn-primary:hover, .get-ink:hover { background: #E9F2F0; border-color: #E9F2F0; }

.band-ink .get-ink { color: #0F1A19; }
.band.band-ink { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.band-ink + .foot, main:has(> .band-ink:last-child) + .foot { padding-top: 0; }
main:has(> .band-ink:last-child) + .foot .foot-grid { padding-top: 2.5rem; border-top: 1px solid var(--rule); }
