:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e2e6ec;
  --line-strong: #cfd5de;
  --text: #17202c;
  --muted: #5d6878;
  --faint: #6b7686;   /* 4,6:1 su bianco: leggibile anche per codici e conteggi piccoli (WCAG AA) */
  --accent: #0f5bd8;
  --accent-strong: #0a47ad;
  --accent-soft: #e8f0fe;
  --ok: #138a4d;
  --ok-soft: #e3f5eb;
  --warn: #b26a00;
  --warn-soft: #fdf1dc;
  --info: #5a5f9e;
  --info-soft: #eceefb;
  --price: #111827;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --radius: 10px;
  --header-h: 112px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #171d26;
    --surface-2: #1c2330;
    --line: #2a3340;
    --line-strong: #39434f;
    --text: #e6eaf0;
    --muted: #a3adbb;
    --faint: #7c8796;
    --accent: #5b9bff;
    --accent-strong: #84b4ff;
    --accent-soft: #1b2a44;
    --ok: #4cc488;
    --ok-soft: #15301f;
    --warn: #f0b354;
    --warn-soft: #33270f;
    --info: #a8adf2;
    --info-soft: #23264a;
    --price: #f4f6fa;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- header */
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1480px; margin: 0 auto; display: flex; align-items: center; gap: 20px; padding: 12px 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; flex: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; }
.brand-mark svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 17px; letter-spacing: -.01em; }
.brand-text small { color: var(--muted); font-size: 12px; }
.search { position: relative; flex: 1; display: flex; align-items: center; max-width: 760px; }
.search input {
  width: 100%; height: 44px; border: 1.5px solid var(--line-strong); border-radius: 22px 0 0 22px; border-right: 0;
  padding: 0 40px 0 42px; background: var(--surface-2); outline: none; font-size: 15px;
}
.search input:focus { border-color: var(--accent); background: var(--surface); }
.search input::-webkit-search-cancel-button { display: none; }
.search-ico { position: absolute; left: 15px; color: var(--faint); pointer-events: none; }
.search-clear { position: absolute; right: 86px; border: 0; background: none; color: var(--faint); cursor: pointer; padding: 6px; display: grid; }
.search-go {
  height: 44px; padding: 0 20px; border: 0; border-radius: 0 22px 22px 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
.search-go:hover { background: var(--accent-strong); }
.vat-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: none; user-select: none; color: var(--muted); font-size: 13px; }
.vat-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.switch { width: 36px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.vat-toggle input:checked + .switch { background: var(--accent); }
.vat-toggle input:checked + .switch::after { transform: translateX(16px); }
.vat-toggle input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.cats { max-width: 1480px; margin: 0 auto; display: flex; gap: 4px; padding: 0 16px 8px; }   /* su una riga: il resto in "Altro" (fitCats) */
.cats[data-ssr] { overflow: hidden; }   /* reparti scritti dal server: finche' app.js non fa il menu "Altro" niente scorrimento laterale */
a.cat-chip { text-decoration: none !important; }
.cats-more { position: relative; flex: none; }
.cats-more > summary { list-style: none; }
.cats-more > summary::-webkit-details-marker { display: none; }
.cats-more > summary .ico { width: 14px; height: 14px; }
.cats-more[open] > summary { background: var(--surface-2); color: var(--text); }
.cats-drop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 220px; padding: 6px; display: grid;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg);
  /* sta nell'intestazione fissa: su schermi bassi (telefono in orizzontale) scorre dentro, cosi' si arriva all'ultimo reparto */
  max-height: calc(100vh - var(--header-h, 150px) - 8px); max-height: calc(100dvh - var(--header-h, 150px) - 8px); overflow-y: auto; overscroll-behavior: contain; }
.cats-drop .cat-chip { width: 100%; }
.cat-chip {
  display: flex; align-items: center; gap: 6px; white-space: nowrap; padding: 7px 12px; border-radius: 8px; border: 0; background: none;
  color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 500;
}
.cat-chip:hover { background: var(--surface-2); color: var(--text); }
.cat-chip.on { background: var(--accent-soft); color: var(--accent); }
.cat-chip .ico { width: 16px; height: 16px; }

/* ---------- suggest */
.suggest {
  position: absolute; top: 50px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; max-height: min(70vh, 560px); overflow: auto; z-index: 40;
}
.sg-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 4px; }
.sg-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.sg-item:hover, .sg-item.on { background: var(--accent-soft); }
.sg-item .sg-main { flex: 1; min-width: 0; }
.sg-item .sg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-item .sg-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-item .sg-n { font-size: 12px; color: var(--faint); }
.sg-item .sg-price { font-weight: 600; white-space: nowrap; }
.sg-thumb { width: 40px; height: 40px; border-radius: 6px; background: var(--surface-2); flex: none; display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.sg-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sg-all { display: block; text-align: center; padding: 9px; border-top: 1px solid var(--line); margin-top: 4px; font-weight: 600; cursor: pointer; border-radius: 0 0 8px 8px; }
.sg-all.on, .sg-all:hover { background: var(--accent-soft); text-decoration: none; }
mark { background: none; color: inherit; font-weight: 700; }

.progress { position: fixed; top: 0; left: 0; height: 3px; z-index: 50; background: var(--accent); animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { left: 0; width: 0; } 50% { left: 20%; width: 50%; } 100% { left: 100%; width: 0; } }

/* ---------- layout */
.layout { max-width: 1480px; margin: 0 auto; display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; padding: 18px 20px 40px; }
.layout.product-mode { grid-template-columns: minmax(0, 1fr); }
.layout.product-mode .side { display: none; }
.side { position: sticky; top: calc(var(--header-h) + 12px); align-self: start; max-height: calc(100vh - var(--header-h) - 24px); overflow: auto; padding-right: 4px; scrollbar-width: thin; }
.side-head { display: none; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.panel-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; align-items: baseline; }
.panel-title small { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--faint); }

/* tree */
.tree { font-size: 13.5px; }
.tn { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.tn:hover { background: var(--surface-2); }
.tn.on { background: var(--accent-soft); }
.tn.on > .tn-link { color: var(--accent); font-weight: 600; }
.tn-tog { width: 22px; height: 26px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--faint); display: grid; place-items: center; flex: none; }
.tn-tog .ico { width: 14px; height: 14px; transition: transform .12s; }
.tn-tog.open .ico { transform: rotate(90deg); }
.tn-tog.leaf { visibility: hidden; }
.tn-link { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 0; color: var(--text); cursor: pointer; text-decoration: none !important; }
.tn-link span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tn-kids { padding-left: 14px; }
.tn.top > .tn-link { font-weight: 600; }
.tn-icon { width: 16px; height: 16px; color: var(--muted); margin-right: 6px; flex: none; vertical-align: -3px; }

/* facets */
.fg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
.fg-head { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: none; padding: 11px 12px; cursor: pointer; font-weight: 600; text-align: left; }
.fg-head .ico { width: 16px; height: 16px; color: var(--faint); transition: transform .12s; }
.fg.closed .fg-head .ico { transform: rotate(-90deg); }
.fg.closed .fg-body { display: none; }
.fg-sel { color: var(--accent); font-weight: 600; font-size: 12px; margin-left: 6px; }
.fg-body { padding: 0 12px 10px; }
.fv { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; font-size: 13.5px; }
.fv input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; flex: none; }
.fv span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.fv.zero { opacity: .5; }
.fg-more { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 4px 0 0; font-size: 13px; }
.fg-find { width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; margin-bottom: 6px; background: var(--surface-2); }
.price { display: flex; align-items: center; gap: 6px; }
.price input { width: 0; flex: 1; height: 32px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: var(--surface-2); }
.btn-sm { height: 32px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; font-weight: 600; }

