/* BorsaLab — stile Windows 11 / Fluent (regola fissa): Mica calda, NavigationView, angoli 8px, Segoe UI Variable, accento terracotta.
   Guscio e componenti presi da Impara Lavoro; il palcoscenico dell'editor è la firma di questa app. */
@font-face { font-family: "BL Montserrat"; src: url(../font/montserrat-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BL Montserrat"; src: url(../font/montserrat-800.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "BL Bebas"; src: url(../font/bebas-neue-400.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "BL Anton"; src: url(../font/anton-400.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "BL Playfair"; src: url(../font/playfair-display-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BL Playfair"; src: url(../font/playfair-display-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "BL Pacifico"; src: url(../font/pacifico-400.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "BL Caveat"; src: url(../font/caveat-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "BL Caveat"; src: url(../font/caveat-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --acc: #a8461f; --acc-h: #933c1a; --acc-t: #fff; --acc-tenue: #f6e3d9;
  --mica: radial-gradient(1100px 700px at 0% 0%, #f2e4d8 0%, transparent 60%), radial-gradient(900px 600px at 100% 100%, #e9ecef 0%, transparent 55%), #f3f1ee;
  --carta: #ffffff; --carta2: #faf8f6; --carta-v: rgba(255, 255, 255, .72); --palco: #ebe6df;
  --testo: #1c1a19; --testo2: #5e5955; --testo3: #6f6a66;
  --bordo: rgba(0, 0, 0, .0803); --bordo2: rgba(0, 0, 0, .15); --sotto: rgba(0, 0, 0, .3);
  --ok: #0f7b0f; --ok-t: #dff6dd; --warn: #8f5400; --warn-t: #fff4ce; --ko: #c42b1c; --ko-t: #fde7e9;
  --om1: 0 1px 2px rgba(0, 0, 0, .05), 0 2px 6px rgba(0, 0, 0, .04);
  --om2: 0 2px 4px rgba(0, 0, 0, .05), 0 8px 24px rgba(0, 0, 0, .09);
  --om3: 0 8px 16px rgba(0, 0, 0, .12), 0 32px 64px rgba(0, 0, 0, .18);
  --r: 8px; --r-s: 4px;
  --f: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --f-d: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, sans-serif;
  --tocco: 40px; --nav: 264px; --tab-h: 0px;
  color-scheme: light;
}
[data-tema="scuro"] {
  --acc: #f0946a; --acc-h: #f6ab88; --acc-t: #2b1206; --acc-tenue: #3d2418;
  --mica: radial-gradient(1100px 700px at 0% 0%, #2c231e 0%, transparent 60%), radial-gradient(900px 600px at 100% 100%, #23252b 0%, transparent 55%), #202020;
  --carta: #2b2b2b; --carta2: #323232; --carta-v: rgba(44, 44, 44, .74); --palco: #262422;
  --testo: #ffffff; --testo2: #cbc6c2; --testo3: #aaa5a1;
  --bordo: rgba(255, 255, 255, .0837); --bordo2: rgba(255, 255, 255, .17); --sotto: rgba(255, 255, 255, .45);
  --ok: #6ccb5f; --ok-t: #1f3a1d; --warn: #fce100; --warn-t: #3d3517; --ko: #ff99a4; --ko-t: #44272a;
  --om1: 0 1px 2px rgba(0, 0, 0, .25); --om2: 0 2px 4px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .35); --om3: 0 8px 16px rgba(0, 0, 0, .4), 0 32px 64px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (pointer: coarse) { :root { --tocco: 44px; } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--f); color: var(--testo); background: var(--mica); background-attachment: fixed; min-height: 100vh; -webkit-font-smoothing: antialiased; }
::selection { background: color-mix(in srgb, var(--acc) 30%, transparent); }
:focus-visible { outline: 2px solid var(--testo); outline-offset: 2px; border-radius: var(--r-s); }
a { color: var(--acc); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-d); text-wrap: balance; }
p { text-wrap: pretty; }
svg { flex-shrink: 0; }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--acc); accent-color: var(--acc); }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sec { color: var(--testo2); font-weight: 400; }
.piccolo { font-size: 13px; }
[hidden] { display: none !important; }
.salta { position: absolute; left: -999px; top: 8px; z-index: 99; background: var(--carta); padding: 8px 14px; border-radius: var(--r); }
.salta:focus { left: 8px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--testo) 22%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
* { scrollbar-color: color-mix(in srgb, var(--testo) 25%, transparent) transparent; }

/* ---------- banner demo */
.demo { position: relative; z-index: 5; padding: 7px 16px; font-size: 13px; text-align: center; background: #1c1a19; color: #f3ede7; }
.demo b { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 3px; background: var(--acc); color: #fff; font-size: 11px; letter-spacing: .06em; }
.demo a { color: #f6c2a8; }
[data-tema="scuro"] .demo { background: #3a2a22; }

/* ---------- guscio: NavigationView a sinistra su PC, barra in basso sul telefono */
.guscio { display: grid; grid-template-columns: var(--nav) minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 12px 8px; gap: 6px; }
.nav-marca { display: flex; align-items: center; gap: 12px; padding: 10px 12px 18px; text-decoration: none; color: var(--testo); }
.nav-marca b { display: block; font: 600 15px/1.2 var(--f-d); } .nav-marca small { color: var(--testo2); font-size: 12px; }
.nav-voci { display: grid; gap: 2px; }
.nav-voci a { position: relative; display: flex; align-items: center; gap: 14px; min-height: var(--tocco); padding: 0 14px; border-radius: var(--r-s); color: var(--testo); text-decoration: none; transition: background .12s; }
.nav-voci a:hover { background: color-mix(in srgb, var(--testo) 5%, transparent); }
.nav-voci a.on { background: color-mix(in srgb, var(--testo) 7%, transparent); font-weight: 600; }
.nav-voci a.on::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px; border-radius: 3px; background: var(--acc); animation: pillola .25s cubic-bezier(.16, 1, .3, 1); }
@keyframes pillola { from { transform: scaleY(0); } }
.nav-piede { margin-top: auto; padding: 12px 14px; display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--testo2); }
.nav-piede a { color: var(--testo2); }
.vista { margin: 8px 8px 8px 0; padding: 28px 32px 40px; background: var(--carta-v); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4); border: 1px solid var(--bordo); border-radius: var(--r); box-shadow: var(--om1); min-height: calc(100vh - 16px); outline: none; min-width: 0; }
body[data-sez="crea"] .vista { padding: 0; overflow: clip; }
.vista.entra > * { animation: entra .28s cubic-bezier(.16, 1, .3, 1); }
@keyframes entra { from { opacity: 0; transform: translateY(14px); } }
.tab { display: none; }
body:has(.demo:not([hidden])) .nav { top: 0; height: calc(100vh - 34px); }

@media (max-width: 1100px) and (min-width: 701px) {
  :root { --nav: 72px; }
  .nav-marca span, .nav-voci a span, .nav-piede { display: none; }
  .nav-marca { justify-content: center; padding: 10px 0 18px; } .nav-voci a { justify-content: center; padding: 0; }
}
@media (max-width: 700px) {
  :root { --tab-h: calc(62px + env(safe-area-inset-bottom)); }
  .guscio { display: block; }
  .nav { display: none; }
  .vista { margin: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 20px 16px calc(var(--tab-h) + 24px); min-height: 100vh; }
  body[data-sez="crea"] .vista { padding: 0; }
  .tab { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: var(--tab-h); padding: 4px 4px env(safe-area-inset-bottom); background: color-mix(in srgb, var(--carta) 86%, transparent); backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5); border-top: 1px solid var(--bordo); }
  .tab a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--testo2); text-decoration: none; border-radius: var(--r-s); }
  .tab a.on { color: var(--acc); font-weight: 600; }
  .tab a.on::after { content: ""; position: absolute; bottom: 4px; width: 16px; height: 3px; border-radius: 3px; background: var(--acc); }
}

/* ---------- pulsanti e campi Fluent */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tocco); padding: 0 16px; border-radius: var(--r-s); border: 1px solid var(--bordo); border-bottom-color: var(--bordo2); background: var(--carta); color: var(--testo); font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; transition: background .12s, transform .08s; white-space: nowrap; }
.btn:hover { background: var(--carta2); } .btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.acc { background: var(--acc); color: var(--acc-t); border-color: transparent; border-bottom-color: rgba(0, 0, 0, .25); }
.btn.acc:hover { background: var(--acc-h); }
.btn.sub { background: transparent; border-color: transparent; }
.btn.sub:hover { background: color-mix(in srgb, var(--testo) 6%, transparent); }
.btn.ic { width: var(--tocco); padding: 0; }
.btn.ko { color: var(--ko); }
.btn.grande { min-height: 48px; padding: 0 22px; font-size: 15px; }
.btn.largo { width: 100%; }
.btn.tog[aria-pressed="true"] { background: var(--acc-tenue); border-color: color-mix(in srgb, var(--acc) 45%, transparent); color: var(--testo); }
.lnk { background: none; border: 0; padding: 0; color: var(--acc); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: 13px; }
.campo { width: 100%; min-height: var(--tocco); padding: 8px 11px; border: 1px solid var(--bordo); border-bottom: 1px solid var(--sotto); border-radius: var(--r-s); background: var(--carta2); color: var(--testo); transition: border-color .12s; }
.campo:focus { outline: none; border-bottom: 2px solid var(--acc); padding-bottom: 7px; background: var(--carta); }
textarea.campo { resize: vertical; }
.etich { display: flex; justify-content: space-between; margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--testo2); }
.etich output { font-variant-numeric: tabular-nums; color: var(--testo); }
input[type=range] { width: 100%; height: 28px; }
.riga { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.riga.centro { justify-content: center; margin-top: 20px; }
.errore { min-height: 1.2em; margin: 8px 0; color: var(--ko); font-size: 14px; font-weight: 600; }
.giro { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- pezzi comuni delle pagine */
.testa { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.testa h1 { margin: 0; font-size: clamp(26px, 3.4vw, 34px); font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.testa p { margin: 6px 0 0; max-width: 68ch; color: var(--testo2); font-size: 15.5px; }
.blocco { background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--r); box-shadow: var(--om1); }
.sez { margin: 30px 0 12px; font-size: 18px; font-weight: 600; }
.vuoto { display: grid; justify-items: center; text-align: center; padding: 48px 16px; color: var(--testo2); }
.vuoto h2 { margin: 12px 0 4px; color: var(--testo); font-size: 20px; } .vuoto p { margin: 0 0 16px; max-width: 46ch; }
.vuoto-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--acc-tenue); color: var(--acc); }
.briciole { margin-bottom: 10px; } .briciole a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none; }
.lista { padding-left: 20px; } .lista li { margin: 6px 0; }
.carica { display: block; width: 100%; aspect-ratio: 4 / 5; border-radius: var(--r); background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--testo) 6%, transparent) 50%, transparent 70%) var(--palco); background-size: 300% 100%; animation: luccica 1.4s linear infinite; }
@keyframes luccica { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ================================================================ EDITOR */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "palco pannello" "conto conto"; height: calc(100vh - 16px); }
body:has(.demo:not([hidden])) .ed { height: calc(100vh - 16px - 34px); }
.ed-palco { grid-area: palco; position: relative; display: flex; flex-direction: column; min-height: 0; background: radial-gradient(70% 60% at 50% 42%, color-mix(in srgb, var(--carta) 70%, var(--palco)) 0%, var(--palco) 100%); }
.ed-barra { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 6px; background: color-mix(in srgb, var(--testo) 7%, transparent); }
.seg button { position: relative; min-height: 34px; padding: 0 16px; border: 0; border-radius: var(--r-s); background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--testo2); }
.seg button[aria-pressed="true"] { background: var(--carta); color: var(--testo); box-shadow: var(--om1); }
.pall { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.ed-cm { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--testo2); font-variant-numeric: tabular-nums; }
.ed-cm b { color: var(--testo); }
.ed-storia { margin-left: auto; display: flex; gap: 2px; }
.ed-scena { position: relative; flex: 1; min-height: 0; margin: 0 auto; aspect-ratio: 4 / 5; max-width: 100%; height: 100%; max-height: 100%; touch-action: none; }
.ed-borsa, .ed-borsa svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ed-borsa svg { filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .13)); }
.ed-area { position: absolute; outline: 1.5px dashed rgba(0, 0, 0, .32); outline-offset: 0; border-radius: 3px; touch-action: none; }
.ed-area.scura { outline-color: rgba(255, 255, 255, .5); }
.ed-area.guida-c::after { content: ""; position: absolute; left: 50%; top: -6%; bottom: -6%; border-left: 1px solid var(--acc); pointer-events: none; }
.ed-vuoto { position: absolute; inset: 0; display: grid; place-content: center; margin: 0; padding: 8px; text-align: center; font-size: 12.5px; line-height: 1.4; color: rgba(28, 26, 25, .55); pointer-events: none; }
.ed-area.scura .ed-vuoto { color: rgba(255, 255, 255, .78); }
.liv { position: absolute; cursor: grab; user-select: none; -webkit-user-select: none; white-space: pre; line-height: 1.15; outline: none; text-align: center; }
.liv:active { cursor: grabbing; }
.liv img { display: block; width: 100%; pointer-events: none; }
.liv span { display: block; }
.liv.sel { outline: 1.5px solid var(--acc); outline-offset: 4px; }
.liv:focus-visible { outline: 2px solid var(--acc); outline-offset: 4px; }
.liv.fuori.sel { outline-color: var(--warn); }
.maniglia { position: absolute; right: -24px; bottom: -24px; width: 22px; height: 22px; border-radius: 50%; background: var(--acc); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); cursor: nwse-resize; }
.maniglia::before { content: ""; position: absolute; inset: -8px; }
.maniglia::after { content: ""; position: absolute; left: -9px; top: -9px; width: 10px; height: 10px; border-right: 1.5px dashed var(--acc); transform: rotate(45deg); transform-origin: 100% 100%; pointer-events: none; }
.ed-aiuto { margin: 0; padding: 8px 16px 14px; text-align: center; font-size: 12.5px; color: var(--testo2); }
.ed-aiuto.warn { color: var(--warn); font-weight: 600; }

