/* White ground, near-black text with an olive cast, sage surfaces, green and
   terracotta reserved for data semantics.

   Light only, on purpose: a single theme keeps tables and charts readable the
   same way everywhere. Fonts are the system stack, so the page makes no
   network request of any kind. */

:root {
  color-scheme: light;

  --page: #f4f6f3;
  --surface: #ffffff;
  --surface-sunken: #f1f4f1;
  --surface-strong: #e6ebe2;

  --line: #e3e7e0;
  --line-strong: #ccd4c6;

  --text: #11150a;
  --text-muted: #59615f;
  --text-faint: #888a85;

  --accent: #11150a;
  --on-accent: #ffffff;
  --link: #35648f;

  --positive: #2f7d55;
  --negative: #b4543a;

  --bar-total: #11150a;
  --bar-down: #b4543a;
  --bar-up: #2f7d55;

  --shadow: 0 1px 2px rgba(17, 21, 10, 0.05), 0 8px 24px rgba(17, 21, 10, 0.04);
  --radius: 12px;
  --radius-sm: 8px;

  /* Scala tipografica e spaziature.
     Sono arrivate tardi, quando le pagine sono diventate quattro e ognuna
     aveva i suoi valori a occhio: venti dimensioni di testo diverse fra 0,64 e
     1,5rem, quattordici delle quali schiacciate in mezzo rem. Non era una
     scala, era deriva. Adesso sono otto, e ogni accorpamento sposta di meno
     del sei per cento: la pagina e la stessa, il disordine no.

     Le spaziature invece sono ancora letterali quasi ovunque. Accorparle
     sposterebbe davvero le cose, e non e questo il momento. */
  --text-2xs: 0.68rem;
  --text-xs: 0.74rem;
  --text-sm: 0.83rem;
  --text-base: 0.95rem;
  --text-md: 1.05rem;
  --text-lg: 1.35rem;
  --text-xl: 1.6rem;
  --text-figure: 1.5rem;
  --text-2xl: clamp(1.9rem, 5vw, 2.9rem);

  --space-1: 0.35rem;
  --space-2: 0.7rem;
  --space-3: 1.1rem;
  --space-4: 1.75rem;
  --space-5: 2.75rem;
  --space-6: 4rem;

  /* Wide on purpose: this is a dense data tool, not an article. Every page uses
     the same width, and long text is split into columns inside the cards. */
  --measure: 100rem;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  /* Nessuna colonna di lettura stretta: testi, tabelle e card usano tutta la
     larghezza della pagina, uguale su tutte le pagine. */
  --prose: none;
}

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

/* Lo spazio della barra di scorrimento resta riservato anche sulle pagine
   corte, cosi passando da una pagina all altra la navigazione non si sposta. */
html { scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.num, table { font-variant-numeric: tabular-nums; }

body > nav, .page-header, main, .page-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ------------------------------------------------------------------ header */

/* La nav e un fratello di header e main, non un loro figlio: senza questa riga
   restava incollata al bordo della finestra mentre tutto il resto rientrava. */

.page-header { padding-top: 2.75rem; padding-bottom: 1.75rem; }

/* La navigazione del sito. Quando le pagine erano due bastava un link di
   ritorno; adesso sono quattro e servono tutte per capire un numero, quindi
   stanno sullo stesso piano invece che una dentro l altra. */
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: var(--space-4) 0 0;
  margin: 0;
  list-style: none;
}

.site-nav a {
  display: inline-block;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--text-muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}

/* La pagina corrente si marca con aria-current, cosi il segno visivo e quello
   per chi legge con lo schermo sono la stessa cosa e non due. */
