/* EdilMail — foglio di stile unico dell'applicazione. Nessuna dipendenza esterna. */

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --ink: #1c2530;
  --muted: #66707a;
  --line: #e3dfd8;
  --line-strong: #cfc9bf;
  --brand: #b4532a;
  --brand-dark: #8f3f1e;
  --brand-soft: #f7ebe4;
  --sidebar: #1f2a33;
  --sidebar-ink: #c9d1d8;
  --ok: #2f7d4f;
  --ok-soft: #e6f3ea;
  --warn: #9a6412;
  --warn-soft: #fbf1dc;
  --err: #b3372f;
  --err-soft: #fbe9e7;
  --info: #2b5f8a;
  --info-soft: #e7f0f7;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(28, 37, 48, .06), 0 1px 3px rgba(28, 37, 48, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
h1, h2, h3 { margin: 0; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 12px; }
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── Struttura ── */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; padding: 4px 10px 2px; }
.brand:hover { color: #fff; }
.brand-mark { width: 22px; height: 22px; border-radius: 5px; background: linear-gradient(135deg, #d9743f 0 50%, var(--brand) 50% 100%); flex: none; }
.tenant-name { padding: 0 10px 14px; font-size: 13px; color: #8f9aa4; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: 10px; overflow-wrap: anywhere; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #74808b; padding: 14px 10px 4px; }
.nav a, .nav button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--sidebar-ink); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 600; }
.sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-menu { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.menu-toggle { display: none; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px; background: none; color: #fff; font: 600 14px/1.4 var(--font); cursor: pointer; }
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.sidebar-user { padding: 0 10px 8px; font-size: 13px; }
.sidebar-user strong { display: block; color: #fff; font-weight: 600; }
.main { padding: 26px 34px 60px; min-width: 0; }
.main-inner { max-width: 1120px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 70ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.trial-bar { background: var(--warn-soft); color: #6b4609; border: 1px solid #ecd9ae; border-radius: var(--radius); padding: 8px 14px; margin-bottom: 18px; font-size: 14px; }

/* ── Schede e griglie ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card > h2 { margin-bottom: 12px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head select { width: auto; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.stack > * + * { margin-top: 12px; }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.stat .sub { font-size: 12px; color: var(--muted); }

/* ── Tabelle ── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #faf9f7; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfaf8; }
.table td.num, .table th.num { text-align: right; }
.table a.row-link { font-weight: 600; text-decoration: none; }
.table .sub { color: var(--muted); font-size: 13px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 12px; }

/* ── Pulsanti ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: 600 14px/1.3 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #b3ab9f; color: var(--ink); background: #fbfaf8; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-danger { color: var(--err); border-color: #e5c1bd; }
.btn-danger:hover { background: var(--err-soft); color: var(--err); border-color: #d9a39d; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--brand-dark); }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-dark); }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline-form { display: inline; }
.linklike { background: none; border: 0; padding: 0; color: var(--brand-dark); font: inherit; cursor: pointer; text-decoration: underline; }

/* ── Moduli ── */
.field { margin-bottom: 14px; }
.field > label:not(.check), .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.field .error { font-size: 13px; color: var(--err); margin-top: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], input[type=search], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--ink); font: 15px/1.4 var(--font);
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
input[type=file] { font: inherit; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 0; }
.check input { margin-top: 3px; flex: none; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.checkbox-list { max-height: 210px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: 6px; padding: 8px 10px; background: #fff; }
.checkbox-list .group { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 2px; }
.checkbox-list .group:first-child { margin-top: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf9f7; }
.filters input[type=search] { width: 230px; }
.filters select { width: auto; max-width: 190px; }
.counter { font-size: 12px; color: var(--muted); float: right; font-weight: 400; }
.counter.over { color: var(--warn); font-weight: 600; }

/* ── Avvisi, etichette ── */
.alert { border-radius: var(--radius); padding: 11px 14px; margin-bottom: 16px; border: 1px solid; }
.alert-success { background: var(--ok-soft); border-color: #bfdcc8; color: #1f5a37; }
.alert-error { background: var(--err-soft); border-color: #eec4bf; color: #8a2921; }
.alert-warning { background: var(--warn-soft); border-color: #ecd9ae; color: #6b4609; }
.alert-info { background: var(--info-soft); border-color: #c5d9e8; color: #1f4868; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eceae5; color: #4b545d; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: #1f5a37; }
.badge-warn { background: var(--warn-soft); color: #6b4609; }
.badge-err { background: var(--err-soft); color: #8a2921; }
.badge-info { background: var(--info-soft); color: #1f4868; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; background: var(--brand-soft); color: var(--brand-dark); margin: 0 4px 4px 0; }
.chip-plain { background: #eceae5; color: #4b545d; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 14px; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); flex-wrap: wrap; }

dl.meta { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
dl.meta dt { color: var(--muted); font-size: 14px; }
dl.meta dd { margin: 0; overflow-wrap: anywhere; }

/* ── Passi per iniziare ── */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; margin-top: 1px; display: grid; place-items: center; font-size: 13px; color: #fff; }
.steps li.done .step-dot { background: var(--ok); border-color: var(--ok); }
.steps li.done .step-title { color: var(--muted); text-decoration: line-through; }
.step-title { font-weight: 600; text-decoration: none; color: var(--ink); }
.progress { height: 6px; background: #eceae5; border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.progress > span { display: block; height: 100%; background: var(--ok); }

/* ── Costruttore di segmenti ── */
.rule { display: grid; grid-template-columns: 200px 190px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rule:last-child { border-bottom: 0; }
.match-toggle { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.preview-count { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Editor della campagna ── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 46%); gap: 18px; align-items: start; }
.block { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 10px; }
.block-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px 7px 12px; background: #faf9f7; border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.block-body { padding: 12px; }
.block-body .field:last-child { margin-bottom: 0; }
.block-tools { display: flex; gap: 2px; }
.icon-btn { width: 28px; height: 28px; border: 0; background: none; border-radius: 5px; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; }
.icon-btn:hover { background: #eceae5; color: var(--ink); }
.icon-btn[disabled] { opacity: .3; cursor: default; }
.add-blocks { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px 0 0; }
.preview-pane { position: sticky; top: 16px; }
.preview-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.preview-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #f1efeb; display: block; margin: 0 auto; }
.preview-frame.mobile { width: 375px; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 5px 10px; font: 600 13px var(--font); cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--ink); color: #fff; }
.tagbar { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.tagbar button { border: 1px solid var(--line); background: #faf9f7; border-radius: 4px; padding: 1px 7px; font: 12px var(--mono); cursor: pointer; color: var(--muted); }
.tagbar button:hover { border-color: var(--brand); color: var(--brand-dark); }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 9px 0 9px 28px; position: relative; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { position: absolute; left: 0; top: 9px; font-weight: 700; }
.checklist li.err::before { content: "✕"; color: var(--err); }
.checklist li.warn::before { content: "!"; color: var(--warn); left: 4px; }
.checklist li.ok::before { content: "✓"; color: var(--ok); }

pre.code { background: #1f2a33; color: #e8edf1; padding: 12px 14px; border-radius: 6px; overflow-x: auto; font: 13px/1.5 var(--mono); margin: 0 0 8px; white-space: pre-wrap; word-break: break-all; }
.mail-frame { width: 100%; height: 720px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ── Pagine pubbliche (accesso, registrazione, messaggi) ── */
.public { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 40px 16px; }
.public .brand { color: var(--ink); margin-bottom: 22px; font-size: 20px; }
.public .brand:hover { color: var(--ink); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 28px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 18px; }
.auth-card .btn-primary { width: 100%; padding: 10px; }
.auth-foot { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.public-foot { margin-top: 26px; font-size: 13px; color: var(--muted); }

.hero { max-width: 880px; text-align: center; padding: 30px 0 10px; }
.hero h1 { font-size: 40px; letter-spacing: -.02em; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 62ch; margin: 14px auto 22px; }
.hero .actions { justify-content: center; }
.features { max-width: 980px; width: 100%; margin-top: 34px; }
.features .card h3 { margin-bottom: 6px; }
.features .card p { color: var(--muted); margin: 0; font-size: 14px; }

.bare { max-width: 520px; margin: 0 auto; padding: 28px 18px; }
.bare.embed { padding: 4px; }
.bare .card { padding: 24px; }
.bare h1 { font-size: 21px; margin-bottom: 8px; }
.bare-foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 1000px) {
  .editor, .split { grid-template-columns: minmax(0, 1fr); }
  .preview-pane { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; padding: 12px 14px; }
  /* Sul telefono il menu si apre a richiesta, così ogni pagina comincia dal contenuto. */
  .sidebar.collapsible .menu-toggle { display: inline-block; }
  .sidebar.collapsible:not(.open) .sidebar-menu { display: none; }
  .sidebar.collapsible:not(.open) .tenant-name { border-bottom: 0; margin-bottom: 0; padding-bottom: 2px; }
  .main { padding: 18px 16px 40px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .rule { grid-template-columns: minmax(0, 1fr); }
  dl.meta { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.meta dd { margin-bottom: 8px; }
  .hero h1 { font-size: 30px; }
}

/* ── Fase 2: editor a trascinamento, libreria, statistiche ── */
.palette { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 10px; margin-bottom: 12px; background: #faf9f7; border: 1px dashed var(--line-strong); border-radius: var(--radius); position: sticky; top: 8px; z-index: 2; }
.palette .btn { cursor: grab; }
.palette .btn:active { cursor: grabbing; }
.block-head { cursor: grab; user-select: none; }
.block-title { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drag-handle { color: var(--line-strong); font-size: 16px; }
.block.dragging { opacity: .45; }
.block.drop-before { box-shadow: 0 -3px 0 0 var(--brand); }
.block.drop-after { box-shadow: 0 3px 0 0 var(--brand); }
#blocks { min-height: 60px; }
#blocks.drop-end { box-shadow: 0 3px 0 0 var(--brand); }
.drop-hint { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; margin: 0; }
.field-tools { margin-top: 6px; }
.color-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; }
.ok-text { color: var(--ok); }
.err-text { color: var(--err); }
.err-text ul { margin: 4px 0 0; padding-left: 18px; overflow-wrap: anywhere; }

dialog.modal { border: 1px solid var(--line); border-radius: 10px; padding: 0; width: min(760px, 94vw); max-height: 86vh; box-shadow: 0 20px 60px rgba(28, 37, 48, .28); }
dialog.modal::backdrop { background: rgba(28, 37, 48, .45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; max-height: 56vh; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: #faf9f7; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.library-list { display: grid; gap: 6px; }
.thumb { display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font: 12px var(--font); color: var(--muted); text-align: left; }
.thumb:hover { border-color: var(--brand); }
.thumb img { width: 100%; height: 96px; object-fit: contain; background: #f1efeb; border-radius: 4px; }
.library-list .thumb { flex-direction: row; align-items: center; }
.thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 16px; }
.asset { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.asset img { display: block; width: 100%; height: 120px; object-fit: contain; background: #f1efeb; }
.asset-info { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.asset-info strong { display: block; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.asset-info .actions { margin-top: 6px; justify-content: space-between; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.template { display: block; border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 14px; background: #fff; cursor: pointer; position: relative; }
.template:hover { border-color: var(--brand); }
.template input { position: absolute; top: 14px; right: 14px; }
.template:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.template strong { display: block; padding-right: 24px; }
.template span { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }

.bar { height: 6px; background: #eceae5; border-radius: 3px; overflow: hidden; min-width: 70px; }
.bar > span { display: block; height: 100%; background: var(--brand); }
.rate { display: grid; grid-template-columns: 52px minmax(60px, 1fr); gap: 8px; align-items: center; }
.kpi-note { font-size: 12px; color: var(--muted); margin: -6px 0 18px; }
.stat .value small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 6px; }
.slots { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.option-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.option-card .check { font-weight: 600; }
[hidden] { display: none !important; }

/* Trascinamento: i blocchi mostrano solo l'intestazione */
#blocks.is-dragging .block-body { display: none; }
#blocks.is-dragging .block { margin-bottom: 6px; }
#blocks.is-dragging { padding-bottom: 28px; }

/* Tabelle con percentuale e barra (resoconto per settore e provincia) */
.table.rates { table-layout: fixed; }
.table.rates th:first-child { width: 38%; }
.table.rates th:nth-child(2) { width: 14%; }

@media (max-width: 760px) {
  /* Sul telefono restano le percentuali, senza barre, e la prima colonna dei link non si schiaccia. */
  .table.rates .bar { display: none; }
  .table.rates .rate { display: block; }
  .table.rates th, .table.rates td { padding-left: 10px; padding-right: 10px; }
  .table.rates th { font-size: 10px; letter-spacing: .02em; }
  .table.rates th:first-child { width: 40%; }
  .table.rates th:nth-child(2) { width: 18%; }
  .table td.col-main { min-width: 220px; }
}

/* ── Fase 3: abbonamento, verifica in due passaggi, dominio, amministrazione ── */
.usage { margin-bottom: 14px; }
.usage-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.usage .bar { height: 8px; }
.bar > span.full { background: var(--err, #b3261e); }
.plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 12px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.plan h3 { margin: 0; font-size: 17px; }
.plan-price { font-size: 28px; font-weight: 700; }
.plan-price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan ul { margin: 0 0 6px; padding-left: 18px; font-size: 14px; line-height: 1.7; flex: 1; }
.plan p { margin: 0; }
.qr { width: 210px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 4px 0 14px; }
.qr svg { display: block; width: 100%; height: auto; }
.mfa-steps { padding-left: 20px; margin: 0 0 12px; line-height: 1.7; }
.mfa-steps li { display: list-item; border: 0; padding: 0; }
code.key { background: #f3f1ed; padding: 2px 6px; border-radius: 4px; font-size: 14px; letter-spacing: .04em; white-space: nowrap; }
pre.codes { background: #1f2a33; color: #e8edf1; padding: 14px 16px; border-radius: var(--radius); font-size: 15px; line-height: 1.8; columns: 2; max-width: 360px; }
.table.dns code { font-size: 12px; overflow-wrap: anywhere; }
.table.dns td { vertical-align: top; }
details.card > summary { cursor: pointer; }
.admin-bar { background: #3a2a55; }
.admin-bar .brand-mark { background: linear-gradient(135deg, #b9a2e8 0 50%, #7a5bc4 50% 100%); }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.review-card { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .plan-grid, .review-card { grid-template-columns: minmax(0, 1fr); } }

/* ── Sito pubblico: pagina di presentazione e pagine legali ── */
.text-err { color: var(--err); }
.auto-kind { display: flex; flex-direction: column; }
.auto-kind h3 { margin-bottom: 6px; }
.auto-kind .form-actions { margin-top: auto; padding-top: 8px; }

body.site { background: var(--surface); }
.site-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.site-head { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.site-head .site-wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.site-head .brand { color: var(--ink); font-size: 19px; }
.site-nav { display: flex; gap: 20px; margin-left: 14px; flex: 1; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.site-nav a:hover { color: var(--ink); }
.site-cta { display: flex; gap: 6px; align-items: center; }

.hero-band { background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%); padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
.hero-band h1 { font-size: 44px; letter-spacing: -.025em; line-height: 1.1; }
.hero-band .lead { font-size: 18px; color: #48525c; margin: 18px 0 26px; max-width: 56ch; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-dark); margin-bottom: 14px; }
.hero-card { position: relative; padding-bottom: 34px; }
.hero-mail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(28, 37, 48, .12); overflow: hidden; }
.hero-mail-top { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf9f6; }
.hero-mail-top span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.hero-mail-body { padding: 22px; }
.hero-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); background: var(--brand-soft); padding: 3px 8px; border-radius: 4px; }
.hero-title { font-size: 19px; font-weight: 700; margin: 12px 0; }
.hero-lines i { display: block; height: 9px; border-radius: 5px; background: #ebe8e2; margin-bottom: 9px; }
.hero-buttons { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.hero-buttons b { background: var(--brand); color: #fff; font-size: 13px; padding: 9px 14px; border-radius: 6px; }
.hero-buttons em { font-style: normal; font-size: 13px; color: var(--brand-dark); font-weight: 600; }
.hero-stat { position: absolute; right: -6px; bottom: 0; background: var(--sidebar); color: #fff; border-radius: 10px; padding: 12px 16px; box-shadow: 0 10px 24px rgba(28, 37, 48, .22); max-width: 86%; }
.hero-stat strong { display: block; font-size: 14px; }
.hero-stat span { font-size: 12px; color: var(--sidebar-ink); }

.site-section { padding: 64px 0; }
.site-section-alt { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { font-size: 30px; letter-spacing: -.02em; text-align: center; }
.section-lead { text-align: center; color: var(--muted); font-size: 17px; max-width: 64ch; margin: 12px auto 0; }
.feature-grid { margin-top: 34px; gap: 16px; }
.feature-grid .card { margin: 0; }
.feature-grid h3 { font-size: 16px; margin-bottom: 6px; }
.feature-grid p { color: var(--muted); margin: 0; font-size: 14px; }

.how { list-style: none; margin: 34px auto 0; padding: 0; max-width: 760px; }
.how li { display: flex; gap: 18px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); }
.how li:last-child { border-bottom: 0; }
.how span { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; }
.how h3 { font-size: 17px; margin-bottom: 4px; }
.how p { margin: 0; color: var(--muted); }

.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 36px; align-items: stretch; }
.price-card { margin: 0; display: flex; flex-direction: column; position: relative; padding: 24px; }
.price-card.featured { border-color: var(--brand); box-shadow: 0 10px 28px rgba(180, 83, 42, .14); }
.price-flag { position: absolute; top: -11px; left: 22px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.price-card h3 { font-size: 19px; }
.price { margin: 14px 0 6px; }
.price strong { font-size: 34px; letter-spacing: -.02em; }
.price span { color: var(--muted); font-size: 14px; margin-left: 6px; }
.price-card ul { list-style: none; margin: 12px 0 20px; padding: 0; }
.price-card li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.price-card li:last-child { border-bottom: 0; }
.price-card .btn { margin-top: auto; }

.faq { max-width: 760px; }
.faq .section-title { margin-bottom: 26px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 15px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq details p { margin: 14px 0; color: #48525c; }

.cta-band { text-align: center; }
.cta-band h2 { font-size: 28px; letter-spacing: -.02em; }
.cta-band p { color: var(--muted); font-size: 17px; margin: 10px 0 22px; }

.site-foot { background: var(--sidebar); color: var(--sidebar-ink); padding: 34px 0; margin-top: 0; }
.site-foot .site-wrap { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.site-foot strong { color: #fff; font-size: 16px; }
.site-foot a { color: var(--sidebar-ink); }
.site-foot a:hover { color: #fff; }
.site-foot nav { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

.legal { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 44px; padding-top: 40px; padding-bottom: 64px; align-items: start; }
.legal-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.legal-nav a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.legal-nav a:hover { background: var(--bg); color: var(--ink); }
.legal-nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.legal-body { max-width: 72ch; font-size: 16px; line-height: 1.65; }
.legal-body h1 { font-size: 32px; letter-spacing: -.02em; margin-bottom: 8px; }
.legal-body h2 { font-size: 20px; margin: 34px 0 10px; scroll-margin-top: 80px; }
.legal-body h3 { font-size: 17px; margin: 22px 0 8px; }
.legal-body ul, .legal-body ol { padding-left: 22px; margin: 0 0 14px; }
.legal-body li { margin-bottom: 6px; }
.legal-links { font-size: 13px; color: var(--muted); margin-top: 14px; text-align: center; }
.legal-links a { color: var(--muted); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero-band h1 { font-size: 34px; }
  .price-grid { grid-template-columns: minmax(0, 1fr); max-width: 440px; margin-left: auto; margin-right: auto; }
  .legal { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 760px) {
  .site-nav { display: none; }
  .site-head .site-wrap { justify-content: space-between; }
  .hero-band { padding: 40px 0; }
  .section-title { font-size: 25px; }
  .site-section { padding: 44px 0; }
  .hero-stat { position: static; margin-top: 12px; max-width: none; }
  .hero-card { padding-bottom: 0; }
}
