:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --text: #18202b;
  --muted: #5b6878;
  --border: #dde2e9;
  --accent: #1f5bd8;
  --accent-hover: #1a4dba;
  --accent-text: #ffffff;
  --ok: #18794e;
  --ok-bg: #e7f5ee;
  --err: #b42318;
  --err-bg: #fdeceb;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --info: #1f4fae;
  --info-bg: #e8effd;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101419;
    --surface: #181d24;
    --surface-2: #20262f;
    --text: #e7ebf0;
    --muted: #98a4b3;
    --border: #2b333e;
    --accent: #6b97ff;
    --accent-hover: #86aaff;
    --accent-text: #0b1222;
    --ok: #5fd39a;
    --ok-bg: #12301f;
    --err: #ff8a80;
    --err-bg: #3a1714;
    --warn: #f3c25a;
    --warn-bg: #362a0d;
    --info: #9dbaff;
    --info-bg: #182540;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2rem 0; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nav a { text-decoration: none; }
main { padding-top: 24px; padding-bottom: 32px; }
.footer { padding-bottom: 32px; font-size: .85rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .8rem; font-weight: 400; }
.lead { max-width: 760px; margin-top: 0; }
.mt { margin-top: 1rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; margin: 0; }
.inline[hidden] { display: none; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title { margin-top: 32px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.layout-2 { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 16px; align-items: start; }
@media (max-width: 760px) { .layout-2 { grid-template-columns: 1fr; } }
.empty { text-align: center; padding: 40px 20px; }

.auth { max-width: 420px; margin: 32px auto; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
input[type=email], input[type=password], input[type=text], input[type=number], input[type=date], input[type=search] {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.check { flex-direction: row; align-items: flex-start; gap: 8px; font-weight: 400; }
.check input { margin-top: .3rem; }
.folder-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow: auto; }
.folder-list .check { flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border-radius: 8px; padding: 9px 16px; border: 1px solid transparent; min-height: 40px;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 4px 10px; min-height: 30px; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn-link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid transparent; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--info-bg); color: var(--info); }

.provider-badge { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.mailbox-email { overflow-wrap: anywhere; margin-bottom: 4px; }

.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
details.help { margin-top: 14px; font-size: .9rem; }
details summary { cursor: pointer; color: var(--accent); }

.table-wrap { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.subject { max-width: 380px; overflow-wrap: anywhere; }

.status { display: inline-block; font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.status-queued, .status-running, .status-picking { background: var(--info-bg); color: var(--info); }
.status-done { background: var(--ok-bg); color: var(--ok); }
.status-failed { background: var(--err-bg); color: var(--err); }
.status-cancelled, .status-expired { background: var(--surface-2); color: var(--muted); }

.progress { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 12px 0; }
.progress-bar { height: 100%; width: 0; min-width: 6px; background-color: var(--accent); border-radius: inherit;
  transition: width 1.2s cubic-bezier(.22, .8, .24, 1), background-color .3s ease; }
/* in corso: strisce diagonali che scorrono; in attesa o in pausa: barra più tenue e ferma */
.progress.is-active .progress-bar {
  background-image: linear-gradient(135deg, rgba(255, 255, 255, .22) 25%, transparent 25%, transparent 50%,
                                    rgba(255, 255, 255, .22) 50%, rgba(255, 255, 255, .22) 75%, transparent 75%, transparent);
  background-size: 28px 28px;
}
.progress.is-waiting .progress-bar { background-color: var(--muted); opacity: .55; }
.progress-mini { display: block; height: 6px; margin: 6px 0 2px; min-width: 90px; }
.progress-mini .progress-bar { display: block; }
.job-eta { margin: -4px 0 12px; font-variant-numeric: tabular-nums; }
@keyframes progress-stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }
@media (prefers-reduced-motion: no-preference) {
  .progress.is-active .progress-bar { animation: progress-stripes 1.1s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar { transition: none; }
}
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 0; }
.stats div { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.stats dt { font-size: .78rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }

.preview { margin-top: 16px; }
.preview .summary { display: flex; gap: 24px; flex-wrap: wrap; align-items: baseline; margin-bottom: 12px; }
.preview .big { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.log { white-space: pre-wrap; font-size: .82rem; max-height: 360px; overflow: auto; }

/* navigazione e archivi */
.nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-underline-offset: 6px; }
.layout-even { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px 24px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 32px 0 12px; }
.section-head .section-title { margin: 0; }
.list { padding: 0; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
/* il testo può restringersi e andare a capo (anche dentro indirizzi email lunghi); il badge resta intero e dentro */
.list-item > :first-child { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.list-item > .status { flex: none; white-space: nowrap; }
/* elementi con badge: badge sulla riga del titolo, così indirizzi, date e barra hanno tutta la larghezza */
.list-item-stacked { display: block; }
.list-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.list-item-head .status { flex: none; white-space: nowrap; }
.list-item-meta { display: block; margin-top: 2px; overflow-wrap: break-word; }
.list-item:hover { background: var(--surface-2); }
.filter-bar { margin: 0; }
.inline-label { flex-direction: row; align-items: center; gap: 8px; }
select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; max-width: 100%; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; }
td.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.saved-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.help .steps { padding-left: 1.2rem; margin: .5rem 0; }
.help .steps li { margin-bottom: .55rem; font-size: .9rem; }
.help p { margin: .5rem 0; }

/* cancellazione dalla casella */
:root { --danger: #c0262d; --danger-hover: #a51f25; --danger-text: #ffffff; }
@media (prefers-color-scheme: dark) { :root { --danger: #ff6b6b; --danger-hover: #ff8787; --danger-text: #1a0606; } }
.btn-danger { background: var(--danger); color: var(--danger-text); }
.btn-danger:hover { background: var(--danger-hover); }
.danger-box { border: 2px solid var(--danger); background: var(--err-bg); color: var(--text); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 16px; }
.danger-box h2 { color: var(--err); margin-bottom: 8px; }
.danger-box ul { margin: 0; padding-left: 1.2rem; }
.danger-box li { margin-bottom: 4px; }
.danger-text { color: var(--err); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  position: sticky; top: 8px; z-index: 2; }
.messages-table td:first-child { width: 32px; }
.messages-table input[type=checkbox] { width: 18px; height: 18px; }
tr.msg-trashed td { color: var(--muted); }
dialog.modal { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 22px; max-width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
dialog.modal::backdrop { background: rgba(10, 14, 20, .6); }
dialog.modal label { margin-top: 12px; }
.transfer-notes { padding-left: 1.1rem; margin: 12px 0 0; }
.transfer-notes li { margin-bottom: 4px; }
dialog.modal select { width: 100%; }

/* ordinamento delle colonne */
.sort-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-transform: inherit;
  letter-spacing: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.sort-btn:hover { color: var(--text); }
.sort-btn::after { content: "↕"; opacity: .35; font-size: .9em; }
th[aria-sort="ascending"] .sort-btn::after { content: "▲"; opacity: .9; }
th[aria-sort="descending"] .sort-btn::after { content: "▼"; opacity: .9; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--text); }
th.num .sort-btn { flex-direction: row; }
a.sort-btn { text-decoration: none; }

/* selezione delle email nell'anteprima */
.selection-bar { margin-top: 8px; }
#selection-info { color: var(--muted); }
#selection-info.selection-active { color: var(--accent); font-weight: 700; }
td.check-col, th.check-col { width: 32px; }
td.check-col input { width: 18px; height: 18px; }

/* badge di stato cliccabili negli archivi */
a.status-link { text-decoration: none; display: inline-block; border-radius: 999px; }
a.status-link .status { transition: box-shadow .15s ease, filter .15s ease; }
a.status-link:hover .status, a.status-link:focus-visible .status { box-shadow: 0 0 0 2px currentColor; filter: brightness(1.05); cursor: pointer; }

/* guide */
.guide { max-width: 780px; }
.guide h2 { margin-top: 28px; }
.guide .steps { padding-left: 1.3rem; }
.guide .steps li { margin-bottom: 10px; }
.guide .steps ul { margin-top: 6px; }
.guide-card { color: var(--text); text-decoration: none; display: flex; flex-direction: column; gap: 6px; }
.guide-card:hover { border-color: var(--accent); }
.guide-card h2 { margin: 4px 0 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.tag-google { background: var(--info-bg); color: var(--info); }
.callout { border-radius: var(--radius); padding: 12px 16px; margin: 16px 0; border: 1px solid var(--border); }
.callout-info { background: var(--info-bg); }
.callout-danger { background: var(--err-bg); border-color: var(--danger); }
.picker-card h2 { margin-bottom: 6px; }

/* intestazione delle pagine: il testo (anche lungo) va a capo, il pulsante «indietro» resta in alto a destra */
.page-head > div:first-child { flex: 1 1 320px; min-width: 0; }
.page-head > div:first-child p { overflow-wrap: anywhere; }
.page-head > .btn, .page-head > .filter-bar { flex: 0 0 auto; margin-left: auto; align-self: flex-start; }
.nav-email { color: var(--muted); text-decoration: none; }
.nav-email:hover { color: var(--text); }
.danger-zone { border-color: var(--danger); }
.footer a { color: var(--muted); }

/* landing page e demo */
h3 { font-size: 1rem; margin: 0 0 .4rem; }
.btn-large { padding: 12px 20px; font-size: 1rem; }
.nav .btn-small { color: var(--accent-text); }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 28px 0 8px; }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); line-height: 1.08; margin: .4rem 0 1rem; letter-spacing: -.025em; font-weight: 800; }
.hero-lead { font-size: 1.08rem; max-width: 620px; }
.hero-cta { margin: 22px 0 8px; }
.eyebrow { color: var(--accent); font-weight: 700; font-size: .85rem; margin: 0; }
.meter { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.meter-bar { height: 100%; background: var(--danger); border-radius: 999px; }
.meter-full { width: 95%; }
.demo-meter { max-width: 360px; }
.landing-section { margin-top: 56px; }
.landing-title { font-size: 1.4rem; margin-bottom: 16px; }
.how { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.how p { margin: 0; }
.how-n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 999px;
  background: var(--info-bg); color: var(--info); font-weight: 700; margin-bottom: 8px; }
.usecases { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.usecases p { margin: 0; }
.trust { padding-left: 1.2rem; max-width: 820px; }
.trust li { margin-bottom: 8px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.plan h3 { font-size: 1.15rem; margin-top: 4px; }
.plan-featured { border: 2px solid var(--accent); }
.price { font-size: 2rem; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.plan-features { padding-left: 1.1rem; margin: 12px 0 0; }
.plan-features li { margin-bottom: 6px; }
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.faq details { padding: 14px 18px; }
.faq summary { font-weight: 600; color: var(--text); }
.faq p { margin: 10px 0 0; }
.cta-final { max-width: 620px; margin-left: auto; margin-right: auto; }
.cta-final h2 { font-size: 1.3rem; }
.waitlist { margin-top: 12px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.demo-banner { background: var(--warn-bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 18px; }
.demo-banner strong { color: var(--warn); }

/* hero: titolo e filmato di 10 secondi (4 scene) */
.hero-video { margin: 0; min-width: 0; width: 100%; max-width: 560px; justify-self: center; }
.hv-window { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 18px 40px rgba(16, 24, 40, .12), var(--shadow); }
.hv-chrome { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); }
.hv-chrome span { width: 10px; height: 10px; border-radius: 999px; background: var(--border); }
.hv-chrome em { margin-left: 8px; font-style: normal; font-size: .78rem; color: var(--muted); font-weight: 600; }
/* larghezza fissa: con aspect-ratio l'altezza minima altrimenti allargherebbe l'area oltre la finestra */
.hv-stage { position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 280px; max-height: 360px; }
.hv-scene { position: absolute; inset: 0; padding: 22px 22px 18px; display: flex; flex-direction: column; justify-content: center;
  gap: 12px; opacity: 0; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
/* la scena nuova entra quando la vecchia è già uscita: niente testi sovrapposti */
.hv-scene.is-active { opacity: 1; transform: none; pointer-events: auto; transition: opacity .4s ease .2s, transform .4s ease .2s; }
.hv-scene p { margin: 0; }
.hv-alert { align-self: flex-start; background: var(--warn-bg); color: var(--warn); font-weight: 700; font-size: .9rem;
  border-radius: 8px; padding: 6px 10px; }
.hv-email { font-weight: 700; overflow-wrap: anywhere; }
.hv-meter { height: 14px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hv-bar { display: block; height: 100%; width: var(--to, 0%); border-radius: 999px; }
.hv-bar-danger { background: var(--danger); }
.hv-bar-accent { background: var(--accent); }
.hv-bar-ok { background: var(--ok); }
.hv-caption { color: var(--muted); font-size: .88rem; }
.hv-caption strong { color: var(--text); }
.hv-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hv-chip { background: var(--info-bg); color: var(--info); border-radius: 999px; padding: 3px 10px; font-size: .8rem; font-weight: 700; }
.hv-total { font-size: 1.05rem; }
.hv-total span { color: var(--muted); font-size: .85rem; margin-left: 6px; }
.hv-rows, .hv-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hv-rows li { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-size: .88rem; }
.hv-subject { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-size { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hv-title { font-size: 1.15rem; font-weight: 700; }
.hv-done { color: var(--ok); font-size: 1.35rem; }
.hv-checks li { font-size: .92rem; }
.hv-controls { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; }
.hv-steps { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hv-steps button { width: 100%; background: none; border: 0; padding: 0; font: inherit; font-size: .78rem; color: var(--muted);
  text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.hv-steps button[aria-current="step"] { color: var(--text); font-weight: 600; }
.hv-track { display: block; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.hv-fill { display: block; height: 100%; width: 0; background: var(--accent); }
.hv-steps .is-done .hv-fill { width: 100%; }
.hv-toggle { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: .7rem; line-height: 1; }
.hv-toggle:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: no-preference) {
  .hv-scene.is-active .hv-bar { animation: hv-grow 1.4s .35s ease-out both; }
  .hv-scene.is-active .hv-alert { animation: hv-pop .5s .1s ease-out both; }
  .hv-scene.is-active .hv-rows li, .hv-scene.is-active .hv-checks li { animation: hv-in .4s ease-out both; }
  .hv-scene.is-active li:nth-child(1) { animation-delay: .45s; }
  .hv-scene.is-active li:nth-child(2) { animation-delay: .85s; }
  .hv-scene.is-active li:nth-child(3) { animation-delay: 1.25s; }
  .hv-steps button[aria-current="step"] .hv-fill { animation: hv-step var(--d, 2.5s) linear both; }
  .hv-scene.is-active .hv-box { animation: hv-check .25s ease-out both; }
  .hv-scene.is-active .hv-tr:nth-child(2) .hv-box { animation-delay: .5s; }
  .hv-scene.is-active .hv-tr:nth-child(3) .hv-box { animation-delay: .75s; }
  .hv-scene.is-active .hv-tr:nth-child(4) .hv-box { animation-delay: 1s; }
  .hv-scene.is-active .hv-tr:nth-child(5) .hv-box { animation-delay: 1.25s; }
  .hv-scene.is-active .hv-tr:nth-child(6) .hv-box { animation-delay: 1.5s; }
  .hv-scene.is-active .hv-selected { animation: hv-pop .4s 1.8s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  .hv-scene { transition: none; }
  .hv-steps button[aria-current="step"] .hv-fill { width: 100%; }
}
.hero-video.is-paused *, .hero-video.is-paused { animation-play-state: paused !important; }
@keyframes hv-grow { from { width: var(--from, 0%); } to { width: var(--to, 0%); } }
@keyframes hv-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes hv-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes hv-step { from { width: 0; } to { width: 100%; } }
@keyframes hv-check { from { background: var(--surface); color: transparent; border-color: var(--border); } to { background: var(--accent); color: var(--accent-text); border-color: var(--accent); } }

/* scena «Scegli le email»: esempio dell'elenco dell'anteprima */
.hv-folders .hv-subject { flex: 0 0 34%; }
.hv-mini { flex: 1; height: 8px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.hv-scene-list { gap: 8px; padding: 16px 16px 14px; }
.hv-list-title { font-weight: 700; font-size: .95rem; }
.hv-list-title span { color: var(--muted); font-weight: 400; font-size: .8rem; margin-left: 4px; }
.hv-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: .76rem; }
.hv-tr { display: grid; grid-template-columns: 16px 66px minmax(0, 1fr) minmax(0, 1.5fr) 64px; gap: 8px; align-items: center;
  padding: 6px 8px; border-top: 1px solid var(--border); }
.hv-th { border-top: 0; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .66rem;
  text-transform: uppercase; letter-spacing: .03em; }
.hv-th .hv-num { color: var(--text); }
.hv-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.hv-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hv-box { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 4px;
  border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-text); font-size: 10px; line-height: 1; }
.hv-box::after { content: "✓"; }
.hv-selected { color: var(--accent); font-weight: 700; font-size: .85rem; }
@media (max-width: 480px) {
  .hv-tr { grid-template-columns: 16px minmax(0, 1fr) minmax(0, 1.4fr) 58px; }
  .hv-col-date { display: none; }
}

/* anteprima in corso: i risultati precedenti restano visibili ma attenuati */
.preview-status { margin-bottom: 12px; }
#preview.is-loading > :not(.preview-status) { opacity: .45; transition: opacity .2s; }

/* richiesta di invito inviata */
.waitlist-done { text-align: center; padding: 8px 0 4px; }
.waitlist-done-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 999px; background: var(--ok-bg); color: var(--ok); font-size: 1.4rem; font-weight: 700; margin: 0 0 8px; }
.waitlist-done h3 { font-size: 1.15rem; }

/* landing: titolo con evidenziatore, modulo in apertura, barra della fiducia */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:root { --hl-bg: #ffe27a; --hl-text: #18202b; }
@media (prefers-color-scheme: dark) { :root { --hl-bg: #f3c94e; --hl-text: #14161a; } }
.hl { background: var(--hl-bg); color: var(--hl-text); padding: 0 .18em; border-radius: 6px; white-space: nowrap;
  box-decoration-break: clone; -webkit-box-decoration-break: clone; display: inline-block; transform: rotate(-1.2deg); }
.hero-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 8px; max-width: 560px; }
.hero-field { flex: 1 1 260px; flex-direction: row; align-items: center; gap: 0; position: relative; font-weight: 400; }
.hero-field .ti { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); }
.hero-field input { padding: 12px 12px 12px 38px; font-size: 1rem; border-radius: 10px; }
.hero-form .btn-large { flex: 0 0 auto; border-radius: 10px; }
.hero-micro { color: var(--muted); font-size: .84rem; margin: 0; }
.hero-flash { margin: 22px 0 -12px; max-width: 560px; }
.hero-demo { margin: 14px 0 0; font-weight: 600; }
.hero-demo a { text-decoration: none; }
.hero-demo a:hover { text-decoration: underline; }
.hero-done { display: flex; gap: 12px; align-items: flex-start; background: var(--ok-bg); color: var(--text);
  border-radius: 10px; padding: 12px 14px; margin: 22px 0 8px; max-width: 560px; }
.hero-done-icon { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 999px; background: var(--ok); color: var(--surface); font-weight: 700; }
.ti { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.trust-bar { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: .85rem; }
.trust-bar li { display: inline-flex; align-items: center; gap: 6px; }
.trust-bar .ti { color: var(--ok); }

/* il costo del problema */
.pain-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 820px) { .pain-grid { grid-template-columns: 1fr; } }
.pain-list ul { list-style: none; margin: 0; padding: 0; }
.pain-list li { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.pain-list li strong { color: var(--danger); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pain-total { margin: 14px 0 6px; font-size: 1.05rem; }
.pain-total span { color: var(--danger); font-weight: 800; font-size: 1.25rem; }
.pain-fix { border: 2px solid var(--ok); display: flex; flex-direction: column; gap: 6px; }
.pain-fix-kicker { margin: 0; color: var(--muted); font-weight: 600; }
.pain-fix-time { margin: 0; font-size: 2.2rem; font-weight: 800; color: var(--ok); line-height: 1.1; }
.pain-checks { list-style: none; padding: 0; margin: 8px 0 16px; }
.pain-checks li { padding: 4px 0 4px 24px; position: relative; }
.pain-checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.pain-fix .btn { align-self: flex-start; margin-top: auto; }

/* note scritte a mano */
.scribble { font-family: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Neue", cursive; color: var(--muted);
  font-size: 1.05rem; line-height: 1.2; margin: 0; pointer-events: none; }
.scribble svg { width: 46px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scribble-film { display: flex; align-items: flex-end; justify-content: flex-end; gap: 4px; margin: 0 6px -4px 0; transform: rotate(-3deg); }
.scribble-price { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end;
  font-size: .95rem; text-align: right; transform: rotate(3deg); }
.scribble-price svg { margin: 2px 26px 0 0; }
.plan-featured { position: relative; }
@media (max-width: 820px) { .scribble-price { position: static; margin: -4px 0 4px; transform: none; } .scribble-price svg { display: none; } }
.cta-repeat { margin-top: 20px; }

/* barra fissa sul telefono */
.sticky-cta { display: none; }
@media (max-width: 760px) {
  .sticky-cta:not([hidden]) { display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(16, 24, 40, .12); }
  .sticky-cta .btn-primary { flex: 1; }
}

/* pannello: primi passi guidati e riquadri numerici */
.onboarding { margin-bottom: 18px; }
.onboarding-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.onboarding-head h2 { margin: 0; }
.onboarding-bar { display: flex; gap: 6px; margin: 12px 0 6px; }
.onboarding-bar span { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); }
.onboarding-bar span.is-done { background: var(--ok); }
.onboarding-steps { list-style: none; margin: 0; padding: 0; }
.onboarding-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.onboarding-steps li:last-child { border-bottom: 0; }
.onboarding-steps li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.onboarding-check { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 999px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--muted); }
.onboarding-steps li.is-done .onboarding-check { background: var(--ok-bg); color: var(--ok); }
.onboarding-steps li.is-done strong { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border); }
.onboarding-steps li.is-next .onboarding-check { background: var(--accent); color: var(--accent-text); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi dd { margin: 4px 0 0; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-ok dd { color: var(--ok); }

/* nastro «funziona con» */
.marquee { margin-top: 40px; display: flex; align-items: center; gap: 18px; }
.marquee-label { flex: 0 0 auto; margin: 0; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.marquee-window { flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; gap: 30px; width: max-content; }
.marquee-item { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 600; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: marquee 32s linear infinite; }
  .marquee:hover .marquee-track { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { flex-wrap: wrap; width: auto; gap: 8px 22px; }
  .marquee-dup { display: none; }
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* numeri che salgono e barra che si svuota */
.pain-result { margin: 6px 0 4px; }
.pain-numbers { margin: 0 0 8px; font-size: 1.05rem; }
.pain-numbers strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.drain-meter { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 6px; }
.drain-bar { height: 100%; width: var(--to, 0%); border-radius: 999px; background: var(--ok); }
.drain-bar.is-animated { animation: drain 1.8s .3s ease-in-out both; }
@keyframes drain { from { width: var(--from); background: var(--danger); } 40% { width: var(--from); background: var(--danger); }
  to { width: var(--to); background: var(--ok); } }

/* prima e dopo da trascinare */
/* i due lati stanno nella stessa cella: l'altezza è quella del più lungo, niente testo tagliato */
.compare { position: relative; overflow: hidden; padding: 0; user-select: none; display: grid; }
.compare-side { grid-area: 1 / 1; }
.compare-side { padding: 22px 24px; }
.compare-side ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
/* «Dopo» allineato a destra e «Prima» a sinistra: con il cursore a metà si leggono entrambi */
.compare-after { background: var(--ok-bg); text-align: right; }
.compare-after ul { align-items: flex-end; margin-left: auto; }
.compare-after .compare-meter { margin-left: auto; }
.compare-side .compare-meter, .compare-side ul, .compare-side .compare-gb { max-width: 46%; }
.compare-after .compare-gb { margin-left: auto; }
@media (max-width: 640px) { .compare-side .compare-meter, .compare-side ul, .compare-side .compare-gb { max-width: 48%; }
  .compare-side { padding: 18px 14px; } .compare-gb { font-size: 1.4rem; } .compare-gb span { display: block; }
  .compare-side li { font-size: .82rem; } }
.compare-after .compare-tag, .compare-after li { color: var(--ok); }
.compare-before { position: relative; z-index: 1; background: var(--err-bg); clip-path: inset(0 50% 0 0); }
.compare-before .compare-tag, .compare-before li { color: var(--err); }
.compare-tag { margin: 0; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.compare-gb { margin: 4px 0 10px; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.compare-gb span { font-size: .95rem; font-weight: 400; color: var(--muted); }
.compare-meter { height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; max-width: 420px; }
.compare-fill { display: block; height: 100%; border-radius: 999px; }
.compare-fill-ok { background: var(--ok); }
.compare-fill-danger { background: var(--danger); }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: var(--text); transform: translateX(-1px);
  z-index: 2; pointer-events: none; }
.compare-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 36px; height: 36px;
  border-radius: 999px; background: var(--surface); border: 2px solid var(--text); display: flex; align-items: center;
  justify-content: center; font-weight: 700; color: var(--text); }
.compare-range:focus-visible + .compare-handle span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* calcolatore: più spazio o casella più leggera */
.calc { margin-top: 20px; max-width: 760px; }
.calc h3 { font-size: 1.1rem; }
.calc-row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-weight: 600; margin: 8px 0 14px; }
.calc-row input { flex: 1 1 180px; accent-color: var(--accent); }
.calc-row output { min-width: 64px; font-weight: 800; }
.calc-bars { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.calc-line { display: grid; grid-template-columns: 150px minmax(0, 1fr) 80px; align-items: center; gap: 12px; }
.calc-line strong { text-align: right; font-variant-numeric: tabular-nums; }
.calc-track { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.calc-fill { display: block; height: 100%; border-radius: 999px; width: 0; transition: width .45s ease; }
.calc-fill-cost { background: var(--danger); }
.calc-fill-ok { background: var(--ok); }
@media (max-width: 520px) { .calc-line { grid-template-columns: 1fr 70px; } .calc-line .calc-track { grid-column: 1 / -1; grid-row: 2; } }

/* comparsa allo scorrimento: solo le sezioni ancora sotto lo schermo all'apertura, e solo se il movimento è gradito */
@media (prefers-reduced-motion: no-preference) {
  .reveal { transition: opacity .6s ease, transform .6s ease; }
  .reveal.reveal-pending { opacity: 0; transform: translateY(24px); }
}

/* bagliore dietro il filmato */
.hero-video { position: relative; isolation: isolate; }
.hero-video::before { content: ""; position: absolute; inset: -14% -12%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent); }
@media (prefers-color-scheme: dark) {
  .hero-video::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); }
}

/* selettore della lingua in fondo alla pagina */
.lang-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.lang-switch strong { color: var(--text); font-weight: 600; }

/* selettore della lingua con le bandiere, in alto a destra */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); font-size: .85rem; font-weight: 600; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); opacity: .7; }
.lang-menu > summary:hover, .lang-menu[open] > summary { border-color: var(--accent); }
.lang-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.flag { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; flex: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent); }
.lang-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 170px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); }
.lang-option { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--text); text-decoration: none; }
.nav .lang-option { text-decoration: none; }
a.lang-option:hover, a.lang-option:focus-visible { background: var(--surface-2); }
.lang-option.is-current { font-weight: 700; }
.lang-option.is-current::after { content: "✓"; margin-left: auto; color: var(--accent); }

/* avvisi via email (pagina Account) */
.notify-row { border: 0; padding: 0; margin: 0; min-width: 0; }
.notify-row legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.notify-options { display: flex; flex-wrap: wrap; gap: 8px; }
.notify-option { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; }
.notify-option input { margin: 0; }
.notify-option:has(input:checked) { border-color: var(--accent); background: var(--info-bg); }

/* elenco delle email da spostare nel Cestino: filtri, mittenti più pesanti, pagine larghe */
.filters-card > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.filters-card > summary::-webkit-details-marker { display: none; }
.filters-card > summary h2 { margin: 0; }
.filters-card > summary h2::before { content: "▸ "; color: var(--muted); }
.filters-card[open] > summary h2::before { content: "▾ "; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 14px; }
.filters-grid label { min-width: 0; }
.filters-actions { display: flex; align-items: flex-end; }
.top-senders { margin-top: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; flex-direction: column; max-width: 100%; padding: 6px 12px; border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none; color: var(--text); font-size: .85rem; }
.chip:hover { border-color: var(--accent); }
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; font-weight: 600; }
.result-line { margin: 18px 0 6px; }
.trash-progress h2 { margin-bottom: 10px; }

/* Pagina «Il tuo pacchetto»: GB usati per contatore */
.quota { margin-bottom: 14px; }
.quota-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.quota .progress { margin: 6px 0 4px; }
.progress.is-full .progress-bar { background-color: var(--danger); }
.nav-plan { font-size: .78rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--info-bg); color: var(--info); text-decoration: none; }
.nav-plan[aria-current="page"] { text-decoration: none; outline: 2px solid var(--info); }
.plain-list { padding-left: 1.1rem; margin: 0; }
.plain-list li { margin-bottom: 6px; }
/* Quattro pacchetti: 4 colonne su schermo largo, 2 su medio, 1 su telefono (nessuno resta da solo su una riga) */
.plans-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .plans-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .plans-4 { grid-template-columns: 1fr; } }
.plans-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .plans-3 { grid-template-columns: 1fr; } }
.price { line-height: 1.15; }
.price .small { line-height: 1.35; }
/* Family: elenco delle persone del gruppo */
.family-invite { margin-bottom: 16px; }
.family-invite p { margin: 0 0 8px; }
.family-cap input[type=number] { width: 6.5em; }
.family-list { margin: 12px 0 0; list-style: none; border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 600px) { .family-member { flex-direction: column; align-items: flex-start; } }

/* pulsanti d'acquisto nella pagina «Il tuo pacchetto» */
.plan-buyable { display: flex; flex-direction: column; }
.plan-buy { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.plan-buy .buy-form, .plan-buy .btn { width: 100%; }
.plan-buy p { margin: 0; }
.buy-form { margin: 0; }
.payment-list { list-style: none; padding: 0; }
