/* ==========================================================================
   Swiss Import Calculator — design system
   Swiss International Typographic Style: strict grid, hairline rules,
   grotesque type, flag red. Result panel styled as a customs receipt.
   ========================================================================== */

/* Self-hosted fonts (no third-party requests). Subsets sourced from
   Google Fonts: Archivo variable 400–900, Fragment Mono 400. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 400 900;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/fragment-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Fragment Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/fragment-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #faf9f6;
  --surface: #ffffff;
  --ink: #10141a;
  --muted: #5b6470;
  --hair: rgba(16, 20, 26, 0.16);
  --hair-soft: rgba(16, 20, 26, 0.09);
  --edge: rgba(16, 20, 26, 0.32);
  --red: #da291c;
  --red-deep: #b02015;
  --red-tint: #fdf1f0;
  --green: #14683f;
  --green-tint: #eef6f0;
  --amber: #7a5a00;
  --amber-tint: #fbf4e2;
  --font-sans: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, "Cascadia Mono", "Courier New", monospace;
  --wrap: 1120px;
  --gutter: clamp(18px, 4vw, 40px);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  /* Swiss flag stripe */
  border-top: 4px solid var(--red);
}

::selection {
  background: var(--red);
  color: #fff;
}

a {
  color: var(--red-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--red);
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.06;
  letter-spacing: -0.015em;
  font-weight: 800;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.35rem, 5.4vw, 3.9rem);
}

h2 {
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
}

h3 {
  font-size: 1.125rem;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
}

p strong {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* --------------------------------------------------------------------------
   Type utilities
   -------------------------------------------------------------------------- */

.eyebrow {
  margin: 0 0 14px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mono {
  font-family: var(--font-mono);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--ink);
}

.section-head .index {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--red);
}

.section-head h2 {
  flex: 1;
}