.site-nav a[aria-current='page'] {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.eyebrow {
  margin: 0 0 0.85rem;
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
}
.eyebrow strong { color: var(--text); font-weight: 700; }

h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.lede {
  margin: 0 0 1.1rem;
  max-width: var(--prose);
  font-size: var(--text-md);
  color: var(--text-muted);
}

.case-note {
  margin: 0;
  max-width: var(--prose);
  padding: 0.85rem 1rem;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-muted);
  background: var(--surface-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.case-note a { color: var(--link); }

/* -------------------------------------------------------------------- form */

.calc-form {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
/* Il campo e una colonna flex, e un bottone dentro una colonna flex si stira
   per tutta la larghezza: erano seicento pixel di "Calcola". */
.field-action { align-self: end; align-items: start; }

/* Collapsed by default: most people have no dependants and should not have to
   scroll past five fields that do not apply to them. */
.field-group {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  min-width: 0;
}

.field-group > summary {
  cursor: pointer;
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
}

.field-group > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.field-group[open] > summary { margin-bottom: 1rem; }

/* auto-fill e non auto-fit: con un campo solo, come nei fringe benefit, auto-fit
   collassa le tracce vuote e quell unico input si prende milleduecento pixel. */
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
  gap: 1rem;
  align-items: start;
}

/* Le etichette vanno a capo in modo diverso da un campo all altro, e senza un
   minimo comune gli input finivano sfalsati di venti pixel dentro la stessa
   riga. Due righe di etichetta sono il caso peggiore che serve reggere. */
.field-grid > .field > label { min-height: 2.4em; }

/* Il campo con la spunta non ha etichetta sopra: si allinea agli altri
   lasciando lo spazio che l etichetta occuperebbe, due righe piu il gap. */
.field-check { justify-content: start; padding-top: calc(2.4em * 0.74 + 0.4rem); }

.check {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.check input { width: auto; margin: 0; accent-color: var(--accent); }

.hint-block { margin-top: 1rem; }

label {
  font-size: var(--text-xs);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
}

.input-wrap { position: relative; display: flex; align-items: center; }

/* Il tipo number era rimasto fuori e restava un campo di sistema alto la meta
   degli altri, in mezzo a una riga di select. */
input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 0.72rem 0.85rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.input-wrap input { padding-right: 3.4rem; font-size: var(--text-md); font-weight: 600; }

input:focus-visible, select:focus-visible,
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.unit {
  position: absolute;
  right: 0.85rem;
  font-size: var(--text-sm);
  color: var(--text-faint);
  pointer-events: none;
}

.hint { margin: 0; font-size: var(--text-xs); color: var(--text-faint); }

button[type="submit"] {
  padding: 0.78rem 1.6rem;
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
button[type="submit"]:hover { opacity: 0.88; }

.error {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  background: color-mix(in srgb, var(--negative) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--negative) 40%, var(--surface));
  border-radius: var(--radius-sm);
  color: var(--negative);
  font-size: var(--text-base);
  font-weight: 500;
}

/* ----------------------------------------------------------------- results */

.results { margin-top: 1.25rem; display: grid; gap: 1.25rem; }

/* Grid children default to min-width:auto, so a wide chart inside one of them
   stretches the whole column and pushes the page sideways instead of scrolling
   inside its own container. */
.results > *,
.summary > *,
.detail-grid > *,
.inverse-row > *,
.reading-grid > * { min-width: 0; }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.summary-figure { background: var(--surface); padding: 1.2rem 1.3rem; }
.summary-secondary { background: var(--surface-sunken); }

.summary-label {
  margin: 0 0 0.35rem;
  font-size: var(--text-2xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
}

.summary-value {
  margin: 0;
  font-size: clamp(1.6rem, 3.8vw, 2.05rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.summary-secondary .summary-value { font-size: var(--text-lg); }

.summary-note {
  margin: 0.45rem 0 0;
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-muted);
}

.block {
  background: var(--surface);
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.block h3 {
  margin: 0 0 1rem;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 650;
}

/* Splits the page into what the brief asked for and what came after. */
.section-lead { margin: 2.5rem 0 1.1rem; }
.section-lead > * { max-width: var(--prose); }
main > .section-lead:first-child { margin-top: 0.25rem; }

.section-title {
  margin: 0 0 0.4rem;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.022em;
}
.section-lead p { margin: 0; font-size: var(--text-base); line-height: 1.55; color: var(--text-muted); }

.section-lead-extra {
  border-top: 1px solid var(--line-strong);
  padding-top: 2.25rem;
  margin-top: 3rem;
}

/* Same card language as every other block: it is a note that leads somewhere,
   not a banner. */
.learned-card {
  display: block;
  margin-top: 1.25rem;
  padding: 1.3rem;
  background: var(--surface-sunken);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
}
.learned-card:hover { border-color: var(--line-strong); }

.learned-label {
  margin: 0 0 0.6rem;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--text-muted);
}
.learned-headline {
  margin: 0 0 0.5rem;
  max-width: var(--prose);
  font-size: var(--text-md);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.012em;
}
.learned-body {
  margin: 0 0 0.9rem;
  max-width: var(--prose);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-muted);
}
.learned-cta {
  display: inline-block;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}
.learned-card:hover .learned-cta { text-decoration-color: currentColor; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1.25rem;
}

/* ------------------------------------------------------------------ tables */

table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }

th, td { text-align: left; padding: 0.6rem; vertical-align: baseline; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
.num, th.num, td.num { text-align: right; }

thead th {
  font-size: var(--text-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border-bottom: 1px solid var(--line);
  font-weight: 650;
}

tbody tr { border-bottom: 1px solid var(--line); }
tbody tr:last-child { border-bottom: 0; }

/* An amount must never break across two lines: "30.000,00 €" split in half is
   unreadable in a column of figures. */
td.amount { font-weight: 650; white-space: nowrap; }

.ledger .voice { font-weight: 600; }
.ledger .formula { color: var(--text-muted); font-size: var(--text-sm); }
.ledger .amount.is-negative { color: var(--negative); }
.ledger .amount.is-positive { color: var(--positive); }
.ledger .amount.is-zero { color: var(--text-faint); font-weight: 400; }

.ref a {
  color: var(--link);
  font-size: var(--text-sm);
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 2px;
}

tfoot td {
  border-top: 2px solid var(--text);
  font-weight: 700;
  padding-top: 0.75rem;
  font-size: var(--text-base);
}

.detail td:first-child { color: var(--text-muted); }
.detail td:last-child { text-align: right; font-weight: 650; }
.detail tr.is-subtle td { color: var(--text-faint); font-weight: 400; }
.detail tr.is-total td { border-top: 1px solid var(--text); font-weight: 700; }
.detail tr.is-total td:first-child { color: var(--text); }

/* --------------------------------------------- inverse mode and curve blocks */

.block.standalone { margin-top: 1.25rem; }

.block-note {
  margin: -0.35rem 0 1.1rem;
  max-width: var(--prose);
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-muted);
}

/* Already inside a card, so it drops the card of its own. */
.inline-form {
  background: var(--surface-sunken);
  box-shadow: none;
  padding: 1rem;
}

.inverse-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1px;
  margin-top: 1.1rem;
  /* The container shows through the 1px gaps and behind an empty slot when three
     figures wrap onto two columns, so it carries the surface colour too. */
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.inverse-figure {
  background: var(--surface);
  padding: 1rem 1.1rem;
  outline: 1px solid var(--line);
}
.inverse-figure .summary-value { font-size: var(--text-figure); }

.inverse-gap-head {
  margin: 1.1rem 0 0;
  padding: 0.8rem 1rem;
  background: color-mix(in srgb, var(--negative) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--negative) 30%, var(--surface));
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text);
}

.inverse-note {
  margin: 0.8rem 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

#curve svg { display: block; min-width: 44rem; width: 100%; height: auto; }

.cv-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.cv-grid { stroke: var(--line); stroke-width: 1; }
.cv-mark { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.cv-mark-dot { fill: var(--surface-strong); stroke: var(--line-strong); stroke-width: 1; }
.cv-mark-index { font-size: 9px; font-weight: 700; fill: var(--text-muted); }
.cv-axis-label { font-size: 10px; fill: var(--text-faint); }

.cv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.35rem;
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: var(--text-2xs);
  font-weight: 700;
  color: var(--text-muted);
}

.breakpoints { margin-top: 1.25rem; }
.breakpoints td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.breakpoints td:nth-child(2) { color: var(--text); font-weight: 400; }
.breakpoints td:nth-child(3) { color: var(--text-muted); font-weight: 400; white-space: nowrap; }
.breakpoints td:last-child { white-space: nowrap; }
.breakpoints .is-positive { color: var(--positive); }
.breakpoints .is-negative { color: var(--negative); }
.breakpoints .is-flat { color: var(--text-faint); font-weight: 400; }
.breakpoints td.effect { color: var(--text-muted); font-weight: 400; font-size: var(--text-sm); }

/* The estimate block is deliberately set apart from the statutory calculation. */
.block.estimate { background: var(--surface-sunken); border-style: dashed; }

.badge-estimate {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.14rem 0.5rem;
  background: color-mix(in srgb, var(--negative) 12%, var(--surface));
  color: var(--negative);
  border-radius: 999px;
  font-size: var(--text-2xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  vertical-align: 0.1em;
}

.block.estimate .inverse-row { margin-top: 0; margin-bottom: 1.25rem; }

/* On the sunken block a bare table reads as a slab bleeding to the edges, so it
   gets the same card as the figures above it. */
/* A table cannot shrink below its min-content width, so a wide one needs a
   container that scrolls rather than pushing the page sideways. */
.table-scroll { overflow-x: auto; }

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.35rem 1.1rem;
  overflow-x: auto;
}
.table-card td:first-child, .table-card th:first-child { padding-left: 0; }
.table-card td:last-child, .table-card th:last-child { padding-right: 0; }
.table-card tbody tr:last-child td { border-bottom: 0; }

.employer-caveat {
  margin: 1rem 0 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-muted);
}

.bands td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.bands td:nth-child(2) { color: var(--text-muted); font-weight: 400; }
.bands tr.is-worst td { background: color-mix(in srgb, var(--negative) 9%, var(--surface)); }
.bands tr.is-worst td:last-child { color: var(--negative); }

.finding {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--surface-sunken);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.finding p { margin: 0 0 0.5rem; font-size: var(--text-sm); line-height: 1.55; color: var(--text-muted); }
.finding p:last-child { margin-bottom: 0; }
.finding-title { color: var(--text) !important; font-weight: 650; font-size: var(--text-base) !important; }

.reading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.4rem;
}

.reading-item p { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--text-muted); }
.reading-title {
  margin: 0 0 0.35rem !important;
  color: var(--text) !important;
  font-weight: 650;
  font-size: var(--text-base) !important;
}

