/* ==========================================================================
   PROJECT X25 — Homepage stylesheet
   FlowzNexus STYLE ONLY (theme / colours / fonts / layout).
   Tokens: architecture §4. Dark theme throughout, no light mode.
   Fonts are self-hosted WOFF2 (no runtime third-party requests).
   ========================================================================== */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-grotesque-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
/* Fallback metric faces (A-Z round, RSP-03): Arial with ascent/descent/
   line-gap overrides matching the webfonts (Bricolage 93%/27%/0%,
   Instrument 97%/25%/0%) and size-adjust matching x-height
   (Bricolage 52.8% vs Arial 52.1% -> 101.3%; Instrument 51.0% vs
   Arial 52.1% -> 97.9%). The fallback occupies the same line box as
   the webfont, so the swap shift that caused lab CLS > 0.1 is
   near-zero even before the preloaded WOFF2 arrives. */
@font-face {
  font-family: "Bricolage Grotesque Fallback";
  src: local("Arial");
  ascent-override: 93%;
  descent-override: 27%;
  line-gap-override: 0%;
  size-adjust: 101.3%;
}
@font-face {
  font-family: "Instrument Sans Fallback";
  src: local("Arial");
  ascent-override: 97%;
  descent-override: 25%;
  line-gap-override: 0%;
  size-adjust: 97.9%;
}