.section-head .aside-note {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (min-width: 720px) {
  .section-head .aside-note {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   Header / footer
   -------------------------------------------------------------------------- */

.site-header {
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand svg {
  display: block;
  width: 26px;
  height: 26px;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(14px, 2.5vw, 26px);
}

.site-nav a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--red);
}

.site-nav .nav-cta {
  padding: 9px 16px;
  background: var(--ink);
  color: #fff;
}

.site-nav .nav-cta:hover {
  background: var(--red);
  color: #fff;
}

.nav-langs {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding-left: clamp(14px, 2.5vw, 26px);
  border-left: 1px solid var(--hair);
}

.nav-globe {
  width: 15px;
  height: 15px;
  color: var(--muted);
  flex-shrink: 0;
}

.nav-lang {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
}

span.nav-lang {
  color: var(--red);
}

.site-footer {
  margin-top: clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--ink);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

.footer-grid h3 {
  margin-bottom: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li {
  margin: 8px 0;
}

.footer-grid a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-grid a:hover {
  color: var(--red-deep);
  text-decoration: underline;
}

.footer-about p {
  margin-top: 12px;
  font-size: 0.9rem;
  max-width: 34ch;
}

.footer-verified {
  display: inline-block;
  margin-top: 16px;
  padding: 6px 10px;
  border: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-bottom {
  border-top: 1px solid var(--hair);
}

.footer-bottom .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 20px;
  font-size: 0.78rem;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--red);
  background: var(--red);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding-top: clamp(36px, 6vw, 72px);
  padding-bottom: clamp(28px, 4vw, 48px);
}

.hero h1 {
  max-width: 17ch;
}

.hero .dek {
  max-width: 58ch;
  margin-top: 18px;
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-meta b {
  color: var(--ink);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Calculator layout
   -------------------------------------------------------------------------- */

.calculator {
  padding-bottom: clamp(40px, 6vw, 72px);
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
}

.calc-form {
  display: grid;
  gap: 26px;
}

.calc-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field-label,
.calc-form legend,
.seg-legend {
  display: block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.field-label .opt,
.calc-form legend .opt {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.06em;
}

/* "Example — clear" flag on the prefilled order. Hidden by script.js as soon
   as the visitor edits anything or arrives via a shared ?p=… link. */
.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.example-note {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.example-reset {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: var(--red-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.example-reset:hover {
  color: var(--red);
}

/* Money inputs */

.money-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.money-field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--edge);
  background: var(--surface);
}

.money-field .unit {
  display: grid;
  place-items: center;
  min-width: 56px;
  border-right: 1px solid var(--hair);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.money-field .unit-select {
  min-width: 78px;
  border: 0;
  border-right: 1px solid var(--hair);
  padding: 0 26px 0 14px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2310141a' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  appearance: none;
  cursor: pointer;
}

.money-field .unit-select:focus {
  outline: none;
}

.money-field input {
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 13px 14px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 1.15rem;
}

.money-field input:focus {
  outline: none;
}

.money-field:focus-within {
  outline: 2px solid var(--red);
  outline-offset: -1px;
}

/* Currency lives inside the price field; FX rate row appears below it */

select {
  border-radius: 0;
  appearance: none;
}

.rate-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.rate-field[hidden] {
  display: none;
}

.rate-field input {
  width: 86px;
  border: 1px solid var(--hair);
  padding: 7px 10px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.rate-hint,
.rate-unit {
  color: var(--muted);
}

/* Currency FX tip (affiliate, shown only for non-CHF) */

.fx-tip {
  margin-top: 16px;
  padding: 15px 17px;
  background: var(--surface);
  border: 1px solid var(--edge);
}

.fx-tip[hidden] {
  display: none;
}

.fx-tip-head {
  margin: 0 0 5px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.fx-tip-body {
  margin: 0 0 13px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
}

.fx-tip-cta {
  display: inline-block;
  padding: 9px 15px;
  background: var(--red);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.fx-tip-cta:hover {
  background: var(--red-deep);
  color: #fff;
}

.fx-tip-disc {
  margin-left: 11px;
  font-size: 0.72rem;
  color: var(--muted);
}

/* Compact Wise line inside the result panel */

.fx-mini {
  margin: 15px 0 0;
  padding-top: 13px;
  border-top: 1px solid var(--hair);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.fx-mini[hidden] {
  display: none;
}

.fx-mini-link {
  color: var(--red-deep);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fx-mini-link:hover {
  color: var(--red);
}

/* Radio option cards */

.option-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--edge);
  background: var(--surface);
}

.option-list label {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hair);
  cursor: pointer;
}

.option-list label:last-child {
  border-bottom: 0;
}

.option-list input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-list .dot {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  border: 1px solid var(--ink);
  border-radius: 50%;
}

.option-list label:has(input:checked) {
  background: var(--red-tint);
  box-shadow: inset 3px 0 0 var(--red);
}

.option-list label:has(input:checked) .dot {
  border-color: var(--red);
  background: radial-gradient(circle, var(--red) 0 42%, transparent 46%);
}

.option-list label:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.option-list .option-text {
  display: grid;
  gap: 2px;
}

.option-list .option-text strong {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.option-list .option-text small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

/* Segmented control */

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--edge);
  background: var(--surface);
}

.seg label {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 8px 10px;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.seg label + label {
  border-left: 1px solid var(--hair);
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg label:has(input:checked) {
  background: var(--ink);
  color: #fff;
}

.seg label:has(input:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: -2px;
}

.seg-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.seg-4 label {
  padding-left: 6px;
  padding-right: 6px;
  font-size: 0.8rem;
}

.seg-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* Parcel calculator keeps its two <fieldset> toggles as flex columns with the
   buttons pinned to the bottom, so the two button rows align. */
.seg-row fieldset {
  display: flex;
  flex-direction: column;
}

.seg-row fieldset .seg {
  margin-top: auto;
}

/* Car calculator: each toggle's label / buttons / helper line become grid
   items via display:contents on .seg-field, so both toggles share three row
   tracks and stay aligned even when a label or hint wraps. The radio-group
   semantics live on .seg (role=radiogroup + aria-labelledby), independent of
   this layout-only wrapper. */
#car-form .seg-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  column-gap: 14px;
  row-gap: 10px;
  align-items: start;
}

/* Both toggles share the second grid row, so its track is as tall as the
   taller control (the "Moving to CH / inheritance" label wraps to two lines).
   Stretch each .seg to fill that track so the two toggles are the same height;
   the legends above stay top-aligned. (On mobile .seg-field is display:block,
   so .seg is no longer a grid item and this is a harmless no-op there.) */
#car-form .seg-row .seg {
  align-self: stretch;
}

/* Unify every toggle-button height across the car form. The two-line "Moving
   to CH / inheritance" label makes the reg/reason buttons 50px tall; lift the
   base min-height so the single-line fuel buttons match, and all three toggles
   are the same height instead of the fuel row sitting 2px shorter. */
#car-form .seg label {
  min-height: 50px;
}

.seg-field {
  display: contents;
}

#car-form .seg-legend {
  margin-bottom: 0;
}

/* Collapsible "what counts as a used import?" note under the car toggles —
   the one eligibility rule the result card can't show, tucked out of the way. */
.seg-help {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
}

.seg-help > summary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 4px 0;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.seg-help > summary::-webkit-details-marker {
  display: none;
}

.seg-help > summary:hover {
  color: var(--red);
}

.seg-help > summary:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 2px;
}

.info-icon {
  flex: none;
  width: 18px;
  height: 18px;
}

.seg-help[open] > summary {
  margin-bottom: 10px;
}

.seg-help-body {
  max-width: 64ch;
  line-height: 1.55;
}

.seg-help-body p {
  margin: 0 0 8px;
}

.seg-help-body ul {
  margin: 0;
  padding-left: 20px;
}

.seg-help-body li {
  margin: 3px 0;
}

.seg-help-body strong {
  color: var(--ink);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Result card
   -------------------------------------------------------------------------- */

.result-holder {
  position: sticky;
  top: 18px;
  scroll-margin-top: 14px;
}

.result-card {
  padding: clamp(24px, 3.2vw, 34px);
  background: rgba(16, 20, 26, 0.045);
  border: 1px solid var(--hair);
}

.result-total {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: clamp(3rem, 8.4vw, 4.1rem);
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--red-deep);
}

.result-total .amount-cur {
  font-size: 0.3em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  margin-right: 0.42em;
  vertical-align: 0.28em;
}

.result-total .amount-dec {
  font-size: 0.6em;
  font-weight: 700;
}

.result-lead {
  max-width: 34ch;
  margin: 12px 0 clamp(20px, 3vw, 28px);
  padding-bottom: clamp(20px, 3vw, 28px);
  border-bottom: 1px solid var(--hair);
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
}

.result-total.is-zero {
  color: var(--green);
}

.result-lines {
  margin: 0;
}

.result-lines > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hair-soft);
}

.result-lines > div:last-child {
  border-bottom: 0;
}

.result-lines dt {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.result-lines dt small {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  font-weight: 400;
  color: var(--muted);
}

.result-lines dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  white-space: nowrap;
  text-align: right;
  color: var(--ink);
}

.result-lines dd.is-zero {
  color: var(--green);
}

.result-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--hair-soft);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* Copy/share actions at the foot of the receipt. The native Share button is
   revealed by script.js only where the Web Share API exists. */
.result-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hair-soft);
}