/* --------------------------------------------------------------- waterfall */

.chart-scroll { overflow-x: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }
#waterfall svg { display: block; min-width: 34rem; width: 100%; height: auto; }

.wf-total { fill: var(--bar-total); }
.wf-down { fill: var(--bar-down); }
.wf-up { fill: var(--bar-up); }
.wf-label { font-size: 10px; fill: var(--text-faint); }
.wf-value { font-size: 10.5px; font-weight: 650; fill: var(--text); }
.wf-connector { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.wf-axis { stroke: var(--line); stroke-width: 1; }


/* ------------------------------------------------------- voci che si aprono */

/* Sembra la cella di prima, e un pulsante solo quando ci si passa sopra: la
   traccia resta una tabella da leggere, non una fila di controlli. */
.explain {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px dotted var(--line-strong);
}

.explain:hover { border-bottom-color: var(--text); }

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

.explain::after {
  content: '';
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 0.5em;
  border-right: 1.6px solid var(--text-faint);
  border-bottom: 1.6px solid var(--text-faint);
  transform: translateY(-0.15em) rotate(45deg);
}

.explain[aria-expanded='true']::after { transform: translateY(0.1em) rotate(-135deg); }

.explanation > td {
  padding: 0.2rem 0.9rem 1.1rem;
  background: var(--surface-sunken);
}

.explanation p {
  margin: 0 0 0.6rem;
  max-width: var(--prose);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-muted);
}