:root {
  --bg:        #050914; /* Midnight background */
  --surface:   #0B1328;
  --panel:     #101B38;
  --line:      #1C2A4D; /* hairline / borders */
  --line-hover:#2F4A8A;
  --text:      #EEF3FF;
  --muted:     #9AA8C7;
  --cyan:      #27D9FF; /* primary accent */
  --violet:    #8A6BFF;
  --amber:     #FFB84D;
  --green:     #3DDC97;
  --red:       #FF6B6B;
  --glow:      #12235A; /* V1-F (FlowzNexus V1, Variant F): hub-glow base, used at 33–55% */
  --btn-grad:  linear-gradient(120deg, #27D9FF, #5AA0FF);
  --aurora:    linear-gradient(100deg, #27D9FF, #8A6BFF);
  --card-grad: linear-gradient(180deg, #101B38, #0B1328);
  --radius:    14px;
  --maxw:      1152px;
  --header-h:  68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Instrument Sans", "Instrument Sans Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: "Bricolage Grotesque", "Bricolage Grotesque Fallback", "Instrument Sans", "Instrument Sans Fallback", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4rem); max-width: 14ch; }
h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
::selection { background: rgba(39, 217, 255, 0.3); }

/* Skip link (A-Z round, RSP-01): visually hidden until keyboard focus. */
.skip-link {
  position: absolute; left: 1rem; top: -100%;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0.6rem 1rem; font-weight: 600; z-index: 100;
}
.skip-link:focus { top: 0.75rem; text-decoration: none; }

/* Visible breadcrumb (A-Z round, T-M4): small, muted, '>' separators. */
.breadcrumb { padding: 1.25rem 0 0; font-size: 0.9rem; color: var(--muted); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.5rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--cyan); }
.breadcrumb [aria-current="page"] { color: var(--text); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.num { font-variant-numeric: tabular-nums; }
.grad-text {
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
section { padding: 4.5rem 0; }
section + section { border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ Header §4.3 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  min-height: var(--header-h);
  background: rgba(5, 9, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 1.5rem;
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 1.25rem;
}
.logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: "Bricolage Grotesque", "Bricolage Grotesque Fallback", sans-serif; font-weight: 700; font-size: 1.1rem;
  color: var(--text); white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--btn-grad);
  color: #021024; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.02em;
}
.main-nav { display: flex; gap: 0.25rem; margin-left: auto; }
.main-nav a {
  color: var(--muted); font-size: 0.9rem; font-weight: 600;
  padding: 0.5rem 0.55rem; border-radius: 8px; position: relative;
}
.main-nav a:hover { color: var(--text); text-decoration: none; }
.main-nav a::after {
  content: ""; position: absolute; left: 0.8rem; right: 0.8rem; bottom: 0.15rem;
  height: 2px; border-radius: 2px;
  background: var(--btn-grad);
  transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease;
}
.main-nav a:hover::after { transform: scaleX(1); }
/* V-01 fix (4 Dec 2026): nowrap on the 8 nav links made the header
   25px too wide at exactly 900px (scrollWidth 925 vs 900). Scope the
   nowrap to >=1080px, where the full nav fits on one line; below that
   the links wrap exactly as they did at baseline (accepted
   pre-existing behaviour at 901–~1049px). At the owner's 1152px
   viewport all 8 links stay on one line. */
@media (min-width: 1080px) {
  .main-nav a { white-space: nowrap; flex: none; }
}
.header-cta { flex: none; }
.menu-toggle {
  display: none; margin-left: auto;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 0.5rem 0.75rem; font-size: 1.1rem; cursor: pointer;
}

/* ------------------------------------------------------------ Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-family: "Instrument Sans", "Instrument Sans Fallback", sans-serif;
  font-size: 0.95rem; font-weight: 600;
  padding: 0.8rem 1.6rem; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--btn-grad); color: #021024; }
.btn-primary:hover { box-shadow: 0 6px 24px rgba(39, 217, 255, 0.35); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ Hero */
.hero {
  padding: 4.5rem 0 3.5rem; border-top: none; position: relative;
  /* V1-F overflow fix (4 Dec 2026 — visual QA FAIL: tablet-820 scrollWidth
     956 vs 820 on all 3 hub pages, load + after calculation). Root cause:
     .hero-art::before has inset -160px; at <=900px .hero-grid collapses to
     one column so .hero-art is full-width (right edge 796 at 820px) and the
     ::before bleeds to 956px, with nothing clipping it. overflow-x: clip
     contains that bleed at the hero's own bounds (the viewport edge — the
     hero is a full-width section) without touching the glow itself.
     Same bleed exists at 901-1423px too (measured 1136 @1000, 1352 @1280),
     so this is applied at all widths, not just <=900px. Desktop glow
     UNCHANGED: at 1920 the ::before right edge (1672px) never reaches the
     hero bound, so nothing is clipped; at 1280 the clipped strip is
     >339px from the hub centre, past the gradient's 300px transparent
     radius. clip (unlike hidden) creates no scroll container, and the
     only sticky element (site header) lives outside .hero, so no sticky
     or fixed descendant is affected. The constellation SVG is inset: 0
     inside .hero-art and the network SVG is in-flow width 100% — neither
     reaches the hero bounds. Vertical overflow is untouched (overflow-y
     stays visible; the glow's visible extent sits inside the hero's
     vertical bounds at every checked width). */
  overflow-x: clip;
  /* V1-F Layer 1 dot grid (static, ~28px) + Layer 4 violet wash (static,
     top-right, alpha ~0.10). Backgrounds only — no layout height, no markup.
     Applies to all 10 heroes via .hero; hidden <=781px (see media query). */
  background-image:
    radial-gradient(circle, rgba(138, 107, 255, 0.10), transparent 70%),
    radial-gradient(circle, rgba(238, 243, 255, 0.055) 1px, transparent 1.5px);
  background-size: 340px 340px, 28px 28px;
  background-position: right -40px top -60px, 0 0;
  background-repeat: no-repeat, repeat;
}
/* V1-F Layer 4 teal hub glow (static base; slow subtle breathe added in a
   later commit). Radius ~400px, peak alpha 0.13.
   FIX (V1-F, 4 Dec 2026 — visual QA FAIL-2): the old centre
   `calc(50% + 288px) 46%` was a percentage of the WHOLE hero height, so at
   1920 the glow centre sat at viewport (1248, 814) — 485px BELOW the hub
   (1261, 329) — and transparent beyond 300px radius, so zero teal reached
   the hub; on the 7 non-hub pages (heroes up to ~7000px tall) no glow was
   visible in the first viewport at all. Re-anchored:
   - Hub pages (homepage, reverse, Svizzera — the 3 with .hero-art): the
     glow now lives on .hero-art::before, centred 50%/50% of the hub's own
     containing element, i.e. exactly on the hub (network-SVG centre
     (280,210) = .hero-art centre). The hero-level ::before is OFF there
     (`.hero:has(.hero-art)::before`) so the peak alpha is not doubled.
   - Non-hub pages (7, no .hero-art): .hero::before keeps the same
     horizontal anchor but a FIXED 190px top offset from the hero top, so
     the glow sits top-right inside the first viewport on any hero height.
   PROPOSED enhancement: the live reference glow is static; the breathe is
   NOT a replication (see handoff §11.3 tension). */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(400px 400px at calc(50% + 288px) 190px, rgba(39, 217, 255, 0.13), rgba(39, 217, 255, 0.04) 55%, transparent 75%);
  background-repeat: no-repeat;
  /* V1-F breathe — FIX (visual QA FAIL-1, 4 Dec 2026): the 7s / 0.77↔1.0
     breathe measured a 2.62 absolute range (9.4% of region mean) over
     15–18s at the glow centre — ~3.3× the ~2% live-study-2 bound, with a
     clearly regular 7.0s cycle. Retuned to 30s period. First retune
     0.92↔1.0 STILL measured above the bound (paused-state range 1.70 abs
     = 6.2% of region mean at the new hub centre), so the swing was reduced
     further to 0.98↔1.0 (effective peak alpha ~0.127↔0.13) — measured
     static-state range 0.32 abs = 1.11% of region mean, inside the bound.
     DEVIATION RECORDED: the original task specified ~7s; 7s failed the
     numeric bound, and 30s is the value spec §11.4 already proposed (≥30s).
     With a 30s period no regular cycle is visible inside a 15–18s window.
     Period was NOT shortened below 30s. Breathe is CSS-only, teal glow
     only. NOTE for QA: measure the glow region with the centre hub node
     masked (it has its own 3.2s nodePulse, 0.55↔1.0, which alone swings
     the unmasked 200×120 region mean by ~1.4 abs); live screenshots AND
     paused-animation screenshots in headless Chrome under-report the
     range (stale compositor frames — live 18s series read 0.00% while
     the true swing is 1.11%). Reliable check: force the pseudo opacity
     statically (animation off) at 0.98 vs 1.0 and compare region means. */
  animation: glowBreathe 30s ease-in-out infinite;
}
/* Hub pages only: hero-level glow OFF — the hub glow comes from
   .hero-art::before below (same radius / peak alpha, no doubling). */
.hero:has(.hero-art)::before { display: none; }
/* V1-F hub glow, hub pages only: attached to .hero-art (the hub's own
   containing element), centred on the hub itself. inset -160px so the
   400px-radius gradient (transparent beyond 300px) is not clipped by the
   .hero-art box. Same breathe as .hero::before; reduced-motion turns it
   OFF (static glow) — see the reduced-motion block. Hidden ≤781px with
   .hero-art itself, so the 360px fold is untouched. */
.hero-art::before {
  content: ""; position: absolute; inset: -160px; z-index: 0; pointer-events: none;
  background: radial-gradient(400px 400px at 50% 50%, rgba(39, 217, 255, 0.13), rgba(39, 217, 255, 0.04) 55%, transparent 75%);
  background-repeat: no-repeat;
  animation: glowBreathe 30s ease-in-out infinite;
}
@keyframes glowBreathe {
  0%, 100% { opacity: 0.98; }
  50% { opacity: 1; }
}
/* X25 Particles (OD-22, 4 Dec 2026): cursor-interactive canvas network in
   the hero — the FlowzNexus-video effect. The <canvas> is created by
   js/particles.js as the hero's first child (never present without its JS,
   never created under prefers-reduced-motion). Absolute, top-left,
   z-index 0 like the ::before glow, below .hero-grid (z-index 1) so it
   sits behind the calculator, the constellation/hub SVG and the pills.
   pointer-events none: it can never intercept a click. Its drawn height
   is capped at the viewport height by the script (some heroes are ~7000px
   tall; a full-hero backing store would be a multi-megapixel canvas), so
   the field covers the hero's first viewport where the calculator sits.
   No layout: hero height unchanged. */
.hero-particles { position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 3rem; align-items: start;
  position: relative; z-index: 1; /* keep hero content above the ::before glow */
}
/* Grid blowout guard: without min-width:0 a grid item cannot shrink
   below its min-content, so a wide child (donut + legend, breakdown
   amounts) forced the whole page to 456px on a 390px viewport. */
.hero-grid > * { min-width: 0; }
.hero-main #calc-title { font-size: 1.5rem; margin-top: 1.75rem; }
.hero .benefits { margin-top: 2.5rem; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.75rem; }
.hero-art { min-height: 320px; position: relative; }
/* V1-F Layer 3 static constellation (Variant F: no drift, no canvas).
   Separate SVG from the pinned hub .network-svg (22 lines / 14 circles
   untouched — QA pins .network-svg only). Absolute, behind the hub,
   pointer-events none; hidden <=781px with .hero-art. 50 dots (2–4px,
   alpha 0.5–0.9), 14 hairlines (1px, alpha 0.15–0.35) in 6 small
   link-groups of 2–4 dots. No FlowzNexus labels/caption anywhere. */
.constellation-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* Hub labels (pre-launch design fix, 2026-12-04): 6 own-language pills just
   outside the constellation annulus, in their own SVG so the pinned
   .network-svg (22 lines / 14 circles) and .constellation-svg (50 dots /
   14 lines) counts are untouched. Dashed spokes are <path>, not <line>. */
.hub-labels-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hub-labels-svg rect { fill: #0B1328; stroke: #1C2A4D; stroke-width: 1; }
.hub-labels-svg text { fill: #EEF3FF; font-family: "Instrument Sans", "Instrument Sans Fallback", sans-serif; font-size: 0.9rem; text-anchor: middle; dominant-baseline: central; }
.hub-labels-svg .spoke-cyan { stroke: rgba(39, 217, 255, 0.6); stroke-width: 1.5; stroke-dasharray: 10 8; fill: none; }
.hub-labels-svg .spoke-violet { stroke: rgba(138, 107, 255, 0.6); stroke-width: 1.5; stroke-dasharray: 10 8; fill: none; }
.network-svg { width: 100%; height: auto; display: block; position: relative; }
.network-svg .edge { stroke: #1C2A4D; stroke-width: 1.2; }
.network-svg .edge-hot { stroke: rgba(39, 217, 255, 0.45); }
.network-svg .node { fill: #101B38; stroke: #2F4A8A; stroke-width: 1.2; }
.network-svg .node-cyan { fill: #27D9FF; stroke: #27D9FF; }
.network-svg .node-violet { fill: #8A6BFF; stroke: #8A6BFF; }
.network-svg .node-amber { fill: #FFB84D; stroke: #FFB84D; }
.network-svg .pulse { animation: nodePulse 3.2s ease-in-out infinite; }
.network-svg .pulse-2 { animation-delay: 1.1s; }
.network-svg .pulse-3 { animation-delay: 2s; }
@keyframes nodePulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ------------------------------------------------------------ Compact visible section (IRPEF table) */
section.compact { padding: 2.5rem 0; }

/* ------------------------------------------------------------ See more (extra content) */
.see-more-wrap { text-align: center; padding: 2rem 0 2.5rem; border-top: 1px solid var(--line); }
.see-more-hint { margin: 0.75rem 0 0; }
.see-more-btn .chevron { display: inline-block; transition: transform 0.2s ease; }
.see-more-btn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
#extra-content { border-top: 1px solid var(--line); }

/* ------------------------------------------------------------ Cards */
.card {
  background: var(--card-grad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.card h3 { font-size: 1.3rem; }
.card:hover { border-color: var(--line-hover); }
.no-lift:hover { transform: none; }

/* ------------------------------------------------------------ Calculator */
.mode-toggle {
  display: inline-flex; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.25rem; gap: 0.25rem; margin-bottom: 1.5rem;
}
.mode-toggle button {
  border: none; background: transparent; color: var(--muted);
  font-family: "Instrument Sans", "Instrument Sans Fallback", sans-serif; font-size: 0.9rem; font-weight: 600;
  padding: 0.55rem 1.1rem; border-radius: 999px; cursor: pointer;
}
.mode-toggle button[aria-pressed="true"] { background: var(--btn-grad); color: #021024; }
.field { margin-bottom: 1.25rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field .hint { font-size: 0.85rem; color: var(--muted); margin-top: 0.35rem; }
.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: "Instrument Sans", "Instrument Sans Fallback", sans-serif;
  font-size: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
}
.field input:focus, .field select:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(39, 217, 255, 0.2); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--red); }
.field-error { color: var(--red); font-size: 0.88rem; margin-top: 0.35rem; display: none; }
.field-error.show { display: block; }
.seg {
  display: inline-flex; background: var(--bg); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.25rem; gap: 0.25rem;
}
.seg button {
  border: none; background: transparent; color: var(--muted);
  font-family: "Instrument Sans", "Instrument Sans Fallback", sans-serif; font-size: 0.95rem; font-weight: 600;
  padding: 0.5rem 1.2rem; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--btn-grad); color: #021024; }
.manual-panel {
  border: 1px dashed var(--amber);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: rgba(255, 184, 77, 0.05);
}
.manual-panel h3 { font-size: 1.05rem; color: var(--amber); }
.manual-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* Result panel (§6.4: gradient-bordered, big net figure, breakdown) */
.result {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(120deg, #27D9FF, #8A6BFF) border-box;
  padding: 1.75rem;
  min-height: 100%;
}
.result-empty { color: var(--muted); text-align: center; padding: 3rem 1rem; }
.result-big { margin-bottom: 1.25rem; }
.result-big .label { font-size: 0.85rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.result-big .value {
  font-family: "Bricolage Grotesque", "Bricolage Grotesque Fallback", sans-serif; font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1.1; margin: 0.15rem 0;
}
.result-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 1.25rem; }
.result-months .stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.75rem 0.9rem;
}
.result-months .stat .label { font-size: 0.78rem; color: var(--muted); font-weight: 600; line-height: 1.35; min-height: 2.7em; }
.result-months .stat .value { font-weight: 700; font-size: 1.05rem; }
.breakdown { width: 100%; border-collapse: collapse; font-size: 0.95rem; margin-bottom: 1rem; }
.breakdown th, .breakdown td { padding: 0.45rem 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.breakdown td:last-child, .breakdown th:last-child { text-align: right; white-space: nowrap; }
.breakdown tr.total td { font-weight: 700; border-bottom: none; font-size: 1.05rem; }
.breakdown tr.sub td { color: var(--muted); font-size: 0.88rem; padding-left: 1rem; }
.breakdown .positive { color: var(--green); }

/* Pre-launch F7: styles formerly inline in the HTML, now classes. The
   four style="display:none" on #stat-extra2 stay inline: JS toggles them
   via style.display, and a class would re-hide them. */
.mode-fieldset { border: 0; padding: 0; margin: 0; }
.mode-fieldset legend { font-weight: 600; margin-bottom: 0.5rem; }
table.breakdown caption { text-align: left; padding-bottom: 0.5rem; }
.site-footer .footer-tagline { margin-top: 0.75rem; }
.mt-05 { margin-top: 0.5rem; }
.mt-075 { margin-top: 0.75rem; }
.mt-1 { margin-top: 1rem; }
.mt-15 { margin-top: 1.5rem; }
.mt-2 { margin-top: 2rem; }
.mb-05 { margin-bottom: 0.5rem; }
.value-big { font-size: 1.25rem; }
.result-notes { font-size: 0.88rem; color: var(--muted); }
.result-notes li { margin-bottom: 0.4rem; }
.result-note-warn { color: var(--amber); }
.payslip-toggle {
  background: none; border: none; color: var(--cyan);
  font-family: "Instrument Sans", "Instrument Sans Fallback", sans-serif; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; padding: 0.5rem 0;
}
.payslip-toggle:hover { text-decoration: underline; }
.payslip-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 0.5rem; }
.payslip-table th, .payslip-table td { padding: 0.4rem 0.25rem; border-bottom: 1px solid var(--line); text-align: right; }
.payslip-table td.num { white-space: nowrap; } /* amounts must not wrap "€" onto its own line; the .table-wrap scrolls on narrow screens */
.payslip-table th:first-child, .payslip-table td:first-child { text-align: left; }
.payslip-table tr.extra td { color: var(--muted); }

/* ------------------------------------------------------------ Benefits */
.benefits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.benefit { text-align: center; padding: 1.25rem 1rem; }
.benefit .icon {
  width: 44px; height: 44px; margin: 0 auto 0.75rem;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--cyan); font-size: 1.25rem; font-weight: 700;
}
.benefit h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.benefit p { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ------------------------------------------------------------ Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data caption { text-align: left; font-weight: 700; padding: 1rem 1.25rem 0.5rem; font-size: 1.1rem; }
table.data th, table.data td { padding: 0.65rem 1.25rem; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { background: var(--surface); font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
table.data tbody tr:nth-child(even) { background: rgba(11, 19, 40, 0.6); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(39, 217, 255, 0.05); }
table.data .hl { color: var(--cyan); font-weight: 700; }

/* ------------------------------------------------------------ Steps */
.steps { display: grid; gap: 1rem; counter-reset: step; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 1rem; }
.step-num {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--btn-grad); color: #021024;
  display: grid; place-items: center;
  font-family: "Bricolage Grotesque", "Bricolage Grotesque Fallback", sans-serif; font-weight: 700; font-size: 1.1rem;
}
.step h3 { margin-bottom: 0.25rem; font-size: 1.2rem; }
.step p { margin: 0; color: var(--muted); }
.example { margin-top: 1.5rem; }
.example h3 { font-size: 1.2rem; }

/* ------------------------------------------------------------ FAQ */
.faq-list { display: grid; gap: 0.75rem; }
.faq-list details {
  background: var(--card-grad); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.faq-list summary {
  cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--cyan); font-size: 1.3rem; flex: none; }
.faq-list details[open] summary::after { content: "–"; }
.faq-list details p { margin: 0.75rem 0 0; color: var(--muted); }
.faq-list details p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ Sources */
.sources { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.sources h3 { font-size: 1.2rem; }
.sources ul { margin: 0; padding-left: 1.2rem; color: var(--muted); }
.sources li { margin-bottom: 0.5rem; }
.sources li strong { color: var(--text); font-weight: 600; }
.sources a { text-decoration: underline; text-underline-offset: 2px; }

/* ------------------------------------------------------------ Result visualisation */
#big-tabs { margin-bottom: 1rem; }
.viz-grid { display: grid; grid-template-columns: 180px 1fr; gap: 1.25rem; align-items: center; margin: 0.5rem 0 1rem; }
.viz-donut svg { width: 100%; height: auto; display: block; }
.viz-center-value { fill: var(--text); font-family: "Bricolage Grotesque", "Bricolage Grotesque Fallback", sans-serif; font-weight: 700; font-size: 1.6rem; }
.viz-center-label { fill: var(--muted); font-size: 0.85rem; }
.viz-legend { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; }
.viz-legend li { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0; border-bottom: 1px solid var(--line); }
.viz-legend li:last-child { border-bottom: none; }
.viz-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; align-self: center; }
.viz-legend strong { margin-left: auto; }
.flow-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface); margin-bottom: 0.5rem; }
.flow-seg { height: 100%; min-width: 0; }

@media (max-width: 900px) {
  .viz-grid { grid-template-columns: 150px 1fr; }
}

/* ------------------------------------------------------------ Footer §4.6 */
.site-footer { border-top: 1px solid var(--line); padding: 1rem 0 0.75rem; background: var(--bg); }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr; gap: 2rem; margin-bottom: 0.75rem; }
/* 4-column footers (CCNL-family pages add a CCNL/Regimi column): keep 4
   columns so the extra column does not wrap to a second row and make the
   footer taller than before (measured +28..+77px with 3 columns). Same
   proportions, middle (link-list) column stays 1.6fr. Desktop only: at
   <= 781px the 1fr mobile rule below must win (this selector outranks it). */
@media (min-width: 782px) {
  .footer-grid:has(> div:nth-child(4)) { grid-template-columns: 1.2fr 1.6fr 1fr 1fr; }
}
.footer-grid h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.3rem; }
.footer-grid a { color: var(--muted); font-size: 0.9rem; }
.footer-grid a:hover { color: var(--cyan); }
.footer-bottom {
  border-top: 1px solid var(--line); padding-top: 1rem;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: 0.88rem;
}

/* ------------------------------------------------------------ Idea 3 (owner-approved 4 Dec 2026):
   sticky calculator form card on desktop + slim footer. The card sticks
   below the 68px sticky site header while its parent (.hero-grid row 2,
   since the 4 Dec 2026 restructure) scrolls; mobile stacks to one
   column, so there is no sticky rule below 782px.
   The Strumento column's links lay out in 2 columns on desktop (reverted
   to 1 column in the max-width: 900px block below). */
@media (min-width: 782px) {
  .sticky-card { position: sticky; top: calc(var(--header-h) + 1rem); }
  .footer-grid > div:nth-child(2) ul { column-count: 2; column-gap: 2rem; }
  .footer-grid > div:nth-child(2) li { break-inside: avoid; }
}

/* ------------------------------------------------------------ Sticky restructure (owner-approved 4 Dec 2026):
   DOM restructure — the form card is now a direct child of .hero-grid
   (not of .hero-main), so its sticky containing block is its own grid
   area instead of the short .hero-main. Desktop >= 901px ONLY: the
   782-900px single-column band and the <=900px collapse are untouched
   by this placement.
   Grid: row 1 = intro (.hero-main) + result column top (.hero-side);
   row 2 = the card, spanning down alongside the result column
   (.hero-side spans rows 1-3, so on CCNL/metalmeccanico — where the
   result column is taller than intro+card — the card row does not
   stretch); row 3+ = the muted intro paragraphs that used to sit
   below the card inside .hero-main (homepage muted, CCNL/metal/
   commercio/part-time/partita-iva/apprendistato trailing muted) —
   they auto-place into column 1 below the card. The last row is
   .benefits (moved into the grid from its own trailing .wrap):
   full width, margin-top 2.5rem unchanged, at-rest position unchanged. */
@media (min-width: 901px) {
  .hero-grid { grid-template-rows: auto 1fr auto auto; column-gap: 3rem; row-gap: 0; }
  .hero-main { grid-column: 1; grid-row: 1; }
  .sticky-card { grid-column: 1; grid-row: 2; align-self: start; }
  .hero-side { grid-column: 2; grid-row: 1 / span 3; }
  .hero-grid > p.muted { grid-column: 1; }
  /* Benefits moved into the grid (4 Dec 2026): it is the last row,
     full width. This also extends the grid — and the card's sticky
     container — below the card, which is what makes the card stick
     down the result column at rest. Row auto-places after the muted. */
  .hero-grid > .benefits { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------ Mobile CTA bar */
.mobile-cta {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(5, 9, 20, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.mobile-cta .btn { min-height: 46px; }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 900px) {
  /* (4 Dec 2026 restructure) The card and the muted paragraphs are
     grid children now, so the 1.5rem row gap would add 24px above the
     card on every page at <=900px. row-gap: 0 instead, and the old
     24px gap between the intro column and the result column is
     reproduced by .hero-side's own top margin — the margins that used
     to separate the stacked intro pieces already do so (they collapse
     through .hero-main exactly as they did when the card was inside
     it, verified by measurement at 360/390/820px). */
  .hero-grid { grid-template-columns: 1fr; gap: 1.5rem; row-gap: 0; }
  .hero-side { margin-top: 1.5rem; }
  .hero-art { min-height: 0; }
  .sources { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:nth-child(2) ul { column-count: 1; }
  /* Milestone 2: the 6th nav link ("Da netto a lordo") made the header
     48px too wide at 820px (868 vs 820). The CTA duplicates the
     calculator right below, so hide it here (already hidden <781px). */
  .header-cta { display: none; }
}
/* Nav collapse breakpoint 899px (4 Dec 2026, D-G6 fix): the 7th header
   nav link ("Guide") made nav#main-nav wider than the viewport at
   782-899px (+25 to +58px horizontal overflow at 820px). The hamburger
   breakpoint was 781px, so the full 7-link nav was shown in that band.
   Only the nav rules move up to 899px — every other mobile rule stays
   at 781px, so tablet layout (hero, art, grids, mobile-cta) is
   untouched. At 900px+ the full nav still shows (verified clean). */
@media (max-width: 899px) {
  .main-nav {
    display: none;
    position: fixed; inset: var(--header-h) 0 auto 0; z-index: 55;
    flex-direction: column; gap: 0;
    background: rgba(5, 9, 20, 0.97);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem 1.5rem 1.25rem;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 0.85rem 0.5rem; font-size: 1rem; border-bottom: 1px solid var(--line); }
  .main-nav a::after { display: none; }
  .menu-toggle { display: block; }
}
@media (max-width: 781px) {
  section { padding: 3rem 0; }
  /* Tighten the hero on small screens so the calculator starts above the
     fold: less top padding, less space above the "Calcolatore" heading. */
  /* V13 A-Z fix (3 Dec 2026), rounds 1–2 — see long comment below. */
  .hero { padding-top: 0.5rem; }
  .hero-main #calc-title { margin-top: 0; }
  /* V13 A-Z fix (3 Dec 2026): the T-M4 breadcrumb added 24–56px above the
     hero on subpages and the longer homepage lead added one wrapped line,
     pushing #calc-form to 640/644/663px at 360x640 (fold = 640px) — a
     regression vs the V12.1 baseline (612/621/608px). Round 1 (hero
     padding-top 2rem->1rem, calc-title margin-top 1rem->0.5rem) fixed the
     homepage (624px) and reverse (632px) but commercio only reached 651px:
     the breadcrumb's 1.25rem top padding never applied (.wrap's padding
     shorthand, later in the file, zeroes it), so the 0.25rem round-1 rule
     ADDED 4px there. Round 2: breadcrumb padding-top 0 (restores the
     .wrap zero), hero padding-top 0.5rem, calc-title margin-top 0,
     eyebrow margin-bottom 0.75rem, h1 margin-bottom 0.75rem — all
     mobile-only, same tightening pattern as the M7 pages. No copy, calc,
     or test changed; desktop untouched; breadcrumb stays fully visible. */
  .breadcrumb { padding-top: 0; }
  .hero .eyebrow { margin-bottom: 0.75rem; }
  .hero-main h1 { margin-bottom: 0.75rem; }
  /* Nav rules moved to the 899px block above (4 Dec 2026, D-G6 fix);
     only .header-cta/.mobile-cta remain here at 781px. */
  .header-cta { display: none; }
  .mobile-cta { display: block; }
  /* Decorative network art is hidden on small screens so the form and
     the result stay tight: the calculator is the focus on mobile. */
  .hero-art { display: none; }
  /* V1-F: dot grid + glow are desktop-only — hidden here so nothing is
     added above the form on mobile and the 360px fold is untouched. */
  .hero { background-image: none; }
  .hero::before { display: none; }
  .site-footer { padding-bottom: 6rem; }
  .benefits { grid-template-columns: 1fr; }
  .result-months { grid-template-columns: 1fr; }
  .manual-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  /* Smaller H1 on narrow phones: the heading wraps to 4 lines at 40px;
     at 32px the form starts ~35px higher, inside the first viewport. */
  h1 { font-size: 2rem; }
  /* Donut + legend side-by-side does not fit a ~340px card: stack them. */
  .viz-grid { grid-template-columns: 1fr; justify-items: center; gap: 0.75rem; }
  .viz-donut { width: 170px; }
  .viz-legend { width: 100%; }
}

/* ------------------------------------------------------------ Reverse page (Milestone 2) */
.check-box {
  border: 1px solid var(--green);
  background: rgba(61, 220, 151, 0.07);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}
.check-box strong { color: var(--green); }
.solution-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
}
.solution-card strong { color: var(--cyan); }
.warn-box {
  border: 1px solid var(--amber);
  background: rgba(255, 184, 77, 0.06);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.warn-box h3 { color: var(--amber); font-size: 1.2rem; }
.warn-box p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ Print */
@media print {
  .site-header, .mobile-cta, .menu-toggle, .hero-art, .hero-actions { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  .card, .result, .faq-list details { border-color: #ccc; background: #fff; color: #000; }
  .result-big .value { color: #000; }
  a { color: #000; }
}

/* ------------------------------------------------------------ Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .network-svg .pulse { animation: none; }
  .hero::before { animation: none; } /* V1-F: breathe OFF, glow stays static */
  .hero-art::before { animation: none; } /* V1-F: hub-glow breathe OFF too */
  .btn:hover, .card:hover { transform: none; }
  * { transition: none !important; }
}

/* Part-time (moved from inline <style>, 2026-12-04): hero compaction, page-scoped. */
    /* Part-time: hero più compatto — la risposta diretta è lunga e il modulo
       deve iniziare sopra la piega anche a 360 px (regola M4). Solo questa
       pagina: lo stile del sito non cambia. */
    body.page-part-time .hero { padding-top: 2.75rem; }
    body.page-part-time .hero-main #calc-title { margin-top: 1rem; }
    @media (max-width: 480px) {
      body.page-part-time .hero { padding-top: 1rem; }
      body.page-part-time .hero-main h1 { font-size: 1.6rem; line-height: 1.15; }
      body.page-part-time .hero .lead { font-size: 1.05rem; line-height: 1.6; }
      body.page-part-time .hero-main #calc-title { margin-top: 0.5rem; }
    }
    @media (max-width: 360px) {
      /* Fold margin was 13px at 360px (measured 3 Dec 2026, Playwright):
         tighten the hero slightly so the form starts further above the fold.
         Safe spacing only — no layout or content change. */
      body.page-part-time .hero { padding-top: 0.5rem; }
      body.page-part-time .hero .lead { font-size: 1rem; }
    }
/* Partita IVA (moved from inline <style>, 2026-12-04): hero compaction, page-scoped. */
    /* Partita IVA: hero più compatto — la risposta diretta è lunga e il
       modulo deve iniziare sopra la piega anche a 360 px (regola M4).
       Solo questa pagina: lo stile del sito non cambia. */
    body.page-partita-iva .hero { padding-top: 2.75rem; }
    body.page-partita-iva .hero-main #calc-title { margin-top: 1rem; }
    @media (max-width: 480px) {
      body.page-partita-iva .hero { padding-top: 1rem; }
      body.page-partita-iva .hero-main h1 { font-size: 1.6rem; line-height: 1.15; }
      body.page-partita-iva .hero .lead { font-size: 1.05rem; line-height: 1.6; }
      body.page-partita-iva .hero-main #calc-title { margin-top: 0.5rem; }
    }
    @media (max-width: 360px) {
      body.page-partita-iva .hero { padding-top: 0.5rem; }
      body.page-partita-iva .hero .lead { font-size: 1rem; }
    }
/* Rientro (moved from inline <style>, 2026-12-04): hero compaction + checklist component, page-scoped. Placed BEFORE the V12.1 M7 block so its mobile overrides still win. */
    /* Rientro: hero più compatto — la risposta diretta è lunga (100–150
       parole, obbligatorie) e la checklist deve iniziare sopra la piega
       anche a 390 px (regola M4). Solo questa pagina: lo stile del sito
       non cambia. V13 A-Z (2026-12-03): a 360 × 640 px la prima radio è a
       609 px, sopra la piega di 640 px — l'introduzione della checklist è
       dentro <details class="intro-more"> (chiuso su mobile, vedi
       style.css) e l'hero è ulteriormente compattato. La frase di gate
       («Questa pagina non calcola lo stipendio netto»)
       è l'ultima frase della risposta diretta, non un box separato: un
       box dedicato spingeva la checklist sotto la piega. */
    body.m7-rientro .hero { padding-top: 1.5rem; }
    body.m7-rientro .hero-main h1 { font-size: 2.75rem; }
    body.m7-rientro .hero-main #calc-title { margin-top: 1rem; }
    body.m7-rientro #calc-title + .muted { margin-bottom: 0.5rem; }
    @media (max-width: 480px) {
      body.m7-rientro .hero { padding-top: 0.5rem; }
      body.m7-rientro .hero-main h1 { font-size: 1.5rem; line-height: 1.15; }
      body.m7-rientro .hero .lead { font-size: 1rem; line-height: 1.55; }
      body.m7-rientro .hero-main #calc-title { margin-top: 0.25rem; }
    }
    @media (max-width: 360px) {
      body.m7-rientro .hero { padding-top: 0.5rem; }
      body.m7-rientro .hero .lead { font-size: 1rem; }
    }
    /* Checklist: un esito per domanda + riepilogo. Quattro esiti, quattro
       colori: verde = probabilmente soddisfatta, rosso = non soddisfatta,
       ambra = serve una verifica professionale, grigio = informazioni
       insufficienti. Nessun verdetto binario "hai diritto / non hai diritto". */
    body.m7-rientro .checklist fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.5rem; margin: 0 0 1rem; background: var(--panel); }
    body.m7-rientro .checklist legend { font-weight: 700; padding: 0 0.5rem; }
    body.m7-rientro .checklist label { display: block; font-weight: 400; margin: 0.4rem 0; cursor: pointer; }
    body.m7-rientro .checklist input[type="radio"] { margin-right: 0.5rem; accent-color: var(--cyan); }
    body.m7-rientro .check-result { border-radius: 10px; padding: 0.75rem 1rem; margin-top: 0.75rem; font-size: 0.95rem; }
    body.m7-rientro .check-ok { border: 1px solid var(--green); background: rgba(61, 220, 151, 0.08); }
    body.m7-rientro .check-ok strong { color: var(--green); }
    body.m7-rientro .check-no { border: 1px solid var(--red); background: rgba(255, 107, 107, 0.08); }
    body.m7-rientro .check-no strong { color: var(--red); }
    body.m7-rientro .check-verify { border: 1px solid var(--amber); background: rgba(255, 184, 77, 0.08); }
    body.m7-rientro .check-verify strong { color: var(--amber); }
    body.m7-rientro .check-info { border: 1px solid var(--line); background: var(--surface); }
    body.m7-rientro .check-info strong { color: var(--muted); }
    body.m7-rientro .checklist-summary { border: 1px solid var(--cyan); border-radius: 14px; padding: 1.25rem 1.5rem; background: var(--surface); margin-top: 1.5rem; }
/* Apprendistato (moved from inline <style>, 2026-12-04): hero compaction, page-scoped. Placed BEFORE the V12.1 M7 block so its mobile overrides still win. */
    /* Apprendistato: hero più compatto — la risposta diretta è lunga
       (100–150 parole, obbligatorie) e il modulo deve iniziare sopra la
       piega anche a 390 px (regola M4). Solo questa pagina: lo stile del
       sito non cambia. V13 A-Z (2026-12-03): a 360 × 640 px il primo campo
       (RAL) è a 558 px, sopra la piega di 640 px — hero ulteriormente
       compattato (vedi style.css). */
    body.m7-apprendistato .hero { padding-top: 1.5rem; }
    body.m7-apprendistato .hero-main h1 { font-size: 2.75rem; }
    body.m7-apprendistato .hero-main #calc-title { margin-top: 1rem; }
    @media (max-width: 480px) {
      body.m7-apprendistato .hero { padding-top: 0.5rem; }
      body.m7-apprendistato .hero-main h1 { font-size: 1.5rem; line-height: 1.15; }
      body.m7-apprendistato .hero .lead { font-size: 1rem; line-height: 1.55; }
      body.m7-apprendistato .hero-main #calc-title { margin-top: 0.25rem; }
    }
    @media (max-width: 360px) {
      body.m7-apprendistato .hero { padding-top: 0.5rem; }
      body.m7-apprendistato .hero .lead { font-size: 1rem; }
    }

/* ------------------------------------------------------------ V12.1 Correction B — M7 mobile first screen
   Scoped to the two M7 pages ONLY via body.m7-rientro / body.m7-apprendistato
   (the section ids #checklist / #calcolatore are shared with other pages,
   so they cannot scope anything here). No other page is affected.
   - Short mobile answer (.lead-short) + full .lead inside <details.lead-more>.
   - Desktop (>= 782px): the full lead must render exactly as before, with the
     summary hidden. A closed <details> hides its content at layout level in
     Chromium — author `display` rules cannot reveal it — so desktop uses the
     ::details-content pseudo-element (Chrome 131+, Firefox 140+) to force the
     content visible. The @supports guard keeps the fallback safe: in a browser
     without ::details-content the summary stays visible as a working expander
     instead of hiding the lead behind a hidden toggle. */
body.m7-rientro #checklist-form,
body.m7-apprendistato #calc-form { scroll-margin-top: 84px; }

@media (min-width: 782px) {
  body.m7-rientro .lead-short,
  body.m7-apprendistato .lead-short,
  body.m7-rientro .hero-jump,
  body.m7-apprendistato .hero-jump { display: none; }
  @supports selector(details::details-content) {
    body.m7-rientro .lead-more::details-content,
    body.m7-apprendistato .lead-more::details-content { content-visibility: visible; }
    body.m7-rientro .lead-more > summary,
    body.m7-apprendistato .lead-more > summary { display: none; }
  }
}

@media (max-width: 781px) {
  /* Hero spacing tightening, M7 pages only. */
  body.m7-rientro .hero,
  body.m7-apprendistato .hero { padding-top: 1rem; }
  body.m7-rientro .hero .eyebrow,
  body.m7-apprendistato .hero .eyebrow { margin-bottom: 0.5rem; }
  body.m7-rientro .hero-main #calc-title,
  body.m7-apprendistato .hero-main #calc-title { margin-top: 0.5rem; }
  /* Compact mobile direct answer, shown on mobile only. */
  body.m7-rientro .lead-short,
  body.m7-apprendistato .lead-short {
    display: block;
    font-size: 1.05rem; line-height: 1.55; color: var(--muted);
    max-width: 34rem; margin-bottom: 0.75rem;
  }
  /* Expander for the full answer (collapsed by default, native <details>). */
  body.m7-rientro .lead-more > summary,
  body.m7-apprendistato .lead-more > summary {
    cursor: pointer; color: var(--cyan); font-weight: 600; font-size: 0.95rem;
    margin-bottom: 0.5rem; width: fit-content;
  }
  body.m7-rientro .lead-more > summary:hover,
  body.m7-apprendistato .lead-more > summary:hover { text-decoration: underline; }
  body.m7-rientro .lead-more > summary:focus-visible,
  body.m7-apprendistato .lead-more > summary:focus-visible,
  body.m7-rientro .hero-jump:focus-visible,
  body.m7-apprendistato .hero-jump:focus-visible {
    outline: 2px solid var(--cyan); outline-offset: 2px;
  }
  /* In-flow jump link directly under the lead, mobile only. */
  body.m7-rientro .hero-jump,
  body.m7-apprendistato .hero-jump {
    display: inline-block; margin-top: 0.25rem;
    font-weight: 700; color: var(--cyan);
  }
  body.m7-rientro .hero-jump:hover,
  body.m7-apprendistato .hero-jump:hover { text-decoration: underline; }
}

@media (max-width: 480px) {
  body.m7-rientro .hero,
  body.m7-apprendistato .hero { padding-top: 0.25rem; }
  body.m7-rientro .hero .eyebrow,
  body.m7-apprendistato .hero .eyebrow { margin-bottom: 0.25rem; }
  body.m7-rientro .hero-main #calc-title,
  body.m7-apprendistato .hero-main #calc-title { margin-top: 0.25rem; }
  body.m7-rientro .lead-short,
  body.m7-apprendistato .lead-short { font-size: 1rem; margin-bottom: 0.5rem; }
  body.m7-rientro .lead-more > summary,
  body.m7-apprendistato .lead-more > summary { margin-bottom: 0.25rem; }
}

/* ------------------------------------------------------------ V13 A-Z — M7 mobile first-field above the 640px fold
   Scoped to the two M7 pages ONLY via body.m7-rientro / body.m7-apprendistato.
   BEFORE (360x640, on-load, measured 2026-12-03): Apprendistato first input
   667px (27px below the fold), Rientro first radio 891px (251px below).
   Variant A (V12.1) had already saved ~161px on each page; this round adds
   only small scoped tightenings, plus — Rientro only — the same <details>
   collapse pattern V12.1 used for the lead, applied to the checklist intro
   paragraph (Variant B of the V12.1 report). No copy is deleted anywhere:
   the intro stays in the DOM, one tap away on mobile, fully visible on
   desktop. No legal disclosure or calculation limitation is touched: the
   gate sentence stays verbatim in .lead-short and the full leads stay in
   .lead-more. No new or oversized CTA. Desktop (>= 782px) layout unchanged.
   Honest limit: at 360x640 the fixed mobile CTA bar covers y 562-640, so a
   first field at ~600px is above the 640px fold but sits behind the bar on
   first paint; one tap on the jump link / retargeted CTA bar lands on it
   fully visible (scroll-margin-top: 84px). */
@media (min-width: 782px) {
  /* Rientro intro: same ::details-content treatment as .lead-more — the
     summary is hidden only where the browser can force the content visible;
     elsewhere it stays a working expander (V12.1 fallback pattern). */
  @supports selector(details::details-content) {
    body.m7-rientro .intro-more::details-content { content-visibility: visible; }
    body.m7-rientro .intro-more > summary { display: none; }
  }
  body.m7-rientro .intro-more { margin: 0 0 0.5rem; }
  body.m7-rientro .intro-more > p.muted { margin-bottom: 0; }
}

@media (max-width: 781px) {
  /* Rientro intro collapsed on mobile (one tap to expand). */
  body.m7-rientro .intro-more { margin: 0 0 0.5rem; }
  body.m7-rientro .intro-more > summary {
    cursor: pointer; color: var(--cyan); font-weight: 600; font-size: 0.95rem;
    width: fit-content;
  }
  body.m7-rientro .intro-more > summary:hover { text-decoration: underline; }
  body.m7-rientro .intro-more > summary:focus-visible {
    outline: 2px solid var(--cyan); outline-offset: 2px;
  }
  body.m7-rientro .intro-more > p.muted { margin: 0.5rem 0 0; }
  /* Apprendistato: less card padding above the form (first field only).
     (Card is a .hero-grid child since the 4 Dec 2026 restructure.) */
  body.m7-apprendistato .sticky-card { padding-top: 0.5rem; }
  body.m7-apprendistato #calc-form .field:first-of-type label { margin-bottom: 0.3rem; }
}

@media (max-width: 480px) {
  /* H1 24px -> 22px (still larger than the 20px calc-title below it),
     tighter leading and less space under it. */
  body.m7-rientro .hero-main h1,
  body.m7-apprendistato .hero-main h1 {
    font-size: 1.375rem; line-height: 1.12; margin-bottom: 0.4em;
  }
  /* Eyebrow: less vertical padding (still two lines on Rientro at 360px). */
  body.m7-rientro .hero .eyebrow,
  body.m7-apprendistato .hero .eyebrow { padding-top: 0.2rem; padding-bottom: 0.2rem; }
  /* Short answer: 15px / 1.5 instead of 16px / 1.55. */
  body.m7-rientro .lead-short,
  body.m7-apprendistato .lead-short {
    font-size: 0.9375rem; line-height: 1.5; margin-bottom: 0.3rem;
  }
  body.m7-rientro .lead-more > summary,
  body.m7-apprendistato .lead-more > summary { margin-bottom: 0.15rem; }
  /* Jump link: tighter type, still a clear tap target. */
  body.m7-rientro .hero-jump,
  body.m7-apprendistato .hero-jump {
    font-size: 0.95rem; line-height: 1.3; margin-top: 0.1rem;
  }
  /* Calc title: 24px -> 20px, less space below (H1 stays the larger heading). */
  body.m7-rientro .hero-main #calc-title,
  body.m7-apprendistato .hero-main #calc-title {
    font-size: 1.25rem; margin-bottom: 0.35rem;
  }
  /* Rientro: tighter first fieldset — less top padding, tighter legend
     (3 lines), less space before the first radio label. */
  body.m7-rientro .checklist fieldset { padding-top: 0.625rem; }
  body.m7-rientro .checklist legend { line-height: 1.4; }
  body.m7-rientro .checklist fieldset:first-of-type label:first-of-type { margin-top: 0.25rem; }
}

/* Gateway blocks (CCNL hub): two cards side by side on desktop */
.gateway-blocks{display:grid;gap:1rem;margin-top:1rem}
@media (min-width:768px){.gateway-blocks{grid-template-columns:1fr 1fr}}

/* 320px fold (I1, 2026-12-04; extended to <= 400px by pre-launch F8 P1,
   so the 360px fold compacts too). Targets the tall hero stack on narrow
   screens: h1, lead / lead-short and the long muted paragraph. */
@media (max-width: 400px) {
  .hero { padding-top: 0.25rem; }
  .hero-main h1 { font-size: 1.35rem; line-height: 1.15; }
  .hero .lead { font-size: 0.92rem; line-height: 1.45; }
  .hero .muted { font-size: 0.9rem; }
  .hero-main #calc-title { margin-top: 0.25rem; }
  body.m7-rientro .hero-main h1,
  body.m7-apprendistato .hero-main h1 { font-size: 1.35rem; line-height: 1.15; }
  body.m7-rientro .lead-short,
  body.m7-apprendistato .lead-short { font-size: 0.85rem; line-height: 1.45; }
  body.m7-rientro .hero .muted { font-size: 0.85rem; }
  /* Part-time / partita IVA: page-scoped rules outrank the global ones above,
     so they need their own <= 400px overrides. */
  body.page-part-time .hero,
  body.page-partita-iva .hero { padding-top: 0.25rem; }
  body.page-part-time .hero-main h1,
  body.page-partita-iva .hero-main h1 { font-size: 1.35rem; line-height: 1.15; }
  body.page-part-time .hero .lead,
  body.page-partita-iva .hero .lead { font-size: 0.92rem; line-height: 1.45; }
  body.page-part-time .hero .muted,
  body.page-partita-iva .hero .muted { font-size: 0.9rem; }
  body.page-part-time .hero-main #calc-title,
  body.page-partita-iva .hero-main #calc-title { margin-top: 0.25rem; }
  /* Pre-launch F8 P2 (home + reverse only): the hero muted paragraph moves
     below the form at narrow widths, so the first field rises above the
     fold. The Svizzera eligibility checker and the part-time direct-answer
     lead are untouched.
     (4 Dec 2026 restructure: the card is a .hero-grid child now, so the
     old .hero-main flex order no longer moves it. Homepage: the muted is
     itself a grid child after the card, so DOM order already puts it
     below the card. Reverse: the muted stays inside .hero-main, so at
     <=400px .hero-main becomes display: contents and the grid orders the
     card before the muted and the result column after it.) */
  body.page-home .hero-main { display: flex; flex-direction: column; }
  body.page-reverse .hero-main { display: contents; }
  body.page-reverse .hero-main > p.muted { order: 1; }
  body.page-reverse .hero-side { order: 2; }
  /* Benefits is a grid child too since the restructure: without an
     order it (order 0) would auto-place ahead of the muted and the
     result column at <=400px on reverse. */
  body.page-reverse .hero-grid > .benefits { order: 3; }
  /* Pre-launch F8 P3 (reverse only): compact the net-mode control — the
     stacked layout is kept, the label gap and button padding shrink. */
  body.page-reverse .net-mode-field { margin-bottom: 0.75rem; }
  body.page-reverse .net-mode-field label { margin-bottom: 0.2rem; }
  body.page-reverse .net-mode-field .seg button { padding: 0.4rem 0.9rem; }
  /* Part-time only: the 320px first field still sits 36px below the fold
     after round 2 (long direct answer). Tighten the hero card itself. */
  body.page-part-time .hero-main h1 { font-size: 1.2rem; }
  body.page-part-time .hero .lead { font-size: 0.85rem; }
  body.page-part-time .hero .card { padding-top: 1rem; padding-bottom: 1rem; }
  body.page-part-time .hero-main #calc-title { font-size: 1.15rem; }
}

/* ------------------------------------------------------------ Idea A — compact two-column hero form
   (owner-approved 4 Dec 2026, mockup qa/shots/hero-fit-ideas/
   media-generation-idea-a-compact-two-column-*.jpg).
   GOAL: the whole homepage form — RAL field through the Calcola button —
   fits above the fold at 1280x800 AND 1440x900 (page viewport).
   SCOPE: homepage ONLY (body.page-home), desktop >= 782px ONLY.
   Mobile <= 781px is untouched: .form-row has no rule there, so the rows
   stack back to a single column exactly as before.
   - Two rows, two columns each: RAL + Mensilità, then Regione + Comune.
   - Slimmer hero: less hero top padding, smaller H1 (wording unchanged),
     tighter eyebrow / lead / calc-title spacing, slimmer card padding.
   - Hints shortened in index.html to one short line each (same meaning:
     RAL formats + tredicesima inclusa; mensilità annual-net unchanged +
     14ª only if CCNL provides; verified-only Lombardia / Milano +
     manual rates otherwise; Milano 0,8% + €23.000 exemption).
   - NOT touched: H1/lead wording, hub/constellation/6 pills, glow
     breathe (30s), particle canvas, result panel, other 9 pages' forms,
     calculator.js (0 changes). */
@media (min-width: 782px) {
  body.page-home .hero { padding-top: 1.25rem; padding-bottom: 2rem; }
  body.page-home .hero .eyebrow { margin-bottom: 0.6rem; }
  body.page-home .hero-main h1 { font-size: 2.6rem; max-width: 22ch; margin-bottom: 0.4em; }
  body.page-home .hero .lead { font-size: 1.05rem; margin-bottom: 0.75rem; }
  body.page-home .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; font-size: 1.3rem; }
  /* The long muted intro paragraph sits below the form card on desktop:
     since the 4 Dec 2026 restructure it is a direct .hero-grid child
     after the card (grid row 3), so no flex order is needed any more —
     DOM order already puts it below the card. margin-bottom: 0 keeps
     the grid bottom exactly where it was. */
  body.page-home .hero-main { display: flex; flex-direction: column; }
  body.page-home .hero-grid > p.muted { margin-bottom: 0; }
  body.page-home .hero-grid > .sticky-card { padding: 1.25rem 1.5rem; }
  body.page-home #calc-form .form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; align-items: start;
  }
  body.page-home #calc-form .form-row .field { margin-bottom: 0.9rem; min-width: 0; }
  body.page-home #calc-form .field label { margin-bottom: 0.35rem; }
  body.page-home #calc-form .field .hint { margin-top: 0.3rem; line-height: 1.4; }
  body.page-home #calc-form .field input[type="text"],
  body.page-home #calc-form .field select { padding: 0.65rem 0.9rem; }
}

/* ------------------------------------------------------------ Partita IVA — Option A+H (4 Dec 2026, owner-approved)
   A: the two questionnaires are <details> (closed by default), styled on
   the site's existing .faq-list details/summary pattern. The
   #questionnaire-result status paragraph stays OUTSIDE its <details> so the
   5% gating feedback remains visible without opening anything.
   H: pure spacing tightening. Every rule is scoped to body.page-partita-iva
   so the other 9 form pages are pixel-identical. No input, calculation or
   JS behaviour changes; calculator.js and partita-iva-app.js untouched.
   Expected (proposal §5, measured in simulation): card 5,430 -> ~3,409px
   desktop, 7,528 -> ~4,777px mobile; Calcola button ~2,013px higher.
   Sticky travel stays 436px (geometric limit, proposal §2) — A+H is a
   usability fix, not a sticky fix. */
body.page-partita-iva .hero-grid > .sticky-card { padding: 1.25rem; }
body.page-partita-iva .field { margin-bottom: 1rem; }
body.page-partita-iva .field label { margin-bottom: 0.25rem; }
body.page-partita-iva .field .hint { margin-bottom: 0.5rem; }
body.page-partita-iva .field input[type="text"],
body.page-partita-iva .field input[type="number"],
body.page-partita-iva .field select { padding: 0.5rem 0.9rem; }
body.page-partita-iva .piva-questionnaire {
  background: var(--card-grad); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.85rem 1.1rem;
}
body.page-partita-iva .piva-questionnaire summary {
  cursor: pointer; font-weight: 700; font-size: 1rem; list-style: none;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; align-items: baseline;
}
body.page-partita-iva .piva-questionnaire summary::-webkit-details-marker { display: none; }
body.page-partita-iva .piva-questionnaire summary::after { content: "+"; color: var(--cyan); font-size: 1.3rem; line-height: 1; flex: none; }
body.page-partita-iva .piva-questionnaire[open ] summary::after { content: "–"; }
body.page-partita-iva .piva-questionnaire .piva-q-title { flex: 1 1 12rem; }
body.page-partita-iva .piva-questionnaire .piva-q-status { font-size: 0.85rem; font-weight: 600; color: var(--muted); flex: none; }

/* ------------------------------------------------------------ X25 visual-fix cycle (4 Dec 2026, owner-approved mockup v1)
   V-01 nav one line + V-06 footer V2-A are in the base rules above.
   V-03 hero compaction is desktop >= 782px ONLY (same convention as the
   Idea A block): mobile <= 781px is untouched, so the <= 781px / <= 400px
   rules above still win there. The mockup appended the homepage V-03
   rules unscoped; scoping them to >= 782px keeps the approved desktop
   effect exactly while avoiding a mobile h1 enlargement (1.35rem -> 2.25rem).
   V-04/V-05/V-06-V2-A are generalised site-wide (the mockup scoped them
   body.page-home); form-field overrides use each page's own form id so the
   (1,2,1) specificity beats the base .field rules, per the specificity
   lesson. No content, figure or calculation change; calculator.js untouched. */

/* V-06 footer V2-A tightening, generalised site-wide (was body.page-home in the mockup) */
.site-footer { padding: 0.75rem 0 0.5rem; }
.footer-grid { gap: 1.5rem; margin-bottom: 0.5rem; }
.footer-grid h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.footer-grid li { margin-bottom: 0.2rem; }
.footer-grid a { font-size: 0.85rem; }
.footer-bottom { padding-top: 0.75rem; }
.site-footer .footer-tagline { margin-top: 0.5rem; }

/* V-04 benefits are links, site-wide (was body.page-home in the mockup) */
.benefits a.benefit { color: inherit; text-decoration: none; cursor: pointer; }
.benefits a.benefit:hover { border-color: var(--cyan); transform: translateY(-2px); }
.benefits a.benefit:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* V-05 benefits section below the hero, site-wide (was body.page-home in the mockup) */
.benefits-section { padding: 0 0 2rem; }
.benefits-section .benefits { margin-top: 0; }

/* V-03 hero compact: Calcola button above the fold at 1152x673, desktop only */
@media (min-width: 782px) {
  /* Homepage (verbatim from the approved mockup diff) */
  body.page-home .hero { padding-top: 0.75rem; }
  body.page-home .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-home .hero .lead { margin-bottom: 0.5rem; }
  body.page-home .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-home .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-home #calc-form .form-row .field { margin-bottom: 0.5rem; }
  body.page-home #calc-form .field label { margin-bottom: 0.25rem; }
  body.page-home #calc-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-home #calc-form .field input[type="text"],
  body.page-home #calc-form .field input[type="number"],
  body.page-home #calc-form .field select { padding: 0.55rem 0.9rem; }
  body.page-home .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-home #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Reverse (same pattern, form #reverse-form) */
  body.page-reverse .hero { padding-top: 0.75rem; }
  body.page-reverse .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-reverse .hero .lead { margin-bottom: 0.5rem; }
  body.page-reverse .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-reverse .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-reverse #reverse-form .field { margin-bottom: 0.5rem; }
  body.page-reverse #reverse-form .field label { margin-bottom: 0.25rem; }
  body.page-reverse #reverse-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-reverse #reverse-form .field input[type="text"],
  body.page-reverse #reverse-form .field input[type="number"],
  body.page-reverse #reverse-form .field select { padding: 0.55rem 0.9rem; }
  body.page-reverse .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-reverse #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Svizzera (same pattern; BOTH forms in the sticky card: #checker-form + #calc-form) */
  body.page-svizzera .hero { padding-top: 0.75rem; }
  body.page-svizzera .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-svizzera .hero .lead { margin-bottom: 0.5rem; }
  body.page-svizzera .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-svizzera .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-svizzera #checker-form .field,
  body.page-svizzera #calc-form .field { margin-bottom: 0.5rem; }
  body.page-svizzera #checker-form .field label,
  body.page-svizzera #calc-form .field label { margin-bottom: 0.25rem; }
  body.page-svizzera #checker-form .field .hint,
  body.page-svizzera #calc-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-svizzera #checker-form .field input[type="text"],
  body.page-svizzera #checker-form .field input[type="number"],
  body.page-svizzera #checker-form .field select,
  body.page-svizzera #calc-form .field input[type="text"],
  body.page-svizzera #calc-form .field input[type="number"],
  body.page-svizzera #calc-form .field select { padding: 0.55rem 0.9rem; }
  body.page-svizzera .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-svizzera #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* CCNL hub (same pattern, form #ccnl-form) */
  body.page-ccnl .hero { padding-top: 0.75rem; }
  body.page-ccnl .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-ccnl .hero .lead { margin-bottom: 0.5rem; }
  body.page-ccnl .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-ccnl .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-ccnl #ccnl-form .field { margin-bottom: 0.5rem; }
  body.page-ccnl #ccnl-form .field label { margin-bottom: 0.25rem; }
  body.page-ccnl #ccnl-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-ccnl #ccnl-form .field input[type="text"],
  body.page-ccnl #ccnl-form .field input[type="number"],
  body.page-ccnl #ccnl-form .field select { padding: 0.55rem 0.9rem; }
  body.page-ccnl .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-ccnl #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Metalmeccanico (same pattern, form #ccnl-form) */
  body.page-metalmeccanico .hero { padding-top: 0.75rem; }
  body.page-metalmeccanico .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-metalmeccanico .hero .lead { margin-bottom: 0.5rem; }
  body.page-metalmeccanico .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-metalmeccanico .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-metalmeccanico #ccnl-form .field { margin-bottom: 0.5rem; }
  body.page-metalmeccanico #ccnl-form .field label { margin-bottom: 0.25rem; }
  body.page-metalmeccanico #ccnl-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-metalmeccanico #ccnl-form .field input[type="text"],
  body.page-metalmeccanico #ccnl-form .field input[type="number"],
  body.page-metalmeccanico #ccnl-form .field select { padding: 0.55rem 0.9rem; }
  body.page-metalmeccanico .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-metalmeccanico #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Commercio (same pattern, form #ccnl-form) */
  body.page-commercio .hero { padding-top: 0.75rem; }
  body.page-commercio .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-commercio .hero .lead { margin-bottom: 0.5rem; }
  body.page-commercio .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-commercio .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-commercio #ccnl-form .field { margin-bottom: 0.5rem; }
  body.page-commercio #ccnl-form .field label { margin-bottom: 0.25rem; }
  body.page-commercio #ccnl-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-commercio #ccnl-form .field input[type="text"],
  body.page-commercio #ccnl-form .field input[type="number"],
  body.page-commercio #ccnl-form .field select { padding: 0.55rem 0.9rem; }
  body.page-commercio .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-commercio #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Part-time (same pattern, form #part-time-form) */
  body.page-part-time .hero { padding-top: 0.75rem; }
  body.page-part-time .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-part-time .hero .lead { margin-bottom: 0.5rem; }
  body.page-part-time .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-part-time .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-part-time #part-time-form .field { margin-bottom: 0.5rem; }
  body.page-part-time #part-time-form .field label { margin-bottom: 0.25rem; }
  body.page-part-time #part-time-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-part-time #part-time-form .field input[type="text"],
  body.page-part-time #part-time-form .field input[type="number"],
  body.page-part-time #part-time-form .field select { padding: 0.55rem 0.9rem; }
  body.page-part-time .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.page-part-time #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Partita IVA (same pattern, form #partita-iva-form; input padding NOT
     raised: the A+H rules already set 0.5rem, tighter than the 0.55rem
     pattern value. Sticky-card keeps its 1.25rem horizontal padding.) */
  body.page-partita-iva .hero { padding-top: 0.75rem; }
  body.page-partita-iva .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.page-partita-iva .hero .lead { margin-bottom: 0.5rem; }
  body.page-partita-iva .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.page-partita-iva .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.page-partita-iva #partita-iva-form .field { margin-bottom: 0.5rem; }
  body.page-partita-iva #partita-iva-form .field label { margin-bottom: 0.25rem; }
  body.page-partita-iva #partita-iva-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.page-partita-iva .hero-grid > .sticky-card { padding: 1rem 1.25rem; }
  body.page-partita-iva #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Apprendistato (same pattern, form #calc-form; visible lead is .lead-short) */
  body.m7-apprendistato .hero { padding-top: 0.75rem; }
  body.m7-apprendistato .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.m7-apprendistato .hero .lead,
  body.m7-apprendistato .hero .lead-short { margin-bottom: 0.5rem; }
  body.m7-apprendistato .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.m7-apprendistato .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
  body.m7-apprendistato #calc-form .field { margin-bottom: 0.5rem; }
  body.m7-apprendistato #calc-form .field label { margin-bottom: 0.25rem; }
  body.m7-apprendistato #calc-form .field .hint { font-size: 0.8rem; line-height: 1.35; }
  body.m7-apprendistato #calc-form .field input[type="text"],
  body.m7-apprendistato #calc-form .field input[type="number"],
  body.m7-apprendistato #calc-form .field select { padding: 0.55rem 0.9rem; }
  body.m7-apprendistato .hero-grid > .sticky-card { padding: 1rem 1.5rem; }
  body.m7-apprendistato #calc-button { padding-top: 0.65rem; padding-bottom: 0.65rem; }

  /* Rientro (hero compaction only: checklist page, no calc form / button / sticky card) */
  body.m7-rientro .hero { padding-top: 0.75rem; }
  body.m7-rientro .hero-main h1 { font-size: 2.25rem; line-height: 1.1; }
  body.m7-rientro .hero .lead,
  body.m7-rientro .hero .lead-short { margin-bottom: 0.5rem; }
  body.m7-rientro .hero-main #calc-title { margin-top: 0.5rem; margin-bottom: 0.5rem; }
  body.m7-rientro .hero .eyebrow { margin-bottom: 0.6rem; padding: 0.25rem 0.9rem; }
}
