/*
StratoLab – foglio di stile unico (index, admin, privacy)
VOICE   chiaro, da maker: un banco di lavoro ordinato
IDEA    la scheda tecnica di una stampa: piatto a griglia, quote, strati
COLOUR  carta calda + inchiostro grafite + arancio filamento (tutto nei token qui sotto)
TYPE    Space Grotesk (titoli) · Inter (testo) · JetBrains Mono (codici e numeri)
Per cambiare i colori basta modificare le variabili in :root (e la versione scura sotto).
*/

/* ---------- Token ---------- */
:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --surface-3: #e8e5dc;
  --line: #e2ded4;
  --line-strong: #cbc5b6;
  --ink: #1b1e23;
  --ink-2: #3c424c;
  --muted: #646b76;

  --accent: #c2410c;          /* arancio filamento: pulsanti, selezioni */
  --accent-hover: #a5360a;
  --accent-ink: #ffffff;      /* testo sopra l'accento */
  --accent-soft: #fff1e6;
  --accent-line: #f5c7a3;
  --accent-text: #b13c0c;     /* link e testo in accento */

  --ok: #15803d;   --ok-soft: #e7f5ec;
  --warn: #9a5200; --warn-soft: #fff4dc;
  --bad: #b91c1c;  --bad-soft: #fdeaea;
  --info: #1d4ed8; --info-soft: #e8efff;

  --r-lg: 18px;
  --r: 12px;
  --r-sm: 8px;
  --shadow-1: 0 1px 0 rgb(30 25 10 / .03), 0 1px 3px rgb(30 25 10 / .06);
  --shadow-2: 0 1px 2px rgb(30 25 10 / .05), 0 14px 34px -14px rgb(30 25 10 / .22);
  --ring: 0 0 0 3px rgb(194 65 12 / .25);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --page: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101215;
    --surface: #171a1f;
    --surface-2: #1d2127;
    --surface-3: #262b32;
    --line: #2a2f37;
    --line-strong: #3b424d;
    --ink: #eceef1;
    --ink-2: #c6cbd3;
    --muted: #9aa2ad;
    --accent: #f08a3e;
    --accent-hover: #f6a05f;
    --accent-ink: #1b0e04;
    --accent-soft: #2a1b10;
    --accent-line: #5a3519;
    --accent-text: #f6a464;
    --ok: #4ade80;   --ok-soft: #12261a;
    --warn: #fbbf24; --warn-soft: #2a2210;
    --bad: #f87171;  --bad-soft: #2c1515;
    --info: #93b4ff; --info-soft: #172038;
    --shadow-1: 0 1px 0 rgb(0 0 0 / .3);
    --shadow-2: 0 18px 40px -18px rgb(0 0 0 / .7);
    --ring: 0 0 0 3px rgb(240 138 62 / .35);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--font); overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; letter-spacing: -.015em; }
h1 { font-size: clamp(34px, 5.4vw, 58px); font-weight: 700; text-wrap: balance; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 18px; }
p { margin: 0; }
a { color: var(--accent-text); text-underline-offset: 3px; }
code { font-family: var(--font-mono); font-size: .92em; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); }
::selection { background: var(--accent-soft); color: var(--ink); }

.salta { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-sm); }
.salta:focus { top: 12px; }
.nascosto { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* ---------- Barra in alto ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 20px/1 var(--font-display); letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; flex: none; border-radius: 9px; display: block; box-shadow: 0 0 0 1px rgb(240 122 42 / .35), 0 2px 10px -2px rgb(240 122 42 / .45); }
.logo-lab { color: var(--accent); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  padding: 9px 13px; border-radius: 999px; color: var(--ink-2); text-decoration: none;
  font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s;
}
.topbar nav a:hover { background: var(--surface-2); color: var(--ink); }
.topbar nav a.on { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) {
  .topbar { padding-block: 8px; }
  .topbar nav { width: 100%; }
  .topbar nav a { flex: 1; text-align: center; padding: 8px 6px; font-size: 13.5px; }
  .topbar nav .nav-sec { flex: 0 0 auto; }
}