.explanation p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------- prose */

/* Le pagine di testo usano le stesse card del calcolatore: il testo si divide
   in colonne invece di restringersi a meta pagina. */

.steps {
  margin: 0;
  padding-left: 1.4rem;
  columns: 2 24rem;
  column-gap: 3rem;
}

.steps li {
  break-inside: avoid;
  margin: 0 0 0.8rem;
  padding-left: 0.2rem;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-muted);
}

.steps li strong { color: var(--text); }
.steps li::marker { color: var(--text-faint); font-weight: 650; }

.text-columns {
  columns: 2 24rem;
  column-gap: 3rem;
}

.text-columns p {
  break-inside: avoid;
  margin: 0 0 0.8rem;
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-muted);
}

.text-columns strong { color: var(--text); }

.note-list {
  margin: 0;
  padding-left: 1.1rem;
}

.note-list li {
  margin: 0 0 0.45rem;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-muted);
}

.note-list li:last-child { margin-bottom: 0; }

.reading-item a, .callout a { color: var(--link); }
.reading-item strong, .note-list strong { color: var(--text); }

/* Un punto che vale la pena leggere due volte, non un riquadro decorativo. */
.callout {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1.15rem;
  background: var(--surface-sunken);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.callout p { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--text-muted); }

/* ------------------------------------------------------------- parametri */

