/* Lattina Configurator – frontend
 * Tutte le regole sono legate al contenitore con specificità da ID (:is(#lc-scope,.lc-root)), così gli stili del
 * tema (pulsanti, tabelle, campi) non le sovrascrivono. Il reset qui sotto usa :where(.lc-app)
 * e quindi resta più debole delle regole dei componenti ma più forte di quelle del tema.
 */
/* Basta il selettore base: con la specificità da ID batte anche button:hover/:focus del tema,
 * mentre le regole dei componenti (es. .lc-card:hover) restano più forti. */
:is(#lc-scope,.lc-root) :where(.lc-app) button {
  background: none; border: 0; border-radius: 0; box-shadow: none; text-shadow: none; text-transform: none;
  letter-spacing: normal; font: inherit; color: inherit; line-height: inherit; text-align: center;
  text-decoration: none; white-space: normal; min-height: 0; min-width: 0; width: auto; height: auto;
  margin: 0; padding: 0; outline-offset: 2px; -webkit-appearance: none; appearance: none; transform: none; filter: none;
  display: inline-block; vertical-align: middle; float: none;
}
:is(#lc-scope,.lc-root) :where(.lc-app) input, :is(#lc-scope,.lc-root) :where(.lc-app) select, :is(#lc-scope,.lc-root) :where(.lc-app) textarea {
  max-width: 100%; min-width: 0;
  font: inherit; color: inherit; text-transform: none; letter-spacing: normal; box-shadow: none; margin: 0; min-height: 0; line-height: normal;
}
:is(#lc-scope,.lc-root) :where(.lc-app) input[type="checkbox"], :is(#lc-scope,.lc-root) :where(.lc-app) input[type="radio"] { -webkit-appearance: auto; appearance: auto; width: 18px; height: 18px; padding: 0; border: 0; background: none; }
:is(#lc-scope,.lc-root) :where(.lc-app) table { border: 0; margin: 0; width: 100%; max-width: 100%; min-width: 0; table-layout: fixed; background: none; }
:is(#lc-scope,.lc-root) :where(.lc-app) th, :is(#lc-scope,.lc-root) :where(.lc-app) td { border: 0; background: none; text-align: left; vertical-align: top; font-weight: inherit; }
:is(#lc-scope,.lc-root) :where(.lc-app) label, :is(#lc-scope,.lc-root) :where(.lc-app) legend { font: inherit; color: inherit; text-transform: none; letter-spacing: normal; margin: 0; line-height: inherit; }
:is(#lc-scope,.lc-root) :where(.lc-app) fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
:is(#lc-scope,.lc-root) :where(.lc-app) img { border: 0; box-shadow: none; border-radius: 0; max-width: 100%; }
:is(#lc-scope,.lc-root) :where(.lc-app) p, :is(#lc-scope,.lc-root) :where(.lc-app) h2, :is(#lc-scope,.lc-root) :where(.lc-app) h3 { text-transform: none; letter-spacing: normal; }
:is(#lc-scope,.lc-root) .lc-app {
  --lc-bg: #eef1f4;
  --lc-surface: #ffffff;
  --lc-ink: #18212c;
  --lc-muted: #5d6875;
  --lc-line: #d5dbe1;
  --lc-accent: #2348e8;
  --lc-accent-ink: #ffffff;
  --lc-accent-soft: #e6ebff;
  --lc-amber: #f5a524;
  --lc-good: #13804b;
  --lc-warn: #9a5b00;
  --lc-bad: #b42318;
  --lc-radius: 14px;
  --lc-font: "LC Poppins", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --lc-display: "LC Adventor", "LC Poppins", system-ui, sans-serif;
  font-family: var(--lc-font);
  color: var(--lc-ink);
  background: var(--lc-bg);
  border-radius: 20px;
  max-width: 1320px;
  margin: 0 auto;
  font-size: 15px;
  line-height: 1.5;
  position: relative;
  -webkit-font-smoothing: antialiased;
}
:is(#lc-scope,.lc-root) .lc-app *, :is(#lc-scope,.lc-root) .lc-app *::before, :is(#lc-scope,.lc-root) .lc-app *::after { box-sizing: border-box; }
:is(#lc-scope,.lc-root) :where(.lc-app) button { cursor: pointer; }
:is(#lc-scope,.lc-root) .lc-app button:disabled { cursor: not-allowed; }
:is(#lc-scope,.lc-root) .lc-app :focus-visible { outline: 3px solid var(--lc-accent); outline-offset: 2px; }
:is(#lc-scope,.lc-root) .lc-app [hidden] { display: none !important; }

/* Header */
:is(#lc-scope,.lc-root) .lc-head { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between; padding: 28px 32px 18px; }
:is(#lc-scope,.lc-root) .lc-title { font-family: var(--lc-display); font-weight: 700; font-size: clamp(26px, 3vw, 38px); line-height: 1.05; letter-spacing: -0.01em; margin: 0; color: var(--lc-ink); }
:is(#lc-scope,.lc-root) .lc-picked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 26px; }
:is(#lc-scope,.lc-root) .lc-picked span { background: var(--lc-surface); border: 1px solid var(--lc-line); border-radius: 999px; padding: 2px 12px; font-size: 13px; color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-steps ol { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
:is(#lc-scope,.lc-root) .lc-step button { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 6px 10px; border-radius: 999px; font-size: 13px; color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-step__n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--lc-line); font-size: 12px; font-weight: 500; background: var(--lc-surface); }
:is(#lc-scope,.lc-root) .lc-step.is-done .lc-step__n { background: var(--lc-ink); border-color: var(--lc-ink); color: #fff; }
:is(#lc-scope,.lc-root) .lc-step.is-active button { color: var(--lc-ink); font-weight: 500; background: var(--lc-surface); box-shadow: 0 1px 0 var(--lc-line); }
:is(#lc-scope,.lc-root) .lc-step.is-active .lc-step__n { border-color: var(--lc-accent); background: var(--lc-accent); color: #fff; }
:is(#lc-scope,.lc-root) .lc-step button:disabled { opacity: .5; }
:is(#lc-scope,.lc-root) .lc-step button:not(:disabled):hover { color: var(--lc-ink); }

/* Corpo */
:is(#lc-scope,.lc-root) .lc-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; padding: 0 32px 24px; align-items: start; }
:is(#lc-scope,.lc-root) .lc-stage { position: sticky; top: 16px; }
:is(#lc-scope,.lc-root) .lc-stage__view { position: relative; height: min(68vh, 600px); min-height: 380px; border-radius: 22px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 38%, #ffffff 0%, #f2f5f8 45%, #dde3e9 100%); border: 1px solid var(--lc-line); }
:is(#lc-scope,.lc-root) .lc-stage__3d, :is(#lc-scope,.lc-root) .lc-stage__flat { position: absolute; inset: 0; }
:is(#lc-scope,.lc-root) .lc-stage__3d canvas { width: 100%; height: 100%; display: block; cursor: grab; }
:is(#lc-scope,.lc-root) .lc-stage__3d canvas:active { cursor: grabbing; }
:is(#lc-scope,.lc-root) .lc-stage__flat canvas { display: block; }
:is(#lc-scope,.lc-root) .lc-stage__empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; color: var(--lc-muted); padding: 24px; }
:is(#lc-scope,.lc-root) .lc-ghostcan { width: 110px; height: 190px; border-radius: 18px / 12px; border: 2px dashed #b9c2cb; }
:is(#lc-scope,.lc-root) .lc-stage__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
:is(#lc-scope,.lc-root) .lc-views, :is(#lc-scope,.lc-root) .lc-switch { display: flex; gap: 4px; background: var(--lc-surface); border: 1px solid var(--lc-line); border-radius: 999px; padding: 3px; }
:is(#lc-scope,.lc-root) .lc-views:empty { visibility: hidden; }
:is(#lc-scope,.lc-root) .lc-views button, :is(#lc-scope,.lc-root) .lc-switch button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-views button[aria-pressed="true"], :is(#lc-scope,.lc-root) .lc-switch button[aria-pressed="true"] { background: var(--lc-ink); color: #fff; }
:is(#lc-scope,.lc-root) .lc-app.no-3d .lc-switch { display: none; }
:is(#lc-scope,.lc-root) .lc-stage__tag { position: absolute; top: 14px; left: 14px; z-index: 2; margin: 0; max-width: calc(100% - 28px); display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.88); border: 1px solid var(--lc-line); font-size: 13px; color: var(--lc-ink); pointer-events: none; }
:is(#lc-scope,.lc-root) .lc-stage__tag::before { content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--lc-can, #c9ced3); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
:is(#lc-scope,.lc-root) .lc-stage__tag[hidden], :is(#lc-scope,.lc-root) .lc-stage__flat:not([hidden]) ~ .lc-stage__tag { display: none; }
:is(#lc-scope,.lc-root) .lc-stage__hint { font-size: 13px; color: var(--lc-muted); margin: 8px 4px 0; }

/* Pannello */
:is(#lc-scope,.lc-root) .lc-panel { background: var(--lc-surface); border-radius: 22px; border: 1px solid var(--lc-line); min-height: 100%; }
:is(#lc-scope,.lc-root) .lc-panel__inner { padding: 28px; outline: none; }
:is(#lc-scope,.lc-root) .lc-h { font-family: var(--lc-display); font-size: 24px; line-height: 1.15; margin: 0 0 6px; font-weight: 700; color: var(--lc-ink); }
:is(#lc-scope,.lc-root) .lc-lead { color: var(--lc-muted); margin: 0 0 20px; max-width: 60ch; }
:is(#lc-scope,.lc-root) .lc-help { color: var(--lc-muted); font-size: 13px; margin: 8px 0 12px; }
:is(#lc-scope,.lc-root) .lc-empty { color: var(--lc-muted); padding: 24px; border: 1px dashed var(--lc-line); border-radius: var(--lc-radius); }

:is(#lc-scope,.lc-root) .lc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
:is(#lc-scope,.lc-root) .lc-card { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--lc-radius); border: 1.5px solid var(--lc-line); background: var(--lc-surface); transition: border-color .15s, box-shadow .15s; }
:is(#lc-scope,.lc-root) .lc-card:hover { border-color: #9aa6b2; }
:is(#lc-scope,.lc-root) .lc-card.is-selected { border-color: var(--lc-accent); box-shadow: 0 0 0 3px var(--lc-accent-soft); }
:is(#lc-scope,.lc-root) .lc-card__title { font-weight: 700; font-size: 16px; }
:is(#lc-scope,.lc-root) .lc-card__title small { font-weight: 500; color: var(--lc-muted); font-size: 13px; }
:is(#lc-scope,.lc-root) .lc-card__text { color: var(--lc-muted); font-size: 13.5px; }
:is(#lc-scope,.lc-root) .lc-card__foot { margin-top: auto; font-size: 13px; font-weight: 500; }
:is(#lc-scope,.lc-root) .lc-card__body { display: flex; flex-direction: column; gap: 4px; }
:is(#lc-scope,.lc-root) .lc-card--format, :is(#lc-scope,.lc-root) .lc-card--content { flex-direction: row; align-items: flex-start; gap: 14px; }
:is(#lc-scope,.lc-root) .lc-cansvg { width: 56px; height: 70px; flex: none; }
:is(#lc-scope,.lc-root) .lc-cansvg__body { fill: #c9ced3; }
:is(#lc-scope,.lc-root) .lc-cansvg__label { fill: var(--lc-accent); opacity: .85; }
:is(#lc-scope,.lc-root) .lc-card.is-selected .lc-cansvg__label { opacity: 1; }
:is(#lc-scope,.lc-root) .lc-swatch { width: 38px; height: 38px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }

:is(#lc-scope,.lc-root) .lc-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
:is(#lc-scope,.lc-root) .lc-seg button { text-align: left; border: 1.5px solid var(--lc-line); background: var(--lc-surface); border-radius: var(--lc-radius); padding: 12px 14px; display: flex; flex-direction: column; }
:is(#lc-scope,.lc-root) .lc-seg button span { font-size: 13px; color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-seg button[aria-pressed="true"] { border-color: var(--lc-accent); background: var(--lc-accent-soft); }

:is(#lc-scope,.lc-root) .lc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
:is(#lc-scope,.lc-root) .lc-chips button { border: 1px solid var(--lc-line); background: var(--lc-surface); border-radius: 999px; padding: 5px 14px; font-size: 13px; }
:is(#lc-scope,.lc-root) .lc-chips button[aria-pressed="true"] { background: var(--lc-ink); color: #fff; border-color: var(--lc-ink); }

:is(#lc-scope,.lc-root) .lc-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
:is(#lc-scope,.lc-root) .lc-tpl { border: 0; background: none; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 4px; }
:is(#lc-scope,.lc-root) .lc-tpl__img { display: block; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #e6eaee; border: 1.5px solid var(--lc-line); transition: border-color .15s, box-shadow .15s; }
:is(#lc-scope,.lc-root) .lc-tpl__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
:is(#lc-scope,.lc-root) .lc-tpl__img img:not([src]) { visibility: hidden; }
:is(#lc-scope,.lc-root) .lc-tpl:hover .lc-tpl__img { border-color: #9aa6b2; }
:is(#lc-scope,.lc-root) .lc-tpl.is-selected .lc-tpl__img { border-color: var(--lc-accent); box-shadow: 0 0 0 3px var(--lc-accent-soft); }
:is(#lc-scope,.lc-root) .lc-tpl__name { font-weight: 500; margin-top: 4px; }
:is(#lc-scope,.lc-root) .lc-tpl__meta { font-size: 12.5px; color: var(--lc-muted); }

/* Campi */
:is(#lc-scope,.lc-root) .lc-group { border: 0; padding: 0; margin: 0 0 22px; }
:is(#lc-scope,.lc-root) .lc-group legend { padding: 0; margin-bottom: 10px; font-weight: 700; }
:is(#lc-scope,.lc-root) .lc-face { border: 0; background: none; padding: 0; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
:is(#lc-scope,.lc-root) .lc-face::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--lc-muted); background: radial-gradient(circle, var(--lc-muted) 2px, transparent 3px); }
:is(#lc-scope,.lc-root) .lc-field { margin-bottom: 16px; }
:is(#lc-scope,.lc-root) .lc-field > label, :is(#lc-scope,.lc-root) .lc-label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; }
:is(#lc-scope,.lc-root) .lc-field em { font-style: normal; color: var(--lc-muted); font-weight: 400; font-size: 13px; }
:is(#lc-scope,.lc-root) .lc-field input[type="text"], :is(#lc-scope,.lc-root) .lc-field textarea, :is(#lc-scope,.lc-root) .lc-qty input {
  width: 100%; font: inherit; color: var(--lc-ink); background: #f7f9fa; border: 1.5px solid var(--lc-line); border-radius: 10px; padding: 11px 13px; transition: border-color .15s, background .15s; }
:is(#lc-scope,.lc-root) .lc-field input[type="text"]:focus, :is(#lc-scope,.lc-root) .lc-field textarea:focus, :is(#lc-scope,.lc-root) .lc-qty input:focus { border-color: var(--lc-accent); background: #fff; outline: none; box-shadow: 0 0 0 3px var(--lc-accent-soft); }
:is(#lc-scope,.lc-root) .lc-field textarea { resize: vertical; min-height: 64px; }
:is(#lc-scope,.lc-root) .lc-field__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--lc-muted); margin-top: 4px; }
:is(#lc-scope,.lc-root) .lc-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
:is(#lc-scope,.lc-root) .lc-swatches--sm { margin-top: 8px; }
:is(#lc-scope,.lc-root) .lc-sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: var(--sw); box-shadow: 0 0 0 1px var(--lc-line); padding: 0; }
:is(#lc-scope,.lc-root) .lc-swatches--sm .lc-sw { width: 26px; height: 26px; }
:is(#lc-scope,.lc-root) .lc-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--lc-ink); }
:is(#lc-scope,.lc-root) .lc-app input[type="range"] { width: 100%; accent-color: var(--lc-accent); }
:is(#lc-scope,.lc-root) .lc-sliders { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--lc-muted); }

:is(#lc-scope,.lc-root) .lc-drop { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 28px 18px; border: 2px dashed #b9c2cb; border-radius: var(--lc-radius); background: #f7f9fa; cursor: pointer; transition: border-color .15s, background .15s; }
:is(#lc-scope,.lc-root) .lc-drop > span:not(.lc-drop__icon) { font-size: 13px; color: var(--lc-muted); max-width: 46ch; }
:is(#lc-scope,.lc-root) .lc-drop:hover, :is(#lc-scope,.lc-root) .lc-drop.is-over, :is(#lc-scope,.lc-root) .lc-drop:focus-visible { border-color: var(--lc-accent); background: var(--lc-accent-soft); }
:is(#lc-scope,.lc-root) .lc-drop--sm { padding: 16px; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; text-align: left; }
:is(#lc-scope,.lc-root) .lc-drop--sm > span:not(.lc-drop__icon) { flex-basis: 100%; text-align: center; }
:is(#lc-scope,.lc-root) .lc-drop__icon { width: 34px; height: 34px; border-radius: 50%; background: var(--lc-ink); position: relative; flex: none; }
:is(#lc-scope,.lc-root) .lc-drop__icon::before, :is(#lc-scope,.lc-root) .lc-drop__icon::after { content: ""; position: absolute; background: #fff; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 2px; }
:is(#lc-scope,.lc-root) .lc-drop__icon::before { width: 14px; height: 2px; }
:is(#lc-scope,.lc-root) .lc-drop__icon::after { width: 2px; height: 14px; }
:is(#lc-scope,.lc-root) .lc-drop--sm .lc-drop__icon { width: 26px; height: 26px; }
:is(#lc-scope,.lc-root) .lc-filecard { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--lc-line); border-radius: 12px; background: #f7f9fa; }
:is(#lc-scope,.lc-root) .lc-filecard img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: repeating-conic-gradient(#e3e7eb 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
:is(#lc-scope,.lc-root) .lc-filecard > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
:is(#lc-scope,.lc-root) .lc-filecard strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:is(#lc-scope,.lc-root) .lc-badge { align-self: flex-start; font-size: 12px; font-weight: 500; padding: 1px 9px; border-radius: 999px; }
:is(#lc-scope,.lc-root) .lc-badge--good { background: #dcf3e6; color: var(--lc-good); }
:is(#lc-scope,.lc-root) .lc-badge--ok { background: #fff1d6; color: var(--lc-warn); }
:is(#lc-scope,.lc-root) .lc-badge--low { background: #fde3e1; color: var(--lc-bad); }
:is(#lc-scope,.lc-root) .lc-specs { background: #f7f9fa; border-radius: var(--lc-radius); padding: 14px 16px; margin-bottom: 14px; font-size: 13.5px; }
:is(#lc-scope,.lc-root) .lc-specs p { margin: 0 0 6px; }
:is(#lc-scope,.lc-root) .lc-link { border: 0; background: none; padding: 0; color: var(--lc-accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Quantità */
:is(#lc-scope,.lc-root) .lc-qty { display: flex; align-items: center; gap: 8px; }
:is(#lc-scope,.lc-root) .lc-qty input { width: 120px; text-align: center; font-size: 22px; font-weight: 700; padding: 8px; }
:is(#lc-scope,.lc-root) .lc-qty__btn { width: 46px; height: 46px; border-radius: 12px; border: 1.5px solid var(--lc-line); background: var(--lc-surface); font-size: 22px !important; line-height: 1; }
:is(#lc-scope,.lc-root) .lc-qty span { color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-tiers { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 10px; }
:is(#lc-scope,.lc-root) .lc-tiers caption { text-align: left; font-weight: 700; padding-bottom: 6px; }
:is(#lc-scope,.lc-root) .lc-tiers td { padding: 8px 10px; border-top: 1px solid var(--lc-line); }
:is(#lc-scope,.lc-root) .lc-tiers td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
:is(#lc-scope,.lc-root) .lc-tiers tr.is-on td { background: var(--lc-accent-soft); font-weight: 500; }
:is(#lc-scope,.lc-root) .lc-bundles tr[data-action] { cursor: pointer; }
:is(#lc-scope,.lc-root) .lc-bundles tr[data-action]:hover td, :is(#lc-scope,.lc-root) .lc-bundles tr[data-action]:focus-visible td { background: var(--lc-accent-soft); }
:is(#lc-scope,.lc-root) .lc-bundles tr[data-action]:focus-visible { outline: 2px solid var(--lc-accent); outline-offset: -2px; }
:is(#lc-scope,.lc-root) .lc-bundles tr.is-off td { opacity: .45; }
:is(#lc-scope,.lc-root) .lc-bundles td small { display: block; color: var(--lc-muted); font-size: 12px; font-weight: 400; }
:is(#lc-scope,.lc-root) .lc-combo { color: var(--lc-ink); font-weight: 500; margin-top: 0; }
:is(#lc-scope,.lc-root) .lc-upsell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; background: var(--lc-accent-soft); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin: 0 0 12px; }
:is(#lc-scope,.lc-root) .lc-saving { display: inline-block; background: #fff1d6; color: #6b4100; border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 500; margin: 0 0 18px; }
:is(#lc-scope,.lc-root) .lc-options { display: grid; gap: 8px; }
:is(#lc-scope,.lc-root) .lc-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--lc-line); border-radius: 12px; cursor: pointer; }
:is(#lc-scope,.lc-root) .lc-option input { margin-top: 4px; accent-color: var(--lc-accent); width: 18px; height: 18px; flex: none; }
:is(#lc-scope,.lc-root) .lc-option > span:nth-of-type(1) { flex: 1; display: flex; flex-direction: column; font-size: 14px; }
:is(#lc-scope,.lc-root) .lc-option > span:nth-of-type(1) span { color: var(--lc-muted); font-size: 13px; }
:is(#lc-scope,.lc-root) .lc-option__price { font-weight: 500; white-space: nowrap; font-size: 14px; }
:is(#lc-scope,.lc-root) .lc-option.is-selected { border-color: var(--lc-accent); background: var(--lc-accent-soft); }
:is(#lc-scope,.lc-root) .lc-option--check { margin-top: 4px; }
:is(#lc-scope,.lc-root) .lc-option--info { cursor: default; }

/* Riepilogo */
:is(#lc-scope,.lc-root) .lc-summary { margin: 0 0 18px; }
:is(#lc-scope,.lc-root) .lc-summary > div { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--lc-line); align-items: baseline; }
:is(#lc-scope,.lc-root) .lc-summary dt { color: var(--lc-muted); font-size: 13.5px; }
:is(#lc-scope,.lc-root) .lc-summary dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
:is(#lc-scope,.lc-root) .lc-breakdown { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 8px; }
:is(#lc-scope,.lc-root) .lc-breakdown td { padding: 6px 0; }
:is(#lc-scope,.lc-root) .lc-breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
:is(#lc-scope,.lc-root) .lc-breakdown tfoot td { border-top: 2px solid var(--lc-ink); padding-top: 10px; font-weight: 700; font-size: 17px; }
:is(#lc-scope,.lc-root) .lc-approve { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px; background: #fff7e6; border: 1.5px solid #f3d38e; margin-top: 10px; font-size: 14px; cursor: pointer; }
:is(#lc-scope,.lc-root) .lc-approve input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--lc-accent); flex: none; }

/* Footer */
:is(#lc-scope,.lc-root) .lc-foot { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: 14px 32px; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-top: 1px solid var(--lc-line); border-radius: 0 0 20px 20px; }
:is(#lc-scope,.lc-root) .lc-price { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; }
:is(#lc-scope,.lc-root) .lc-price__label { font-size: 13px; color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-price__total { font-family: var(--lc-display); font-size: 26px; font-variant-numeric: tabular-nums; }
:is(#lc-scope,.lc-root) .lc-price__meta { grid-column: 1 / -1; font-size: 12.5px; color: var(--lc-muted); }
:is(#lc-scope,.lc-root) .lc-foot__msg { flex: 1; margin: 0; font-size: 13.5px; color: var(--lc-bad); text-align: right; }
:is(#lc-scope,.lc-root) .lc-foot__actions { display: flex; gap: 8px; }
:is(#lc-scope,.lc-root) .lc-btn { border: 0; border-radius: 999px; padding: 12px 24px; font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
:is(#lc-scope,.lc-root) .lc-btn--primary { background: var(--lc-ink); color: #fff !important; }
:is(#lc-scope,.lc-root) .lc-btn--primary.is-ready { background: var(--lc-accent); }
:is(#lc-scope,.lc-root) .lc-btn--primary:hover { filter: brightness(1.08); }
:is(#lc-scope,.lc-root) .lc-btn--ghost { background: transparent; border: 1.5px solid var(--lc-line); }
:is(#lc-scope,.lc-root) .lc-btn--sm { padding: 6px 14px; font-size: 13px; cursor: pointer; }

/* Overlay */
:is(#lc-scope,.lc-root) .lc-overlay { position: fixed; inset: 0; z-index: 99999; background: rgba(18,24,32,.55); display: grid; place-items: center; padding: 20px; }
:is(#lc-scope,.lc-root) .lc-overlay__box { background: var(--lc-surface); color: var(--lc-ink); border-radius: 20px; padding: 28px; width: min(760px, 100%); max-height: 90vh; overflow: auto; }
:is(#lc-scope,.lc-root) .lc-progress { text-align: center; display: grid; justify-items: center; gap: 12px; }
:is(#lc-scope,.lc-root) .lc-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--lc-line); border-top-color: var(--lc-accent); animation: lc-spin .8s linear infinite; }
@keyframes lc-spin { to { transform: rotate(360deg); } }
:is(#lc-scope,.lc-root) .lc-bar { width: 100%; height: 6px; background: var(--lc-bg); border-radius: 6px; overflow: hidden; }
:is(#lc-scope,.lc-root) .lc-bar span { display: block; height: 100%; background: var(--lc-accent); transition: width .3s; }
:is(#lc-scope,.lc-root) .lc-result__grid { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; margin: 16px 0; }
:is(#lc-scope,.lc-root) .lc-result figure { margin: 0; }
:is(#lc-scope,.lc-root) .lc-result img { width: 100%; border-radius: 10px; border: 1px solid var(--lc-line); background: #f7f9fa; }
:is(#lc-scope,.lc-root) .lc-result figcaption { font-size: 12.5px; color: var(--lc-muted); margin-top: 6px; }
:is(#lc-scope,.lc-root) .lc-result pre { background: #f7f9fa; padding: 12px; border-radius: 10px; font-size: 12px; overflow: auto; max-height: 260px; }
:is(#lc-scope,.lc-root) .lc-result__actions { display: flex; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 900px) {
  :is(#lc-scope,.lc-root) .lc-app { border-radius: 0; }
  :is(#lc-scope,.lc-root) .lc-head { padding: 18px 16px 10px; }
  :is(#lc-scope,.lc-root) .lc-steps { width: 100%; overflow-x: auto; }
  :is(#lc-scope,.lc-root) .lc-steps ol { flex-wrap: nowrap; }
  :is(#lc-scope,.lc-root) .lc-step:not(.is-active) .lc-step__l { display: none; }
  :is(#lc-scope,.lc-root) .lc-body { grid-template-columns: 1fr; padding: 0 12px 16px; gap: 14px; }
  :is(#lc-scope,.lc-root) .lc-stage { position: relative; top: 0; }
  :is(#lc-scope,.lc-root) .lc-stage__view { height: 46vh; min-height: 300px; }
  :is(#lc-scope,.lc-root) .lc-panel__inner { padding: 20px 16px; }
  :is(#lc-scope,.lc-root) .lc-foot { padding: 10px 12px; gap: 10px; border-radius: 0; flex-wrap: wrap; }
  :is(#lc-scope,.lc-root) .lc-foot__msg { order: 3; flex-basis: 100%; text-align: left; }
  :is(#lc-scope,.lc-root) .lc-foot__actions { margin-left: auto; }
  :is(#lc-scope,.lc-root) .lc-price__total { font-size: 21px; }
  :is(#lc-scope,.lc-root) .lc-btn { padding: 11px 18px; }
  :is(#lc-scope,.lc-root) .lc-sliders { grid-template-columns: 1fr; }
  :is(#lc-scope,.lc-root) .lc-summary > div { grid-template-columns: 1fr auto; }
  :is(#lc-scope,.lc-root) .lc-summary dd { grid-column: 1; }
  :is(#lc-scope,.lc-root) .lc-summary .lc-link { grid-row: 1; grid-column: 2; }
  :is(#lc-scope,.lc-root) .lc-result__grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  :is(#lc-scope,.lc-root) .lc-app * { transition: none !important; animation-duration: 0s !important; }
}

/* Immagini e badge gestiti dal backend */
:is(#lc-scope,.lc-root) .lc-card--media { padding-top: 12px; }
:is(#lc-scope,.lc-root) .lc-card__img { display: block; margin: 0 0 6px; border-radius: 10px; overflow: hidden; aspect-ratio: 16 / 9; background: #f2f4f6; }
:is(#lc-scope,.lc-root) .lc-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
:is(#lc-scope,.lc-root) .lc-card__thumb { width: 56px; height: 70px; object-fit: contain; flex: none; }
:is(#lc-scope,.lc-root) .lc-card__thumb--round { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
:is(#lc-scope,.lc-root) .lc-pill { align-self: flex-start; display: inline-block; background: var(--lc-amber); color: #2b1d00; font-size: 11.5px; font-weight: 500; border-radius: 999px; padding: 1px 9px; margin-bottom: 2px; }
:is(#lc-scope,.lc-root) .lc-tpl__img { position: relative; }
:is(#lc-scope,.lc-root) .lc-tpl__img .lc-pill { position: absolute; top: 8px; left: 8px; }

/* ------------------------------------------------------------------
   1.1.1 – Protezione dagli stili del tema
   Alcuni temi applicano a tutti i <button> sfondo bianco, bordo colorato,
   angoli squadrati e padding: i pallini colore diventavano quadrati vuoti
   e il titolo del lato ("Fronte") sembrava un campo di testo.
   Inoltre il <fieldset> ha per default min-width: min-content, quindi un
   nome file lungo allargava il pannello oltre il bordo.
   ------------------------------------------------------------------ */
:is(#lc-scope,.lc-root) .lc-app .lc-group { min-width: 0; min-inline-size: 0; max-width: 100%; }
:is(#lc-scope,.lc-root) .lc-app .lc-panel, :is(#lc-scope,.lc-root) .lc-app .lc-panel__inner, :is(#lc-scope,.lc-root) .lc-app .lc-field { min-width: 0; max-width: 100%; }
:is(#lc-scope,.lc-root) .lc-app .lc-field input[type="text"], :is(#lc-scope,.lc-root) .lc-app .lc-field textarea { max-width: 100%; }

/* Pallini colore */
:is(#lc-scope,.lc-root) .lc-app .lc-swatches .lc-sw {
  -webkit-appearance: none; appearance: none;
  display: inline-block; flex: none;
  width: 34px !important; height: 34px !important; min-width: 0 !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important;
  border: 2px solid #fff !important; border-radius: 50% !important;
  background: var(--sw) !important; background-image: none !important;
  box-shadow: 0 0 0 1px var(--lc-line) !important;
  outline-offset: 2px; text-indent: 0; line-height: 1; transform: none;
}
:is(#lc-scope,.lc-root) .lc-app .lc-swatches--sm .lc-sw { width: 26px !important; height: 26px !important; }
:is(#lc-scope,.lc-root) .lc-app .lc-swatches .lc-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--lc-ink) !important; }
:is(#lc-scope,.lc-root) .lc-app .lc-swatches .lc-sw:hover, :is(#lc-scope,.lc-root) .lc-app .lc-swatches .lc-sw:focus { background: var(--sw) !important; }

/* Titolo del lato (Fronte / Lato / Retro) */
:is(#lc-scope,.lc-root) .lc-app .lc-group > legend { float: none; width: auto; border: 0; }
:is(#lc-scope,.lc-root) .lc-app .lc-face {
  -webkit-appearance: none; appearance: none;
  margin: 0 !important; padding: 0 !important; min-height: 0 !important;
  border: 0 !important; border-radius: 0 !important;
  background: none !important; box-shadow: none !important;
  color: var(--lc-ink) !important; font-family: var(--lc-font) !important;
  font-weight: 700 !important; font-size: 15px !important; line-height: 1.5 !important;
  text-transform: none !important; letter-spacing: normal !important;
}
:is(#lc-scope,.lc-root) .lc-app .lc-face:hover, :is(#lc-scope,.lc-root) .lc-app .lc-face:focus { background: none !important; color: var(--lc-accent) !important; }

/* Pulsanti del configuratore */
:is(#lc-scope,.lc-root) .lc-app .lc-btn { border-radius: 999px !important; text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; line-height: 1.2; }
:is(#lc-scope,.lc-root) .lc-app .lc-btn--ghost { background: transparent !important; border: 1.5px solid var(--lc-line) !important; color: var(--lc-ink) !important; }
:is(#lc-scope,.lc-root) .lc-app .lc-btn--ghost:hover { border-color: var(--lc-ink) !important; }
:is(#lc-scope,.lc-root) .lc-app .lc-views button, :is(#lc-scope,.lc-root) .lc-app .lc-switch button, :is(#lc-scope,.lc-root) .lc-app .lc-chips button, :is(#lc-scope,.lc-root) .lc-app .lc-step button { box-shadow: none; text-transform: none; letter-spacing: normal; min-height: 0; }

/* Scheda della foto caricata */
:is(#lc-scope,.lc-root) .lc-app .lc-filecard { max-width: 100%; min-width: 0; }
:is(#lc-scope,.lc-root) .lc-app .lc-filecard img { flex: none; }
:is(#lc-scope,.lc-root) .lc-app .lc-filecard > .lc-btn { flex: none; }
:is(#lc-scope,.lc-root) .lc-app .lc-sliders > label { min-width: 0; display: block; }
:is(#lc-scope,.lc-root) .lc-app .lc-btn--sm { padding: 6px 14px !important; font-size: 13px; }

/* ---------- Protezione delle grafiche ---------- */
:is(#lc-scope,.lc-root).lc-protect canvas, :is(#lc-scope,.lc-root).lc-protect img, :is(#lc-scope,.lc-root).lc-protect .lc-stage, :is(#lc-scope,.lc-root).lc-protect .lc-tpl__img {
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
}
:is(#lc-scope,.lc-root).lc-protect .lc-tpl__img img, :is(#lc-scope,.lc-root).lc-protect .lc-card__thumb, :is(#lc-scope,.lc-root).lc-protect .lc-result img { pointer-events: none; }
:is(#lc-scope,.lc-root).lc-protect .lc-stage, :is(#lc-scope,.lc-root).lc-protect .lc-tpl__img, :is(#lc-scope,.lc-root).lc-protect .lc-result__grid { transition: filter .15s; }
html.lc-shielded :is(#lc-scope,.lc-root).lc-protect .lc-stage, html.lc-shielded :is(#lc-scope,.lc-root).lc-protect .lc-tpl__img, html.lc-shielded :is(#lc-scope,.lc-root).lc-protect .lc-result__grid, html.lc-shielded :is(#lc-scope,.lc-root).lc-protect canvas { filter: blur(22px) saturate(.4); }
:is(#lc-scope,.lc-root) .lc-result__locked { display: grid; place-items: center; gap: 8px; min-height: 160px; background: var(--lc-surface, #f2f4f6); border-radius: 12px; padding: 16px; text-align: center; }
:is(#lc-scope,.lc-root) .lc-result__locked span { font-size: 34px; }
@media print {
  :is(#lc-scope,.lc-root).lc-protect { display: none !important; }
  body::after { content: "Le grafiche del configuratore sono riservate e non possono essere stampate da questa pagina."; display: block; padding: 40px; font: 16px/1.4 sans-serif; }
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  :is(#lc-scope,.lc-root) .lc-seg { grid-template-columns: 1fr; }
  :is(#lc-scope,.lc-root) .lc-stage__tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; font-size: 12px; padding-left: 28px; position: absolute; }
  :is(#lc-scope,.lc-root) .lc-stage__tag::before { position: absolute; left: 10px; top: 50%; margin-top: -6px; }
  :is(#lc-scope,.lc-root) .lc-tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  :is(#lc-scope,.lc-root) .lc-tpl__name { font-size: 14px; line-height: 1.25; }
  :is(#lc-scope,.lc-root) .lc-tpl__meta { font-size: 12px; line-height: 1.3; }
  :is(#lc-scope,.lc-root) .lc-price__meta { font-size: 12px; }
  :is(#lc-scope,.lc-root) .lc-foot__actions .lc-btn { padding: 11px 16px; }
}

/* ---------- Niente scroll laterale ----------
 * Rete di sicurezza: nulla dentro il configuratore può allargare la pagina.
 * overflow-x: clip non crea un contenitore di scorrimento, quindi la barra del prezzo resta "sticky".
 */
:is(#lc-scope,.lc-root) { display: block; max-width: 100%; min-width: 0; overflow-x: clip; }
:is(#lc-scope,.lc-root) .lc-app { max-width: min(1320px, 100%); overflow-wrap: anywhere; word-break: normal; }
:is(#lc-scope,.lc-root) .lc-app img, :is(#lc-scope,.lc-root) .lc-app svg, :is(#lc-scope,.lc-root) .lc-app video { max-width: 100%; }
:is(#lc-scope,.lc-root) .lc-head, :is(#lc-scope,.lc-root) .lc-head__intro, :is(#lc-scope,.lc-root) .lc-body, :is(#lc-scope,.lc-root) .lc-stage, :is(#lc-scope,.lc-root) .lc-panel, :is(#lc-scope,.lc-root) .lc-card, :is(#lc-scope,.lc-root) .lc-card__body,
:is(#lc-scope,.lc-root) .lc-tpl, :is(#lc-scope,.lc-root) .lc-option, :is(#lc-scope,.lc-root) .lc-option > span, :is(#lc-scope,.lc-root) .lc-foot, :is(#lc-scope,.lc-root) .lc-price, :is(#lc-scope,.lc-root) .lc-summary > div, :is(#lc-scope,.lc-root) .lc-summary dd { min-width: 0; }
:is(#lc-scope,.lc-root) .lc-tiers td:last-child, :is(#lc-scope,.lc-root) .lc-breakdown td:last-child { width: 9.5em; }
:is(#lc-scope,.lc-root) .lc-steps { max-width: 100%; }
:is(#lc-scope,.lc-root) .lc-overlay__box { max-width: 100%; }
@media (max-width: 360px) {
  :is(#lc-scope,.lc-root) .lc-step button { padding: 6px 6px; gap: 6px; }
  :is(#lc-scope,.lc-root) .lc-steps ol { gap: 0; }
  :is(#lc-scope,.lc-root) .lc-qty { flex-wrap: wrap; }
  :is(#lc-scope,.lc-root) .lc-qty input { width: 96px; }
  :is(#lc-scope,.lc-root) .lc-tiers td:last-child, :is(#lc-scope,.lc-root) .lc-breakdown td:last-child { width: 7.5em; }
}