.share-btn {
  border: 1px solid var(--edge);
  background: var(--surface);
  padding: 9px 14px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
}

.share-btn:hover {
  border-color: var(--ink);
  background: var(--paper);
}

.share-btn.is-done {
  border-color: var(--green);
  background: var(--green-tint);
  color: var(--green);
}

/* Peek bar: on phones the detailed result sits below a ~700px form, so a slim
   fixed bar mirrors the running total while the visitor types. Shown only
   when the form is on screen and the real result card is not (script.js
   IntersectionObserver); aria-hidden because the card is the live region. */
.calc-peek {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: none;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  padding: 13px var(--gutter);
  padding-bottom: calc(13px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform: translateY(101%);
  transition: transform 0.25s ease;
}

.calc-peek.is-on {
  transform: translateY(0);
}

.peek-label {
  flex: 1;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.peek-amount {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--red-deep);
  white-space: nowrap;
}

.peek-amount.is-zero {
  color: var(--green);
}

.peek-arrow {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .calc-peek {
    transition: none;
  }
}

/* Methodology note under the estimate card (car calc). It sits in the right
   rail directly beneath the card, reading as a footnote to the figures. The
   min-height reserves room for the longest note (the relocation copy, longest
   in FR) so switching states never resizes the column or nudges the sections
   below. */
.calc-caption {
  margin: clamp(16px, 2vw, 20px) 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--hair-soft);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  min-height: 9.5em;
}

/* Car calculator: keep the estimate card a tidy receipt (the methodology note
   now lives in the caption) by trimming the internal vertical rhythm below. The
   card padding is deliberately left at the shared .result-card value so both
   calculators' estimate cards frame their content identically. */
.calc-grid:has(#car-form) .result-lead {
  margin-bottom: 18px;
  padding-bottom: 18px;
}

.calc-grid:has(#car-form) .result-lines > div {
  padding: 12px 0;
}

/* Constant-height estimate card: all four rows are always present now, so the
   only thing that could still change the card's height is a sub-label wrapping
   to a different number of lines between states (e.g. "4% of CHF 23'500.00" vs
   "waived — removal goods"). Reserve two lines for every sub-label and for the
   headline lead so the card is byte-for-byte the same height in every state and
   language. */
.calc-grid:has(#car-form) .result-lead {
  min-height: 2.9em;
}

.calc-grid:has(#car-form) .result-lines dt small {
  line-height: 1.4;
  min-height: 2.8em;
}

