/* Same world as davidegiacomel.space: violet, lime highlight, ink frames, Bricolage Grotesque.
   WHY a frame of ruled cells: Davide drew the pages that way on the whiteboard (2026-11-09).
   WHY the font is served from here: the CSP allows no external request. Bricolage Grotesque, SIL Open Font License. */
@font-face {
  font-family: "Bricolage Grotesque"; src: url("/bricolage.woff2") format("woff2");
  font-weight: 300 800; font-style: normal; font-display: swap;
}
:root {
  --hero: oklch(0.70 0.14 280);
  --ink: oklch(0.21 0.05 276);
  --ink-soft: oklch(0.33 0.05 276);
  --bg: oklch(1 0 0);
  --surface: oklch(0.965 0.012 280);
  --tint: oklch(0.88 0.055 280);
  --muted: oklch(0.47 0.03 276);
  --line: oklch(0.89 0.02 280);
  --accent: oklch(0.93 0.18 118);
  --accent-soft: oklch(0.97 0.06 118);
  --gain: oklch(0.82 0.22 148);
  --on-dark: oklch(0.97 0.01 280);
  --bad: oklch(0.47 0.17 27);
  --bad-bg: oklch(0.96 0.025 27);
  --wait: oklch(0.42 0.14 280);
  --rule: 2px solid var(--ink);
  --cell-x: clamp(1rem, 2.2vw, 1.75rem);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
  accent-color: var(--wait);
  scrollbar-color: var(--ink) var(--hero);
}
* { box-sizing: border-box; }
/* WHY: .button and .cell set display, which would otherwise beat the hidden attribute */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--hero); }
body {
  margin: 0; color: var(--ink); caret-color: var(--wait);
  font: 400 1rem/1.5 "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
::selection { background: var(--ink); color: var(--accent); }
:focus-visible { outline: 2px solid var(--wait); outline-offset: 2px; }
a { color: var(--ink); text-underline-offset: 3px; }
p { margin: 0; }
.wrap { max-width: 76rem; margin-inline: auto; padding-inline: clamp(.75rem, 3vw, 2rem); }
.skip { position: absolute; left: -999rem; }
a.skip:focus { left: 1rem; top: .75rem; padding: .4rem .8rem; background: var(--ink); color: var(--on-dark); border-radius: 999px; z-index: 1; }
main { padding-block: clamp(.75rem, 3vw, 2.5rem) clamp(2rem, 5vw, 4rem); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

h1, h2 { margin: 0; font-weight: 750; line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
/* WHY smaller than the site's hero (4.6rem), and no lime mark on the name (2026-11-10): here the title only says where you are.
   At 5.5rem it pushed the history down, and the mark made the client's name the loudest thing on the page. */
.title { margin-block: clamp(.75rem, 2vw, 1.5rem) clamp(1rem, 2.5vw, 1.75rem); font-size: clamp(2rem, 4.5vw, 3.25rem); letter-spacing: -0.035em; }
.who { font-weight: 400; }

/* ---------- the frame ---------- */
.sheet { background: var(--bg); border: var(--rule); border-radius: 1.5rem; overflow: clip; box-shadow: 0 1.5rem 3rem -2rem oklch(0.21 0.05 276 / 0.7); }
/* WHY: the frame clips its corners, and would also cut an open explanation that does not fit inside it */
.sheet:has(.help:hover), .sheet:has(.help button:focus), .sheet:has(.help.open) { overflow: visible; }
.sheet > .go, .sheet > .head { border-radius: calc(1.5rem - 2px) calc(1.5rem - 2px) 0 0; }
.cells { display: grid; grid-template-columns: minmax(0, 1fr) clamp(15rem, 30%, 22rem); }
.cells > * + * { border-left: var(--rule); }
.pad { padding: clamp(1.25rem, 2.5vw, 2rem) var(--cell-x); border-top: var(--rule); }

.strip { background: var(--ink); color: var(--on-dark); font-size: .9rem; }
.strip .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .1rem 1.5rem; padding-block: .85rem; }
.strip a { color: inherit; font-weight: 650; }
.strip a:hover { color: var(--accent); }
.strip a:focus-visible { outline-color: var(--accent); }

.head { background: var(--tint); }
.head h1 { padding: clamp(1.25rem, 3vw, 2.25rem) var(--cell-x); font-size: clamp(2.1rem, 4.6vw, 3.75rem); }
.head h1.described { font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.2; letter-spacing: -0.02em; overflow-wrap: anywhere; text-wrap: pretty; }
/* WHY violet and underlined: on white it looked like a separate block of plain text. It belongs to the title and it is a link (Davide, 2026-11-09) */
.back {
  display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 1rem var(--cell-x);
  font-size: clamp(1.1rem, 1.6vw, 1.35rem); font-weight: 700; letter-spacing: -0.015em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
  transition: background-color .3s var(--ease);
}
.back:hover { background: var(--accent); }
.back:hover .ic { translate: -.2em 0; }
.back:focus-visible, .go:focus-visible { outline-offset: -5px; }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; transition: translate .3s var(--ease); }

/* ---------- home ---------- */
.go {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(1.25rem, 2.5vw, 2rem) var(--cell-x);
  background: var(--ink); color: var(--on-dark); font-size: clamp(1.9rem, 3.8vw, 3.25rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.03em; text-decoration: none;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
.go:hover { background: var(--accent); color: var(--ink); }
.go:focus-visible { outline-color: var(--accent); }
.go:hover .ic { translate: .25em 0; }
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; border-top: var(--rule); }
.stats > div { padding: 1.1rem var(--cell-x) 1.2rem; }
/* WHY thin inside a group, ink between groups (2026-11-10): with an ink rule on every cell, every cell weighed the same */
.stats > div + div { border-left: 1px solid var(--line); }
.stats dt { font-weight: 600; line-height: 1.25; }
.stats dd { margin: .15rem 0 0; font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.03em; }
/* The total beside the credits left: same line, a step down, so the first figure stays the one to read */
.stats .of { font-size: .5em; font-weight: 600; letter-spacing: 0; color: var(--muted); }
/* The plan's row under the three figures: the credits take two of the three columns, so the rule between its cells falls under the one above */
.stats.plan { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* WHY only with two cells: with no plan the credits take the room of the plan's end day. */
.stats.plan > div:first-child:nth-last-child(2) { grid-column: span 2; }
/* A cell of the figures' row that holds words: a step under the figures, so a sentence does not shout */
.stats dd.words { margin-top: .35rem; font-size: clamp(1.15rem, 1.8vw, 1.5rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.history { padding: clamp(1.1rem, 2vw, 1.5rem) var(--cell-x); padding-bottom: .9rem; border-top: var(--rule); font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.empty { max-width: none; border-top: 0; padding-top: 0; }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; }
th { padding: .6rem 1rem; border-bottom: var(--rule); font-size: .875rem; font-weight: 700; text-align: left; white-space: nowrap; }
td { padding: .9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th + th, td + td { border-left: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: var(--cell-x); }
th:last-child, td:last-child { padding-right: var(--cell-x); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .2s var(--ease); }
/* WHY the whole row opens the search: a title alone did not read as a way in (Davide, 2026-11-09). The link stretches over the row, the buttons sit above it */
tbody tr { position: relative; }
tbody tr:hover { background: var(--accent-soft); }
.open { display: flex; align-items: flex-start; gap: .45rem; max-width: 36rem; text-decoration: none; }
.open::after { content: ""; position: absolute; inset: 0; }
.open .clamp { text-decoration: underline; }
.open .ic { width: 1.05em; height: 1.05em; margin-top: .2em; }
tbody tr:hover .open .ic { translate: .25em 0; }
.action .button, .action form, .help button { position: relative; z-index: 1; }
th.num, td[data-label="Spesa"] { text-align: right; }
td.num { white-space: nowrap; }
td[data-label="Ricerca"] .muted { display: block; margin-top: .15rem; font-size: .875rem; }
td[data-label="Aziende"] { min-width: 9rem; white-space: normal; }
.action { text-align: right; white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; max-width: 34rem; font-weight: 650; }

/* ---------- status ---------- */
/* WHY one word and one thin line: dots and a three-part bar were too much, and the last step did not read as the end (Davide, 2026-11-09) */
.status { position: relative; width: 12rem; max-width: 100%; }
.status.failed p { display: flex; align-items: center; gap: .3rem; }
.status p { font-size: .9375rem; line-height: 1.25; }
.status strong { font-weight: 700; }
.status .detail { display: block; margin-top: .1rem; color: var(--muted); font-size: .8125rem; }
.track { display: block; height: .4rem; margin-top: .45rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.track i { display: block; width: 33%; height: 100%; border-radius: inherit; background: var(--ink); }
.understanding .track i { width: 15%; }
.failed.late .track i { width: 66%; }
/* WHY one length for each step: at two thirds for the whole search, "Cerco le aziende" looked almost finished (Davide, 2026-11-11) */
.queued .track i { width: 25%; }
.running .track i, .at-find .track i { width: 35%; }
.at-clean .track i { width: 48%; }
.at-maps .track i { width: 54%; }
.at-read .track i { width: 61%; }
.at-score .track i { width: 74%; }
.at-replace .track i { width: 77%; }
.at-contacts .track i { width: 80%; }
.at-write .track i { width: 87%; }
.done .track i { width: 100%; background: var(--gain); }
.failed .track i { background: var(--bad); }
.failed strong { color: var(--bad); }
/* WHY none while it waits for a click: a third of a bar read as work in progress */
.canceled .track, .awaiting_confirm .track { display: none; }
.understanding .track i, .queued .track i, .running .track i {
  background: linear-gradient(90deg, var(--wait) 30%, var(--accent) 50%, var(--wait) 70%) 0 0 / 200% 100%;
  animation: flow 1.8s linear infinite;
}
@keyframes flow { to { background-position-x: -200%; } }

/* ---------- one search ---------- */
.run-top { border-top: var(--rule); }
.sheet > .alert + .run-top { border-top: var(--rule); }
.run-top.single { grid-template-columns: minmax(0, 1fr); }
.status-cell { display: grid; align-content: center; gap: .9rem; padding: clamp(1.1rem, 2.2vw, 1.6rem) var(--cell-x); }
.status-cell .status { width: min(30rem, 100%); }
.wait { font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.45; }
.wait a { color: inherit; font-weight: 650; }
.status-cell .status p { font-size: 1rem; }
/* WHY smaller than .head h1.described (Davide, 2026-11-16): the state sits under the search's own title, and at 2.1rem it
   read as the heading of the page. Keep it under that title's size at every width. */
.status-cell strong { font-size: clamp(1.15rem, 1.8vw, 1.45rem); font-weight: 750; letter-spacing: -0.025em; line-height: 1.15; }
.status-cell .track { height: .6rem; margin-top: .65rem; }
/* The steps of a search at work. WHY a list with checks here, when the history keeps one thin line: on the search's own page
   the line did not say which steps were done (Davide, 2026-11-11). */
.steps { display: grid; margin: 0; padding: 0; list-style: none; font-size: 1.0625rem; line-height: 1.5rem; }
.steps li { position: relative; display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .75rem; padding-bottom: 1rem; color: var(--muted); }
.steps li:last-child { padding-bottom: 0; }
/* the line down to the next step */
.steps li:not(:last-child)::before { content: ""; position: absolute; left: calc(.75rem - 1px); top: calc(1.5rem + 3px); bottom: 3px; width: 2px; border-radius: 1px; background: var(--line); }
.steps .mark, .working .mark { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); }
.steps .done { color: var(--ink); }
.steps .done::before { background: var(--ink); }
.steps .done .mark { background: var(--gain); box-shadow: none; }
.steps .done .ic { width: 1rem; height: 1rem; stroke-width: 3; }
.steps .now { color: var(--ink); font-weight: 700; }
.steps .now .mark, .working .mark { box-shadow: inset 0 0 0 2px var(--wait); }
/* WHY the dot is painted in the middle of a box as large as the mark, and not as a small box of its own (Davide,
   2026-11-16): on his screen the dot showed a second, thin piece on its right while it beat. A box that changes size
   while it moves can leave its edge behind where the browser draws it on its own layer; here that edge is clear, so
   nothing can be left. Not seen in Chrome 156 at eleven screen scales: the cause is reasoned, not reproduced. */
.steps .now .mark::after, .working .mark::after {
  content: ""; width: 100%; height: 100%; border-radius: 50%;
  background: radial-gradient(circle, var(--wait) calc(var(--dot, .3rem) - .5px), transparent var(--dot, .3rem));
  animation: beat .9s var(--ease) infinite alternate;
}
.steps .detail { display: block; color: var(--muted); font-size: .875rem; font-weight: 400; line-height: 1.3; font-variant-numeric: tabular-nums; }
@keyframes beat { to { scale: .45; opacity: .6; } }
/* A search being prepared: the mark of the step at work beside the state, and no sentence (see web.py, run_page). */
.working { display: flex; align-items: center; gap: .85rem; }
/* WHY larger than in the steps, with a ring that spreads: here the mark is the whole message, beside a name at 1.45rem. */
.working .mark { --dot: .35rem; position: relative; flex: none; width: 1.75rem; height: 1.75rem; }
/* The ring that spreads, as wide as the mark, painted .25rem inside its box for the same reason as the dot. */
.working .mark::before {
  content: ""; position: absolute; inset: -.25rem; border-radius: 50%;
  background: radial-gradient(circle closest-side, transparent calc(100% - .25rem - 2.5px), var(--wait) calc(100% - .25rem - 2px), var(--wait) calc(100% - .25rem - .5px), transparent calc(100% - .25rem));
  animation: spread 1.8s var(--ease) infinite;
}
@keyframes spread { from { scale: 1; opacity: .7; } to { scale: 1.9; opacity: 0; } }
.go.compact { padding-block: 1.1rem; font-size: clamp(1.3rem, 2.2vw, 1.8rem); }
.go-form { display: grid; margin: 0; }
.run-actions { display: grid; grid-template-rows: 1fr auto; }
.go.edit { padding-block: .9rem; border-top: var(--rule); background: var(--tint); color: var(--ink); font-size: clamp(1.05rem, 1.5vw, 1.25rem); letter-spacing: -0.02em; line-height: 1.15; }
.go.edit:hover { background: var(--accent); }
.go.edit:focus-visible { outline-color: var(--wait); }
button.go { width: 100%; border: 0; font-family: inherit; text-align: left; cursor: pointer; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: var(--rule); }
.facts > div { min-width: 0; padding: 1rem var(--cell-x) 1.1rem; border-top: 1px solid var(--line); }
.facts > div:first-child, .facts > .half:first-child + .half { border-top: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts .half + .half { border-left: 1px solid var(--line); }
.facts dt { font-size: clamp(1.05rem, 1.4vw, 1.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.facts dd { margin: .3rem 0 0; font-size: 1.0625rem; max-width: 75ch; overflow-wrap: anywhere; }
/* The spend and the buttons that commit it, as one block */
.end.pay { display: grid; gap: 1rem; }
.spend { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; }
.spend-label { flex-basis: 100%; font-size: clamp(1.05rem, 1.4vw, 1.2rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.spend strong { font-size: clamp(1.7rem, 3vw, 2.6rem); font-weight: 750; line-height: 1.05; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }

/* ---------- login ---------- */
.login { max-width: 40rem; margin: clamp(1.5rem, 9vh, 6rem) auto 0; }
.login-head { margin: 0; padding: clamp(1.1rem, 2.5vw, 1.75rem) var(--cell-x); font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
.login .end .primary { width: 100%; }
.strip-end { display: flex; align-items: center; gap: 1.5rem; font-size: 1.125rem; }
.logout { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.logout:hover { color: var(--accent); }
.logout:focus-visible { outline-color: var(--accent); }

/* ---------- score legend ---------- */
.stats, #goal-field, .history-row { position: relative; }
.stats dt { display: flex; align-items: center; gap: .3rem; }
.history-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1.5rem; padding: clamp(1.1rem, 2vw, 1.5rem) var(--cell-x) .9rem; border-top: var(--rule); }
.history-row .history { padding: 0; border: 0; }
.legend .tip { left: var(--cell-x); width: min(31rem, 84vw); font-weight: 400; letter-spacing: 0; }
tbody .legend .tip { left: auto; right: var(--cell-x); }
.fit-line { display: flex; align-items: center; gap: .3rem; }
.tip b { font-weight: 750; }
.tip > b:first-child { display: block; margin-bottom: .25rem; font-size: 1rem; }
.tip .line { display: block; }
.tip .line.first { margin-top: .5rem; }

/* ---------- how to use it ---------- */
/* WHY no display here: a display on .how would keep the closed popover on screen */
.how { width: min(62rem, 100vw - 1.5rem); max-height: calc(100dvh - 1.5rem); padding: 0; border: var(--rule); border-radius: 1.5rem; background: var(--bg); color: var(--ink); overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--ink) transparent; }
.how:popover-open { animation: how-in .35s var(--ease); }
@keyframes how-in { from { opacity: 0; translate: 0 .75rem; } }
.how::backdrop { background: oklch(0.21 0.05 276 / 0.6); }
.how h3 { margin: 0 0 .25rem; font-size: clamp(1.15rem, 1.6vw, 1.35rem); font-weight: 750; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.how-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: clamp(.9rem, 2vw, 1.4rem) var(--cell-x); border-bottom: var(--rule); background: var(--tint); }
.how-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.75rem); }
.how-close { flex: none; width: 2.75rem; padding: 0; }
.how-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.how-steps li { position: relative; counter-increment: step; padding: 1.1rem var(--cell-x) 1.2rem calc(var(--cell-x) + 2.75rem); }
.how-steps li + li { border-top: var(--rule); }
.how-steps li::before { content: counter(step); position: absolute; left: var(--cell-x); top: .85rem; font-size: 2.25rem; font-weight: 750; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.how-steps p { max-width: 62ch; }
/* WHY 46% (Davide, 2026-11-17): at the 30% of .cells the side ran to 938px beside 532px of steps, once the legend said
   what a grey score is. At 46% the two columns end together, measured at 62rem and at 55rem. */
.how > .cells { grid-template-columns: minmax(0, 1fr) 46%; }
.how-side { display: grid; grid-template-rows: auto 1fr; }
.how-side > section { padding: 1.1rem var(--cell-x) 1.2rem; }
.how-side > section > p + h3 { margin-top: 1rem; }
.how-score { background: var(--surface); font-size: .9375rem; line-height: 1.4; }
.how-score b { font-weight: 750; font-variant-numeric: tabular-nums; }
.how .line:not(.note) { display: grid; grid-template-columns: 3.75rem minmax(0, 1fr); gap: .5rem; margin-top: .3rem; }
.how .line.first { margin-top: .75rem; }
.how .note { display: block; }
.how .note b { font-variant-numeric: normal; }
.how.ask { width: min(32rem, 100vw - 1.5rem); padding: clamp(1.25rem, 3vw, 1.75rem) var(--cell-x); }
.ask h2 { margin-bottom: .6rem; font-size: clamp(1.6rem, 3vw, 2.1rem); }
.ask form { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

/* ---------- form ---------- */
.new > .cells, .new > .cell { border-top: var(--rule); }
.cell { display: grid; align-content: start; gap: .3rem; min-width: 0; padding: 1rem var(--cell-x) 1.1rem; transition: background-color .3s var(--ease); }
/* WHY the whole cell lights up: the inputs have no box of their own, the ruled cell is the box */
.cell:focus-within { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--wait); }
.cell input:focus-visible, .cell textarea:focus-visible { outline: none; }
label { font-size: clamp(1.1rem, 1.5vw, 1.3rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.label-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
textarea, input[type="number"], input[type="text"], input[type="password"] { width: 100%; padding: .1rem 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.125rem; }
textarea { display: block; resize: vertical; scrollbar-color: var(--ink) transparent; }
/* WHY: the browser's arrows clash with the page (Davide, 2026-11-09). The number is typed; the keyboard arrows still work */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
::placeholder { color: var(--muted); opacity: 1; }
.hint { font-size: .875rem; color: var(--muted); max-width: 70ch; }
.end { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1.1rem var(--cell-x); border-top: var(--rule); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.75rem; padding: .55rem 1.2rem;
  border: 0; border-radius: 999px; background: transparent; box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink);
  font: inherit; font-size: .95rem; font-weight: 650; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .3s var(--ease), box-shadow .3s var(--ease), color .3s var(--ease), translate .3s var(--ease);
}
.button:hover { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); translate: 0 -2px; }
.button.primary { background: var(--ink); box-shadow: none; color: var(--on-dark); }
.button.primary:hover { background: var(--accent); color: var(--ink); }
.end .primary { font-size: 1.05rem; padding-inline: 1.6rem; }
.help { display: flex; margin-left: .2rem; }
.help button { position: relative; width: 1.35rem; height: 1.35rem; padding: 0; border: 0; border-radius: 50%; background: transparent; box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); font: inherit; font-size: .8125rem; font-weight: 750; line-height: 1; cursor: help; transition: background-color .3s var(--ease); }
/* WHY: a bigger area to hit than the small circle */
.help button::before { content: ""; position: absolute; inset: -.5rem; }
.help:hover button, .help button:focus { background: var(--accent); }
.help.bad button { box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); }
.help.bad:hover button, .help.bad button:focus { background: var(--bad); color: var(--bg); }
.tip {
  position: absolute; z-index: 2; left: 0; bottom: calc(100% + .7rem); width: min(25rem, 76vw); padding: .75rem 1rem; border-radius: 1.1rem;
  background: var(--ink); color: var(--on-dark); font-size: .875rem; line-height: 1.4;
  box-shadow: 0 .75rem 1.5rem -.75rem oklch(0.21 0.05 276 / 0.7);
  opacity: 0; visibility: hidden; translate: 0 .3rem; transition: opacity .2s var(--ease), translate .2s var(--ease), visibility .2s;
}
/* WHY: bridges the gap, so the mouse can move onto the text without closing it */
.tip::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .7rem; }
.help:hover .tip, .help button:focus + .tip, .help.open .tip { opacity: 1; visibility: visible; translate: 0 0; }
/* WHY: Esc or a second tap must close it even while the pointer or the focus is still on it (app.js sets these two classes) */
.help.shut button + .tip { opacity: 0; visibility: hidden; }
.button.small { min-height: 2rem; padding: .25rem .85rem; font-size: .8125rem; }
.button.danger { box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); }
.button.danger:hover { background: var(--bad); box-shadow: inset 0 0 0 2px var(--bad); color: var(--bg); }

/* ---------- how the companies may be contacted ---------- */
/* WHY the "?" is not a .help: app.js toggles those as explanations, and this box opens the window by itself */
/* WHY flex: the box sits at the right of the title's cell, centred on it (Davide, 2026-11-11), and goes under the title when there is no room */
/* WHY the cell's vertical space is on .head-main and not on the title (2026-11-12): the box had a bottom margin on phones,
   for when it sits under the title, and that margin pushed it off centre whenever it still fitted beside the title. With
   the space on the cell, the box is centred beside the title and keeps its space below when it wraps, with no margin. */
.head-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; row-gap: 1.1rem; min-width: 0; padding-block: clamp(1.25rem, 3vw, 2.25rem); }
.head-main h1 { padding-block: 0; }
.law-box { margin: 0 var(--cell-x) 0 auto; }
.law-box .q { display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; font-size: .6875rem; font-weight: 750; line-height: 1; }
.law-lead { max-width: 75ch; padding: 1.1rem var(--cell-x) 1.2rem; font-size: 1.0625rem; }
.law table { border-block: var(--rule); font-size: .9375rem; line-height: 1.4; }
.law thead th { background: var(--surface); line-height: 1.25; vertical-align: bottom; white-space: normal; }
.law tbody th { padding-block: .9rem; border-bottom: 1px solid var(--line); font-size: .9375rem; vertical-align: top; }
.law tbody th + td { border-left: 1px solid var(--line); }
.law tbody tr:last-child th { border-bottom: 0; }
.law tbody tr:hover { background: none; }
.law-notes { max-width: 80ch; margin: 0; padding: 1.1rem var(--cell-x) 0 calc(var(--cell-x) + 1.1rem); }
.law-notes li + li { margin-top: .4rem; }
.law-date { padding: .9rem var(--cell-x) 1.2rem; color: var(--muted); font-size: .875rem; }

/* ---------- one search ---------- */
.choices { display: grid; gap: .75rem; }
.choices .hint { margin: .4rem 0 0 1rem; }
.check { position: relative; display: flex; gap: .6rem; align-items: baseline; padding: .75rem 1rem; border-radius: 1.1rem; background: var(--accent-soft); font-size: 1rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; cursor: pointer; }
.check input { width: 1.05rem; height: 1.05rem; flex: none; translate: 0 .12em; }
td form { margin: 0; }
.alert { padding: .7rem var(--cell-x); background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.alert a { color: inherit; font-weight: 700; }
.alert .next { margin-top: .2rem; color: var(--ink); font-weight: 400; }
.support { font-size: .9375rem; }
.sheet > .alert { border-top: var(--rule); }

@media (max-width: 52rem) {
  /* WHY: on a phone "Powered by" wrapped onto its own line, on top of the two menu links (Davide, 2026-11-10). */
  .strip p { display: none; }
  .cells, .how > .cells { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts .half + .half { border-left: 0; }
  .facts > .half:first-child + .half { border-top: 1px solid var(--line); }
  .stats { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stats.plan { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.plan > div:first-child:nth-last-child(2) { grid-column: auto; }
  .stats > div:nth-child(odd) { border-left: 0; }
  .stats > div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .cells > * + * { border-left: 0; border-top: var(--rule); }
  .back { justify-content: flex-start; }
  textarea { min-height: 7.25rem; }
  table, tbody, tr, td { display: block; }
  thead { position: absolute; left: -999rem; }
  tr { display: grid; gap: .4rem; padding: .95rem var(--cell-x); border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td, td:first-child, td:last-child { padding: 0; border: 0; text-align: left !important; white-space: normal; }
  td + td { border-left: 0; }
  td[data-label] { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-align: right !important; }
  td[data-label]::before { content: attr(data-label); flex: none; color: var(--muted); }
  td[data-label="Ricerca"]::before, td[data-label="Stato"]::before { display: none; }
  td[data-label="Stato"] { display: block; margin-block: .2rem; text-align: left !important; }
  .status { width: 100%; }
  td[data-label="Ricerca"] { order: -1; display: block; text-align: left !important; }
  td:empty { display: none; }
  .action { margin-top: .35rem; }
  .action .button { width: 100%; }
  .fit-line { justify-content: flex-end; }
  /* One block per country. WHY each label above its value: beside it, as in the history, these long cells were squeezed at 390px */
  .law tr { gap: .75rem; padding-block: 1.1rem 1.2rem; border-bottom: var(--rule); }
  .law tbody th { padding: 0; border: 0; font-size: 1.35rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; white-space: normal; }
  .law tbody th + td { border-left: 0; }
  .law td[data-label] { display: block; text-align: left !important; }
  .law td[data-label]::before { display: block; margin-bottom: .1rem; color: var(--ink); font-size: .875rem; font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
