/* =========================================================================
   Fulgione PDF - stile
   Allineato a davidefulgione.com: fondo #07050e, accento #d018ab, solo Inter,
   superfici in vetro (bianco translucido + bordo chiaro) invece di riquadri
   pieni, orb sfocati in sottofondo sul desktop.
   ========================================================================= */

:root {
  --bg:        #07050e;
  --bg-2:      #0d0817;
  --glass:     rgba(255, 255, 255, .05);
  --surf:      rgba(17, 11, 30, .72);
  --glass-2:   rgba(255, 255, 255, .09);
  --line:      rgba(255, 255, 255, .10);
  --line-2:    rgba(255, 255, 255, .18);

  --text:      #e8e4f0;
  --muted:     #9080b8;
  --muted-2:   #6b5f8a;

  --pink:      #d018ab;
  --pink-2:    #8c0f70;
  --pink-soft: #e066cc;
  --grad:      linear-gradient(140deg, #d018ab, #8c0f70);

  --ok:        #4ade80;
  --err:       #f0506e;

  --r:         14px;
  --r-sm:      10px;
  --shadow:    0 18px 46px rgba(0, 0, 0, .55);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --nav-h: 68px;
  /* altezza reale occupata dalla navbar fissa, tacca dell'iPhone compresa */
  --nav-full: calc(68px + env(safe-area-inset-top));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 15px; -webkit-text-size-adjust: 100%; overflow-x: hidden;
  /* la navbar e' fissa: gli ancoraggi non devono finirci sotto */
  scroll-padding-top: calc(var(--nav-full) + .8rem);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* spazio lasciato alla navbar fissa, che e' uscita dal flusso */
  padding-top: var(--nav-full);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
ul, ol { list-style: none; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
::selection { background: var(--pink); color: #fff; }
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--pink); border-radius: 2px; }

.ic { width: 20px; height: 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----- sfondo fotografico -----
   background-attachment:fixed e' rotto su iOS: si usa un livello fisso
   proprio. Le due url sono un ripiego voluto: se sfondo.jpg non c'e'
   dentro /pdf/ viene mostrato quello nella radice del sito. */
.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url('sfondo.jpg'), url('/sfondo.jpg');
  background-size: cover, cover;
  background-position: center center, center center;
  background-repeat: no-repeat, no-repeat;
}
.bg::after {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 12% 108%, rgba(208, 24, 171, .22), transparent 62%),
    radial-gradient(110% 80% at 92% -12%, rgba(140, 15, 112, .22), transparent 58%),
    linear-gradient(180deg, rgba(7, 5, 14, .90) 0%, rgba(7, 5, 14, .94) 45%, rgba(7, 5, 14, .97) 100%);
}

/* ----- orb di sfondo: decorazione, solo desktop ----- */
.orb { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; z-index: 0; border-radius: 50%; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(38px, -28px); } }
@media (min-width: 1025px) {
  .orb { position: fixed; filter: blur(110px); opacity: .14; }
  .orb-1 { width: 600px; height: 600px; background: radial-gradient(circle, #d018ab 0%, transparent 70%); top: -200px; left: -220px; animation: drift 30s ease-in-out infinite; }
  .orb-2 { width: 420px; height: 420px; background: radial-gradient(circle, #8c0f70 0%, transparent 70%); bottom: -140px; right: -140px; animation: drift 24s ease-in-out infinite reverse; }
}

/* ----- navbar ----- */
/* Fissa, non sticky: resta visibile anche risalendo con un colpo di pollice
   dentro una pagina lunga. Essendo fuori dal flusso, lo spazio che occupava
   viene restituito dal padding-top del body (--nav-full). */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  background: rgba(7, 5, 14, .92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(208, 24, 171, .18);
  padding-top: env(safe-area-inset-top);
}
.nav-wrap {
  max-width: 1160px; margin: 0 auto; height: var(--nav-h);
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.logo { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.logo-photo {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(208, 24, 171, .4);
  box-shadow: 0 0 10px rgba(208, 24, 171, .3);
}
.logo-photo img { width: 38px; height: 38px; object-fit: cover; object-position: center top; }
.logo-copy { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.logo-name { font-size: .94rem; font-weight: 600; white-space: nowrap; }
.logo-role {
  font-size: .58rem; font-weight: 400; color: var(--pink-soft);
  letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
/* Con sei strumenti le voci possono sfiorare il bordo del logo: invece di
   spezzare la riga, la fascia centrale si restringe e scorre in orizzontale. */
.nav-mid { display: none; gap: .1rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav-mid::-webkit-scrollbar { display: none; }
.nav-a {
  padding: .38rem .8rem; border-radius: 7px;
  font-size: .82rem; color: var(--muted);
  transition: color .2s, background .2s; white-space: nowrap;
}
.nav-a:hover, .nav-a.on { color: var(--text); background: rgba(208, 24, 171, .1); }
.nav-act { display: flex; align-items: center; gap: .5rem; }
.nav-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .46rem .85rem; border-radius: 9px;
  border: 1px solid rgba(208, 24, 171, .3);
  background: rgba(208, 24, 171, .1);
  font-size: .78rem; font-weight: 500; color: var(--text);
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.nav-btn:hover { background: rgba(208, 24, 171, .2); border-color: rgba(208, 24, 171, .55); }
.nav-btn svg { width: 13px; height: 13px; }

/* ----- contenitore ----- */
.wrap {
  position: relative; z-index: 1;
  max-width: 1160px; margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) clamp(1rem, 4vw, 2.5rem) 3rem;
}

.crumb { display: flex; align-items: center; gap: .5rem; font-size: .76rem; color: var(--muted-2); margin-bottom: 1.4rem; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--text); }

/* ----- pill + hero ----- */
.pill {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .26rem .9rem; border-radius: 40px;
  border: 1px solid rgba(224, 102, 204, .28);
  background: rgba(208, 24, 171, .12);
  font-size: .67rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--pink-soft);
}
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }

.hero { margin-bottom: clamp(1.6rem, 4vw, 2.4rem); }
.hero .pill { margin-bottom: 1.1rem; }
.hero h1 { font-size: clamp(1.9rem, 6.6vw, 3rem); font-weight: 700; letter-spacing: -.03em; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #d018ab, #e066cc);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { margin-top: .7rem; color: var(--muted); font-size: .95rem; max-width: 58ch; }

/* Il contatore: una riga sotto il testo, non una card. */
.hero-hits { margin-top: .85rem; font-size: .76rem; color: var(--muted-2); }
.hero-hits span {
  font-weight: 600; color: var(--pink-soft);
  font-variant-numeric: tabular-nums;
}

/* Illustrazione dell'hub: nascosta di partenza e accesa solo da 1025px,
   la stessa soglia a cui compare la barra degli strumenti. Mobile-first:
   sul telefono il browser non la scarica nemmeno. */
.hero-art { display: none; }

/* ----- superficie in vetro ----- */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ----- griglia strumenti ----- */
.sec-title {
  display: flex; align-items: center; gap: .7rem;
  font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted-2); margin: 2rem 0 .9rem;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.grid { display: grid; grid-template-columns: 1fr; gap: .8rem; }

/* Bordo verde: le card degli strumenti sono l'unica cosa cliccabile della
   pagina, il verde le stacca dal magenta usato per tutto il resto. */
.card {
  display: flex; align-items: flex-start; gap: .85rem;
  padding: 1.05rem 1.1rem;
  background: var(--surf); border: 1px solid rgba(74, 222, 128, .38); border-radius: 12px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: background .25s, border-color .25s, transform .25s, box-shadow .25s;
  -webkit-tap-highlight-color: transparent;
}
.card:hover {
  background: var(--glass-2);
  border-color: rgba(74, 222, 128, .8);
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(74, 222, 128, .16);
}
.card-ic {
  flex: none; width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(208, 24, 171, .12);
  border: 1px solid rgba(208, 24, 171, .22);
  color: var(--pink);
}
.card-b { min-width: 0; }
.card-t { display: block; font-size: .95rem; font-weight: 600; }
.card-c { display: block; font-size: .8rem; line-height: 1.5; color: var(--muted); margin-top: .1rem; }
.card-go { display: block; font-size: .74rem; color: var(--pink-soft); margin-top: .45rem; }
/* Le card "in arrivo" sono state rimosse: nell'hub compare solo cio' che
   funziona davvero, quindi .card.soon e .soon-tag non servono piu'. */

/* ----- card di sostegno PayPal (hub, sotto gli strumenti) -----
   Gemella di quella in index.php del sito: stesse proporzioni e stesso
   pulsante, ma sui colori e sulle superfici di questa sotto-app. */
.dfs-sup {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  margin: 1.6rem 0 0; padding: 1.15rem 1.25rem;
  border: 1px solid rgba(208, 24, 171, .22); border-radius: 12px;
  background:
    radial-gradient(620px 220px at 6% 0%, rgba(0, 120, 240, .12), transparent 72%),
    var(--surf);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .34);
}
.dfs-sup-ico {
  display: grid; place-items: center;
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--grad); color: #fff;
  box-shadow: 0 4px 18px rgba(208, 24, 171, .35);
}
.dfs-sup-ico svg { width: 19px; height: 19px; }
.dfs-sup-txt { flex: 1 1 280px; min-width: 0; }
.dfs-sup-txt h2 { margin-bottom: .15rem; font-size: .95rem; font-weight: 600; }
.dfs-sup-txt p { font-size: .82rem; line-height: 1.6; color: var(--muted); }
.dfs-sup-act { margin-left: auto; }

.dfs-pp {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .66rem 1.25rem; border-radius: 40px; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(135deg, #0a8bff, #00337d);
  color: #fff; font-size: .84rem; font-weight: 600; line-height: 1;
  box-shadow: 0 6px 22px rgba(0, 92, 200, .38);
  transition: transform .15s, box-shadow .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.dfs-pp:hover { filter: brightness(1.09); box-shadow: 0 8px 28px rgba(0, 92, 200, .52); }
.dfs-pp:active { transform: scale(.97); }
.dfs-pp svg { width: 16px; height: 16px; }

/* Il bottone reso dall'SDK: nel DOM per poterlo cliccare, mai a video. */
.dfs-pp-sdk {
  position: fixed; left: -9999px; top: -9999px;
  width: 1px; height: 1px; overflow: hidden; opacity: 0;
}

/* ----- pannelli dello strumento ----- */
.panel {
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 1.1rem; margin-bottom: .9rem;
}
.panel-h { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin-bottom: .9rem; }
.panel-h h2 { font-size: .92rem; }
.panel-h .hint { font-weight: 400; font-size: .76rem; color: var(--muted-2); }
.panel-a { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ----- dropzone -----
   Bassa di proposito: e' il punto di partenza, non il contenuto della
   pagina. Su mobile resta in colonna e centrata; da 620px passa su una
   riga sola (vedi la media query in fondo), che e' quello che le fa
   guadagnare davvero altezza. */
.drop {
  position: relative; text-align: center;
  padding: clamp(1.1rem, 3vw, 1.4rem) 1.2rem;
  border: 1px dashed rgba(208, 24, 171, .35);
  border-radius: var(--r);
  background: radial-gradient(120% 140% at 50% 0%, rgba(208, 24, 171, .14), transparent 65%), var(--surf);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: border-color .25s, background .25s;
  margin-bottom: .9rem;
}
.drop.over { border-color: var(--pink); background: rgba(208, 24, 171, .2); }
.drop.mini { display: none; }
.drop-ic {
  width: 38px; height: 38px; margin: 0 auto .55rem;
  border-radius: 11px; display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 18px rgba(208, 24, 171, .3);
}
.drop-ic svg { width: 19px; height: 19px; }
.drop h2 { font-size: .98rem; }
.drop p { color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.drop .btn { margin-top: .7rem; }

/* ----- pulsanti ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .68rem 1.25rem; border-radius: 10px;
  font-size: .88rem; font-weight: 600; color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 22px rgba(208, 24, 171, .28);
  transition: transform .15s, box-shadow .2s, opacity .2s;
}
.btn:hover { box-shadow: 0 10px 28px rgba(208, 24, 171, .4); }
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .4; box-shadow: none; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-lg { width: 100%; padding: .9rem 1.4rem; font-size: .95rem; }
.btn-sm { padding: .42rem .8rem; font-size: .78rem; border-radius: 8px; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-2); box-shadow: none;
}
.btn-ghost:hover { border-color: rgba(208, 24, 171, .55); background: rgba(208, 24, 171, .08); box-shadow: none; }

/* ----- miniature ----- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: .55rem; }
.thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 4; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: #0a0713;
  touch-action: manipulation;
}
.thumb.dragging { opacity: .3; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb .idx {
  position: absolute; top: 4px; left: 4px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 6px;
  background: rgba(7, 5, 14, .85); border: 1px solid var(--line);
  font-size: .66rem; font-weight: 600; line-height: 19px; text-align: center;
}
.thumb .nm {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem .4rem .3rem;
  font-size: .58rem; color: #cfc7e0;
  background: linear-gradient(transparent, rgba(7, 5, 14, .95));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.thumb .pg {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  padding: 0 6px; height: 19px; border-radius: 6px;
  background: rgba(208, 24, 171, .85); border: 1px solid rgba(255, 255, 255, .18);
  font-size: .62rem; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.thumb-wait {
  width: 100%; height: 100%;
  background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(208,24,171,.14) 50%, rgba(255,255,255,.03) 70%);
  background-size: 220% 100%;
  animation: shim 1.3s linear infinite;
}
@keyframes shim { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.thumb-tools { position: absolute; top: 4px; right: 4px; display: flex; flex-direction: column; gap: 3px; }
.thumb-move { position: absolute; bottom: 4px; left: 4px; display: flex; gap: 3px; }
.tbtn {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(7, 5, 14, .82); border: 1px solid var(--line); color: var(--text);
  transition: border-color .2s, color .2s;
}
.tbtn svg { width: 13px; height: 13px; }
.tbtn:hover { border-color: rgba(208, 24, 171, .6); color: #fff; }
.tbtn.del:hover { border-color: rgba(240, 80, 110, .7); color: var(--err); }
.tbtn.grab { cursor: grab; touch-action: none; }
.thumb.err { border-color: rgba(240, 80, 110, .5); }
.thumb .errmsg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  padding: .5rem; font-size: .62rem; color: #ff9db0; background: rgba(7, 5, 14, .86);
}

/* ----- opzioni ----- */
.opts { display: grid; grid-template-columns: 1fr; gap: .95rem; }
.opts-1 { grid-template-columns: 1fr; }
.opt-l { display: block; font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: .4rem; }
.seg {
  display: flex; gap: 3px; padding: 3px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}
.seg button {
  flex: 1 1 0; min-width: 0; padding: .48rem .3rem; border-radius: 8px;
  font-size: .77rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .18s, color .18s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] {
  background: var(--grad); color: #fff; font-weight: 500;
  box-shadow: 0 4px 14px rgba(208, 24, 171, .28);
}
.seg button[disabled] { opacity: .5; cursor: not-allowed; }
.note { font-size: .72rem; line-height: 1.55; color: var(--muted-2); margin-top: .35rem; }

/* ----- azione, progresso, risultato ----- */
.actions { display: flex; flex-direction: column; gap: .8rem; }
.prog { display: none; }
.prog.on { display: block; }
.prog-t { font-size: .77rem; color: var(--muted); margin-bottom: .4rem; }
.bar { height: 5px; border-radius: 40px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s ease; }

.result { display: none; margin-top: .9rem; }
.result.on { display: block; }
.result-in {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .9rem; border-radius: var(--r-sm);
  border: 1px solid rgba(74, 222, 128, .3); background: rgba(74, 222, 128, .07);
}
.result-ic { width: 34px; height: 34px; flex: none; color: var(--ok); }
.result-b { flex: 1 1 150px; min-width: 0; }
.result-n { font-size: .88rem; font-weight: 600; word-break: break-all; }
.result-s { font-size: .74rem; color: var(--muted); }
.result-a { display: flex; gap: .45rem; flex-wrap: wrap; }

/* ----- card espandibile ----- */
.acc {
  margin-top: 1.6rem;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}
.acc + .acc { margin-top: .6rem; }
.acc > summary {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.1rem; cursor: pointer; list-style: none;
  transition: background .2s;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: rgba(208, 24, 171, .07); }
.acc-ic {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: rgba(208, 24, 171, .12); border: 1px solid rgba(208, 24, 171, .22);
  color: var(--pink);
}
.acc-ic svg { width: 16px; height: 16px; }
.acc-t { flex: 1; min-width: 0; }
.acc-t strong { display: block; font-size: .9rem; font-weight: 600; }
.acc-t span { display: block; font-size: .76rem; color: var(--muted); }
.acc-ch { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .25s; }
.acc[open] > summary .acc-ch { transform: rotate(180deg); }
.acc[open] > summary { border-bottom: 1px solid var(--line); }
.acc-body { padding: .3rem 1.1rem 1.2rem; }
.acc-body h3 { font-size: .86rem; margin: 1.1rem 0 .25rem; }
.acc-body h3:first-child { margin-top: .8rem; }
.acc-body p, .acc-body li { font-size: .85rem; color: var(--muted); }
.acc-body strong { color: var(--text); font-weight: 500; }
.acc-body ol, .acc-body ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.acc-body ol { list-style: decimal; }
.acc-body ul { list-style: disc; }
.acc-body li { margin-bottom: .3rem; }
.acc-body li::marker { color: var(--pink-soft); }

.tip {
  display: flex; align-items: flex-start; gap: .6rem;
  margin-top: 1rem; padding: .7rem .85rem; border-radius: var(--r-sm);
  border: 1px solid rgba(208, 24, 171, .28); background: rgba(208, 24, 171, .08);
  font-size: .82rem; color: #d8cfe6;
}
.tip svg { width: 15px; height: 15px; flex: none; margin-top: .25rem; color: var(--pink-soft); }
.tip strong { color: var(--text); }

/* ----- riga file caricato ----- */
.fileline {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem .9rem; margin-bottom: .9rem;
  background: var(--surf); border: 1px solid var(--line); border-radius: var(--r);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.fileline-ic { width: 22px; height: 22px; flex: none; color: var(--pink); }
.fileline-b { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.fileline-b strong { font-size: .86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileline-b span { font-size: .74rem; color: var(--muted); }

/* ----- due colonne: anteprima e controlli ----- */
.cols { display: grid; grid-template-columns: 1fr; gap: 0; align-items: start; }

/* ----- anteprima ----- */
.prev-stage {
  display: grid; place-items: center;
  padding: .6rem; border-radius: var(--r-sm);
  background: repeating-conic-gradient(rgba(255,255,255,.045) 0% 25%, transparent 0% 50%) 0 0 / 16px 16px;
  border: 1px solid var(--line);
  min-height: 180px;
}
.prev-stage canvas {
  max-width: 100%; height: auto;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

/* ----- firma: riquadro trascinabile sull'anteprima -----
   Il riquadro e' posizionato in percentuale sul contenitore, che avvolge
   esattamente il canvas: cosi' le coordinate della firma restano frazioni
   della pagina e valgono per qualunque formato e rotazione. */
.sig-wrap { position: relative; display: inline-block; max-width: 100%; line-height: 0; }
.sig-wrap canvas { display: block; }
.sig-box {
  position: absolute; touch-action: none; cursor: grab;
  border: 1px dashed rgba(208, 24, 171, .85);
  background: rgba(208, 24, 171, .07);
  -webkit-tap-highlight-color: transparent;
}
.sig-box img { width: 100%; height: 100%; display: block; pointer-events: none; }
.sig-box.mv { cursor: grabbing; border-style: solid; }
.sig-box.rz { border-style: solid; }
.sig-hd {
  position: absolute; right: -11px; bottom: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--pink); border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  cursor: nwse-resize; touch-action: none;
}

/* ----- firma: foglio su cui si disegna -----
   Fondo bianco via CSS, canvas trasparente: quello che si esporta e' solo
   l'inchiostro, quindi la firma non porta con se' un rettangolo bianco. */
.sig-pad-w { position: relative; }
.sig-pad {
  display: block; width: 100%; aspect-ratio: 5 / 2;
  border-radius: var(--r-sm);
  border: 1px dashed rgba(208, 24, 171, .4);
  background: #fff; touch-action: none; cursor: crosshair;
}
.sig-pad-line {
  position: absolute; left: 7%; right: 7%; bottom: 26%;
  border-bottom: 1px dashed rgba(0, 0, 0, .2); pointer-events: none;
}
.sig-pad-hint {
  position: absolute; left: 0; right: 0; top: 42%;
  text-align: center; font-size: .8rem; color: #9aa;
  pointer-events: none; transition: opacity .2s;
}
.sig-pad-w.inked .sig-pad-hint { opacity: 0; }
.sig-padbar { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.sig-padbar .note { margin-top: 0; flex: 1 1 auto; }

/* ----- campi di testo ----- */
.fld {
  width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(7, 5, 14, .55); color: var(--text);
  font-family: inherit; font-size: .88rem;
  transition: border-color .2s, background .2s;
}
.fld::placeholder { color: var(--muted-2); }
.fld:focus {
  outline: none; border-color: rgba(208, 24, 171, .6);
  background: rgba(7, 5, 14, .75);
}
#rangeRow { margin-top: .5rem; }

.pair { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: .8rem; }
.pickline { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.pickline .note { margin-top: 0; }

/* ----- tavolozza colori ----- */
.sw { display: flex; gap: .4rem; }
.sw button {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--c); border: 1px solid var(--line-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);
  transition: transform .15s, box-shadow .2s;
}
.sw button:hover { transform: translateY(-1px); }
.sw button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--pink);
}

/* ----- footer ----- */
.foot { position: relative; z-index: 1; border-top: 1px solid var(--line); background: rgba(13, 8, 23, .6); padding-bottom: env(safe-area-inset-bottom); }
.foot-in { max-width: 1160px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 1.8rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-bottom: .9rem; }
.foot-nav a { font-size: .8rem; color: var(--muted); }
.foot-nav a:hover { color: var(--text); }
.foot-copy { font-size: .74rem; color: var(--muted-2); }
.foot-copy a { color: var(--muted); }
.foot-copy strong { color: var(--muted); font-weight: 600; }

/* Il blocco dei diritti occupa tutta la larghezza del footer. Non a riga
   piena, che a 1160px sarebbe illeggibile: a colonne, cosi' il testo si
   distribuisce in orizzontale e ogni riga resta di lunghezza sana. Una
   colonna sul telefono, due sul tablet, tre sul desktop. */
.foot-legal { margin-top: .9rem; }
.foot-legal p {
  font-size: .7rem; line-height: 1.6; color: var(--muted-2);
  break-inside: avoid; -webkit-column-break-inside: avoid;
}
.foot-legal p + p { margin-top: .5rem; }
.foot-legal strong { color: var(--muted); font-weight: 600; }

.foot-stat {
  margin-top: .9rem; padding-top: .8rem;
  border-top: 1px solid var(--line);
  font-size: .72rem; color: var(--muted-2);
}
.foot-stat span {
  font-weight: 600; color: var(--pink-soft);
  font-variant-numeric: tabular-nums;
}

/* ----- toast ----- */
.toast-host {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(1rem + env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 1.5rem));
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
.toast {
  padding: .7rem .9rem; border-radius: var(--r-sm);
  background: rgba(20, 13, 34, .97); border: 1px solid var(--line-2);
  box-shadow: var(--shadow); font-size: .83rem;
  animation: toast-in .22s ease;
}
.toast.err { border-color: rgba(240, 80, 110, .5); }
.toast.ok { border-color: rgba(74, 222, 128, .5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ----- griglia di pagine -----
   Usata da Organizza pagine e Dividi PDF. Namespace .pgt, separato da
   .thumb: quello ragiona per documento, questo per pagina.
   Il riquadro dell'immagine e' QUADRATO di proposito: una rotazione di
   90 gradi dentro un quadrato non esce dal quadrato, quindi la rotazione
   non richiede nessuna correzione di scala. Non cambiare l'aspect-ratio
   senza rimettere la correzione. */
.pgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: .55rem; }
.pgt {
  position: relative; overflow: hidden;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: #0a0713;
  touch-action: manipulation; transition: border-color .18s, opacity .18s;
}
.pgt-fr { aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; }
.pgt-fr img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  transition: transform .22s ease;
}
.pgt-fr .thumb-wait { width: 100%; height: 100%; }
.pgt.dragging { opacity: .3; }
.pgt-no {
  position: absolute; top: 4px; left: 4px;
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 6px;
  background: rgba(7, 5, 14, .85); border: 1px solid var(--line);
  font-size: .66rem; font-weight: 600; line-height: 19px; text-align: center;
}
.pgt-tools { position: absolute; top: 4px; right: 4px; display: flex; flex-direction: column; gap: 3px; }
/* le frecce stanno a sinistra: a destra finirebbero sotto la colonna
   dei pulsanti (maniglia + ruota + cestino = 78px di altezza). */
.pgt-move { position: absolute; bottom: 4px; left: 4px; display: flex; gap: 3px; }
.tbtn.back:hover { border-color: rgba(74, 222, 128, .7); color: var(--ok); }

/* pagina esclusa: resta visibile, cosi' si capisce cosa si sta togliendo */
.pgt.off { opacity: .34; border-style: dashed; }
.pgt.off .pgt-fr img { filter: grayscale(1); }
.pgt.off::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, transparent 0 7px, rgba(240, 80, 110, .13) 7px 14px);
  pointer-events: none;
}

/* etichetta della parte di destinazione */
.pgt-tag {
  position: absolute; left: 4px; right: 4px; bottom: 4px;
  padding: .1rem .3rem; border-radius: 6px;
  font-size: .6rem; font-weight: 600; line-height: 1.5; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(7, 5, 14, .88); border: 1px solid var(--line); color: var(--muted);
}
.pgt-tag.k0 { border-color: rgba(208, 24, 171, .6);  color: #f0a0e0; }
.pgt-tag.k1 { border-color: rgba(96, 165, 250, .6);  color: #a8cbff; }
.pgt-tag.k2 { border-color: rgba(74, 222, 128, .6);  color: #9ae9b8; }
.pgt-tag.k3 { border-color: rgba(251, 191, 36, .6);  color: #ffd98a; }
.pgt-tag.k4 { border-color: rgba(167, 139, 250, .6); color: #c9b8ff; }
.pgt-tag.k5 { border-color: rgba(45, 212, 191, .6);  color: #8ee6dc; }

/* selezione: si tocca il riquadro, non una casella minuscola */
.pgs.pick .pgt-fr { cursor: pointer; }
.pgt-chk {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  background: rgba(7, 5, 14, .82); border: 1px solid var(--line-2); color: transparent;
  transition: background .18s, color .18s, border-color .18s;
}
.pgt-chk svg { width: 15px; height: 15px; }
.pgt.sel { border-color: rgba(208, 24, 171, .75); }
.pgt.sel .pgt-chk { background: var(--pink); border-color: var(--pink); color: #fff; }
.pgs.pick .pgt:not(.sel) .pgt-fr img { opacity: .55; }

/* ----- elenco dei file prodotti ----- */
.filelist { margin-top: .7rem; display: grid; gap: .3rem; }
.filelist a {
  display: flex; align-items: center; gap: .55rem;
  padding: .45rem .6rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--glass);
  font-size: .78rem; transition: border-color .18s, background .18s;
}
.filelist a:hover { border-color: rgba(208, 24, 171, .55); background: rgba(208, 24, 171, .08); }
.filelist svg { width: 14px; height: 14px; flex: none; color: var(--pink-soft); }
.filelist span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist em { flex: none; font-style: normal; font-size: .72rem; color: var(--muted-2); }

/* ----- campo numerico con passi ----- */
.stepper { display: flex; align-items: center; gap: .4rem; }
.stepper .fld { width: 5.5rem; text-align: center; }
.stepper input[type="number"] { -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.chips button {
  padding: .26rem .6rem; border-radius: 40px; font-size: .74rem;
  border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  transition: border-color .18s, color .18s;
}
.chips button:hover { border-color: rgba(208, 24, 171, .55); color: var(--text); }
.chips button[aria-pressed="true"] { border-color: var(--pink); color: var(--text); background: rgba(208, 24, 171, .16); }

/* ----- riassunto del piano di uscita ----- */
.plan { display: grid; gap: .35rem; margin-top: .2rem; }
.plan-r {
  display: flex; align-items: baseline; gap: .5rem;
  padding: .4rem .6rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--glass); font-size: .78rem;
}
.plan-r b { font-weight: 600; }
.plan-r span { flex: 1; min-width: 0; color: var(--muted); font-size: .74rem; }
.plan-r i { font-style: normal; font-size: .72rem; color: var(--muted-2); }
.plan-empty { font-size: .78rem; color: var(--err); }

@media (min-width: 1025px) {
  .pgs { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

@media (max-width: 640px) {
  .dfs-sup { padding: 1.05rem; gap: .85rem; }
  .dfs-sup-act { margin-left: 0; width: 100%; }
  .dfs-sup-act .dfs-pp { width: 100%; }
}

/* ----- desktop ----- */
@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .foot-legal { column-count: 2; column-gap: 2.2rem; }
  /* in colonne il margine fra paragrafi diventa uno stacco a inizio colonna */
  .foot-legal p + p { margin-top: .6rem; }

  /* Dropzone su una riga: icona, testo, pulsante. Le aree servono perche'
     titolo e sottotitolo sono fratelli senza contenitore proprio in tutte
     e sei le pagine, e non voglio toccare il markup per una questione di
     sola presentazione. L'input file e' hidden, quindi non prende cella. */
  .drop {
    display: grid; align-items: center; text-align: left;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "ic tit btn" "ic sub btn";
    column-gap: .95rem;
    padding: .85rem 1.1rem;
  }
  .drop-ic { grid-area: ic; margin: 0; }
  .drop h2 { grid-area: tit; }
  .drop p { grid-area: sub; margin-top: .1rem; }
  .drop .btn { grid-area: btn; margin-top: 0; }
  .opts { grid-template-columns: repeat(2, 1fr); }
  .actions { flex-direction: row; align-items: center; }
  .actions .btn-lg { width: auto; min-width: 220px; }
  .actions .prog { flex: 1 1 auto; }
  .panel { padding: 1.3rem; }
}
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .9rem; }
  /* I pannelli dentro .cols perdono il margine inferiore per stare allineati,
     ma allora il blocco intero resta incollato al pannello che lo segue:
     il margine va rimesso sul contenitore. */
  .cols { margin-bottom: .9rem; }
  .cols > .panel { margin-bottom: 0; }
  .prev { position: sticky; top: calc(var(--nav-full) + 1rem); }
  .pair { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1025px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .opts { grid-template-columns: repeat(3, 1fr); }
  .opts-1 { grid-template-columns: 1fr; }
  .nav-mid { display: flex; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .foot-legal { column-count: 3; column-gap: 2.4rem; }

  /* Testo a sinistra, illustrazione a destra. L'immagine viene misurata in
     ALTEZZA, non in larghezza: cosi' resta alta quanto il blocco di testo
     invece di gonfiarsi sugli schermi larghi. Con height definita e
     width:auto il browser ricava la larghezza dalle proporzioni, e la
     colonna "auto" si stringe su quella. */
  .hero-hub {
    display: grid; align-items: center; gap: clamp(1.5rem, 4vw, 3rem);
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .hero-copy { min-width: 0; }
  .hero-art {
    display: block; justify-self: end;
    height: clamp(150px, 15vw, 205px);
    width: auto; max-width: 34vw;
    object-fit: contain;
    filter: drop-shadow(0 14px 32px rgba(0, 0, 0, .5));
  }
}