/* Let the car estimate card stay put in the flow and scroll with the form
   instead of pinning to the top. The car form and the card are near-equal
   height, so sticky gave the card almost no travel — it just detached and
   drifted relative to the form. (The parcel calculator keeps its sticky rail.) */
.calc-grid:has(#car-form) .result-holder {
  position: static;
}

/* --------------------------------------------------------------------------
   Content sections
   -------------------------------------------------------------------------- */

.section {
  padding-top: clamp(40px, 7vw, 84px);
}

.section > .wrap > .lead {
  max-width: 62ch;
  margin-bottom: clamp(22px, 3vw, 34px);
  font-size: 1.02rem;
}

/* Big stat band */

.stat-band {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--ink);
  background: var(--surface);
}

.stat {
  padding: clamp(20px, 3vw, 34px);
  border-left: 1px solid var(--hair);
}

.stat:first-child {
  border-left: 0;
}

.stat .figure {
  font-family: var(--font-mono);
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  letter-spacing: -0.03em;
  color: var(--ink);
}

.stat .figure em {
  font-style: normal;
  color: var(--red);
}

.stat h3 {
  margin-top: 10px;
  font-size: 0.95rem;
}

.stat p {
  margin-top: 6px;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* Step list */

.steps {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--ink);
  counter-reset: step;
}

.step {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  padding: clamp(18px, 3vw, 28px) 0;
  border-bottom: 1px solid var(--hair);
}

.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--red);
}

.step h3 {
  margin-bottom: 8px;
}

.step p {
  max-width: 68ch;
}

.step p + p {
  margin-top: 8px;
}

/* Data tables */

.data-table {
  width: 100%;
  border: 1px solid var(--ink);
  border-collapse: collapse;
  background: var(--surface);
  font-size: 0.92rem;
}

.data-table caption {
  caption-side: bottom;
  padding: 10px 2px;
  font-size: 0.78rem;
  text-align: left;
  color: var(--muted);
}

.data-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  color: var(--ink);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hair-soft);
  color: var(--muted);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table td:first-child {
  color: var(--ink);
  font-weight: 600;
}

.data-table .num {
  font-family: var(--font-mono);
  white-space: nowrap;
  text-align: right;
  color: var(--ink);
}

.data-table th.num {
  font-family: inherit;
  color: inherit;
}

.table-scroll {
  overflow-x: auto;
}

/* Worked example / callouts */

.callout {
  padding: 18px 22px;
  border: 1px solid var(--ink);
  border-left: 4px solid var(--red);
  background: var(--surface);
}

.steps + .callout {
  margin-top: 28px;
}

.fine-print {
  font-size: 0.95rem;
  color: var(--muted);
}

.callout .label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.callout p {
  font-size: 0.95rem;
}

.callout p + p {
  margin-top: 8px;
}

/* Guides index list */

.guide-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
  counter-reset: guide;
}

.guide-list li {
  border-bottom: 1px solid var(--hair);
}

.guide-list a {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 28px;
  gap: 18px;
  align-items: baseline;
  padding: clamp(16px, 2.6vw, 24px) 4px;
  color: var(--ink);
  text-decoration: none;
}

.guide-list a::before {
  counter-increment: guide;
  content: counter(guide, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--red);
}

.guide-list .guide-text {
  display: grid;
  gap: 4px;
}

.guide-list .guide-text strong {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.guide-list .guide-text span {
  font-size: 0.9rem;
  color: var(--muted);
}

.guide-list .arrow {
  font-family: var(--font-mono);
  color: var(--muted);
  transition: transform 120ms ease, color 120ms ease;
}

.guide-list a:hover .guide-text strong {
  color: var(--red-deep);
}

.guide-list a:hover .arrow {
  transform: translateX(6px);
  color: var(--red);
}

/* FAQ */

.faq-list {
  border-top: 1px solid var(--ink);
}

.faq-list details {
  border-bottom: 1px solid var(--hair);
}

.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 18px 4px;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--red);
}

.faq-list details[open] summary::after {
  content: "\2212";
}

.faq-list .faq-body {
  max-width: 70ch;
  padding: 0 4px 20px;
}

.faq-list .faq-body p + p {
  margin-top: 8px;
}

/* Sources strip */

.sources-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.sources-strip a {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-left: 1px solid var(--hair);
  color: var(--ink);
  text-decoration: none;
}

.sources-strip a:first-child {
  border-left: 0;
}

.sources-strip .src-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.sources-strip .src-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.sources-strip a:hover .src-name {
  color: var(--red-deep);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Article / guide pages
   -------------------------------------------------------------------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--hair);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--red-deep);
}

.breadcrumb [aria-current] {
  color: var(--ink);
}