/* Condividi */
.condividi-box { position: relative; }
.condividi { min-height: 38px; padding: 0 14px; border-radius: 999px; font-size: 14.5px; gap: 7px; background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
.condividi:hover { background: var(--accent-soft); border-color: var(--accent); }
.condividi svg, .menu-condividi svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-condividi {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 12; min-width: 200px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
}
.menu-condividi:not([hidden]) { display: grid; }
.menu-condividi a, .menu-condividi button {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--ink); font: 500 14.5px var(--font); text-decoration: none; justify-content: flex-start; width: 100%; cursor: pointer;
}
.menu-condividi a:hover, .menu-condividi button:hover { background: var(--surface-2); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30;
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 999px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow-2);
}
body.con-barra .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (max-width: 560px) {
  .condividi-box { order: 1; margin-left: auto; }
  .topbar nav { order: 2; }
  .condividi { min-height: 36px; padding: 0 12px; font-size: 13.5px; }
}
@media (min-width: 561px) { .topbar nav { margin-left: auto; } }

main { max-width: var(--page); margin: 0 auto; padding: clamp(20px, 4vw, 44px) var(--gutter) 64px; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font: 500 12.5px/1 var(--font-mono); letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px;
}
.pallino { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.hero h1 em { font-style: normal; color: var(--accent); }
.lead { color: var(--ink-2); font-size: clamp(16px, 1.6vw, 18.5px); max-width: 54ch; margin-top: 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-art { width: 100%; height: auto; max-height: 320px; color: var(--line-strong); }
.hero-3d {
  position: relative; height: clamp(280px, 30vw, 360px); max-height: none; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
  background:
    radial-gradient(120% 90% at 50% 35%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    linear-gradient(180deg, #2b2e35, #16181c);
}
.hero-3d canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .6s; }
.hero-3d.pronto canvas { opacity: 1; }
.hero-3d-tag {
  position: absolute; left: 14px; top: 14px; z-index: 1; display: inline-flex; align-items: center; gap: 7px;
  font: 500 11.5px/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: #f3efe8;
  background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); border-radius: 999px; padding: 7px 10px;
  backdrop-filter: blur(6px);
}
.hero-3d-tag i { width: 7px; height: 7px; border-radius: 50%; background: #ff8a30; box-shadow: 0 0 0 3px rgb(255 138 48 / .25); animation: lampeggia 1.4s ease-in-out infinite; }
@keyframes lampeggia { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .hero-3d-tag i { animation: none; } }
.hero-3d.no-3d .hero-3d-tag { display: none; }
.art-fondo { fill: var(--surface); stroke: var(--line); }
.art-telaio { fill: var(--surface-3); }
.art-telaio-scuro, .art-asse { fill: var(--ink-2); }
.art-piatto { fill: var(--ink); }
.art-piatto-luce { fill: var(--muted); opacity: .5; }
.art-pezzo rect { fill: var(--accent); }
.art-pezzo rect:nth-child(even) { fill: color-mix(in srgb, var(--accent) 82%, var(--surface)); }
.art-testa { fill: var(--surface); stroke: var(--ink-2); stroke-width: 2; }
.art-display { fill: var(--surface-3); }
.art-led { fill: var(--ok); }
.art-ugello { fill: var(--muted); }
.art-punta { fill: var(--accent); }
.art-quota path { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.art-quota text { font: 500 12px var(--font-mono); fill: var(--muted); }
.art-bobina circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 3; }
.art-bobina .art-bobina-centro { fill: var(--surface); stroke-width: 2; }
@media (max-width: 560px) { .hero-cta .btn { flex: 1 1 100%; } }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-art { max-height: 210px; order: -1; }
  .hero-3d { height: clamp(220px, 62vw, 300px); }
}

/* Come funziona */
.come { margin: clamp(24px, 4vw, 40px) 0 clamp(24px, 4vw, 36px); }
.come ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.come li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.come b { display: block; font-size: 15px; }
.come li span:not(.come-n) { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.come-n { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font: 700 14px var(--font-mono); border: 1px solid var(--accent-line); }
@media (max-width: 820px) { .come ol { grid-template-columns: 1fr; } }

/* Lo stato e la conferma non hanno bisogno della vetrina */
body[data-vista="stato"] .hero, body[data-vista="stato"] .come,
body[data-vista="ok"] .hero, body[data-vista="ok"] .come { display: none; }

/* ---------- Pannelli e layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-1); }
.gate { max-width: 480px; margin-inline: auto; }
.gate.largo { max-width: 640px; }
.gate h2 { margin-bottom: 8px; }
.centrato { text-align: center; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } }
.passi-col { display: grid; gap: 18px; }
.stack-gap > * + * { margin-top: 18px; }

.passo-testa { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.passo-testa .hint { margin-top: 3px; }
.step-n {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink);
  font: 700 15px var(--font-mono); transition: background .2s, color .2s, border-color .2s;
}
.step-n.icona svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.passo.fatto .step-n { background: var(--ok); border-color: var(--ok); color: var(--surface); font-size: 0; }
.passo.fatto .step-n::after { content: ''; width: 12px; height: 7px; border: solid currentColor; border-width: 0 0 2.5px 2.5px; transform: translateY(-2px) rotate(-45deg); }

/* ---------- Campi ---------- */
label, .etichetta { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }
.hint { color: var(--muted); font-size: 13.5px; font-weight: 400; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.row + .row, .field + .field, .row + .field, .field + .row, .seg + .field, .seg + .info-box, .info-box + .field { margin-top: 16px; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 11px 12px; min-height: 46px;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 100px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
input[type="date"] { min-height: 46px; }

/* Selettori a segmenti */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg.seg2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg button {
  flex-direction: column; gap: 6px; min-height: 78px; padding: 12px 8px; border-radius: var(--r);
  background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); font-weight: 600; font-size: 14.5px;
}
.seg button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.seg button:hover { border-color: var(--muted); color: var(--ink); background: var(--surface); }
.seg button[aria-pressed='true'] { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.seg.taglie { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg.taglie button { min-height: 64px; gap: 2px; text-align: center; }
.seg.taglie small { font-weight: 500; font-size: 12px; color: var(--muted); line-height: 1.25; }
.seg.taglie button[aria-pressed='true'] small { color: inherit; opacity: .8; }
@media (max-width: 480px) {
  .seg, .seg.seg2 { grid-template-columns: 1fr; }
  .seg button { flex-direction: row; min-height: 52px; justify-content: flex-start; padding-inline: 14px; }
  .seg.taglie { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg.taglie button { flex-direction: column; justify-content: center; padding-inline: 8px; min-height: 60px; }
}

/* Zona file */
#box-files { margin-top: 18px; }
.drop {
  display: grid; justify-items: center; gap: 6px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 26px 16px;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box;
  transition: border-color .15s, background .15s;
}
.drop:hover { border-color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-ico { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-testo b { color: var(--accent-text); }
.drop-sub { font: 500 12px var(--font-mono); color: var(--muted); }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.files li {
  position: relative; display: flex; gap: 10px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 8px 10px 12px; overflow: hidden;
}
.files li::before { content: ''; flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2) center / 18px no-repeat; border: 1px solid var(--line);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 2 3 7v10l9 5 9-5V7z'/%3E%3Cpath d='m3 7 9 5 9-5M12 12v10'/%3E%3C/svg%3E"); }
.files li > div:first-of-type { flex: 1; }
.files li > div:first-of-type > div:first-child { font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.files .meta { color: var(--muted); font-size: 13px; font-family: var(--font-mono); }
.files .x { min-height: 34px; padding: 0 12px; background: transparent; color: var(--muted); font-size: 13px; border: 1px solid transparent; }
.files .x:hover { color: var(--bad); border-color: var(--line); background: var(--surface-2); }
.files .up { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-3); }
.files .up i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.files li.caricato .up i { background: var(--ok); }
.warn { color: var(--warn) !important; }
.bad { color: var(--bad) !important; }

/* Colori a campioni */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; }
.swatch {
  width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--c, #ccc);
  box-shadow: inset 0 0 0 2px var(--surface); transition: transform .12s, box-shadow .12s;
}
.swatch:hover { transform: translateY(-1px); background: var(--c, #ccc); }
.swatch[aria-checked='true'] { box-shadow: inset 0 0 0 3px var(--surface), 0 0 0 2px var(--accent); border-color: var(--accent); }
.swatch.altro { background: conic-gradient(#e53935, #fbc02d, #43a047, #1e88e5, #8e24aa, #e53935); }
.swatch:focus-visible { box-shadow: inset 0 0 0 3px var(--surface), var(--ring); }

/* Stepper quantità / scala */
.stepper { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; }
.stepper input { border-radius: 0; text-align: center; font-family: var(--font-mono); font-weight: 700; -moz-appearance: textfield; position: relative; z-index: 1; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button { min-height: 46px; padding: 0; font-size: 20px; font-weight: 600; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }
.stepper button:hover { background: var(--surface-3); }
.st-meno { border-radius: var(--r-sm) 0 0 var(--r-sm) !important; border-right: 0 !important; }
.st-piu { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; border-left: 0 !important; }

.info-box { display: block; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; color: var(--ink-2); font-size: 14px; }
.info-box:empty { display: none; }

/* ---------- Pulsanti ---------- */
button, .btn {
  font: inherit; font-weight: 600; font-size: 15px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  min-height: 46px; padding: 0 18px; cursor: pointer; background: var(--surface); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:active, .btn:active { transform: translateY(1px); }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ghost { background: transparent; }
.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.danger:hover { background: var(--bad-soft); }
button:disabled { opacity: .55; cursor: wait; transform: none; }
.wide { width: 100%; }
.grande { min-height: 54px; font-size: 16.5px; }

/* ---------- Consenso, trappola anti-bot ---------- */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 14px; color: var(--ink-2); margin: 18px 0 0; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.check input { width: 20px; height: 20px; min-height: 0; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--accent); cursor: pointer; }

/* ---------- Stima ---------- */
.stima { position: sticky; top: 84px; }
.stima-testa { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag { font: 500 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; }
.prezzo { font: 700 clamp(40px, 5vw, 50px)/1.1 var(--font-mono); letter-spacing: -.03em; color: var(--ink); margin: 14px 0 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stima dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0; margin: 16px 0 0; font-size: 14px; border-top: 1px solid var(--line); }
.stima dt, .stima dd { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.stima dt { color: var(--muted); }
.stima dd { margin: 0; text-align: right; font-family: var(--font-mono); font-weight: 500; font-size: 13.5px; overflow-wrap: anywhere; }
.passi { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 2px; counter-reset: p; }
.passi li { counter-increment: p; }
.passi button {
  width: 100%; min-height: 38px; justify-content: flex-start; gap: 10px; padding: 0 8px; border: 0; background: transparent;
  color: var(--ink-2); font-weight: 500; font-size: 14px; border-radius: var(--r-sm);
}
.passi button::before {
  content: counter(p); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-strong); font: 700 11px var(--font-mono); color: var(--muted);
}
.passi li.fatto button { color: var(--ink); }
.passi li.fatto button::before { content: '✓'; background: var(--ok); border-color: var(--ok); color: var(--surface); }
.nota-stima { margin: 16px 0 14px; }
.err { color: var(--bad); font-weight: 600; margin-top: 10px; font-size: 14.5px; }
.err:empty { display: none; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
#p-stato { margin-top: 8px; }
#p-stato:empty { display: none; }

/* Barra stima su telefono */
.barra-stima { display: none; }
@media (max-width: 960px) {
  .stima { position: static; }
  .barra-stima:not([hidden]) {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgb(0 0 0 / .35);
  }
  .barra-stima > div { display: grid; }
  .barra-label { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .barra-prezzo { font: 700 22px/1.1 var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .barra-stima button { min-height: 44px; }
  body.con-barra main { padding-bottom: 110px; }
}

/* ---------- Conferma e stato ---------- */
.ok-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.ok-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
#v-ok > p { color: var(--ink-2); }
.codice {
  font: 700 clamp(30px, 7vw, 44px)/1 var(--font-mono); letter-spacing: .06em; color: var(--ink);
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 18px 12px; margin: 18px 0;
  user-select: all;
}
.azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
@media (max-width: 420px) { .azioni { grid-template-columns: 1fr; } }

.cerca-codice { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.cerca-codice input { font-family: var(--font-mono); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.cerca-codice input::placeholder { text-transform: none; letter-spacing: .02em; font-weight: 500; }
@media (max-width: 420px) { .cerca-codice { grid-template-columns: 1fr; } }
#out-stato:not(:empty) { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.stato-saluto { font-size: 15.5px; color: var(--ink-2); }
.stato-saluto b { color: var(--ink); }
.timeline { list-style: none; padding: 0; margin: 18px 0 0; display: grid; }
.timeline li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding-bottom: 18px; position: relative; color: var(--muted); align-items: center; }
.timeline li::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); margin: 0 6px; background: var(--surface); box-sizing: border-box; }
.timeline li::after { content: ''; position: absolute; left: 14px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline li.done { color: var(--ink-2); }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.done::after { background: var(--ok); }
.timeline li.now { color: var(--ink); font-weight: 700; }
.timeline li.now::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.timeline li.rifiutata { color: var(--bad); }
.timeline li.rifiutata::before { background: var(--bad); border-color: var(--bad); box-shadow: 0 0 0 5px var(--bad-soft); }
.stato-prezzo { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.stato-prezzo span { color: var(--muted); font-size: 14px; }
.stato-prezzo b { font: 700 24px var(--font-mono); }
.stato-prezzo.confermato { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.stato-prezzo.confermato span { color: var(--ok); font-weight: 600; }
.stato-nota { margin-top: 12px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); font-size: 14.5px; }
.stato-nota b { display: block; font-size: 12px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--accent-text); margin-bottom: 2px; }

/* ---------- Piè di pagina ---------- */
.foot { max-width: var(--page); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13.5px; padding: 22px var(--gutter) 36px; border-top: 1px solid var(--line); }
.foot a { color: var(--ink-2); }

/* ---------- Privacy ---------- */
.prose { max-width: 780px; margin-inline: auto; }
.prose h1 { font-size: clamp(30px, 4.5vw, 40px); }
.prose h2 { margin: 30px 0 10px; font-size: 19px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 10px; }
.prose ul { padding-left: 20px; margin: 8px 0 0; }
.prose li + li { margin-top: 6px; }
.prose b { color: var(--ink); }
.prose .sommario { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 20px; }
.prose .sommario div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: 14px; color: var(--ink-2); }
.prose .sommario b { display: block; font: 700 22px var(--font-mono); color: var(--ink); }

/* ---------- Admin ---------- */
.admin-testa { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.riepilogo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.riepilogo div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow-1); }
.riepilogo b { display: block; font: 700 26px/1.1 var(--font-mono); }
.riepilogo span { color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .riepilogo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar input[type="search"] { flex: 1 1 260px; max-width: 420px; }
.chip { min-height: 36px; padding: 0 13px; border-radius: 999px; font-size: 13.5px; background: var(--surface); color: var(--ink-2); }
.chip[aria-pressed='true'] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-1); }
.card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card h3 { font-size: 17px; overflow-wrap: anywhere; }
.badge { font: 600 12px/1 var(--font); padding: 6px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.badge.in_attesa { color: var(--warn); background: var(--warn-soft); }
.badge.accettata { color: var(--info); background: var(--info-soft); }
.badge.in_stampa { color: var(--accent-text); background: var(--accent-soft); }
.badge.pronta { color: var(--ok); background: var(--ok-soft); }
.badge.consegnata { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.badge.rifiutata { color: var(--bad); background: var(--bad-soft); }
.kv { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.dl { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.dl button, .dl .btn { min-height: 38px; font-size: 13.5px; padding: 0 12px; }
.edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; align-items: end; padding-top: 14px; border-top: 1px solid var(--line); }
.edit label { font-size: 12.5px; color: var(--muted); }
.vuoto { color: var(--muted); text-align: center; padding: 48px 0; grid-column: 1 / -1; }

/* ---------- Animazione ---------- */
@media (prefers-reduced-motion: no-preference) {
  .layer { animation: strato 3.4s ease-in-out infinite; }
  .carrello { animation: carrello 3.4s ease-in-out infinite; }
  @keyframes strato { 0%, 12% { opacity: 0; transform: scaleX(.2); } 45%, 88% { opacity: 1; transform: none; } 100% { opacity: 0; } }
  @keyframes carrello { 0%, 100% { transform: translateX(-34px); } 50% { transform: translateX(34px); } }
  .layer { transform-box: fill-box; transform-origin: left center; }
}

.prezzo.range { font-size: clamp(30px, 4vw, 40px); }

/* ---------- Feedback ---------- */
.fab-feedback {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 13px; border-radius: 999px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow-2);
  font-weight: 600; font-size: 14.5px; cursor: pointer;
}
.fab-feedback:hover { border-color: var(--accent); color: var(--accent-text); }
.fab-feedback svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
@media (max-width: 960px) {
  .fab-feedback { padding: 12px; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .fab-feedback span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.con-barra .fab-feedback { bottom: calc(92px + env(safe-area-inset-bottom)); }
}
button.link { background: none; border: 0; padding: 0; min-height: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; box-shadow: none; }
button.link:hover { color: var(--accent-text); background: none; }
.dlg-feedback {
  width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
}
.dlg-feedback::backdrop { background: rgb(15 12 8 / .45); backdrop-filter: blur(2px); }
.dlg-feedback form, .fb-grazie { padding: clamp(18px, 4vw, 26px); }
.fb-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-testa h2 { font-size: 22px; margin: 0; }
.fb-chiudi { width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 999px; font-size: 24px; line-height: 1; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.fb-tipi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 16px 0 12px; }
.fb-tipi button { min-height: 40px; padding: 6px 4px; font-size: 13.5px; font-weight: 600; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink-2); }
.fb-tipi button[aria-checked='true'] { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.fb-voto { display: flex; align-items: center; gap: 2px; margin-bottom: 14px; }
.fb-voto > .hint { margin-right: 8px; }
.fb-opz { opacity: .8; }
.fb-voto button { width: 36px; height: 36px; min-height: 0; padding: 0; font-size: 24px; line-height: 1; background: none; border: 0; box-shadow: none; color: var(--line-strong); }
.fb-voto button.on { color: #e0a100; }
.fb-voto button:hover { background: none; color: #e0a100; }
.fb-privacy { margin: 10px 0 0; font-size: 13px; }
.dlg-feedback .primary.wide { margin-top: 14px; }
.fb-grazie { text-align: center; }
.fb-ok { width: 54px; height: 54px; margin: 6px auto 10px; display: grid; place-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 28px; font-weight: 700; }
.fb-grazie .wide { margin-top: 16px; }
@media (max-width: 400px) { .fb-tipi { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.fb-admin-testa { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); align-items: center; }
.fb-admin-testa h2 { font-size: clamp(22px, 3vw, 28px); margin: 0; }
.fb-admin-testa .toolbar { margin: 0; }
.fb-messaggio { white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.fb-azioni { display: flex; gap: 8px; flex-wrap: wrap; }
.card.fb-letto { opacity: .75; }