.ed-pannello { grid-area: pannello; display: flex; flex-direction: column; min-height: 0; background: var(--carta); border-left: 1px solid var(--bordo); }
.ed-tab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 10px; border-bottom: 1px solid var(--bordo); }
.ed-tab button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 4px; border: 0; border-radius: var(--r-s); background: transparent; font-size: 12.5px; font-weight: 600; color: var(--testo2); cursor: pointer; }
.ed-tab button:hover { background: color-mix(in srgb, var(--testo) 5%, transparent); }
.ed-tab button[aria-selected="true"] { background: var(--acc-tenue); color: var(--testo); }
.ed-tab button[aria-selected="true"] svg { color: var(--acc); }
.conta { position: absolute; top: 4px; right: calc(50% - 26px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--acc); color: var(--acc-t); font: 700 11px/18px var(--f); font-style: normal; }
.conta:empty { display: none; }
.ed-pag { display: none; flex: 1; overflow-y: auto; padding: 4px 16px 20px; overscroll-behavior: contain; }
.ed-pag.on { display: block; }
.ed-pag h3 { margin: 18px 0 10px; font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

.modelli { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mod { display: grid; justify-items: center; gap: 2px; padding: 8px 4px 10px; border: 1px solid var(--bordo); border-radius: var(--r); background: var(--carta2); cursor: pointer; text-align: center; transition: border-color .12s, background .12s; }
.mod:hover { border-color: var(--bordo2); }
.mod[aria-checked="true"] { border-color: var(--acc); background: var(--acc-tenue); box-shadow: inset 0 0 0 1px var(--acc); }
.mod-img { width: 64px; height: 80px; } .mod-img svg { width: 100%; height: 100%; }
.mod b { font-size: 12.5px; line-height: 1.2; } .mod small { font-size: 11px; color: var(--testo2); line-height: 1.25; }
.colori, .pallini { display: flex; flex-wrap: wrap; gap: 8px; }
.colori button, .pallini button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); cursor: pointer; position: relative; transition: transform .12s; }
.colori button:hover, .pallini button:hover { transform: scale(1.08); }
.colori button[aria-checked="true"], .pallini button[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 0 0 2px var(--carta), 0 0 0 4px var(--acc); }
.pallini button { width: 24px; height: 24px; }
@media (pointer: coarse) { .pallini button { width: 30px; height: 30px; } }
.scheda { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 18px 0 0; padding: 14px; border-radius: var(--r); background: var(--carta2); border: 1px solid var(--bordo); }
.scheda dt { font-size: 12px; color: var(--testo2); } .scheda dd { margin: 0; font-size: 13.5px; font-weight: 600; }