.article-hero {
  padding-top: clamp(32px, 5vw, 56px);
  padding-bottom: clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--ink);
}

.article-hero h1 {
  max-width: 24ch;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
}

.article-hero .dek {
  max-width: 62ch;
  margin-top: 16px;
  font-size: 1.08rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(28px, 4.5vw, 56px);
  padding-top: clamp(28px, 4.5vw, 48px);
  align-items: start;
}

.article-body {
  max-width: 70ch;
}

.article-body h2 {
  margin-top: clamp(30px, 4.5vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--hair);
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
}

.article-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.article-body h3 {
  margin-top: 24px;
}

.article-body p {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.7;
}

.article-body ul,
.article-body ol {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.article-body li {
  margin: 7px 0;
}

.article-body li strong {
  color: var(--ink);
}

.article-body .callout,
.article-body .data-table,
.article-body .table-scroll {
  margin-top: 20px;
}

.quick-answer {
  padding: 20px 24px;
  border: 1px solid var(--ink);
  border-left: 4px solid var(--red);
  background: var(--surface);
}

.quick-answer .label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.quick-answer p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
}

.article-body .quick-answer {
  margin-bottom: 28px;
}

/* Article sidebar */

.article-aside {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 20px;
}

.aside-card {
  padding: 20px 22px;
  border: 1px solid var(--ink);
  background: var(--surface);
}

.aside-card h2 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.aside-card p {
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.aside-card .btn {
  width: 100%;
}

.aside-links h3 {
  margin-bottom: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.aside-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.aside-links li {
  border-top: 1px solid var(--hair-soft);
}

.aside-links a {
  display: block;
  padding: 9px 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.aside-links a:hover {
  color: var(--red-deep);
}

/* In-article FAQ reuses .faq-list */

.article-body .faq-list {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Utility / misc pages
   -------------------------------------------------------------------------- */

.prose-page {
  max-width: 70ch;
  padding-top: clamp(32px, 5vw, 56px);
}

.prose-page h1 {
  font-size: clamp(2rem, 4.6vw, 3rem);
}

.prose-page h2 {
  margin-top: 34px;
  font-size: 1.4rem;
}

.prose-page p {
  margin-top: 14px;
  line-height: 1.7;
}

.prose-page ul {
  margin: 14px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.error-page {
  padding-top: clamp(48px, 10vw, 120px);
  text-align: center;
}

.error-page .code {
  font-family: var(--font-mono);
  font-size: clamp(4rem, 14vw, 8rem);
  color: var(--red);
  line-height: 1;
}

.error-page h1 {
  margin-top: 12px;
}

.error-page p {
  margin-top: 14px;
}

.error-page .btn {
  margin-top: 28px;
}

.error-page .error-links {
  margin-top: 26px;
  font-size: 0.9rem;
}

.error-page .error-links + .error-links {
  margin-top: 10px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }

  .result-holder {
    position: static;
  }

  /* The peek bar only exists on stacked layouts — beside-the-form result
     cards above 960px make it redundant. */
  .calc-peek {
    display: flex;
  }

  .article-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-aside {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .stat-band {
    grid-template-columns: 1fr;
  }

  .stat {
    border-left: 0;
    border-top: 1px solid var(--hair);
  }

  .stat:first-child {
    border-top: 0;
  }

  .sources-strip {
    grid-template-columns: 1fr;
  }

  .sources-strip a {
    border-left: 0;
    border-top: 1px solid var(--hair);
  }

  .sources-strip a:first-child {
    border-top: 0;
  }

  .money-row,
  .seg-row {
    grid-template-columns: 1fr;
  }

  #car-form .seg-row {
    grid-template-columns: 1fr;
    grid-auto-flow: row;
    grid-template-rows: none;
    row-gap: 22px;
  }

  .seg-field {
    display: block;
  }

  #car-form .seg-legend {
    margin-bottom: 10px;
  }

  .step {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
  }

  .guide-list a {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .guide-list .arrow {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  /* Nav wraps onto its own line(s) on phones; drop the language divider so a
     wrapped switcher doesn't show a stray vertical rule at the line start. */
  .nav-langs {
    border-left: 0;
    padding-left: 0;
  }

  /* Compact header: with the nav wrapped to a second line the header ran to
     ~116px on phones; tighter paddings and gaps move the calculator up. */
  .site-header .wrap {
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 9px;
    gap: 2px 16px;
  }

  .site-header .brand {
    font-size: 0.9rem;
    gap: 9px;
  }

  .site-header .brand svg {
    width: 22px;
    height: 22px;
  }

  .site-nav {
    gap: 6px 14px;
  }
}