/* ---------- content */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 6px; min-height: 18px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--faint); }
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h1 { margin: 0; font-size: 24px; letter-spacing: -.015em; line-height: 1.2; }
.list-head p { margin: 2px 0 0; }
.list-head .q-tutto { margin-top: 4px; font-size: 13.5px; padding: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; }
.sort { display: flex; align-items: center; gap: 8px; }
.sort select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 0 8px; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 9px; cursor: pointer; color: var(--muted); display: grid; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.btn-outline { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 600; }
.badge { background: var(--accent); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.only-mobile { display: none; }

.active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.active:empty { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); font-size: 13px; border: 0; cursor: pointer; }
.pill .ico { width: 14px; height: 14px; }
.pill small { color: var(--muted); }
.pill-clear { background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent); font-weight: 600; padding: 2.5px 12px 2.5px 8px; margin-left: 4px; }
.pill-clear:hover { background: var(--accent); color: #fff; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 13.5px; }
.interp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 13.5px; color: var(--muted); }
.interp .pill { background: var(--accent); color: #fff; }
.interp .pill small { color: rgba(255,255,255,.75); }
.interp .pill .ico { stroke: #fff; }
.interp .corr { margin-left: 4px; }
.interp .corr b { color: var(--accent); cursor: pointer; text-decoration: underline; }
.interp .corr .link-btn { padding: 0; font: inherit; }   /* pulsante (raggiungibile da tastiera) che resta una parola nel testo */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tiles:empty { display: none; }
.tile { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); cursor: pointer; text-align: left; box-shadow: var(--shadow); text-decoration: none !important; }
.tile:hover { border-color: var(--accent); }
.tile-ico { width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.tile b { display: block; font-weight: 600; line-height: 1.25; }
.tile small { color: var(--faint); }

/* product cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; color: var(--text); cursor: pointer; transition: border-color .12s, transform .12s; text-decoration: none !important; }
.card:hover { border-color: var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.thumb { aspect-ratio: 4 / 3; background: #fff; display: grid; place-items: center; position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
/* l'immagine sta fuori dalla griglia del riquadro: altrimenti la riga cresce fino all'altezza naturale della foto e il riquadro 4:3 la taglia */
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; background: var(--surface-2); color: var(--line-strong); }
.ph .ico { width: 54px; height: 54px; stroke-width: 1.3; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-brand { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.card-brand a { color: inherit; }   /* nella scheda prodotto: tutti gli articoli della marca */
.card-name { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.price-main { font-size: 18px; font-weight: 700; color: var(--price); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price-alt { font-size: 11.5px; color: var(--faint); }
.price-main.price-na { font-size: 13.5px; font-weight: 600; color: var(--faint); }
.buy .price-main.price-na { font-size: 18px; }
.code { font-size: 11.5px; color: var(--faint); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* articolo gia' acquistato dal cliente: giorno dell'ultimo acquisto */
.acq-il { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--info); white-space: nowrap; }
.acq-il .ico { width: 13px; height: 13px; flex: none; }
.av { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.av::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.av-magazzino { color: var(--ok); }
.av-ultimi { color: var(--ok); font-weight: 600; }
.av-fornitore { color: var(--info); }
.av-ordinazione, .av-richiesta { color: var(--warn); }
.av-login { font-size: 12.5px; white-space: nowrap; }

.grid.list { grid-template-columns: 1fr; gap: 8px; }
.grid.list .card { flex-direction: row; }
.grid.list .thumb { width: 150px; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--line); flex: none; }
.grid.list .card-body { flex-direction: row; gap: 16px; align-items: center; }
.grid.list .card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.grid.list .card-foot { flex-direction: column; align-items: flex-end; margin: 0; padding: 0; min-width: 150px; }
.card-info { display: contents; }

.pager { display: flex; justify-content: center; gap: 4px; margin-top: 24px; flex-wrap: wrap; }
.pager button, .pager a { min-width: 36px; height: 36px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; cursor: pointer; padding: 0 10px; }
/* le pagine del catalogo sono link veri (i motori di ricerca li seguono): stesso aspetto dei pulsanti */
.pager a { display: inline-flex; align-items: center; justify-content: center; color: var(--text); font-size: 13.33px; text-decoration: none !important; }
.pager button.on, .pager a.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager .gap { padding: 0 4px; line-height: 36px; color: var(--faint); }

.empty { text-align: center; padding: 60px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty .ico { width: 44px; height: 44px; color: var(--faint); }
.empty h2 { margin: 12px 0 6px; font-size: 18px; }

/* ---------- product page */
.pd-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; margin-bottom: 10px; font-weight: 600; }
.pd { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.pd-img { background: #fff; border: 1px solid var(--line); border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; position: sticky; top: calc(var(--header-h) + 20px); }
.pd-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.pd-img .ph .ico { width: 110px; height: 110px; }
.pd h1 { margin: 4px 0 8px; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.pd-meta b { color: var(--text); font-weight: 600; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.buy { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface-2); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.buy .price-main { font-size: 28px; }
.buy-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn:hover { background: var(--accent-strong); }
.btn.ghost { background: var(--surface); color: var(--accent); }
.pd h2 { font-size: 15px; margin: 22px 0 8px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv th, .kv td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv th { width: 42%; color: var(--muted); font-weight: 500; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.kv-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv-group { padding: 8px 10px; background: var(--surface-2); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.desc { white-space: pre-line; color: var(--text); font-size: 14px; }
.desc.clamp { max-height: 190px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 6px 0; font-weight: 600; }
.similar { margin-top: 24px; }
.similar h2 { font-size: 18px; margin: 0 0 12px; }
.similar .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.foot { max-width: 1480px; margin: 0 auto; padding: 10px 20px 30px; color: var(--faint); font-size: 12px; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 44; }

/* ---------- responsive */
@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 16px 32px; }
  /* align-self: stretch serve: con "start" (dalla colonna del computer) i browser di oggi fanno il pannello alto quanto
     il contenuto, che quindi non scorre e i filtri in fondo non si raggiungono */
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(340px, 88vw); max-height: none; z-index: 45; background: var(--bg);
    align-self: stretch; overscroll-behavior: contain;
    padding: 12px; transform: translateX(-102%); transition: transform .18s; box-shadow: var(--shadow-lg);
  }
  .side.open { transform: none; }
  .side-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
  .only-mobile { display: inline-flex; }
  .pd { grid-template-columns: 1fr; padding: 16px; }
  .pd-img { position: static; max-width: 420px; width: 100%; margin: 0 auto; }
}
@media (max-width: 720px) {
  .top-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand-text small { display: none; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .vat-toggle { margin-left: auto; }
  .search input { font-size: 16px; }
  .list-head h1 { font-size: 20px; }
  .toolbar { width: 100%; justify-content: space-between; }
  /* con il numero dei filtri attivi la barra non ci stava piu' (pagina che scorre di lato): si stringe l'ordinamento */
  .sort { flex: 1; min-width: 0; }
  .sort select { width: 100%; min-width: 0; }
  .sort .muted { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .price-main { font-size: 16px; }
  /* schede strette (due colonne): prezzo scontato e disponibilita' vanno a capo invece di tagliare «Su ordinazione» */
  .card-foot { flex-wrap: wrap; row-gap: 4px; }
  .price-list { flex-wrap: wrap; }
  .grid.list .thumb { width: 96px; }
  .grid.list .card-body { flex-direction: column; align-items: stretch; gap: 6px; }
  .grid.list .card-foot { flex-direction: row; align-items: flex-end; min-width: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buy .price-main { font-size: 24px; }
}

/* ================================================================== negozio */
.usr { display: flex; align-items: center; gap: 4px; flex: none; }
.usr-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 13.5px; text-decoration: none !important; white-space: nowrap; }
.usr-btn:hover { background: var(--surface-2); }
button.usr-btn { border: 0; background: none; cursor: pointer; font: inherit; font-weight: 500; font-size: 13.5px; }
button.usr-btn:hover { background: var(--surface-2); }
.acq-btn { color: var(--muted); }
.acq-btn.on { color: #b42318; background: rgba(180, 35, 24, .12); }   /* acceso: ben visibile, per ricordarsi di spegnerlo */
.usr-btn .ico { width: 20px; height: 20px; }
.usr-menu { position: relative; }
.usr-menu > summary { list-style: none; cursor: pointer; }
.usr-menu > summary::-webkit-details-marker { display: none; }
.usr-menu[open] > summary { background: var(--surface-2); }
.usr-drop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 180px; padding: 6px; display: grid;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); }
.usr-drop a { padding: 9px 12px; border-radius: 6px; color: var(--text); text-decoration: none !important; font-size: 14px; }
.usr-drop a:hover { background: var(--surface-2); }
/* intestazione su schermi medi (portatili, 1024-1320 px): la ricerca si stringe (min-width 0) e i pulsanti restano icone
   con il nome nel suggerimento, cosi' con i pulsanti dei gestori niente esce dallo schermo */
.search { min-width: 0; }
@media (max-width: 1320px) {
  .usr-menu .usr-label, .acq-btn .usr-label, .cart-btn .usr-label { display: none; }
  .top-inner { gap: 14px; }
}
@media (max-width: 1180px) {
  .usr-label { display: none; }
  .brand-text small { display: none; }
}
.cart-btn .badge { position: absolute; top: 2px; left: 22px; }
.add-cart { display: inline-flex; gap: 6px; align-items: center; }
.add-cart input { width: 70px; height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--surface); text-align: center; }
.btn:disabled, .btn-sm:disabled { opacity: .5; cursor: not-allowed; }
.btn.loading { opacity: .7; cursor: progress; }
.btn.block { width: 100%; justify-content: center; margin: 10px 0 6px; }
.btn-outline { text-decoration: none !important; color: var(--text); }
.link-btn.danger, .danger { color: #c0392b; }
.small { font-size: 12.5px; }
.code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }

#page-view { min-height: 50vh; }
.page h1, .narrow h1 { font-size: 24px; letter-spacing: -.015em; margin: 4px 0 12px; }
.narrow { max-width: 560px; margin: 0 auto; }
.narrow.wide-form { max-width: 760px; }
.panel-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.panel-box h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 10px; }
.panel-box.sticky { position: sticky; top: calc(var(--header-h) + 14px); }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cart-cols { grid-template-columns: minmax(0, 1fr) 340px; }
.box-alt { margin-top: 20px; padding: 16px 18px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.box-alt p { margin: 6px 0 12px; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; background: none; }
.narrow > .form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.form h3 { margin: 8px 0 -4px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.form .wide, .form .form-err { grid-column: 1 / -1; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.fld > span { color: var(--muted); font-weight: 500; }
.fld input, .fld select, .fld textarea, .filters input, .filters select, .quick input, .tbl.edit input, .tbl.edit select {
  height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface); min-width: 0; font-size: 14px;
}
.fld textarea { height: auto; padding: 8px 10px; resize: vertical; font: inherit; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .filters input:focus, .quick input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.fld input[readonly] { background: var(--surface-2); color: var(--muted); }
.fld small { color: var(--faint); font-size: 12px; }
.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.chk input { margin-top: 2px; accent-color: var(--accent); }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.flash { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.msg { border-radius: 10px; padding: 11px 14px; margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.msg-ok { background: var(--ok-soft); color: var(--ok); }
.msg-err { background: #fde8e6; color: #b42318; }
.form-err { scroll-margin-top: calc(var(--header-h) + 12px); }
.msg-warn { background: var(--warn-soft); color: var(--warn); }
.msg-info { background: var(--info-soft); color: var(--info); }
@media (prefers-color-scheme: dark) { .msg-err { background: #3a1714; color: #ff9b8f; } }
.hint-ok { color: var(--ok); font-size: 13px; margin: 8px 0 0; }
.hint-warn { color: var(--warn); font-size: 13px; margin: 8px 0 0; }
.note-sm { color: var(--warn); font-size: 12px; margin-top: 2px; }

.tabs { display: flex; gap: 4px; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none !important; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .link-btn { margin-left: auto; }
/* impostazioni: sezioni (Negozio, Vendita, Pagamenti...) e barra «Salva» sempre visibile in basso */
.set-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
/* taratura del wizard allarme (Impostazioni) */
.wzt h3 { margin: 18px 0 6px; font-size: 15px; }
.wzt-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px 18px; }
.wzt-campo { display: grid; gap: 4px; align-content: start; font-size: 13.5px; }
.wzt-campo.wzt-largo { margin-top: 8px; }
.wzt-num { display: inline-flex; align-items: center; gap: 6px; }
.wzt-num input { width: 100px; }
.wzt-campo input, .wzt-campo textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.wzt-campo textarea { width: 100%; resize: vertical; }
.wzt-legenda { margin-top: 14px; }
.wzt-legenda summary { cursor: pointer; }
.wzt-azioni { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.set-nav button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); padding: 7px 14px; border-radius: 999px;
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.set-nav button:hover { color: var(--text); border-color: var(--line-strong); }
.set-nav button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.set-nav button.mod::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.set-salva { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 4px 0 16px;
  padding: 12px 0; background: var(--bg); border-top: 1px solid var(--line); }
.set-salva[hidden] { display: none; }
.set-sporco { color: var(--warn); font-weight: 600; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 10px; font-size: 13.5px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.plain.addr li { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.log li { font-size: 13px; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; text-align: right; }
.totals .tot { font-size: 18px; font-weight: 700; color: var(--price); border-top: 1px solid var(--line); padding-top: 8px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .c { text-align: center; }
.tbl tr[data-href] { cursor: pointer; }
.tbl.hover tr[data-href]:hover td, .tbl tr[data-href]:hover td { background: var(--accent-soft); }
.tbl.edit td { padding: 6px; vertical-align: middle; }
.tbl.edit input:not([type=checkbox]), .tbl.edit select { width: 100%; height: 34px; }
.st { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.st-ricevuto, .st-c-attesa { background: var(--warn-soft); color: var(--warn); }
.st-confermato { background: var(--info-soft); color: var(--info); }
.st-spedito, .st-pronto, .st-completato, .st-c-attivo { background: var(--ok-soft); color: var(--ok); }
.st-annullato, .st-c-bloccato { background: #fde8e6; color: #b42318; }
.ok-tag, .tag { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: var(--ok-soft); color: var(--ok); }
.tag { background: var(--accent-soft); color: var(--accent); }
.order-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.order-head h1 { margin-bottom: 4px; }
.pd-back { text-decoration: none !important; }

.cart { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 10px; }
.cart-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 110px 100px 36px; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.panel-box .cart-row { grid-template-columns: 48px minmax(0, 1fr) 90px 90px; }
.cart-row:last-child { border-bottom: 0; }
.cart-row.ko { background: var(--warn-soft); }
.cart-img { width: 64px; height: 64px; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--faint); }
.panel-box .cart-img { width: 48px; height: 48px; }
.cart-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cart-info a { color: var(--text); }
.cart-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cart-qty input { width: 80px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; text-align: center; background: var(--surface); }
.cart-qty small { color: var(--faint); font-size: 11.5px; }
.cart-tot { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
.quick input[name=codice] { flex: 1; min-width: 160px; }
.quick input[name=qty] { width: 80px; }
.quick .form-err { flex-basis: 100%; margin: 0; }
.quick .btn-sm { height: 38px; }
.seg-choice { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13.5px; }
.seg-choice label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { margin-top: 3px; accent-color: var(--accent); }
.addr-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.filters input[name=q] { flex: 1; min-width: 200px; }
.filters .btn-sm, .filters .btn-outline { height: 38px; }
#pp-box { margin-top: 10px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; line-height: 1.6; }
.doc h1 { margin-top: 0; }
.doc-tab { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.doc-tab th, .doc-tab td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc-tab th { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) {   /* telefono: ogni riga diventa una scheda */
  .doc-tab thead { display: none; }
  .doc-tab tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .doc-tab td { display: block; border: 0; padding: 2px 0; }
}
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
/* pagine di presentazione (chi siamo, soluzioni, utility): testo dei gestori, solo classi pg-* e btn */
.doc-wide { max-width: 960px; margin: 0 auto; }
.doc img { max-width: 100%; height: auto; border-radius: 8px; }
.doc h2 { margin-top: 1.6em; }
.pg-lead { font-size: 17px; }
.pg-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.pg-card { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface-2); }
.pg-card h3 { margin: 0 0 6px; font-size: 16px; }
.pg-card p { margin: 0; }
/* "Chi siamo" con la grafica di thesecurity.it: titoli maiuscoli, testo grigio, icone a linee, riquadro grigio */
.doc .cs-h1 { color: #bf1a3a; text-transform: uppercase; font-size: 22px; font-weight: 500; letter-spacing: .02em; }
.cs-hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 32px; align-items: center; margin: 8px 0 24px; }
.cs-hero img { width: 100%; max-width: 380px; justify-self: center; border-radius: 0; }
.doc .cs-titolo { text-transform: uppercase; font-size: 19px; font-weight: 500; line-height: 1.45; margin: 0 0 14px; color: var(--text); }
.doc .cs-sezione { text-transform: uppercase; font-size: 26px; font-weight: 400; letter-spacing: .01em; margin: 28px 0 6px; }
.doc .cs-sotto { text-transform: uppercase; font-size: 16px; font-weight: 500; margin: 18px 0 6px; }
.cs-testo { color: var(--muted); text-align: justify; }
.cs-vantaggi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; margin: 18px 0 32px; }
.cs-vantaggio img { width: 56px; height: 56px; border-radius: 0; }
.doc .cs-vantaggio h4 { text-transform: uppercase; font-size: 15px; font-weight: 500; margin: 8px 0 6px; }
.cs-vantaggio p { margin: 0; color: var(--muted); font-size: 14px; text-align: justify; }
.cs-box { background: var(--surface-2); border-radius: 10px; padding: 28px 40px; text-align: center; margin: 12px 0 8px; }
.cs-box > img { width: 76px; height: 76px; border-radius: 0; }
.doc .cs-box .cs-sezione { margin-top: 10px; }
.cs-box .cs-testo, .cs-spunte { text-align: justify; }
.cs-spunte { list-style: none; padding: 0; margin: 8px auto; max-width: 820px; }
.cs-spunte li { position: relative; padding-left: 26px; margin: 8px 0; }
.cs-spunte li::before { content: "✓"; position: absolute; left: 0; color: #bf1a3a; font-weight: 700; }
.cs-spunte b { color: #bf1a3a; }
@media (prefers-color-scheme: dark) { .cs-hero img, .cs-vantaggio img, .cs-box > img { filter: invert(1) hue-rotate(180deg); } }
@media (max-width: 720px) {
  .cs-hero, .cs-vantaggi { grid-template-columns: minmax(0, 1fr); }
  .cs-hero img { max-width: 220px; }
  .cs-box { padding: 20px 16px; }
  .doc .cs-sezione { font-size: 21px; }
}
/* "Utility": un riquadro grigio per programma, immagini (logo, QR) a sinistra e testo a destra */
.ut-sw { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; background: var(--surface-2); border-radius: 10px;
  padding: 20px 24px; margin: 12px 0; }
.ut-img { display: grid; gap: 10px; align-content: start; justify-items: center; }
.ut-img img { width: 150px; height: auto; border-radius: 12px; }
.ut-img img.ut-ico { width: 64px; border-radius: 0; }
.doc .ut-tit { color: #bf1a3a; text-transform: uppercase; font-size: 15px; font-weight: 600; letter-spacing: .02em; margin: 0 0 8px; }
.ut-sw p { color: var(--muted); font-size: 14px; text-align: justify; }
.ut-sw .cs-spunte { margin: 8px 0; font-size: 14px; }
.ut-dl { font-weight: 600; }
.ut-dl::before { content: "⬇ "; }
@media (prefers-color-scheme: dark) { .ut-img img.ut-ico { filter: invert(1) hue-rotate(180deg); } }
@media (max-width: 720px) {
  .ut-sw { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .ut-img { grid-auto-flow: column; justify-content: start; }
  .ut-img img { width: 110px; }
  .ut-sw p, .cs-testo, .cs-spunte, .cs-vantaggio p, .cs-box .cs-testo { text-align: left; }   /* giustificato su schermi stretti lascia buchi */
}
.cat-log { max-height: 260px; overflow: auto; font-size: 12px; background: var(--surface-2); padding: 10px; border-radius: 8px; white-space: pre-wrap; }
.pd-cat-form { margin: 12px 0; }
.pd-cat-form h3 { margin: 0 0 8px; }
.pd-forn-btn { margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.pd-forn-btn svg { width: 14px; height: 14px; }
.pd-forn { margin: 12px 0; }
.pd-forn h3 { margin: 0 0 8px; }
/* resi */
.st-r-richiesto { background: var(--warn-soft); color: var(--warn); }
.st-r-autorizzato, .st-r-ricevuto { background: var(--info-soft); color: var(--info); }
.st-r-completato { background: var(--ok-soft); color: var(--ok); }
.st-r-rifiutato, .st-r-annullato { background: #fde8e6; color: #b42318; }
.rs-riga { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.rs-testa { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; margin-bottom: 8px; }
/* editor delle pagine (Gestione > Pagine) */
.ed-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px 10px 0 0; border-bottom: 0; }
.ed-btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; padding: 5px 9px; font-size: 13px; cursor: pointer; }
.ed-btn:hover { background: var(--surface-2); }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-html { margin-left: auto; font-size: 13px; }
.ed-area { border-radius: 0 0 12px 12px; min-height: 360px; outline: none; max-width: none; }
.ed-area:focus { box-shadow: 0 0 0 2px var(--accent-soft) inset; }
.ed-src { width: 100%; min-height: 420px; font: 13px/1.5 ui-monospace, Consolas, monospace; padding: 12px; border: 1px solid var(--line);
  border-radius: 0 0 12px 12px; background: var(--surface); color: var(--text); box-sizing: border-box; }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-links a { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg);
  padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; gap: 14px; align-items: center; z-index: 60; transition: opacity .15s, transform .15s; font-size: 14px; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
/* con la barra della simulazione o del confronto in basso, l'avviso sale e non le copre */
body:has(#sim-bar) .toast, body:has(#cmp-bar) .toast { bottom: 84px; }
/* pulsanti-icona (togli dal carrello, dal confronto, sposta riga): senza il bordo grigio del browser, su ogni schermo */
.icon-btn { border: 0; background: none; cursor: pointer; padding: 6px; display: grid; color: inherit; }
.toast a { color: var(--accent-soft); font-weight: 700; }

@media (max-width: 980px) {
  .cols, .cart-cols { grid-template-columns: minmax(0, 1fr); }
  .panel-box.sticky { position: static; }
  .usr-label { display: none; }
}
@media (max-width: 720px) {
  .form { grid-template-columns: minmax(0, 1fr); }
  /* la terza colonna larga quanto il totale della riga: a 36px "126,00 €" perdeva il simbolo dell'euro */
  .cart-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .cart-img { width: 52px; height: 52px; }
  /* a capo: con lo sconto (listino barrato) la riga usciva dalla colonna e copriva il totale */
  .cart-qty { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 8px; justify-content: flex-start; }
  .cart-tot { grid-column: 3; grid-row: 2; white-space: nowrap; }
  .cart-row .icon-btn { grid-column: 3; grid-row: 1; justify-self: end; }
  .panel-box .cart-row { grid-template-columns: 48px minmax(0, 1fr); }
  .panel-box .cart-qty, .panel-box .cart-tot { grid-column: 2; grid-row: auto; text-align: left; }
  .usr { margin-left: auto; }
  .vat-toggle { margin-left: 0; }
  .tbl th, .tbl td { padding: 8px; }
}
.doc-dialog { border: 0; border-radius: 14px; padding: 0; width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 48px); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.doc-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.doc-dialog .doc { border: 0; }
.doc-close { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; background: var(--surface); border-radius: 8px; }
.filters .chk { align-items: center; white-space: nowrap; }
.filters .chk input { margin-top: 0; }
@media (max-width: 720px) {
  .top-inner { gap: 8px; }
  .usr { margin-left: 0; gap: 0; }
  .usr-btn { padding: 0 7px; }
  .vat-toggle { margin-left: auto; gap: 5px; }
  .vat-label { font-size: 0; }
  .vat-label::after { content: "IVA"; font-size: 12px; }
}
@media (max-width: 380px) {
  .brand-text b { font-size: 15px; }
  .brand-mark { width: 34px; height: 34px; }
  .usr-btn { padding: 0 4px; }
}

/* ---------- sconti */
.price-list { font-size: 12.5px; color: var(--faint); display: flex; gap: 6px; align-items: center; }
.price-list s { font-variant-numeric: tabular-nums; }
.disc { background: #fde8e6; color: #b42318; font-weight: 700; font-size: 11.5px; padding: 1px 6px; border-radius: 5px; }
.disc-row { color: var(--faint); }
.disc-row s { margin-right: 2px; }
.totals dd.neg { color: var(--ok); }
.btn-link { display: inline-flex; align-items: center; text-decoration: none !important; height: 38px; }
.sel-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.wide-page { max-width: none; }
.sc-wrap { max-height: calc(100vh - var(--header-h) - 120px); overflow: auto; }
.sc-tbl { font-size: 13px; }
.sc-tbl thead th { position: sticky; top: 0; z-index: 2; }
.sc-tbl td { padding: 5px 8px; vertical-align: middle; white-space: nowrap; }
/* sconti che scenderebbero sotto il prezzo d'acquisto + 3% */
.sc-h2 { margin: 28px 0 8px; font-size: 18px; }
/* simulazione dei prezzi di un cliente: barra in basso, sempre visibile */
.sim-bar { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); padding: 8px 14px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 14px; }
.sim-bar a { color: inherit; text-decoration: underline; }
.sim-bar .sim-azioni { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
@media (max-width: 600px) { .sim-bar { width: calc(100vw - 24px); justify-content: space-between; font-size: 13px; } }
/* prezzo d'acquisto, solo per i gestori */
.price-buy { margin-top: 3px; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 3px; }
.price-buy.low { color: #b42318; }
.sc-tbl td.sc-marg-basso { color: #b42318; font-weight: 600; }
.sc-margine label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.filters.sc-margine input { width: 80px; text-align: right; }
.filters input.sc-cod-q { width: 170px; }
.sc-h2 small { display: block; font-size: 13px; font-weight: 400; margin-top: 2px; }
.sc-alert { display: inline-block; background: #fde8e6; color: #b42318; border-radius: 6px; font-size: 11px; font-weight: 600; padding: 0 6px; line-height: 18px; }
.sc-tbl tr.sotto-costo > td:first-child { box-shadow: inset 3px 0 0 #d92d20; }
.sc-tbl tr.lv-articolo.sotto-costo > td:not(.uff):not(.ext) { background: #fff1f0; }
@media (prefers-color-scheme: dark) { .sc-alert { background: #4a1d1a; color: #ffb4ab; } .sc-tbl tr.lv-articolo.sotto-costo > td:not(.uff):not(.ext) { background: #2d1614; } }
.sc-tbl th.uff, .sc-tbl td.uff { background: #fff8d6; }
.sc-tbl th.ext, .sc-tbl td.ext { background: #fff2c2; }
@media (prefers-color-scheme: dark) { .sc-tbl th.uff, .sc-tbl td.uff { background: #2e2a14; } .sc-tbl th.ext, .sc-tbl td.ext { background: #36301a; } }
.sc-tbl input.sc { width: 58px; height: 28px; border: 1px solid var(--line-strong); border-radius: 6px; text-align: right; padding: 0 6px; background: var(--surface); font-size: 13px; }
.sc-tbl input.sc::placeholder { color: var(--faint); opacity: .8; }
.sc-tbl tr.own input.sc { border-color: var(--accent); font-weight: 700; color: var(--accent); }
.sc-tbl tr.lv-globale td { font-weight: 700; border-bottom: 2px solid var(--accent); }
.sc-tbl tr.lv-marca td { font-weight: 600; background-image: linear-gradient(var(--surface-2), var(--surface-2)); }
.sc-tbl tr.lv-marca td.uff, .sc-tbl tr.lv-marca td.ext { background-image: none; }
.sc-tbl tr.lv-articolo td { font-size: 12.5px; }
.sc-tbl tr.saving { opacity: .5; }
/* nascosto al cliente: riga sbiadita e barrata (la casella resta ben visibile per toglierla) */
.sc-tbl tr.sc-nascosto > td:not(:has(.sc-hide)) { opacity: .45; }
.sc-tbl tr.sc-nascosto .sc-name { text-decoration: line-through; }
.sc-tbl input.sc-hide { width: 16px; height: 16px; accent-color: #d92d20; cursor: pointer; }
.sc-tbl input.sc-hide:disabled { cursor: not-allowed; }
.sc-tbl .b { font-weight: 700; }
.sc-tbl .ok { color: var(--ok); font-weight: 600; }
.sc-name { display: inline-flex; align-items: center; gap: 4px; white-space: normal; min-width: 220px; }
/* riga articolo: il codice sempre intero (mai tagliato con i puntini), sopra la descrizione */
.sc-name.sc-art { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.sc-cod { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; }
.sc-tog { width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); cursor: pointer; padding: 0; line-height: 1; flex: none; }
.sc-tog-sp { display: inline-block; width: 20px; flex: none; }
.print-cli { break-inside: avoid; margin-bottom: 18px; }
.print-cli h2 { font-size: 16px; margin: 14px 0 6px; }
@media print {
  .top, .foot, .no-print, .tabs, .pd-back, #toast { display: none !important; }
  body { background: #fff; color: #000; }
  .layout { padding: 0; }
  .print-page .tbl { font-size: 11px; }
  .table-wrap, .print-page table { border: 1px solid #999; }
}
.link-box { border-color: var(--accent); }
.link-row { display: flex; gap: 8px; margin: 8px 0; }
.link-row input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; background: var(--surface-2); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.link-row .btn-sm { height: 38px; }
.ss-scegli { margin-top: 12px; }
.ss-scegli .link-row input { font-family: inherit; font-size: 14px; }

/* ---------- sicurezza e privacy */
.qr { margin: 10px 0; }
.qr img { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
code.key { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; font-size: 14px; letter-spacing: .05em; user-select: all; }
.steps { padding-left: 20px; line-height: 1.6; }
details.canc summary { cursor: pointer; color: #b42318; font-weight: 600; margin-top: 6px; }
.tbl tr.riga-warn td { background: var(--warn-soft); }
.nowrap { white-space: nowrap; }
.filters input[type=date] { height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--surface); }

/* ---------- aspetto personalizzato (logo, colori, venditore) */
.brand-mark.has-logo { background: none; width: auto; height: 40px; border-radius: 0; }
.brand-mark.has-logo img { height: 40px; width: auto; max-width: 200px; object-fit: contain; display: block; }
.foot-main { display: flex; flex-direction: column; gap: 2px; }
.logo-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; margin: 6px 0 8px; }
.logo-row > div:last-child { flex: 1 1 200px; min-width: 0; }
.logo-row input[type=file] { max-width: 100%; }
.logo-prev { width: 140px; height: 70px; border: 1px dashed var(--line-strong); border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); flex: none; overflow: hidden; }
.logo-prev img { max-width: 130px; max-height: 60px; object-fit: contain; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); cursor: pointer; }
.color-row input[type=text] { width: 110px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.color-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; border: 1px solid var(--line-strong); }
.da-compilare { background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; }
@media (max-width: 380px) { .brand-mark.has-logo, .brand-mark.has-logo img { height: 34px; } }

/* ---------- preventivi */
.st-bozza { background: var(--surface-2); color: var(--muted); }
.st-inviato { background: var(--info-soft); color: var(--info); }
.st-vinto { background: var(--ok-soft); color: var(--ok); }
.st-perso { background: #fde8e6; color: #b42318; }
.pv-sporco { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 2px 8px; border-radius: 10px; }
.pv-azioni .chk { gap: 6px; }
.pv-azioni select { height: 38px; }
.pv-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pv-tbl th { white-space: nowrap; }
.pv-tbl td { padding: 6px 6px; vertical-align: middle; }
.pv-tbl td.pv-d { min-width: 240px; width: 40%; }
.pv-tbl textarea { width: 100%; min-height: 34px; resize: vertical; font: inherit; font-size: 13.5px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); }
.pv-n { width: 84px; height: 34px; text-align: right; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px; }
.pv-n.pv-q { width: 64px; }
.pv-n.pv-p { width: 66px; }
.pv-n.bad, .pv-page .fld .bad { border-color: #b42318; outline: 1px solid #b42318; }
.pv-conta { text-align: center; margin: 16px 0 0; }
#pv-fino { align-self: end; margin: 0 0 10px; }
.pv-calc { white-space: nowrap; }
.pv-calc select, .pv-def select { height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 6px; background: var(--surface); color: var(--text); font-size: 13px; }
.pv-mv { white-space: nowrap; }
.pv-mv .icon-btn { width: 24px; height: 28px; font-size: 13px; }
.pv-tbl tr.pv-testo td { background: var(--surface-2); }
.pv-tbl tr.pv-testo textarea { min-height: 52px; line-height: 1.45; }
.pv-testo-piede { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.pv-testo-piede .pv-opz { margin-top: 0; }
.pv-testo-q { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pv-testo-lab { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 3px 2px; }
.pv-tbl tr.ko td { background: #fde8e6; }
.pv-tbl tr.pv-gruppo td { background: var(--accent-soft); font-weight: 600; }
.pv-tbl input.pv-gr { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.pv-tbl .pv-opz { margin-top: 4px; font-size: 12px; color: var(--muted); gap: 4px; }
.pv-tbl tr.pv-opz-riga td[data-c="tot"], .pv-tbl tr.pv-opz-riga td[data-c="marg"] { color: var(--muted); text-decoration: line-through; }
.pv-tbl td.pv-fine { white-space: nowrap; }
.pv-pronte, .pv-cond-pronte select { height: 40px; max-width: 280px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; background: var(--surface); color: var(--text); font-size: 13.5px; }
.pv-cond-pronte { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.pv-cond-pronte select { height: 34px; }
.pv-chiudi { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 10px 0 4px; }
.pv-chiudi .fld { flex: 1; min-width: 140px; margin: 0; }
.pv-testi { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; max-height: 40vh; overflow: auto; }
.pv-testi li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pv-testi li .pv-descr { flex: 1; }
.pv-dlg h3 { margin: 4px 0 0; font-size: 14px; }
.pv-neg { color: #b42318; font-weight: 600; }
.totals dd.pv-neg { color: #b42318; }
.pv-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 8px; }
.pv-cerca { position: relative; flex: 1; min-width: min(100%, 260px); }
.pv-cerca input { width: 100%; height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: var(--surface); color: var(--text); font-size: 14px; }
.pv-cerca input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.pv-ris { position: absolute; z-index: 30; left: 0; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 380px; overflow: auto; }
.pv-ri { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 12px; cursor: pointer; color: var(--text); font: inherit; font-size: 13.5px; }
.pv-ri:hover, .pv-ri:focus { background: var(--accent-soft); outline: none; }
.pv-ri small { display: block; margin-top: 2px; }
/* foto degli articoli: nell'editor, nei risultati della ricerca e in stampa (icona se l'articolo non ha foto) */
.pv-foto, .pv-ri-foto { display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: var(--faint); }
.pv-foto { width: 48px; height: 48px; margin-bottom: 4px; }
.pv-ri-foto { width: 40px; height: 40px; }
.pv-foto img, .pv-ri-foto img { width: 100%; height: 100%; object-fit: contain; }
.pv-foto .ico, .pv-ri-foto .ico { width: 22px; height: 22px; }
.pv-foto .ph .ico, .pv-ri-foto .ph .ico { width: 22px; height: 22px; }
.pv-st-tbl td.pv-st-foto, .pv-st-tbl th.pv-st-foto { width: 66px; padding-right: 2px; }
.pv-st-foto img { display: block; width: 60px; height: 60px; object-fit: contain; }
.pv-st-tbl tr { break-inside: avoid; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.pv-nessuno { padding: 10px 12px; margin: 0; }
.pv-def { margin: 0 0 10px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv-solo { margin-top: 18px !important; }
.pv-solo small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.pv-da-carrello { margin-top: 8px; }
.pv-dlg { padding: 20px 22px; display: grid; gap: 12px; }
.pv-dlg h2 { margin: 0; font-size: 18px; }
.pv-scelte { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.pv-dlg-q { max-width: 140px; }
.pv-intest { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; line-height: 1.5; }
.pv-dest { min-width: 240px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
.pv-az { font-size: 18px; }
.pv-logo { display: block; max-width: 240px; max-height: 80px; object-fit: contain; margin-bottom: 8px; }
.pv-stampa-opz { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: 13px; }
.pv-stampa-opz b { color: var(--muted); font-weight: 500; }
.pv-descr, .pv-lungo { white-space: pre-line; }
.pv-st-tbl tr.pv-st-testo td { color: var(--muted); }
.pv-st-tbl tr.pv-st-gruppo td { font-weight: 700; padding-top: 14px; border-bottom: 2px solid var(--line-strong); }
.pv-st-tbl tr.pv-st-sub td { font-weight: 600; background: var(--surface-2); }
.pv-st-tbl tr.pv-st-opz td { color: var(--muted); }
.pv-st-opzlab { font-style: italic; font-size: 12px; }
.pv-st-opztot { text-align: right; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
/* aspetto dei preventivi stampati: colore del cliente (--pv-c) e stile (classico, moderno, essenziale) */
.pv-stampa { --pv-c: #1f5fae; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pv-stampa h1, .pv-stampa h2 { color: var(--pv-c); }
.pv-stampa .pv-st-tbl thead th { color: var(--pv-c); border-bottom: 2px solid var(--pv-c); }
.pv-stampa .pv-st-tbl tr.pv-st-gruppo td { color: var(--pv-c); border-bottom-color: var(--pv-c); }
.pv-stampa .totals .tot { color: var(--pv-c); }
.pv-intro { margin: 10px 0 16px; line-height: 1.55; }
.pv-st-riep { width: auto; min-width: min(100%, 420px); margin-bottom: 8px; }
.pv-st-riep td { padding: 6px 10px; }
.pv-st-riep td.r { padding-left: 40px; }
.pv-st-riep tr.tot td { font-weight: 700; color: var(--pv-c); border-top: 2px solid var(--pv-c); }
.pv-chiusura { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 26px; break-inside: avoid; }
.pv-firma { display: flex; flex-direction: column; gap: 2px; }
.pv-firma p { margin: 0 0 6px; }
.pv-firma img { max-width: 200px; max-height: 70px; object-fit: contain; align-self: flex-start; margin: 2px 0 4px; }
.pv-firma span { color: var(--muted); font-size: 13px; }
.pv-accetta { display: grid; gap: 22px; padding: 12px 16px 16px; border: 1px solid var(--line-strong); border-radius: 8px; }
.pv-accetta span { border-bottom: 1px solid var(--line-strong); padding-top: 14px; font-size: 12px; color: var(--muted); }
.pv-stile-moderno .pv-intest { background: var(--pv-c); color: #fff; padding: 18px 20px; border-radius: 10px; }
.pv-stile-moderno .pv-intest .pv-logo { background: #fff; padding: 6px 10px; border-radius: 6px; }
.pv-stile-moderno .pv-dest { background: #fff; color: #1f2937; border: 0; }
.pv-stile-moderno .pv-dest .muted { color: #6b7280; }
.pv-stile-moderno h1 { font-size: 28px; letter-spacing: -.01em; }
.pv-stile-moderno .pv-st-tbl thead th, .pv-stile-moderno .pv-st-riep tr.tot td { background: var(--pv-c); color: #fff; border-color: var(--pv-c); }
.pv-stile-moderno .pv-st-tbl tr.pv-st-gruppo td { background: color-mix(in srgb, var(--pv-c) 12%, transparent); }
.pv-stile-essenziale .pv-dest { border: 0; padding: 0; text-align: right; }
.pv-stile-essenziale h1 { font-weight: 400; font-size: 26px; border-bottom: 1px solid var(--pv-c); padding-bottom: 6px; }
.pv-stile-essenziale .table-wrap { border: 0; }
.pv-stile-essenziale .pv-st-tbl thead th { border-bottom-width: 1px; font-weight: 600; }
.pv-stile-essenziale .pv-st-tbl tr.pv-st-sub td { background: none; border-top: 1px solid var(--line-strong); }
.pv-asp-col { display: flex; align-items: center; gap: 12px; }
.pv-asp-col input[type=color] { width: 56px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.pv-asp-form { margin-top: 14px; }
.pv-asp-firma { display: grid; gap: 6px; }
@media (max-width: 600px) { .pv-chiusura { grid-template-columns: 1fr; } }
/* piè di pagina scelto dal cliente anche in fondo all'offerta (Safari e Firefox non stampano i margini di @page) */
.pv-piede-st { margin: 24px 0 0; padding-top: 8px; border-top: 1px solid var(--line); break-inside: avoid; }
/* «Salva» in fondo all'editor del preventivo: solo sul telefono, con modifiche non salvate (sticky come .set-salva) */
.pv-salva-basso { display: none; }
@media (max-width: 720px) { .pv-salva-basso { display: flex; } }
@media print {
  .pv-stampa { font-size: 12px; }
  .pv-accetta, .pv-accetta span { border-color: #888; }
}
.pv-st-tot { max-width: 340px; margin: 14px 0 0 auto; }
.pv-stampa h2 { font-size: 14px; margin: 18px 0 4px; }
@media (max-width: 720px) {
  .pv-cols { grid-template-columns: minmax(0, 1fr); }
}
/* righe del preventivo sul telefono: ogni riga e' una scheda, niente tabella larga tre schermi da scorrere di lato
   (etichette da data-l, ordine dei campi da data-col / data-c) */
@media (max-width: 720px) {
  .pv-wrap { overflow: visible; border: 0; background: none; }
  .pv-tbl, .pv-tbl tbody { display: block; }
  .pv-tbl thead { display: none; }
  .pv-tbl tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; padding: 12px; margin-bottom: 10px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
  .pv-tbl tr.pv-testo { background: var(--surface-2); }
  .pv-tbl tr.pv-gruppo { background: var(--accent-soft); }
  .pv-tbl tr.ko { background: #fde8e6; }
  .pv-tbl td, .pv-tbl td.r { display: block; padding: 0; border: 0; min-width: 0; width: auto; background: none !important; text-align: left; }
  .pv-tbl td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 3px; font-size: 11px; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .pv-tbl td:empty { display: none; }
  .pv-tbl td.code { grid-column: 1 / -1; order: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
  .pv-tbl td.code br { display: none; }
  .pv-tbl td.code .pv-foto { margin: 0; }
  .pv-tbl td.pv-d, .pv-tbl td.pv-grt { grid-column: 1 / -1; order: 2; min-width: 0; width: auto; }
  .pv-tbl td.pv-grl { display: none; }
  .pv-tbl td[data-col="listino"] { order: 3; }
  .pv-tbl td[data-col="acq"] { order: 4; }
  .pv-tbl td.pv-calc { grid-column: 1 / -1; order: 5; white-space: normal; }
  .pv-tbl td[data-col="qty"] { order: 6; }
  .pv-tbl td[data-col="prezzo"] { order: 7; }
  .pv-tbl td[data-c="tot"], .pv-tbl td[data-c="sub"] { order: 8; font-weight: 700; }
  .pv-tbl td[data-c="marg"] { order: 9; }
  .pv-tbl td.pv-mv { order: 10; grid-column: 1; display: flex; gap: 6px; align-self: center; }
  .pv-tbl td.pv-fine { order: 11; grid-column: 2; display: flex; gap: 6px; justify-content: flex-end; align-self: center; }
  .pv-tbl .pv-n, .pv-tbl .pv-n.pv-q { width: 100%; max-width: 160px; text-align: left; }
  .pv-tbl .pv-calc select { max-width: 100%; }
  .pv-tbl .pv-mv .icon-btn, .pv-tbl .pv-fine .icon-btn { width: 40px; height: 40px; }
  .pv-testo-piede { gap: 10px 18px; }
}
@media print {
  .pv-stampa .table-wrap { border: 0; }
  .pv-dest { border-color: #999; }
}

/* scelta dei pagamenti (quelli di StoreSync sono oltre cento) */
.pag-scelta { max-height: 280px; overflow: auto; display: grid; gap: 4px; padding: 4px 0; }
.chk[hidden], tr[hidden] { display: none; }
.pag-filtro, #pag-filtro { width: 100%; max-width: 320px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; }

/* confronto articoli */
.cmp-btn { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.4; cursor: pointer;
  opacity: 0; transition: opacity .15s; }
.cmp-btn svg, .cmp-pd svg, .cmp-bar svg { width: 15px; height: 15px; }
.card:hover .cmp-btn, .card:focus-within .cmp-btn, .cmp-btn.on, .cmp-btn:focus-visible { opacity: 1; }
@media (hover: none) { .cmp-btn { opacity: 1; } }
.cmp-btn.on, .cmp-pd.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cmp-bar { position: fixed; right: 14px; bottom: 14px; z-index: 59; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: #1f2937; color: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; }
.cmp-bar span { display: inline-flex; align-items: center; gap: 6px; }
.cmp-bar .link-btn { color: #cbd5e1; }
body:has(#sim-bar) .cmp-bar { bottom: 74px; }
@media (max-width: 600px) { .cmp-bar { left: 12px; right: 12px; justify-content: space-between; } }
.cmp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 6px 0 12px; }
.cmp-head h1 { margin: 0; }
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cmp-tbl { border-collapse: separate; border-spacing: 0; width: 100%; min-width: calc(150px + var(--n) * 190px); table-layout: fixed; }
.cmp-tbl th, .cmp-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; font-size: 13.5px; overflow-wrap: anywhere; }
.cmp-tbl .cmp-lab { position: sticky; left: 0; z-index: 1; width: 150px; background: var(--surface); color: var(--muted); font-weight: 600; }
.cmp-tbl thead th { background: var(--surface); }
.cmp-tbl .cmp-sec th { position: static; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cmp-tbl tr.is-diff td, .cmp-tbl tr.is-diff .cmp-lab { background: var(--warn-soft); }
.cmp-tbl tr.is-diff td { font-weight: 600; }
.cmp-tbl tr[hidden] { display: none; }
.cmp-tbl .best .price-main { color: var(--ok); }
.cmp-tbl .best::after { content: "il più conveniente"; display: block; color: var(--ok); font-size: 12px; font-weight: 600; }
.cmp-prod { position: relative; padding-right: 26px; }
.cmp-prod a { color: inherit; text-decoration: none; }
.cmp-prod .cmp-togli { position: absolute; top: -2px; right: -4px; }
.cmp-img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #fff; border-radius: 8px; overflow: hidden; margin-bottom: 6px; position: relative; }
.cmp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.cmp-name { font-weight: 600; font-size: 14px; margin: 2px 0 4px; }
.cmp-buy td { border-bottom: 0; }
.cmp-uno { max-width: 280px; margin: 12px auto; }
@media (max-width: 600px) { .cmp-tbl { min-width: calc(108px + var(--n) * 165px); } .cmp-tbl .cmp-lab { width: 108px; font-size: 12.5px; } .cmp-tbl th, .cmp-tbl td { padding: 7px 8px; } }

/* avanzamento dell'ordine (da StoreSync) */
.fasi { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 12px; }
.fasi .fase { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.fasi .fase.fatta { background: var(--ok-soft); border-color: var(--ok-soft); color: var(--ok); }
.fasi .fase.ora { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fasi .fase.ann { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.avanz .tbl .r { text-align: right; }
/* ordini fatti fuori dal sito, letti da StoreSync */
.storico { margin-top: 32px; }
.storico h2 { font-size: 20px; margin: 0 0 4px; }
.tbl tr.muted td { color: var(--muted); }
/* miniature degli articoli nelle righe di ordini e resi */
.riga-art { display: flex; align-items: center; gap: 10px; min-width: 0; }
.riga-img { flex: none; width: 44px; height: 44px; border-radius: 6px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; color: var(--line-strong); }
.riga-img img { width: 100%; height: 100%; object-fit: contain; }
.rs-testa .riga-art { align-items: flex-start; }
input[readonly] { background: var(--surface-2); color: var(--muted); }
/* ---------- statistiche dei gestori (web/statistiche.js). Colori dei canali fissi (sito, telefono/banco, altri online),
   verificati per daltonismo e contrasto sugli sfondi del tema chiaro e scuro */
:root { --viz-1: #2a78d6; --viz-2: #eb6834; --viz-3: #1baf7a; --viz-tutti: #aeb7c4; --viz-grid: #e9ecf1; --viz-axis: #c3cad4; --st-giu: #b42318; }
@media (prefers-color-scheme: dark) {
  :root { --viz-1: #3987e5; --viz-2: #d95926; --viz-3: #199e70; --viz-tutti: #56616f; --viz-grid: #232b37; --viz-axis: #39434f; --st-giu: #ff9b8f; }
}
.page h1.st-h1 { margin: 0 0 8px; }
.st-h2 { font-size: 18px; margin: 22px 0 10px; letter-spacing: -.01em; }
.st-filtri { margin-bottom: 4px; }
.st-seg button { padding: 7px 12px; font-weight: 600; font-size: 13px; display: inline-block; }
.st-fonte { margin: 0 0 14px; }
.st-fonte .link-btn { padding: 0 0 0 6px; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 10px; margin-bottom: 14px; }
.st-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow); min-width: 0; }
.st-kpi-l { color: var(--muted); font-size: 12.5px; }
.st-kpi-v { font-size: 22px; font-weight: 650; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.st-kpi-x { font-size: 12.5px; }
.st-delta { font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.st-delta.su { color: var(--ok); }
.st-delta.giu { color: var(--st-giu); }
.st-griglia { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(560px, 100%), 1fr)); gap: 14px; margin-bottom: 14px; align-items: start; }
.st-griglia .panel-box { margin-bottom: 0; }
.st-box > p { margin: -4px 0 10px; }
.st-box .table-wrap, .panel-box .table-wrap { margin-bottom: 8px; }
.st-cols-pari { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tbl.st-tbl th, .tbl.st-tbl td { padding: 7px 10px; }
.tbl.st-tbl td small { font-size: 12px; }
.st-tbl tr.st-apribile { cursor: pointer; }
.st-tbl tr.st-apribile:hover td, .st-tbl tr.st-apribile:focus-visible td { background: var(--accent-soft); }
.st-tbl tr.st-apribile[aria-expanded="true"] .st-freccia { transform: rotate(90deg); }
.st-freccia { display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.st-tbl tr.st-figlio td:first-child { padding-left: 34px; color: var(--muted); }
.st-cbar { min-width: 120px; }
.st-cbar > small, .st-due > span > small { display: inline-block; min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.st-due > span { display: flex; align-items: center; gap: 6px; }
.st-due > span + span { margin-top: 3px; }
.st-bar { display: inline-block; vertical-align: middle; width: calc(100% - 50px); min-width: 50px; max-width: 160px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-right: 6px; }
.st-due .st-bar { margin-right: 0; flex: 1; }
.st-bar i { display: block; height: 100%; border-radius: 3px; background: var(--viz-1); }
.st-bar.tutti i { background: var(--viz-tutti); }
.st-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--muted); }
.st-key.st-tutti { background: var(--viz-tutti); }
.st-s0 { fill: var(--viz-1); background: var(--viz-1); }
.st-s1 { fill: var(--viz-2); background: var(--viz-2); }
.st-s2 { fill: var(--viz-3); background: var(--viz-3); }
.st-grafico { position: relative; }
.st-svg svg { display: block; overflow: visible; outline: none; }
.st-svg svg:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 4px; }
.st-legenda { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }
.st-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.st-grid { stroke: var(--viz-grid); stroke-width: 1; }
.st-base { stroke: var(--viz-axis); stroke-width: 1; }
.st-ax { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.st-hit { fill: transparent; cursor: crosshair; }
.st-col { transition: opacity .12s; }
.st-col.spento { opacity: .35; }
.st-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: 8px 10px; font-size: 12.5px; min-width: 190px; }
.st-tip > b { display: block; margin-bottom: 4px; font-weight: 600; color: var(--muted); }
.st-tip-r { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }
.st-tip-r > span:last-child, .st-tip-r > b { text-align: right; }
.st-tip .st-key { width: 12px; height: 2px; border-radius: 1px; margin: 0; vertical-align: middle; }
.st-tip-r:last-child:not(:first-of-type) b { color: var(--text); }
.st-tabella { margin-top: 10px; font-size: 13px; }
.st-tabella summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.st-tabella .table-wrap { max-height: 320px; overflow-y: auto; margin-top: 8px; }
.st-dl { margin: 10px 0 0; }
@media (max-width: 980px) { .st-cols-pari { grid-template-columns: minmax(0, 1fr); } }

/* magazzino (magazzino.js): usa le parti delle statistiche */
.mg-filtri { align-items: flex-end; }
.mg-fil { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: min(260px, 100%); }
.mg-fil > span { color: var(--muted); font-weight: 500; }
.mg-fil select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); padding: 0 8px; max-width: 100%; }
.mg-seg { flex-wrap: wrap; margin-bottom: 10px; width: fit-content; max-width: 100%; }
.mg-seg button small { font-weight: 500; opacity: .8; margin-left: 2px; }
.mg-spiega { margin: 0 0 8px; max-width: 900px; }
.mg-testa { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mg-tbl th { white-space: nowrap; }
.mg-tbl td.r { white-space: nowrap; }
.mg-ord { border: 0; background: none; padding: 0; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.mg-ord:hover, .mg-ord:focus-visible { color: var(--accent); }
.mg-riassunto li { padding: 6px 0; }
.mg-riassunto .link-btn { padding: 0; }

/* wizard impianto di videosorveglianza (preventivi.js) */
.wz-dialog { width: min(980px, calc(100vw - 32px)); }
.wz { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.wz-head { position: relative; padding: 18px 22px 10px; border-bottom: 1px solid var(--line); }
.wz-head h2 { margin: 0 36px 6px 0; font-size: 18px; }
.wz-head p { margin: 0; }
.wz-close { position: absolute; top: 14px; right: 14px; }
.wz-chat { flex: 1 1 auto; overflow: auto; padding: 14px 22px; display: grid; gap: 10px; align-content: start; min-height: 110px; }
.wz-vuoto { margin: 0; }
.wz-chat { max-height: 34vh; }
.wz-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.wz-msg.utente { justify-self: end; background: var(--accent-soft); border-bottom-right-radius: 4px; }
.wz-msg.assistente { justify-self: start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.wz-msg small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.wz-prop { border-top: 1px solid var(--line); padding: 12px 22px; max-height: 46vh; overflow: auto; }
.wz-prop h3 { margin: 0 0 4px; font-size: 15px; }
.wz-prop p { margin: 4px 0; }
.wz-prop ul { margin: 2px 0 8px 18px; padding: 0; font-size: 13px; }
.wz-tbl td { vertical-align: top; padding: 6px 6px; }
.wz-tbl .pv-foto { float: left; margin: 0 6px 0 0; }
.wz-motivo { display: block; color: var(--muted); font-size: 12px; }
.wz-tipi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 18px 22px 22px; }
.wz-tipo { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.wz-tipo:hover:not(:disabled), .wz-tipo:focus-visible { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.wz-tipo b { font-size: 16px; }
.wz-tipo:disabled { cursor: not-allowed; opacity: .65; }
.wz-tipo-ico { font-size: 26px; line-height: 1; }
.wz-presto { margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.wz-tbl .wz-gruppo td { background: var(--surface-2); font-weight: 600; padding: 6px 8px; }
.wz-tbl tr.wz-opz td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
/* scheda dell'allarme (wizard a tre passi) */
.wz-dialog.wz-largo { width: min(1220px, calc(100vw - 32px)); }
.wz-dialog.wz-largo .wz-chat { max-height: 66vh; }
.wza { padding: 0 22px 14px; overflow: auto; max-height: 72vh; }
.wza-passi { display: flex; gap: 6px; list-style: none; margin: 12px 0; padding: 0; flex-wrap: wrap; position: sticky; top: 0; background: var(--surface); z-index: 2; padding-bottom: 6px; }
.wza-passi button { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.wza-passi button[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.wza-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 18px; }
.wza-campo { position: relative; display: grid; gap: 4px; align-content: start; font-size: 13.5px; }
.wza-campo > label:not(.chk) { font-weight: 600; font-size: 13px; }
.wza-campo select, .wza-campo input[type=number], .wza-campo textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.wza-campo textarea { resize: vertical; }
.wza-campo.wza-largo { grid-column: 1 / -1; }
.wza-campo.predef select, .wza-campo.predef input[type=number], .wza-campo.predef .chk { color: var(--muted); }
.wza-predef { justify-self: start; font-size: 11px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 0 6px; font-weight: 400; }
.wza-piede { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.wza-stanze { display: grid; gap: 16px; }
.wza-stanze.con-pianta { grid-template-columns: minmax(280px, 42%) 1fr; align-items: start; }
.wza-pianta { margin: 0; position: sticky; top: 52px; }
.wza-pianta img { width: 100%; max-height: 62vh; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.wza-elenco { display: grid; gap: 10px; min-width: 0; }
.wza-strumenti { display: flex; gap: 10px 14px; align-items: flex-start; flex-wrap: wrap; }
.wza-file { cursor: pointer; }
.wza-veloce { flex: 1 1 320px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.wza-veloce summary { cursor: pointer; font-size: 13.5px; font-weight: 600; }
.wza-veloce-campi { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; padding: 8px 0 4px; }
.wza-veloce-campi label { display: grid; gap: 2px; }
.wza-veloce-campi input { width: 90px; font: inherit; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.wza-stanza { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.wza-st-testa { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wza-st-testa select, .wza-st-testa input, .wza-cont input, .wza-ragg select { font: inherit; font-size: 13.5px; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.wza-st-nome { flex: 1 1 160px; min-width: 0; font-weight: 600; }
.wza-mq { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.wza-mq input { width: 72px; }
.wza-st-az { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; }
.wza-st-conti { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: flex-end; }
.wza-cont, .wza-ragg { display: grid; gap: 2px; }
.wza-cont-ctl { display: inline-flex; align-items: center; gap: 2px; }
.wza-cont-ctl .icon-btn { width: 32px; height: 32px; font-size: 18px; }
.wza-cont input { width: 52px; text-align: center; }
.wza-chip { display: flex; gap: 6px; flex-wrap: wrap; }
.wza-ch { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; }
.wza-ch.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
.wza-ch:focus-visible { outline: 2px solid var(--accent); }
.wza-altri summary { cursor: pointer; font-size: 12px; color: var(--accent); padding: 3px 4px; list-style: none; }
.wza-altri summary::-webkit-details-marker { display: none; }
.wza-altri[open] { flex-basis: 100%; }
.wza-altri .wza-chip { margin-top: 4px; }
.wza-aggiungi { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wza-conta { margin: 2px 0; }
.wza-livelli { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.wza-livelli legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.wza-livello { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.wza-livello input { position: absolute; opacity: 0; pointer-events: none; }
.wza-livello.on { border-color: var(--accent); background: var(--accent-soft); }
.wza-prezzo { margin-top: 4px; font-size: 13.5px; }
.wza-extra { display: grid; gap: 10px; margin: 12px 0; }
.wza-box { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: grid; gap: 6px; }
.wza-box summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.wza-box p, .wza-box ul { margin: 2px 0; }
.wza-conf-righe { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.wza-conf { display: grid; gap: 3px; align-content: start; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; }
.wza-conf.on { border-color: var(--accent); background: var(--accent-soft); }
.wza-conf .btn-outline { justify-self: start; margin-top: 4px; }
.wza-testo { display: block; margin-top: 2px; }
.wza-nota-prezzi { grid-column: 1 / -1; margin: 0; }
.wza-livello:focus-within { outline: 2px solid var(--accent); }
@media (max-width: 760px) {
  .wza { padding: 0 12px 12px; max-height: none; }
  .wza-stanze.con-pianta { grid-template-columns: 1fr; }
  .wza-pianta { position: static; }
  .wza-st-az { margin-left: 0; }
  .wza-st-conti { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .wza-cont-ctl .icon-btn { width: 40px; height: 40px; }
  .wza-cont input { width: 44px; }
  .wza-ch { padding: 7px 11px; font-size: 13px; }
}
.wz-opz-lab { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 11px; font-weight: 400; color: var(--muted); }
.wz-tot { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.wz-form { border-top: 1px solid var(--line); padding: 12px 22px 16px; display: grid; gap: 8px; }
.wz-form textarea { width: 100%; resize: vertical; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.wz-form textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.wz-azioni { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
@media print { .wz-dialog { display: none; } }

/* ---------- telefono: niente zoom dell'iPhone sui campi, pulsanti grandi abbastanza per il dito.
   Anche col telefono in orizzontale (largo fino a 930px ma basso: schermo touch alto meno di 500px) */
@media (max-width: 720px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  /* sotto i 16px l'iPhone ingrandisce la pagina quando si tocca un campo (e poi non torna indietro da solo) */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=submit]):not([type=button]),
  select, textarea { font-size: 16px !important; }
  .tn-tog { width: 36px; height: 36px; }
  .tn-link { padding-top: 7px; padding-bottom: 7px; }
  .wz-close, .wza [data-wza="togli"] { min-width: 40px; min-height: 40px; }
  /* valori dei filtri: ogni spunta rilancia la ricerca, righe alte abbastanza da non prendere quella accanto */
  .fv { padding: 9px 0; min-height: 40px; }
  .fv input { width: 20px; height: 20px; }
  .fg-more { padding: 10px 0; }
}
/* le barre in basso (confronto, simulazione) non coprono la fine della pagina */
body:has(#cmp-bar), body:has(#sim-bar) { padding-bottom: 84px; }
/* ...ne' la fine del pannello Filtri aperto (sul telefono e' a tutta altezza e scorre per conto suo) */
body:has(.side.open) .cmp-bar, body:has(.side.open) .sim-bar { display: none; }
/* accessi (accessi.js): usa le parti delle statistiche */
.ac-online { margin: 0 0 14px; font-size: 14px; }
.ac-punto { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px var(--ok-soft); }
.ac-segn { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.ac-segn li { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
.ac-segn li.ac-alta { border-left-color: var(--st-giu); }
.ac-segn p { margin: 4px 0 0; font-size: 13.5px; }
.ac-segn-testa { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 2px; }
.ac-liv { font-size: 12px; font-weight: 650; color: var(--warn); text-transform: uppercase; letter-spacing: .03em; }
.ac-alta .ac-liv { color: var(--st-giu); }
.badge.ac-badge-alta { background: var(--st-giu); }
.ac-spiega summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 13px; }
.ac-spiega ul { margin: 8px 0 0; padding-left: 18px; }
.ac-spiega li { margin-bottom: 4px; }
.ac-h3 { font-size: 14px; margin: 14px 0 6px; }
.ac-ore { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 70px; align-items: end; }
.ac-ore span { height: 100%; display: flex; align-items: flex-end; }
.ac-ore i { display: block; width: 100%; background: var(--viz-1); border-radius: 2px 2px 0 0; min-height: 1px; }
.ac-ore-ax { display: flex; justify-content: space-between; margin-top: 2px; }

/* ordine telefonico (Gestione, web/ordini-telefonici.js) */
.ot-cerca { position: relative; margin-bottom: 12px; }
.ot-cerca input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; }
.ot-esiti { position: absolute; z-index: 20; left: 0; right: 0; top: 42px; max-height: 420px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.ot-esiti > p { margin: 8px; }
.ot-esito { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
.ot-esito:hover, .ot-esito:focus { background: var(--accent-soft); }
.ot-esito-txt { flex: 1; min-width: 0; font-size: 13.5px; }
.ot-esito-pz { text-align: right; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; }
.ot-art-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tbl.edit.ot-tbl td { padding: 6px 8px; }
.tbl.edit.ot-tbl input.ot-qty { width: 64px; text-align: right; }
.tbl.edit.ot-tbl input.ot-prezzo { width: 84px; text-align: right; }
.ot-tbl input.bad { border-color: #c0392b; }
.ot-neg, .ot-err { color: #c0392b; }
.ot-avv { color: var(--warn); }