.agg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.agg-b { display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--bordo); border-bottom-color: var(--bordo2); border-radius: var(--r); background: var(--carta2); cursor: pointer; text-align: center; transition: background .12s, transform .08s; }
.agg-b:hover { background: var(--acc-tenue); } .agg-b:active { transform: scale(.98); }
.agg-b:focus-within { outline: 2px solid var(--testo); outline-offset: 2px; }
.agg-b svg { color: var(--acc); } .agg-b b { font-size: 13.5px; } .agg-b small { font-size: 11.5px; color: var(--testo2); line-height: 1.25; }
.clip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.clip button { display: grid; justify-items: center; gap: 4px; padding: 10px 2px 6px; border: 1px solid var(--bordo); border-radius: var(--r-s); background: var(--carta2); cursor: pointer; font-size: 11px; color: var(--testo2); }
.clip button:hover { border-color: var(--acc); color: var(--testo); }
.clip img { width: 34px; height: 34px; }
.idee-mini { display: grid; gap: 6px; }
.idee-mini button { display: grid; text-align: left; gap: 1px; padding: 10px 12px; border: 1px solid var(--bordo); border-radius: var(--r-s); background: var(--carta2); cursor: pointer; }
.idee-mini button:hover { border-color: var(--acc); } .idee-mini b { font-size: 13.5px; } .idee-mini small { font-size: 12px; color: var(--testo2); }