/* Ogni gruppo di parametri e una card, come i blocchi del calcolatore. */
.param-group {
  margin-bottom: 1.25rem;
  padding: 1.3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.param-group > h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}

.param-group > p {
  margin: 0 0 var(--space-3);
  max-width: var(--prose);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.param-path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.year-switch {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  margin: var(--space-3) 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.year-switch button {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
  font-weight: 650;
  color: var(--text-muted);
  cursor: pointer;
}

.year-switch button:hover { border-color: var(--line-strong); color: var(--text); }

.year-switch button.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

/* --------------------------------------------------- tabelle della curva */

/* Senza larghezze il browser distribuisce a caso: la colonna di testo si
   prendeva tre quarti della tabella e i numeri finivano a mezzo schermo di
   distanza dalla loro etichetta. Qui le colonne strette sono fissate e quella
   di testo si prende quello che resta. */
.bands, .breakpoints { table-layout: fixed; }

/* Le bande occupano tutta la card: le tre colonne di numeri hanno una
   larghezza fissa e la quarta, la barra, si prende il resto. Cosi lo spazio
   mostra la stessa scala del grafico invece di restare vuoto. */
.bands th, .bands td { white-space: nowrap; }
.bands th:nth-child(1), .bands td:nth-child(1) { width: 15rem; }
.bands th:nth-child(2), .bands td:nth-child(2) { width: 11rem; }
.bands th:nth-child(3), .bands td:nth-child(3) { width: 12rem; }
.bands th.band-bar-col, .bands td.band-bar-col { width: auto; padding-left: 2.5rem; }

.band-bar {
  display: block;
  height: 0.5rem;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
}

.band-bar > span {
  display: block;
  height: 100%;
  background: var(--text);
  border-radius: 999px;
}

.bands tr.is-worst .band-bar > span { background: var(--negative); }
.finding:empty { display: none; }

.breakpoints th:nth-child(1), .breakpoints td:nth-child(1) { width: 8.5rem; }
.breakpoints th:nth-child(2), .breakpoints td:nth-child(2) { width: auto; }
.breakpoints th:nth-child(3), .breakpoints td:nth-child(3) { width: 12rem; }
.breakpoints th:nth-child(4), .breakpoints td:nth-child(4) { width: 9.5rem; }
.breakpoints th:nth-child(5), .breakpoints td:nth-child(5) { width: 13rem; }

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

.page-footer { padding-top: 2rem; padding-bottom: 3rem; font-size: var(--text-sm); color: var(--text-faint); }
.page-footer p { margin: 0 0 0.4rem; max-width: var(--prose); }
.page-footer p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 46rem) {
  /* Le larghezze fisse servono a riequilibrare le colonne su uno schermo largo.
     Su uno stretto costringerebbero la tabella a scorrere di lato dove prima si
     riadattava: il problema da risolvere era l altro. */
  .bands, .breakpoints { table-layout: auto; }
  .bands th, .bands td, .breakpoints th, .breakpoints td { width: auto; }
  .bands .band-bar-col { display: none; }
  .bands th { white-space: normal; }
  .bands th, .bands td { padding-left: 0.35rem; padding-right: 0.35rem; }
  .bands th:first-child, .bands td:first-child { padding-left: 0; }

  .calc-form { grid-template-columns: 1fr; }
  .field-action { align-self: stretch; }
  button[type="submit"] { width: 100%; }

  /* Four columns do not fit: each ledger row becomes a labelled block. */
  .ledger thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ledger tbody tr, .ledger tfoot tr { display: grid; grid-template-columns: 1fr auto; padding: 0.75rem 0; }
  .ledger td { padding: 0; }
  .ledger td.voice { grid-column: 1; font-size: var(--text-base); }
  .ledger td.amount { grid-column: 2; grid-row: 1; }
  .ledger td.formula { grid-column: 1 / -1; margin-top: 0.2rem; }
  .ledger td.ref { grid-column: 1 / -1; margin-top: 0.2rem; }
  .ledger tfoot td { border-top: 0; padding-top: 0; }
  .ledger tfoot tr { border-top: 2px solid var(--text); margin-top: 0.3rem; }
}
