/* =====================================================================
   Chainsaw Chain Size: stylesheet. One file, no remote resources.
   ===================================================================== */

/* Oswald (SIL OFL 1.1, assets/fonts/OFL.txt), self-hosted variable font. */
@font-face {
  font-family: "Oswald";
  src: url("/assets/fonts/Oswald-wght.ttf") format("truetype");
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --paper: #FAF8F4;
  --surface: #FFFFFF;
  --chip: #F5F2EC;         /* spec chips, hover wash */
  --chip-2: #F2EFE8;       /* segmented control, pills */
  --ink: #14180F;          /* 16.96:1 on paper */
  --ink-2: #232A1D;        /* nav input */
  --muted: #555E51;        /* 6.37:1 on paper, 5.6:1 on chip */
  --line: #E7E3DA;         /* hairlines, decorative only */
  --line-2: #EFEBE3;
  --rule-ui: #8C887E;      /* input/button borders: 3.33:1 on paper */
  --accent: #D2531C;       /* fills, big code (64px+): 3.96:1, large text only */
  --accent-ink: #A63E12;   /* text/links: 5.96:1 on paper */
  --accent-wash: #FBEDE5;
  --accent-wash-2: #F6DCCB;
  --on-accent: #FFFFFF;
  --warn-bg: #FBF1D6;
  --warn-ink: #5E4300;     /* 8.19:1 on warn-bg */
  --warn-mark: #9C7210;    /* triangle: 3.86:1 on warn-bg */
  --ok-bg: #E3EEE6;
  --ok-ink: #1F5138;       /* 7.4:1 on ok-bg */
  --none-bg: #EEEBE4;
  --none-ink: #4A4F45;     /* 7.3:1 on none-bg */
  --disabled-ink: #6F6A60; /* 4.52:1 on none-bg */
  --focus: #1F5138;

  --font-head: "Oswald", "Arial Narrow", "Roboto Condensed", "DejaVu Sans Condensed", sans-serif;
  --font-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;

  --shadow: 0 1px 2px rgba(20,24,15,.06), 0 4px 16px rgba(20,24,15,.06);
  --shadow-sm: 0 1px 2px rgba(20,24,15,.06), 0 2px 8px rgba(20,24,15,.05);
  --shadow-pop: 0 1px 2px rgba(20,24,15,.06), 0 8px 28px rgba(20,24,15,.16);
  --r: 12px; --r-sm: 10px; --r-xs: 8px;
  --pad: clamp(16px, 4vw, 40px);
  --tap: 44px;
  --t: 120ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---- Base ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--font-body); }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 12px; }
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
summary::-webkit-details-marker { display: none; }
.mono, code { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); padding: 12px; z-index: 50; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }

.h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -.005em; margin: 20px 0 6px; }
.lede { margin: 0 0 24px; color: var(--muted); max-width: 60ch; }
.h2 { font-family: var(--font-head); font-weight: 600; font-size: 24px; line-height: 1.2; margin: 0 0 16px; }
.h2--sm { font-size: 20px; margin: 48px 0 12px; }
.h3cap { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sec { margin-top: 72px; }
.sec--narrow { max-width: 820px; }

/* ---- Buttons ------------------------------------------------------------ */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: var(--r-xs); background: var(--accent-ink); color: var(--on-accent); font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; transition: background var(--t); }
.btn:hover { background: #8B330E; color: var(--on-accent); }
.btn-sec { display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 16px; border-radius: var(--r-xs); border: 1px solid var(--rule-ui); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background var(--t); }
.btn-sec:hover { background: var(--chip); color: var(--ink); }

/* ---- Nav ---------------------------------------------------------------- */
.gnav { background: var(--ink); color: var(--paper); position: sticky; top: 0; z-index: 20; }
.gnav__in { max-width: 1120px; margin: 0 auto; padding: 0 var(--pad); min-height: 64px; display: flex; align-items: center; gap: 8px 24px; position: relative; flex-wrap: wrap; }
.gnav__logo { font-family: var(--font-head); font-weight: 600; font-size: 22px; letter-spacing: .01em; color: var(--paper); text-decoration: none; white-space: nowrap; min-height: var(--tap); display: flex; align-items: center; }
.gnav__logo span { color: var(--accent); padding: 0 0 0 .25em; }
.gnav__logo svg { flex: none; margin-right: 10px; border-radius: 6px; }
.gnav__logo:hover { color: var(--paper); }
.gnav__links { margin-left: auto; display: flex; gap: 8px; }
.gnav__links a { color: var(--paper); text-decoration: none; font-weight: 600; font-size: 16px; min-height: var(--tap); display: flex; align-items: center; padding: 0 12px; border-radius: var(--r-xs); }
.gnav__links a:hover { background: var(--ink-2); color: var(--paper); }
.gnav :focus-visible { outline-color: #FFD9C7; }
.search { position: relative; width: 320px; margin: 0; }
.search input { width: 100%; height: var(--tap); padding: 0 14px 0 42px; border-radius: var(--r-sm); border: 1px solid #4A5244; background: var(--ink-2); color: var(--paper); font: inherit; font-size: 16px; }
.search input::placeholder { color: #B9BFB2; }
.ico-search { position: absolute; left: 14px; top: 14px; width: 12px; height: 12px; border: 2px solid #B9BFB2; border-radius: 50%; pointer-events: none; }
.ico-search::after { content: ""; position: absolute; left: 10px; top: 11px; width: 7px; height: 2px; background: #B9BFB2; transform: rotate(45deg); transform-origin: left center; }
.results { position: absolute; right: var(--pad); top: 60px; width: min(400px, calc(100% - 32px)); list-style: none; margin: 0; padding: 6px; background: var(--surface); color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow-pop); z-index: 30; max-height: 70vh; overflow-y: auto; }
.results:empty { display: none; }
.results a, .pick-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 0 12px; border-radius: var(--r-xs); color: var(--ink); text-decoration: none; font-size: 16px; }
.results a:hover, .results a:focus-visible { background: var(--chip); }
.results b, .pick-list b { font-family: var(--font-mono); font-weight: 700; color: var(--accent-ink); }
/* No match: say so, and point at the other ways in. */
.res-none { padding: 12px; }
.res-none__t { margin: 0 0 8px; font-size: 15px; color: var(--muted); }
.res-none a { display: block; min-height: 0; padding: 0; font-size: 15px; color: var(--accent-ink); text-decoration: underline; }
.res-none a:hover { background: none; }
@media (max-width: 720px) {
  .gnav__links a { padding: 0 8px; font-size: 15px; }
  .search { order: 3; width: 100%; padding-bottom: 12px; }
  .search input { height: 48px; font-size: 17px; }
  .ico-search { top: 16px; }
  .results { top: 112px; left: var(--pad); right: var(--pad); width: auto; }
}

/* ---- Breadcrumb ----------------------------------------------------------- */
.crumbs { padding: 16px 0 0; font-size: 15px; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.crumbs li + li::before { content: "/"; color: #B5B0A5; margin-right: 10px; }
.crumbs a { color: var(--muted); display: inline-flex; min-height: 32px; align-items: center; }
.copy { height: var(--tap); padding: 0 16px; border-radius: var(--r-xs); border: 1px solid var(--rule-ui); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background var(--t); }
.copy:hover { background: var(--chip); }
.copy::before { content: ""; width: 10px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; box-shadow: 3px -3px 0 -1.5px var(--surface), 3px -3px 0 0 currentColor; }
.copy.is-done { color: var(--ok-ink); }
.chips { flex: 1 1 380px; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.chip { background: var(--chip); border-radius: var(--r-sm); padding: 12px 16px; }
.chip dt { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.chip dd { margin: 2px 0 0; font-family: var(--font-mono); font-weight: 700; font-size: 24px; line-height: 1.2; }
@media (max-width: 520px) { .chips { grid-template-columns: 1fr 1fr; flex-basis: 100%; } .chip dd { font-size: 22px; } }

/* Empty: numbered checklist */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 680px; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; background: var(--chip); border-radius: var(--r-sm); padding: 12px 16px; }
.num-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 700 15px var(--font-mono); }

/* ---- Callout (renumbered) ------------------------------------------------- */
.callout { margin-top: 24px; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-sm); padding: 16px 20px; display: grid; grid-template-columns: 20px 1fr; gap: 4px 14px; align-items: start; }
.tri { margin-top: 5px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 17px solid var(--warn-mark); position: relative; }
.tri::before, .tri::after { content: ""; position: absolute; left: -1px; width: 2px; background: var(--warn-bg); border-radius: 1px; }
.tri::before { top: 5px; height: 6px; } .tri::after { top: 13px; height: 2px; }
.callout p { margin: 0; }
.callout__t { font-weight: 700; }
.callout__b { margin: 2px 0 8px !important; max-width: 68ch; }
.callout a { display: inline-flex; align-items: center; min-height: var(--tap); margin: -10px 0 -10px -8px; padding: 0 8px; color: var(--warn-ink); font-weight: 700; }

/* ---- Tables: card on desktop, row cards on phones --------------------------- */
.tcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 8px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 16px; }
.tbl caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tbl thead th { text-align: left; padding: 14px 12px 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody th, .tbl td { text-align: left; padding: 12px; border-bottom: 1px solid var(--line-2); font-family: var(--font-mono); vertical-align: middle; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--paper); }
.tbl td.txt { font-family: var(--font-body); }
.tbl .b { font-weight: 700; }
.tbl tbody th a { color: var(--ink); text-decoration: none; font-weight: 700; }
.tbl tbody th a:hover { color: var(--accent-ink); text-decoration: underline; }
.code-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 6px; background: var(--accent-wash); color: var(--accent-ink); font-family: var(--font-mono); font-weight: 700; text-decoration: none; }
.code-chip:hover { background: var(--accent-wash-2); color: var(--accent-ink); }
.nodata, .nd { font-family: var(--font-body); font-size: 14px; color: var(--muted); }
.tbl th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.tbl th button:focus-visible { outline: 3px solid var(--focus); }
.tbl th[aria-sort=ascending] button::after { content: "\2191"; } .tbl th[aria-sort=descending] button::after { content: "\2193"; }
@media (max-width: 720px) {
  .tcard { background: transparent; box-shadow: none; padding: 0; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tbl, .tbl tbody, .tbl tr, .tbl td, .tbl tbody th { display: block; width: 100%; }
  .tbl tr { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 10px; }
  .tbl tbody tr:hover { background: var(--surface); }
  .tbl tbody th { padding: 0 0 8px; border: 0; }
  .tbl tbody th:not(:has(a)) , .tbl tbody th.pill { display: inline-flex; width: auto; align-items: center; min-height: 28px; padding: 0 12px; margin-bottom: 8px; border-radius: 999px; background: var(--chip-2); font-size: 15px; }
  .tbl td { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 9px 0; border-bottom: 0; border-top: 1px solid var(--line); text-align: right; }
  .tbl td > * { justify-self: end; }
  .tbl td::before { content: attr(data-label); text-align: left; font-family: var(--font-body); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
}

/* Hub: indice di marca, due colonne (nome + stato). Il badge va a destra. */
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font: 700 13px var(--font-body); white-space: nowrap; }
.badge--part, .badge.part { background: var(--warn-bg); color: var(--warn-ink); }
.badge--none, .badge.none { background: var(--none-bg); color: var(--none-ink); }
.hub td:nth-child(2) { text-align: right; }
.legend { list-style: none; margin: 4px 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 8px; }
.hubbar { position: sticky; top: 64px; z-index: 5; background: var(--paper); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.filter { position: relative; flex: 1 1 280px; max-width: 440px; }
.filter input { width: 100%; height: 52px; padding: 0 14px 0 44px; border-radius: var(--r-sm); border: 1px solid var(--rule-ui); background: var(--surface); font: 17px var(--font-mono); color: var(--ink); box-shadow: 0 1px 2px rgba(20,24,15,.06); }
.filter .ico-search { left: 16px; top: 18px; border-color: var(--muted); }
.filter .ico-search::after { background: var(--muted); }
.hubcount { font-size: 15px; color: var(--muted); }
.hubcount b { font-family: var(--font-mono); color: var(--ink); }
@media (max-width: 720px) {
  .hubbar { top: 124px; }
  .hub tbody th { font-size: 17px; }
}
.small { font-size: 15px; color: var(--muted); max-width: 52ch; margin: 0; }

/* ---- Accordion (help + FAQ) ------------------------------------------------------ */
.acc { border-top: 1px solid var(--line); }
.acc > details { border-bottom: 1px solid var(--line); }
.acc summary { list-style: none; cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 700; font-size: 18px; }
.acc summary::after { content: "+"; flex: none; font: 22px var(--font-mono); color: var(--accent-ink); transition: transform var(--t); }
.acc details[open] > summary::after { transform: rotate(45deg); }
.acc summary:hover { color: var(--accent-ink); }
.acc .a { padding: 0 0 20px; }
.acc .a p { max-width: 68ch; }
.faq summary { font-size: 17px; }
.panel-box { background: var(--surface); border-radius: var(--r-sm); padding: 16px; box-shadow: 0 1px 2px rgba(20,24,15,.06); }
/* stamp lookup */
.lookup { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.lookup label { display: block; margin-bottom: 4px; }
.lookup input { width: 120px; height: 52px; padding: 0 14px; border-radius: var(--r-xs); border: 1px solid var(--rule-ui); background: var(--surface); font: 700 22px var(--font-mono); color: var(--ink); }
.lookup__out { flex: 1 1 220px; }
.lookup__out div { font-size: 13px; color: var(--muted); }
.lookup__out strong { display: block; font: 700 clamp(22px, 2.4vw, 28px)/1.25 var(--font-mono); }
.more summary { list-style: none; cursor: pointer; min-height: var(--tap); display: inline-flex; align-items: center; color: var(--accent-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.stamps { width: 100%; max-width: 420px; border-collapse: collapse; font: 15px var(--font-mono); margin-top: 8px; }
.stamps th, .stamps td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line-2); }
.stamps thead th { font: 700 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--line); }

/* ---- Link chips --------------------------------------------------------------------- */
.lchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lchips a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; border-radius: var(--r-xs); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font: 600 15px var(--font-mono); transition: background var(--t); }
.lchips a:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
.lchips a small { margin-left: 8px; font-family: var(--font-body); font-weight: 400; color: var(--muted); }
.lgroup + .lgroup { margin-top: 20px; }
.after-chips { margin-top: 16px; }

/* ---- Footer ---------------------------------------------------------------------------- */
.gfoot { background: var(--chip-2); color: var(--ink); margin-top: 72px; padding: 40px 0 32px; font-size: 15px; }
.gfoot__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px 40px; }
.gfoot h2 { margin: 0 0 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gfoot ul { list-style: none; margin: 0; padding: 0; display: grid; }
.gfoot a { display: flex; align-items: center; min-height: var(--tap); color: var(--ink); text-decoration: none; }
.gfoot a:hover { color: var(--accent-ink); }
.gfoot__fine { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; max-width: none; }

/* ---- Home --------------------------------------------------------------------------------- */
.home-h1 { font-family: var(--font-head); font-weight: 600; font-size: clamp(32px, 4.6vw, 48px); line-height: 1.08; margin: clamp(28px, 5vw, 56px) 0 8px; max-width: 18ch; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: clamp(24px, 4vw, 48px); align-items: start; }
.picker { padding: clamp(20px, 3vw, 28px); }
.picker__steps { display: grid; gap: 20px; }
.picker label { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.picker .num-dot { width: 26px; height: 26px; font-size: 13px; }
.field { width: 100%; height: 56px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--rule-ui); background: var(--surface); font: inherit; font-size: 18px; color: var(--ink); }
.field.mono { font-family: var(--font-mono); }
.field:disabled { background: var(--none-bg); color: var(--disabled-ink); }
.pick-head { margin-top: 16px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 2px 6px; }
.pick-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 420px; overflow-y: auto; }
.pick-list a { border-radius: 0; min-height: 52px; padding: 0 4px; border-bottom: 1px solid var(--line); }
.pick-list a:hover { background: var(--paper); }
.pick-list a span { font-weight: 600; }
.ways { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ways a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ways a:hover { background: var(--chip); color: var(--ink); }
.ways b { font-family: var(--font-head); font-weight: 600; font-size: 20px; }
.ways i { grid-row: span 2; font-style: normal; color: var(--accent-ink); font-size: 22px; }
.ways span { font-size: 15px; color: var(--muted); }
.brand-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.brand-chips a { display: inline-flex; align-items: center; min-height: 52px; padding: 0 22px; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand-chips a:hover { background: var(--accent-wash); color: var(--ink); }
.all-brands { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); column-gap: 24px; }
.all-brands a { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 16px; }
.all-brands a small { color: var(--muted); font-family: var(--font-mono); }
.all-brands a:hover { color: var(--accent-ink); }

/* ---- Size, code, info ---------------------------------------------------------------------- */
.dlset { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dlset li { font: 700 16px var(--font-mono); background: var(--chip-2); border-radius: 999px; padding: 2px 12px; }
.prose { max-width: 68ch; }
.prose h2 { font-family: var(--font-head); font-weight: 600; font-size: 22px; margin: 32px 0 8px; }
.prose ol { padding-left: 1.2em; } .prose li { margin-bottom: 10px; }
.err { max-width: 640px; margin: 56px 0; padding: 32px; }
.err .label { margin-bottom: 8px; display: block; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* State helpers */
[hidden] { display: none !important; }

/* Hub on phones: una riga, nome a sinistra e stato a destra */
@media (max-width: 720px) {
  .hub tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "m s"; gap: 2px 10px; align-items: center; padding: 12px 16px; margin-bottom: 8px; box-shadow: var(--shadow-sm); border-radius: var(--r-sm); }
  .hub tbody th { grid-area: m; padding: 0; font-size: 17px; }
  .hub td { display: block; width: auto; padding: 0; border: 0; min-width: 0; grid-area: s; justify-self: end; }
  .hub td::before { content: none !important; }
  .hub .badge { font-size: 12px; padding: 0 8px; }
}

/* =====================================================================
   Liste lunghe: il browser non disegna cio' che sta fuori dallo schermo.
   `content-visibility: auto` (Baseline dal settembre 2025: Chrome 85+,
   Firefox 125+, Safari 18+) salta layout e pittura dei blocchi lontani
   dalla vista. Il DOM e i link restano al loro posto, quindi i crawler e
   "trova nella pagina" funzionano come prima. Non riduce i byte, riduce
   il lavoro del browser.
   L'unita' e' il GRUPPO di modelli, non la sezione: misurato nel browser,
   un gruppo e' 75 px (max 151) e una lista 44 px, mentre una sezione va da
   180 px (pagine modello) a 2.778 px (pagine /size/), e una sola stima non
   andrebbe bene per entrambe. `contain-intrinsic-size: auto N` da' al
   browser la misura provvisoria e, dopo il primo disegno, quella vera:
   cosi' la barra di scorrimento non salta.
   ===================================================================== */
.lgroup, .lchips { content-visibility: auto; }
.lgroup { contain-intrinsic-size: auto 75px; }
.lchips { contain-intrinsic-size: auto 44px; }

/* =====================================================================
   H12 report form. The form needs JS (it posts with fetch), so it only
   appears when JS is on: .js is added to <html> by an inline script.
   Without JS the page keeps the four ways in, which is what the user
   actually needs.
   ===================================================================== */
.rep { display: none; }
.js .rep { display: block; }
.rep-wrap { max-width: 680px; margin: 8px 0 4px; }
.rep__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rep label { display: block; font: 600 15px var(--font-body); color: var(--ink); margin: 12px 0 6px; }
.rep textarea { resize: vertical; min-height: 72px; }
.rep__foot { display: flex; align-items: center; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.rep__out { margin: 0; font-size: 15px; color: var(--muted); }
.rep__out:not(:empty) { color: var(--ink); }

/* =====================================================================
   Print: the drive link charts are the pages people take to the shop.
   Nothing here changes the screen view.
   ===================================================================== */
@media print {
  .gnav, .gfoot, .crumbs, .skip, .search, .results, .buy, .faq, .ways, .next-big, .steps { display: none !important; }
  body { background: #fff; color: #000; }
  .wrap { max-width: none; padding: 0; }
  .sec { break-inside: avoid-page; }
  .lgroup, .lchips { content-visibility: visible; }
  .tcard, .card, .code-big { box-shadow: none !important; border: 1px solid #bbb; }
  .tbl { font-size: 11pt; }
  .tbl tr { break-inside: avoid; }
  .tbl thead { display: table-header-group; }
  a { text-decoration: none; color: #000; }
}
@media (max-width: 720px) {
  .gnav__logo { font-size: 19px; }
  html, body { overflow-x: clip; }
}
/* Hub rows carry no data-label (bytes x 400 rows): the label comes from here. */
@media (max-width: 720px) { .hub td::before { content: "Data"; } }

/* =====================================================================
   Model page v2: hero + one answer card + buy box right under it
   ===================================================================== */
.mtop { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px 40px; align-items: start; margin-top: 8px; }
.mtop .h1 { margin: 12px 0 20px; }
.mfig { margin: 0; border-radius: var(--r); overflow: hidden; background: var(--chip); }
.mfig img { display: block; width: 100%; height: auto; }
.mfig figcaption { padding: 8px 12px; font-size: 12px; color: var(--muted); background: var(--surface); }
.mfig figcaption a { color: var(--muted); }
.mfig--draw { background: var(--chip); padding: 12px 8px; }
@media (max-width: 860px) {
  .mtop { grid-template-columns: 1fr; }
  .mtop .h1 { margin-bottom: 12px; }
  .mfig--draw { display: none; }            /* the drawing is decoration: the answer comes first on a phone */
  .mfig:not(.mfig--draw) { max-height: 220px; }
  .mfig:not(.mfig--draw) img { max-height: 190px; object-fit: contain; }
}

.ans { padding: clamp(20px, 3vw, 32px); }
.ans__t { font: 600 14px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.ans__q { margin: 0 0 8px; font-weight: 700; }
.bars { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.bars button { min-height: 48px; min-width: 64px; padding: 0 16px; border-radius: var(--r-sm); border: 2px solid var(--line); background: var(--surface);
  font: 700 18px var(--font-mono); color: var(--ink); cursor: pointer; transition: border-color var(--t), background var(--t); }
.bars button:hover { border-color: var(--rule-ui); }
.bars button[aria-pressed=true] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.opt__bar { margin: 0 0 8px; font: 700 15px var(--font-mono); color: var(--muted); }
.js .opt:not(.on) { display: none; }
.js .opt__bar:not(.opt__bar--one) { display: none; }
.opt + .opt { margin-top: 24px; }
.js .opt + .opt { margin-top: 0; }
.big3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.big3 > div { background: var(--chip); border-radius: var(--r-sm); padding: 14px 16px 16px; }
.big3 dt { white-space: nowrap; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.big3 dd { margin: 4px 0 0; font: 600 clamp(28px, 3.6vw, 40px)/1.05 var(--font-head); color: var(--ink); }
.big3 > div:last-child { background: var(--accent-wash); }
.big3 > div:last-child dd { color: var(--accent-ink); }
.big3 dd a { font-size: .7em; }
.big3__sub { display: block; margin-top: 4px; font: 400 13px var(--font-body); color: var(--muted); }
.opt__meta { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 15px; color: var(--muted); }
.opt__meta li:first-child { color: var(--ink); font-size: 16px; display: flex; align-items: center; gap: 8px; }
.opt__meta b { font-size: 20px; }
.opt__meta .copy { height: 36px; padding: 0 12px; font-size: 14px; }
.ans__sum { margin: 20px 2px 0; font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 80ch; }
.ans__sum b { color: var(--ink); }
.ans__txt { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.ans__mount { margin: 6px 0 0; font-size: 15px; color: var(--muted); }
.ans__btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
@media (max-width: 420px) { .big3 > div { padding: 10px 10px 12px; } .big3 dd { font-size: 24px; } .big3 dt { font-size: 10.5px; letter-spacing: .04em; } }

/* Buy box: the next thing after the answer. Two shops, each with its own picture. */
.buybox { margin-top: 28px; padding: clamp(18px, 3vw, 28px); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border-top: 4px solid var(--accent); }
.buybox__head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.buybox__head .h2 { margin: 0; }
.ad { font: 700 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--rule-ui); border-radius: 4px; padding: 1px 6px; }
.bset__for { margin: 0 0 12px; font-weight: 700; }
.bset__for span { font-weight: 400; color: var(--muted); }
.js .bset:not(.on) { display: none; }
.bset + .bset { margin-top: 20px; }
.js .bset + .bset { margin-top: 0; }
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.offer { display: grid; grid-template-columns: 96px 1fr; grid-template-areas: "img shop" "img t" "img go"; gap: 2px 16px; align-items: center;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none; color: var(--ink); background: var(--surface); transition: border-color var(--t), box-shadow var(--t); }
.offer:hover { border-color: var(--rule-ui); box-shadow: var(--shadow-sm); color: var(--ink); }
.offer img { grid-area: img; width: 96px; height: 96px; object-fit: contain; }
.offer__shop { grid-area: shop; font: 700 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.offer__t { grid-area: t; font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.offer__go { grid-area: go; justify-self: start; margin-top: 8px; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px;
  border-radius: var(--r-xs); background: var(--accent-ink); color: var(--on-accent); font-weight: 700; font-size: 15px; }
.offer:hover .offer__go { background: #8B330E; }
.offer--search { grid-template-columns: 1fr; grid-template-areas: "shop" "t" "go"; }
.buybox__note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.fig { margin: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-sm); overflow: hidden; }
.fig img { display: block; width: 100%; height: auto; background: var(--chip); }
.fig figcaption { padding: 12px 16px 16px; font-size: 15px; line-height: 1.5; }
.fig figcaption b { display: block; font: 600 18px var(--font-head); margin-bottom: 2px; }
.more { margin-top: 16px; }
.more > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 700; color: var(--accent-ink); }
.buybox__legal { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.buybox__legal + .buybox__note { margin-top: 4px; }
.subs { margin: -8px 0 20px; padding: 12px; border-radius: var(--r-sm); background: var(--chip); }
.js .subs:not(.on) { display: none; }
.subs__q { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.subs button { min-height: var(--tap); margin: 0 6px 6px 0; padding: 0 14px; border-radius: var(--r-xs); border: 1px solid var(--rule-ui); background: var(--surface); font: 600 15px var(--font-body); color: var(--ink); cursor: pointer; }
.subs button[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
/* critique pass: orange only for actions */
.big3 > div:last-child dd { color: var(--ink); }
.big3 > div:last-child { background: var(--accent-wash); box-shadow: inset 0 0 0 2px var(--accent-wash-2); }
.offer--search { border-style: dashed; background: var(--paper); }
.offer--search .offer__go { background: var(--surface); color: var(--accent-ink); border: 1px solid var(--rule-ui); }
.offer--search:hover .offer__go { background: var(--chip); }
.offer--search .offer__t { color: var(--muted); }
.opt__meta .copy, .copy { height: var(--tap); }
.ad { font-size: 12px; color: var(--ink); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.hub tbody th, .hub tbody th a { font-family: var(--font-body); }
.buybox, .ans, .fig, .tcard { box-shadow: var(--shadow); }
/* hub as a compact grid of models (the table stays for filter, sort and no-JS) */
.hub thead { display: none; }
.hub tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 6px; }
.hub tr { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 12px !important;
  margin: 0 !important; background: var(--surface); border-radius: var(--r-xs); box-shadow: none !important; border: 1px solid var(--line); }
.hub tr:hover { border-color: var(--rule-ui); }
.hub tbody th, .hub td { display: block !important; width: auto !important; padding: 0 !important; border: 0 !important; background: none !important; margin: 0 !important; }
.hub tbody th a { display: flex; align-items: center; min-height: 46px; font-size: 16px; font-weight: 600; }
.hub td::before { content: none !important; }
.hub td:empty { display: none !important; }
.tcard:has(> .hub) { background: transparent; box-shadow: none; padding: 0; }
.hub tr[hidden] { display: none !important; }
.allbars { margin-top: 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 0 16px; }
.allbars > summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.allbars > summary::after { content: "+"; margin-left: auto; font: 600 22px var(--font-head); color: var(--accent-ink); }
.allbars[open] > summary::after { content: "\2212"; }
.allbars .mini { margin-bottom: 8px; }
.allbars .ans__sum { margin: 4px 0 14px; }
@media (max-width: 720px) { .allbars .mini, .allbars .mini tbody, .allbars .mini tr { display: table; width: 100%; }
  .allbars .mini thead { position: static; width: auto; height: auto; clip: auto; display: table-header-group; }
  .allbars .mini tbody { display: table-row-group; } .allbars .mini tr { display: table-row; box-shadow: none; padding: 0; margin: 0; }
  .allbars .mini td, .allbars .mini tbody th { display: table-cell; width: auto; padding: 8px 6px; text-align: left; border-top: 0; font-size: 14px; }
  .allbars .mini td::before { content: none; } }
.hub tbody th, .hub tbody th a { font-family: var(--font-body) !important; }
.chipset { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (min-width: 721px) { .chipset { justify-content: flex-start; } }
.big3 dd a { font-size: .6em; }
/* legacy components aligned with the new cards */
.callout { background: var(--surface); color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow); border-left: 4px solid var(--warn-mark); padding: 18px 22px; grid-template-columns: 1fr; }
.callout .tri { display: none; }
.callout__t { font: 600 18px var(--font-head); }
.callout__b { color: var(--muted); }
.callout a { color: var(--accent-ink); }
.panel-box { box-shadow: none; border: 1px solid var(--line); border-radius: var(--r); }
.lookup input { height: var(--tap); border-radius: var(--r-sm); font-size: 20px; }
.more .panel-box { margin-top: 8px; }
.stamps { max-width: 100%; }
.dlset { list-style: none; margin: 0; padding: 0; display: inline-flex; flex-wrap: wrap; gap: 6px; }
.dlset li { min-width: 36px; padding: 2px 8px; border-radius: 999px; background: var(--chip-2); font: 700 15px var(--font-mono); text-align: center; }
p.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
p.chips .label { margin-right: 6px; }
p.chips .chip { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 600; min-height: 36px; display: inline-flex; align-items: center; }
.lchips a { font-family: var(--font-body) !important; font-weight: 600; }
#h-oem ~ .tcard td span .small { display: block; }

/* mobile table cards: label on the left, all values wrap together on the right */
@media (max-width: 720px) {
  .tbl:not(.mini):not(.hub) td { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
  .tbl:not(.mini):not(.hub) td::before { margin-right: auto; padding-right: 12px; }
}
.chipset--left { justify-content: flex-start !important; }
.mgroup { margin-top: 16px; }
.hub tbody { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }

/* ---- Soul: one photograph on the home page, sentence-case labels ---- */
.hero { position: relative; background: var(--ink); color: var(--paper); overflow: hidden; }
.hero picture, .hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 45%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,24,15,.92) 0%, rgba(20,24,15,.72) 45%, rgba(20,24,15,.25) 100%); }
.hero__in { position: relative; z-index: 1; padding-top: clamp(56px, 9vw, 112px); padding-bottom: clamp(48px, 7vw, 88px); }
.hero .home-h1 { color: var(--paper); max-width: 14ch; margin: 0 0 16px; font-size: clamp(40px, 6vw, 72px); line-height: 1.02; }
.hero__in p { max-width: 46ch; margin: 0; font-size: clamp(17px, 1.6vw, 20px); color: #E9E5DC; }
.hero__credit { position: relative; z-index: 1; margin: 0 auto; padding-bottom: 10px; font-size: 12px; color: #B9BFB2; text-align: right; }
.hero__credit a { color: #B9BFB2; }
.hero + main .home-grid { margin-top: -24px; position: relative; z-index: 2; }
@media (max-width: 720px) { .hero::after { background: linear-gradient(180deg, rgba(20,24,15,.55), rgba(20,24,15,.9)); } .hero + main .home-grid { margin-top: 24px; } }
.photo { margin: 8px 0 32px; max-width: 820px; }
.photo img { display: block; width: 100%; height: auto; border-radius: var(--r); }
.photo figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); }
.photo figcaption a { color: var(--muted); }
.label, .h3cap, .big3 dt, .offer__shop, .ans__t, .tbl thead th, .tbl td::before, .stamps thead th, .gfoot h2 { text-transform: none !important; letter-spacing: 0 !important; }
.big3 dt { font-size: 14px; } .h3cap, .label { font-size: 14px; }
@media (max-width: 720px) { .tbl td::before { font-size: 14px; } }
.hero + main .home-grid { margin-top: 32px !important; }

/* hero and photos live inside the page column like every other card */
.hero { margin-top: 24px; border-radius: var(--r); box-shadow: var(--shadow); }
.hero__in { padding: clamp(36px, 6vw, 72px) clamp(20px, 5vw, 56px) clamp(44px, 6vw, 72px); }
.hero .home-h1 { font-size: clamp(36px, 5vw, 60px); }
.hero__credit { position: absolute; right: 14px; bottom: 8px; padding: 0; margin: 0; }
.hero + .home-grid, .hero ~ .home-grid { margin-top: 28px !important; }
.photo img { aspect-ratio: 16 / 9; object-fit: cover; max-height: 380px; }
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; padding: 16px 18px;
  background: var(--surface); color: var(--ink); border-radius: var(--r); box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.consent p { margin: 0 0 12px; font-size: 15px; }
.consent__btns { display: flex; gap: 8px; justify-content: flex-end; }
.consent__btns .btn-sec { min-width: 110px; justify-content: center; }