.prop { padding-top: 6px; }
.font-scelta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.font-scelta button { min-height: 40px; padding: 0 10px; border: 1px solid var(--bordo); border-radius: var(--r-s); background: var(--carta2); font-size: 17px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-scelta button[aria-checked="true"] { border-color: var(--acc); background: var(--acc-tenue); box-shadow: inset 0 0 0 1px var(--acc); }
.prop .riga { margin-top: 10px; } .prop .riga .btn { flex: 1; padding: 0 10px; }
.prop .azioni { margin-top: 18px; } .prop .azioni .btn { flex: 1 1 calc(50% - 8px); }
.tav { display: flex; flex-wrap: wrap; gap: 6px; }
.tav button, .tav .libero { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); cursor: pointer; position: relative; }
.tav button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2), 0 0 0 2px var(--carta), 0 0 0 4px var(--acc); }
.tav .nessuno { background: linear-gradient(135deg, transparent 46%, var(--ko) 46%, var(--ko) 54%, transparent 54%), var(--carta); }
.tav .libero { background: conic-gradient(#e53935, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935); overflow: hidden; }
.tav .libero input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.livelli { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.livelli button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: var(--r-s); background: var(--carta2); cursor: pointer; text-align: left; }
.livelli button[aria-current="true"] { border-color: var(--acc); background: var(--acc-tenue); }
.mini { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-s); background: var(--palco); overflow: hidden; flex-shrink: 0; }
.mini img { width: 26px; height: 26px; object-fit: contain; } .mini i { font-style: normal; font-weight: 700; font-size: 15px; } .mini .mf { width: 22px; height: 10px; border-radius: 2px; }
.livelli .nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }

.ed-conto { grid-area: conto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--carta); border-top: 1px solid var(--bordo); box-shadow: 0 -6px 18px rgba(0, 0, 0, .05); }
.q { display: flex; align-items: center; gap: 4px; }
.q input { width: 66px; min-height: var(--tocco); text-align: center; border: 1px solid var(--bordo); border-bottom-color: var(--sotto); border-radius: var(--r-s); background: var(--carta2); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.q input::-webkit-inner-spin-button { -webkit-appearance: none; }
.prezzo { display: grid; line-height: 1.3; min-width: 0; } .prezzo b { font-size: 17px; font-variant-numeric: tabular-nums; } .prezzo small { color: var(--testo2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prezzo .lnk { justify-self: start; text-align: left; }
.tot { margin-left: auto; display: grid; text-align: right; line-height: 1.2; } .tot small { color: var(--testo2); font-size: 12px; } .tot b { font: 600 22px var(--f-d); font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) and (min-width: 701px) { .ed { grid-template-columns: minmax(0, 1fr) 330px; } }
@media (max-width: 700px) {
  .ed { display: flex; flex-direction: column; height: auto; min-height: calc(100vh - var(--tab-h)); }
  body:has(.demo:not([hidden])) .ed { height: auto; }
  .ed-palco { height: 56vh; min-height: 330px; }
  .ed-barra { padding: 10px 12px 6px; gap: 8px; }
  .ed-aiuto { padding: 4px 12px 8px; font-size: 12px; }
  .ed-pannello { border-left: 0; border-top: 1px solid var(--bordo); flex: 1; }
  .ed-tab { position: sticky; top: 0; z-index: 3; background: var(--carta); padding: 8px 10px; }
  .ed-tab button { flex-direction: row; justify-content: center; min-height: 42px; gap: 6px; font-size: 13.5px; }
  .conta { position: static; }
  .ed-pag { overflow: visible; padding-bottom: 104px; }
  .ed-conto { position: fixed; left: 0; right: 0; bottom: var(--tab-h); z-index: 15; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; }
  .ed-conto .tot { display: none; }
  .ed-conto .prezzo { flex: 1; } .ed-conto .prezzo b { font-size: 15.5px; }
  .ed-conto .btn.grande { min-height: 44px; padding: 0 16px; }
  .modelli { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 400px) { .q input { width: 52px; } .ed-conto .prezzo small { display: none; } }

/* ================================================================ MODELLI e IDEE */
.griglia-mod { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.carta-mod, .carta-idea, .carta-bozza { display: flex; flex-direction: column; background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--r); box-shadow: var(--om1); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.carta-mod:hover, .carta-idea:hover, .carta-bozza:hover { box-shadow: var(--om2); }
.cm-img { aspect-ratio: 4 / 4.2; padding: 16px 32px 0; background: radial-gradient(70% 60% at 50% 45%, var(--carta) 0%, var(--palco) 100%); }
.cm-img svg { width: 100%; height: 100%; }
.cm-t, .ci-t, .cb-t { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; flex: 1; }
.cm-t h2, .ci-t h2 { margin: 0; font-size: 17px; font-weight: 600; }
.cm-t p, .ci-t p { margin: 0; font-size: 13.5px; color: var(--testo2); }
.cm-t .da { margin-top: auto; color: var(--testo); } .da b { font-size: 17px; font-variant-numeric: tabular-nums; } .da small { color: var(--testo2); }
.cm-t .btn, .ci-t .btn { align-self: flex-start; }
.nota-stampa { display: flex; gap: 12px; align-items: flex-start; margin-top: 20px; padding: 16px; } .nota-stampa svg { color: var(--acc); margin-top: 2px; } .nota-stampa p { margin: 4px 0 0; color: var(--testo2); font-size: 14px; max-width: 80ch; }
.griglia-idee { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.ci-img { aspect-ratio: 4 / 5; background: #f4f2ee; } .ci-img img { display: block; width: 100%; height: 100%; object-fit: cover; } .ci-img .carica { border-radius: 0; }

/* ================================================================ LE MIE BORSE */
.griglia-bozze { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.carta-bozza.attuale { border-color: var(--acc); }
.cb-img { position: relative; display: block; aspect-ratio: 1; padding: 12px 30px 4px; background: radial-gradient(70% 60% at 50% 45%, var(--carta) 0%, var(--palco) 100%); }
.cb-img svg { width: 100%; height: 100%; }
.cb-liv { position: absolute; left: 10px; bottom: 8px; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; background: var(--carta); color: var(--testo2); box-shadow: var(--om1); }
.cb-t b { font-size: 15px; } .cb-t small { color: var(--testo2); font-size: 12.5px; margin-top: -6px; } .cb-t .riga { margin-top: auto; }
.richieste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.richieste li { display: flex; align-items: center; gap: 14px; padding: 10px 14px; }
.richieste img { width: 56px; height: 70px; object-fit: cover; border-radius: var(--r-s); background: var(--palco); }
.richieste li > div { display: grid; flex: 1; min-width: 0; } .richieste small { color: var(--testo2); }
.stato { justify-self: start; display: inline-block; margin-top: 4px; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--carta2); border: 1px solid var(--bordo); }
.stato.nuova { background: var(--acc-tenue); } .stato.confermata, .stato.stampa { background: var(--warn-t); color: var(--warn); } .stato.pronta, .stato.consegnata { background: var(--ok-t); color: var(--ok); } .stato.annullata { background: var(--ko-t); color: var(--ko); }

/* ================================================================ RICHIESTA */
.richiedi { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.modulo { padding: 22px 24px; }
.modulo h2 { margin: 6px 0 14px; font-size: 18px; font-weight: 600; } .modulo h2:not(:first-child) { margin-top: 26px; }
.scelta2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.scelta2 label { position: relative; cursor: pointer; }
.scelta2 input { position: absolute; opacity: 0; }
.scelta2 span { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding: 12px 14px; border: 1px solid var(--bordo); border-radius: var(--r); background: var(--carta2); height: 100%; }
.scelta2 span svg { grid-row: span 2; color: var(--acc); margin-top: 2px; } .scelta2 small { color: var(--testo2); font-size: 12.5px; }
.scelta2 input:checked + span { border-color: var(--acc); background: var(--acc-tenue); box-shadow: inset 0 0 0 1px var(--acc); }
.scelta2 input:focus-visible + span { outline: 2px solid var(--testo); outline-offset: 2px; }
.spunta { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-size: 14px; cursor: pointer; }
.spunta input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; }
.campi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.f { display: grid; gap: 5px; } .f > span { font-size: 13px; font-weight: 600; color: var(--testo2); } .f small { font-weight: 400; } .f.largo { grid-column: 1 / -1; }
.riep { position: sticky; top: 16px; padding: 18px; }
.riep h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
.riep-img { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.riep-img figure { margin: 0; } .riep-img img, .riep-img svg { display: block; width: 100%; height: auto; border-radius: var(--r-s); background: #f4f2ee; }
.riep-img figcaption { font-size: 12px; color: var(--testo2); text-align: center; margin-top: 4px; }
.righe { margin: 14px 0 0; display: grid; gap: 6px; font-size: 14px; }
.righe div { display: flex; justify-content: space-between; gap: 12px; } .righe dt { color: var(--testo2); } .righe dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.righe .sotto { font-size: 12.5px; padding-left: 10px; } .righe .sotto dd { font-weight: 400; color: var(--testo2); }
.righe .totale { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--bordo); font-size: 16px; } .righe .totale dt { color: var(--testo); font-weight: 600; } .righe .totale dd { font: 600 20px var(--f-d); }
@media (max-width: 900px) { .richiedi { grid-template-columns: 1fr; } .riep { position: static; order: -1; } }
@media (max-width: 560px) { .campi, .scelta2 { grid-template-columns: 1fr; } .modulo { padding: 18px 16px; } }

.fatto { max-width: 680px; margin: 0 auto; text-align: center; }
.fatto .testa { justify-content: center; text-align: center; } .fatto .testa p { margin-inline: auto; }
.ok-ic { display: inline-grid; place-items: center; width: 72px; height: 72px; margin: 12px 0 8px; border-radius: 50%; background: var(--ok-t); color: var(--ok); animation: salta .5s cubic-bezier(.16, 1, .3, 1); }
@keyframes salta { from { transform: scale(.5); opacity: 0; } }
.stato-r { display: flex; gap: 18px; align-items: center; padding: 16px; text-align: left; }
.stato-r img { width: 110px; height: auto; border-radius: var(--r-s); background: #f4f2ee; } .stato-r p { margin: 6px 0 0; }
.nota-neg { padding: 8px 12px; border-radius: var(--r-s); background: var(--carta2); font-size: 14px; }

/* ================================================================ ALTRO */
.altro-g { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.menu { list-style: none; margin: 0; padding: 4px; }
.menu a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 12px; border-radius: var(--r-s); color: var(--testo); text-decoration: none; }
.menu a:hover { background: color-mix(in srgb, var(--testo) 5%, transparent); }
.menu a > span:nth-child(2) { flex: 1; display: grid; } .menu small { color: var(--testo2); font-size: 12.5px; }
.lb-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-s); background: var(--acc-tenue); color: var(--acc); flex-shrink: 0; }
.credit { margin-top: 24px; text-align: center; font-size: 13px; color: var(--testo2); } .credit a { color: var(--testo2); }
.funz { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.funz li { display: flex; gap: 14px; padding: 16px; } .funz p { margin: 4px 0; color: var(--testo2); font-size: 14px; }
.legale { padding: 22px 26px; max-width: 78ch; font-size: 15px; line-height: 1.65; } .legale p { margin: 0 0 12px; }

/* ================================================================ finestre e avvisi */
.dlg { padding: 0; border: 1px solid var(--bordo); border-radius: var(--r); background: var(--carta); color: var(--testo); box-shadow: var(--om3); width: min(460px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(0, 0, 0, .35); }
.dlg[open] { animation: apri .22s cubic-bezier(.16, 1, .3, 1); }
@keyframes apri { from { opacity: 0; transform: scale(.96); } }
.dlg-c { position: relative; padding: 26px 24px 20px; }
.dlg-x { position: absolute; top: 8px; right: 8px; }
.dlg-c h2 { margin: 6px 0 8px; font-size: 21px; font-weight: 600; } .dlg-c p { margin: 0 0 10px; color: var(--testo2); }
.dlg-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--acc-tenue); color: var(--acc); }
.dlg-az { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.guida { text-align: center; }
.g-img { width: 150px; height: 188px; margin: 0 auto 4px; } .g-img svg { width: 100%; height: 100%; }
.punti { display: flex; justify-content: center; gap: 6px; list-style: none; padding: 0; margin: 14px 0 0; }
.punti li { width: 6px; height: 6px; border-radius: 3px; background: var(--bordo2); transition: background-color .2s; } .punti li.on { width: 18px; background: var(--acc); }
.guida .dlg-az { justify-content: space-between; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 96px); z-index: 60; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: var(--r); background: var(--testo); color: var(--carta); font-size: 14px; font-weight: 600; box-shadow: var(--om3); animation: apri .22s cubic-bezier(.16, 1, .3, 1); transition: opacity .5s, transform .5s; }
.toast.warn { background: var(--warn-t); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.toast.ko { background: var(--ko-t); color: var(--ko); }
.toast.via { opacity: 0; transform: translate(-50%, 10px); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .nav, .tab, .demo, .ed-pannello, .ed-conto { display: none !important; } }
