/* Studio Salatino — Gestionale. Design system derivato dal sito (blu #023F82, Inter + Open Sans) */
:root {
  --blue: #023F82;
  --blue-dark: #012a56;
  --blue-light: #e8eff7;
  --blue-lighter: #f3f7fb;
  --amber: #F5A524;
  --amber-light: #fff8ec;
  --amber-dark: #8a5c10;
  --green: #1f7a45;
  --green-light: #e7f5ec;
  --red: #c03434;
  --red-light: #fdeeee;
  --text: #212836;
  --gray: #5a6272;
  --muted: #8a93a3;
  --border: #E9EBEF;
  --border-strong: #CAD0DB;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --shadow-sm: 0 1px 3px rgba(2, 63, 130, .06), 0 1px 2px rgba(2, 63, 130, .08);
  --shadow-md: 0 8px 24px rgba(2, 63, 130, .08);
  --shadow-lg: 0 20px 50px rgba(2, 63, 130, .18);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar: 248px;
  --font-head: 'Inter', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; color: var(--text); }
h1 { font-size: 26px; font-weight: 800; line-height: 1.2; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
h2 { font-size: 16px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 2px; font-size: 11px; font-weight: 700; color: var(--blue); margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.mono { font-variant-numeric: tabular-nums; font-family: var(--font-head); font-weight: 600; }
.text-danger { color: var(--red) !important; }
.text-success { color: var(--green) !important; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; line-height: 1.2;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 3px 10px rgba(2, 63, 130, .22); }
.btn-primary:hover:not(:disabled) { background: var(--blue-dark); }
.btn-outline { background: var(--surface); color: var(--blue); border-color: var(--blue); }
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost { background: transparent; color: var(--gray); }
.btn-ghost:hover { background: var(--blue-lighter); color: var(--blue); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #a02828; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--gray); cursor: pointer; flex: none; list-style: none;
}
.icon-btn:hover:not(:disabled) { background: var(--blue-light); color: var(--blue); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn::-webkit-details-marker { display: none; }
.link { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; font-size: 13px; }
.link .icon { width: 14px; height: 14px; }

/* ---------- Forms ---------- */
.input {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(2, 63, 130, .12); }
.input::placeholder { color: #a8b0bd; }
textarea.input { resize: vertical; min-height: 44px; line-height: 1.6; }
select.input { padding-right: 32px; }
.input-sm { width: auto; padding: 7px 10px; font-size: 13px; }
.input.num { text-align: right; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--gray); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }
.form-error { color: var(--red); font-size: 13px; font-weight: 600; }
.form-stack .btn { align-self: flex-start; }
.form-stack h2 { margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); column-gap: 16px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-brand {
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff;
  padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.login-brand .eyebrow { color: var(--amber); }
.login-brand h1 { color: #fff; font-size: 36px; max-width: 520px; }
.login-sub { margin-top: 16px; opacity: .8; max-width: 460px; font-size: 16px; }
.login-logo { width: 220px; }
.login-form { align-self: center; justify-self: center; width: min(400px, 100% - 48px); padding: 40px 0; }
.login-form h2 { font-size: 24px; margin-bottom: 24px; }
.login-form .check { margin: 4px 0 18px; }
.login-form .form-error { margin-bottom: 12px; }
.login-logo-mobile { display: none; width: 200px; margin-bottom: 28px; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--blue-dark); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 14px;
}
.brand { padding: 4px 10px 22px; }
.brand img { width: 170px; }
.sidebar-client { margin: -8px 10px 16px; padding: 8px 10px; background: rgba(255, 255, 255, .08); border-radius: var(--radius-sm); font-family: var(--font-head); font-weight: 600; font-size: 13px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .78); font-family: var(--font-head); font-weight: 600; font-size: 14px; text-decoration: none;
}
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav a.active { background: var(--blue); color: #fff; box-shadow: inset 3px 0 0 var(--amber); }
.sidebar-user { display: flex; align-items: center; gap: 6px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: #fff; padding: 6px; border-radius: var(--radius-sm); text-decoration: none !important; }
.user-chip:hover { background: rgba(255, 255, 255, .08); }
.user-chip strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: block; font-size: 11px; opacity: .65; }
.user-chip > span:last-child { min-width: 0; }
.sidebar .icon-btn { color: rgba(255, 255, 255, .7); }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.avatar {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--amber); color: var(--blue-dark); font-family: var(--font-head); font-weight: 800; font-size: 13px;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; background: var(--blue-light); color: var(--blue); margin-left: auto; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.view { padding: 28px 36px 60px; max-width: 1320px; width: 100%; }
.sidebar-scrim { display: none; }

/* ---------- Page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head > div:first-child { min-width: 0; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--gray); margin-bottom: 10px; }
.back .icon { width: 15px; height: 15px; }
.meta-line { margin-top: 6px; font-size: 14px; }
.sticky-head { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 12px 0; margin-top: -12px; border-bottom: 1px solid transparent; }
.head-title { flex: 1 1 380px; min-width: 0; }
.head-title .input-h1 { width: 100%; }
.input-h1 { font-family: var(--font-head); font-size: 24px; font-weight: 800; border-color: transparent; background: transparent; padding: 4px 8px; margin-left: -9px; }
textarea.input-h1 { display: block; resize: none; overflow: hidden; min-height: 0; line-height: 1.25; }
.input-h1:hover { border-color: var(--border-strong); }
.input-h1:focus { background: var(--surface); }
.save-state { min-width: 0; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar .input { width: auto; min-width: 180px; }
.toolbar input[type=search] { flex: 1; min-width: 220px; max-width: 380px; }
.segmented { display: inline-flex; background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 2px; }
.segmented button { border: 0; background: transparent; padding: 6px 12px; border-radius: 4px; font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--gray); cursor: pointer; }
.segmented button[aria-pressed=true] { background: var(--blue); color: #fff; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
/* Ritmo verticale dentro card, finestre e moduli a colonna: due blocchi uno sotto l'altro (testo e pulsanti, modulo e tabella,
   pulsanti e titolo…) hanno sempre almeno 12px d'aria. :where() non pesa, quindi vince qualunque margine già scritto per un
   elemento (il sottotitolo attaccato al suo titolo, le righe di un elenco…). Fuori le card che dispongono i figli in flex o in
   griglia con il loro gap: una card nuova di quel tipo va aggiunta qui. */
:where(.card:not(.dash-numbers, .web-controls, .aih-card, .settings-ov-card, .rules, .te-platform, .plan-card, .acc-summary), .sheet-body, .form-stack, .card > div:not([class])) > :where(* + *) { margin-top: 12px; }
/* Due paragraphi uno sotto l'altro (descrizione e stato, «Non è condiviso…», «Nessun … caricato»): un po' d'aria tra loro */
:where(.card, .sheet-body, .form-stack, .card > div:not([class])) > p + p { margin-top: 8px; }
/* Paragrafi e titoli dopo un blocco (pulsanti, tabella, modulo, griglia di campi): il loro margin: 0 di base li incollerebbe */
:where(.card, .sheet-body, .form-stack) > :where(.actions, .table-wrap, table, form, fieldset, .callout, [class*="grid-"], ul, ol, details, .field, .btn, .empty) + p,
:where(.card, .sheet-body, .form-stack) > :where(*) + fieldset,
:where(.card, .sheet-body, .form-stack) > :where(.actions, .table-wrap, table, form, fieldset, .callout, [class*="grid-"], ul, ol, details, .field, .btn, .empty, p) + h3,
:where(.card, .sheet-body, .form-stack) > :where(.actions, .table-wrap, table, form, fieldset, .callout, [class*="grid-"], ul, ol, details, .field, .btn, .empty, p) + h4 { margin-top: 16px; }
/* Una card dopo un riquadro vuoto («Nessun accesso…») e la card del piano dei pagamenti nel preventivo */
.empty + .card, .empty + section { margin-top: 18px; }
section.card.plan-card { margin-bottom: 18px; }
/* Una card subito dopo un paragrafo (es. «Cosa ha fatto il cliente» nel preventivo) */
p + .card { margin-top: 12px; }
/* File di schede che scorrono di lato: sfumatura dal lato dove c'è ancora qualcosa (scroll-fade.js → data-fade) */
[data-fade="r"] { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
[data-fade="l"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px); mask-image: linear-gradient(90deg, transparent, #000 48px); }
[data-fade="l r"] { -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent); }
/* Occhiello della pagina uguale a quello delle schede di sezione (app.js → hideSameEyebrow) */
.page-head .eyebrow[hidden] { display: none; }
/* Selettore e pulsante sulla stessa riga (es. «Condiviso con i partner»), che vanno a capo con il loro spazio */
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form > .input { flex: 1 1 220px; width: auto; }
/* Tabella o contenuto sotto il titoletto di un riquadro richiudibile («Vedi i dati in tabella», utenze dello scenario…) */
details[open] > summary + :where(*) { margin-top: 10px; }
/* Coppie ricorrenti nei moduli: campi e gruppi di scelte, pulsanti dopo un gruppo, testo dopo i pulsanti */
.grid-2 + fieldset, fieldset + .actions, .grid-2 + p, .sheet-actions + p, form + ul.list { margin-top: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > .card { margin-bottom: 0; }
.cols + .card, .cols + section { margin-top: 18px; }
.section { margin-bottom: 28px; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue-light); color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: 0; }
.prose p + p, .prose ul { margin-top: 10px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none !important;
}
a.stat:hover { border-color: var(--blue); }
.stat-value { font-family: var(--font-head); font-weight: 800; font-size: 26px; color: var(--blue); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13px; color: var(--gray); }
.stat-alert .stat-value { color: var(--red); }
.stats-sm .stat-value { font-size: 20px; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; white-space: nowrap; letter-spacing: .1px; }
h1 .badge { font-size: 12px; }
.badge-neutral { background: #eef0f3; color: var(--gray); }
.badge-info { background: var(--blue-light); color: var(--blue); }
/* Trasparenza sull'AI: etichetta «Preparato con l'AI» (link alla pagina informativa) */
.badge-ai { background: var(--blue-light); color: var(--blue); text-decoration: none; gap: 4px; }
.badge-ai:hover { text-decoration: underline; }
.badge-ai svg { width: 12px; height: 12px; }
.ai-info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ai-info-list li { display: flex; gap: 8px; align-items: flex-start; }
.badge-brand { background: var(--blue); color: #fff; }
.badge-success { background: var(--green-light); color: var(--green); }
.badge-warn { background: var(--amber-light); color: var(--amber-dark); }
.badge-danger { background: var(--red-light); color: var(--red); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list.card { padding: 4px 0; }
/* .list (margin: 0) viene dopo .card e ne toglieva lo spazio sotto: un elenco-card seguito da altro restava attaccato */
.list.card:not(:last-child) { margin-bottom: 18px; }
.cols > .list.card { margin-bottom: 0; }
.list > li + li { border-top: 1px solid var(--border); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--text); text-decoration: none !important; }
.list.card .list-row { padding: 12px 18px; }
a.list-row:hover, .clickable:hover strong { color: var(--blue); }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.list-main strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.list-main small { color: var(--muted); font-size: 13px; }
.list-meta { display: flex; align-items: center; gap: 8px; flex: none; font-size: 13px; }
.clickable { cursor: pointer; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--font-head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--blue-lighter); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { text-align: right; white-space: nowrap; }

.progress { height: 6px; background: var(--blue-light); border-radius: 3px; overflow: hidden; min-width: 80px; }
.progress span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-row .progress { flex: 1; max-width: 360px; }

.empty { text-align: center; padding: 36px 20px; color: var(--gray); }
.empty-title { font-family: var(--font-head); font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 14px; margin-bottom: 12px; }
.empty .btn { margin-top: 10px; }

.callout { display: flex; gap: 14px; background: var(--amber-light); border: 1px solid #f3dcae; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; }
.callout > .icon { color: var(--amber-dark); width: 22px; height: 22px; margin-top: 2px; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.callout p { margin: 4px 0 10px; }

.loading { display: grid; place-items: center; min-height: 40vh; }
.loading span { width: 30px; height: 30px; border: 3px solid var(--blue-light); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; padding: 9px 0; font-size: 14px; align-items: baseline; }
.timeline li + li { border-top: 1px dashed var(--border); }
.timeline-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); align-self: center; }
.timeline time { font-size: 12px; white-space: nowrap; }

/* Client detail */
.detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.info { margin: 0; }
.info-row { padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 90px 1fr; gap: 8px; font-size: 14px; }
.info-row:last-child { border-bottom: 0; }
.info dt { color: var(--muted); font-size: 13px; }
.info dd { margin: 0; overflow-wrap: anywhere; }
.notes { margin-top: 16px; background: var(--amber-light); padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; }
.notes h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--amber-dark); margin-bottom: 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--gray); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tabs button[aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }
/* Schede della scheda del cliente del CRM (v1.12): barra che scorre in orizzontale su telefono, badge delle cose aperte */
.crm-tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.crm-tabs::-webkit-scrollbar { display: none; }
.crm-tabs .tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--orange, #eb6834); color: #fff; font-size: 11px; line-height: 18px; text-align: center; vertical-align: 1px; }
.crm-tabs .tab-badge[hidden] { display: none; }
.crm-tab-panel > * + * { margin-top: 16px; }
.crm-tab-panel[hidden] { display: none; }
/* Vista Vendite della scheda del cliente (sales-view.js) */
.sv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; align-items: start; }
.sv-kpi { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sv-kpi-l { font-size: 12px; color: var(--gray); }
.sv-kpi-v { font-family: var(--font-head); font-size: 20px; }
.sv-kpi-v small { font-size: 12px; font-weight: 500; color: var(--gray); }
.sv-how summary { cursor: pointer; font-size: 12px; color: var(--blue); margin-top: 4px; }
.sv-coverage { display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 16px; align-items: start; }
.sv-donut { margin: 0; text-align: center; }
.sv-donut svg { width: 100%; max-width: 180px; }
.sv-donut-n { font-family: var(--font-head); font-size: 22px; font-weight: 700; fill: var(--ink, #1a1a1a); }
.sv-donut-l { font-size: 11px; fill: var(--gray); }
.sales-view .table-wrap { overflow-x: auto; max-width: 100%; }
.sales-view h3.card-title-sm { margin-top: 18px; }
@media (max-width: 640px) { .sv-coverage { grid-template-columns: 1fr; } }
/* Viste dei partner (v1.12): Riepilogo del portale e scheda Partner del CRM */
.pr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pr-use { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.pr-use strong { font-family: var(--font-head); font-size: 22px; }
.pov-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 8px; }
.pov-use { display: flex; flex-direction: column; gap: 6px; }

/* Menu (details) */
.menu { position: relative; }
.menu summary { font-size: 20px; line-height: 1; }
/* Menu «⋯» aperto: la testata della pagina (sticky, z-index 20) sale sopra schede, barre e card che si sovrappongono, così il menu resta sopra a tutto */
.page-head:has(.menu[open]), .sticky-head:has(.menu[open]), .card:has(.menu[open]) { position: relative; z-index: 45; }
.sticky-head:has(.menu[open]) { position: sticky; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 6px; min-width: 220px; z-index: 30; }
.menu-list button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.menu-list button:hover { background: var(--blue-lighter); }

/* Projects */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 10px; margin: 0; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.project-card-head, .project-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.project-todo { background: #fdecea; color: #b42318; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.project-card-foot .icon { width: 14px; height: 14px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 10px; }
.column { background: #eef2f7; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; min-height: 220px; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; }
.column-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); }
.column-head .icon-btn { margin-left: auto; width: 28px; height: 28px; }
.column-body { display: flex; flex-direction: column; gap: 8px; flex: 1; border-radius: var(--radius-sm); transition: background .15s; min-height: 60px; }
.column-body.drop-over { background: var(--blue-light); }
.task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: pointer; }
.task:hover { border-color: var(--blue); }
.task.dragging { opacity: .45; }
.task-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.task-meta .icon { width: 13px; height: 13px; }
.task-done .task-title, .task-done .list-main strong { text-decoration: line-through; color: var(--muted); }
.task-row { padding-left: 18px !important; }
.task-check { width: 18px; height: 18px; accent-color: var(--green); flex: none; cursor: pointer; }
.task-group { margin-bottom: 22px; }

/* ---------- Documents ---------- */
.doc-editor { max-width: 900px; }
.sec-edit { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.sec-edit-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.input-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; border-color: transparent; padding: 6px 8px; }
.input-title:hover { border-color: var(--border-strong); }
.doc-num { font-family: var(--font-head); font-weight: 800; color: var(--amber); font-size: 14px; margin-right: 6px; }
.kpi-edit { display: grid; grid-template-columns: 2fr 1fr 1fr 2fr auto; gap: 8px; margin-bottom: 8px; }

.doc-read { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 48px 56px; max-width: 900px; margin: 0 auto; font-size: 15.5px; line-height: 1.7; }
.doc-cover { border-bottom: 3px solid var(--blue); padding-bottom: 24px; margin-bottom: 28px; }
.doc-logo { width: 190px; margin-bottom: 28px; }
.doc-cover h1 { font-size: 30px; margin: 4px 0 8px; }
.doc-read h2 { font-size: 19px; color: var(--blue); margin-bottom: 10px; display: flex; align-items: baseline; }
.doc-read section { margin-bottom: 28px; break-inside: auto; }
.doc-read p + p, .doc-read ul { margin-top: 10px; }
.doc-read ul { padding-left: 22px; }
.doc-summary { background: var(--blue-lighter); border-left: 4px solid var(--amber); padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 2px; break-inside: avoid; }
.kpi-label { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-family: var(--font-head); font-weight: 700; }
.kpi-value { font-family: var(--font-head); font-size: 24px; font-weight: 800; color: var(--blue); }
.kpi-target { font-size: 13px; color: var(--green); font-weight: 600; }
.kpi-note { font-size: 13px; color: var(--gray); }
.doc-foot { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- Quotes ---------- */
.quote-editor { max-width: 960px; }
.items-head, .item-row { display: grid; grid-template-columns: 1fr 90px 140px 120px 34px; gap: 8px; align-items: center; }
.items-head { font-family: var(--font-head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 0 0 6px; }
.item-row { margin-bottom: 8px; }
.item-amount { font-weight: 600; }
.discounts-box { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); }
.discounts-title { font-size: 15px; margin: 0 0 8px; }
.discount-row { display: grid; grid-template-columns: 1fr 120px 130px 120px 34px; gap: 8px; align-items: center; margin: 10px 0 0; }
.discount-row .discount-desc { grid-column: 1 / 5; }
.discount-amount { font-weight: 600; color: var(--good, #1baf7a); }
.totals-discount small { font-size: 12px; font-weight: 400; }
.totals { margin: 16px 0 0 auto; min-width: 300px; border-collapse: collapse; font-size: 14px; }
.totals td { padding: 6px 0; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; padding-left: 24px; }
.totals-grand td { border-top: 2px solid var(--blue); font-family: var(--font-head); font-weight: 800; font-size: 18px; color: var(--blue); padding-top: 10px; }
.quote-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--blue); padding-bottom: 20px; margin-bottom: 24px; }
.quote-head .doc-logo { margin: 0; }
.quote-id { text-align: right; }
.quote-id h1 { font-size: 24px; justify-content: flex-end; }
.quote-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.quote-parties p { font-size: 14px; }
.quote-items { margin-top: 20px; border: 1px solid var(--border); }
.quote-items th { background: var(--blue-lighter); }
.terms { margin-top: 28px; font-size: 13.5px; color: var(--gray); }
.terms h2 { font-size: 14px !important; }
.stamp { display: inline-block; margin-top: 18px; padding: 8px 16px; border: 2px solid; border-radius: var(--radius-sm); font-family: var(--font-head); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.stamp-ok { color: var(--green); }
.stamp-ko { color: var(--red); }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(1, 26, 54, .45); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s ease; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-wide { width: min(680px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 8px; }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 10px 22px; overflow-y: auto; }
.modal-body > p { margin-bottom: 14px; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.modal-foot .form-error { flex: 1; }
.foot-left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--blue-dark); color: #fff; padding: 12px 18px; border-radius: var(--radius-sm); box-shadow: var(--shadow-md); font-size: 14px; font-weight: 600; border-left: 4px solid var(--amber); transition: opacity .3s, transform .3s; max-width: 360px; }
.toast-danger { background: var(--red); border-left-color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

.print-area[hidden] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(1, 26, 54, .4); z-index: 80; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
  .topbar-logo { height: 28px; width: auto; }
  .view { padding: 20px 16px 48px; }
  .sticky-head { top: 55px; }
  h1 { font-size: 22px; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-logo-mobile { display: block; }
  .board { grid-template-columns: repeat(4, 260px); }
  .doc-read { padding: 28px 20px; }
  .kpi-edit { grid-template-columns: 1fr 1fr; }
  .kpi-edit .icon-btn { justify-self: end; }
  .items-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .item-row > input:first-child { grid-column: 1 / -1; }
  .discount-row { grid-template-columns: 1fr 1fr 34px; }
  .discount-row > input:first-child, .discount-row .discount-desc { grid-column: 1 / -1; }
  .discount-row .discount-amount { grid-column: 1 / 3; text-align: left; }
  .quote-parties { grid-template-columns: 1fr; }
  .toolbar .input, .toolbar input[type=search] { flex: 1 1 100%; max-width: none; }
  .list-row { flex-wrap: wrap; }
  .table { font-size: 13px; }
}
@media (max-width: 520px) {
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .totals { min-width: 0; width: 100%; }
  .quote-head { flex-direction: column; }
  .quote-id { text-align: left; }
  .quote-id h1 { justify-content: flex-start; }
}

/* ---------- Stampa / PDF ---------- */
/* Impostazioni → Fatturazione: una scheda per classe ATECO con i suoi servizi */
.bc-class { margin: 0 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.bc-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; margin: 10px 0 0; padding: 0; border: 0; }
.bc-services legend { margin-bottom: 6px; }

/* Pagamenti (studio e cliente): indicatori, grafico mese per mese, mesi e tabella */
.pay-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pay-kpis .kpi { background: var(--white, #fff); }
.kpi-alert .kpi-value { color: #b42318; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 8px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pay-chart-wrap { overflow-x: auto; }
.pay-chart { width: 100%; min-width: 560px; height: auto; display: block; }
.pay-months { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pay-months .chip.active { background: var(--blue, #023F82); border-color: var(--blue, #023F82); color: #fff; }
.row-current td { background: rgba(42, 120, 214, .06); }

/* Meta Ads · nuovi gruppi di inserzioni (frontend/js/meta-adsets.js) */
.mas-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mas-search .input { flex: 1 1 220px; }
.mas-results { display: flex; flex-direction: column; gap: 4px; }
.mas-results:empty { display: none; }
.mas-row, .mas-custom { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--border); }
.mas-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mas-chips .chip { cursor: default; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.mas-chips .chip-x { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; color: inherit; }
.mas-chips .input-xs { width: 56px; padding: 2px 4px; height: auto; }
.mas-checks { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.mas-summary { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 12px; margin: 8px 0; font-size: 14px; }
.mas-summary dt { color: var(--gray); }
.mas-summary dd { margin: 0; }
.mas-proposals { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.mas-proposal { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 560px) { .mas-summary { grid-template-columns: 1fr; } .mas-summary dt { margin-top: 4px; } }


/* Meta Ads → Struttura: barra con periodo, filtro e ricerca; righe apribili campagna → gruppo → inserzioni (frontend/js/meta-ads.js) */
.meta-toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-top: 12px; }
.meta-toolbar .field-inline { display: inline-flex; align-items: center; gap: 6px; }
.meta-toolbar input[type="search"] { min-width: 180px; flex: 1 1 180px; max-width: 320px; }
.meta-node > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.meta-node > summary::-webkit-details-marker { display: none; }
.meta-node > summary::before { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(-45deg); transition: transform .15s; flex-shrink: 0; }
.meta-node[open] > summary::before { transform: rotate(45deg); }
.meta-node-head { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.meta-node-head h2 { margin: 0; font-size: 17px; }
.meta-node-tot { display: flex; flex-wrap: wrap; gap: 4px 12px; flex: 1 1 260px; }
.meta-node .meta-manage { margin-left: auto; }
.meta-adset { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.meta-adset > summary strong { font-size: 15px; }
.meta-rest { margin-top: 10px; }
.meta-rest > summary { cursor: pointer; }
.meta-chg-sum { cursor: pointer; margin: 0; }
/* Video con Claude (frontend/js/video-jobs.js) */
.vj-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.vj-row:first-child { border-top: 0; }
.vj-row > div:first-child { min-width: 0; flex: 1 1 280px; }
@media (max-width: 640px) { .meta-node .meta-manage { margin-left: 0; } .meta-toolbar input[type="search"] { max-width: none; } }

/* Selettori con tante voci con la casella «Cerca» (select-enhance.js): il <select> vero resta nascosto nel modulo */
.sx { position: relative; display: block; min-width: 0; }
.sx-native { position: absolute !important; inset: auto 0 0 0; width: 100% !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; }
.sx-btn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; cursor: pointer; min-height: 44px; }
.sx-btn:disabled { cursor: not-allowed; opacity: .6; }
.sx-btn.input-sm { min-height: 36px; }
.sx-val { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.sx-val > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-val small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.sx-btn.is-empty .sx-val > span { color: var(--muted); }
.sx-caret { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); }
.sx-pop { position: fixed; z-index: 4000; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, .18); overflow: hidden; }
.sx-pop.is-sheet { left: 0; right: 0; bottom: 0; max-height: 75vh; border-radius: 16px 16px 0 0; }
.sx-search { padding: 10px; border-bottom: 1px solid var(--border); }
.sx-search .input { width: 100%; }
.sx-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.sx-group { position: sticky; top: -6px; z-index: 1; padding: 8px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
.sx-opt { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; overflow-wrap: anywhere; }
.sx-opt > span:first-child { flex: 1; min-width: 0; }
.sx-opt.active { background: var(--blue-light); }
.sx-opt[aria-selected=true] { font-weight: 600; color: var(--blue); }
.sx-opt[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.sx-opt.is-empty { color: var(--muted); font-style: italic; }
.sx-check { color: var(--blue); font-weight: 700; }
.sx-none { padding: 14px 10px; color: var(--muted); font-size: 14px; }
.sx-count { margin: 0; padding: 0 12px 8px; }
.sx-count:empty { display: none; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .no-print, #toasts, .sidebar-scrim, .back { display: none !important; }
  .view { padding: 0; max-width: none; }
  .print-area, .print-area[hidden] { display: block !important; }
  .doc-read { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .doc-read h2 { break-after: avoid; }
  .kpi, .quote-items tr, .totals { break-inside: avoid; }
  a { color: inherit; }
}

/* =====================================================================
   MODULO MARKETING
   ===================================================================== */
:root {
  --series: #1d5fb0;
  --series-cmp: #9aa3b2;
  --ok: #1f7a45; --ok-bg: #e7f5ec;
  --warn: #9a6512; --warn-bg: #fff4dd;
  --bad: #c03434; --bad-bg: #fdeeee;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-warn { color: var(--warn); }
.h1-like { font-size: 24px; font-weight: 800; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.plain { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.link-btn { border: 0; background: none; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0; }
.table-compact th, .table-compact td { padding: 8px 10px; }
.table-wrap.flat { box-shadow: none; }
.small-loading { min-height: 60px; }
.small-loading span { width: 22px; height: 22px; }
.disabled { opacity: .55; }

/* Panoramica */
.steps-mini { display: inline-flex; gap: 5px; }
.step-dot { width: 12px; height: 12px; border-radius: 50%; background: #e3e7ee; display: inline-block; }
.step-dot.done { background: var(--blue); }
.ai-pill { font-family: var(--font-head); font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 20px; background: var(--blue-light); color: var(--blue); }
.ai-pill.ai-off { background: #eef0f3; color: var(--gray); }

/* Stepper */
.stepper { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none !important; min-width: 0; }
.step:hover { border-color: var(--blue); }
.step-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #eef0f3; color: var(--gray); font-family: var(--font-head); font-weight: 800; font-size: 12px; }
.step.done .step-num { background: var(--ok-bg); color: var(--ok); }
.step.active { border-color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.step.active .step-num { background: var(--blue); color: #fff; }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-text strong { font-family: var(--font-head); font-size: 14px; }
.step-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fonti */
.source-card { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.source-card.inactive { opacity: .6; }
.source-head { display: flex; justify-content: space-between; align-items: center; }
.platform-tag { display: inline-block; font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gray); background: #eef0f3; padding: 2px 8px; border-radius: 4px; vertical-align: middle; }
.source-actions { display: flex; gap: 2px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.platform-group { display: grid; grid-template-columns: 110px 1fr; gap: 12px; margin-bottom: 12px; align-items: start; }
.platform-group-label { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--gray); padding-top: 10px; }
.platform-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.platform-tile { text-align: left; border: 1.5px dashed var(--border-strong); background: var(--surface); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.platform-tile:hover { border-color: var(--blue); border-style: solid; background: var(--blue-lighter); }
.platform-tile small { color: var(--muted); font-size: 12px; }
.platform-tile small.tile-link { color: var(--blue); font-weight: 600; }
.cm-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr 1.2fr auto; gap: 6px; margin-bottom: 6px; }

/* Dati */
.cov-table { font-size: 13px; }
.cov-table th.cov-month { text-align: center; padding: 8px 2px; font-size: 11px; }
.cov-table th.cov-month small { display: block; font-weight: 400; color: var(--muted); }
.cov-table td { padding: 6px 10px; }
.cov-table td.cov { padding: 0; border: 2px solid var(--surface); height: 26px; min-width: 30px; }
.cov-0 { background: #f1f3f6; }
.cov-1 { background: #c9daf0; }
.cov-2 { background: #7fa6dc; }
.cov-3 { background: var(--series); }
.cov-legend { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
/* Origine del dato nel quadrante: icone chiare sui mesi pieni, scure su quelli parziali */
.cov-table td.cov { text-align: center; vertical-align: middle; }
.cov-origin { display: inline-flex; gap: 1px; align-items: center; justify-content: center; line-height: 0; }
.cov-ico { width: 12px; height: 12px; flex: none; }
.cov-1 .cov-origin, .cov-0 .cov-origin { color: #24456f; }
.cov-2 .cov-origin, .cov-3 .cov-origin { color: #fff; }
.cov-key { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; }
.cov-key .cov-ico { color: var(--text); }
.cov-legend .cov { width: 14px; height: 14px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.cov-source { cursor: pointer; }
.cov-source:hover td:first-child { color: var(--blue); }
.cov-metric td:first-child { padding-left: 26px; color: var(--gray); }
.data-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 18px; }
.mono-input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.copy-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.copy-row .input { flex: 1; min-width: 200px; }
.imp-summary { display: flex; gap: 18px; flex-wrap: wrap; padding: 12px 14px; background: var(--blue-lighter); border-radius: var(--radius-sm); margin: 16px 0; font-size: 14px; }
.imp-grid h3 { margin: 4px 0 8px; font-size: 14px; }
.imp-grid .table-wrap { max-height: 280px; overflow: auto; }
.manual-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 14px; }

/* Filtri */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 6px; }
.filters .field { margin-bottom: 0; min-width: 170px; }

/* Analisi */
.analysis-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; margin-top: 14px; }
.snap-live.refreshing { opacity: .5; transition: opacity .2s; }
.mk-block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 16px; }
.mk-block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.mk-block-title { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mk-block-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.kpi-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kpi-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px 6px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-tile-label { font-size: 12.5px; color: var(--gray); }
.kpi-tile-value { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-tile-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; min-height: 20px; }
.spark { width: 100%; height: 28px; display: block; margin-top: 2px; }
.warn-dot { font-size: 11px; color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 1px 7px; }
.delta { font-family: var(--font-head); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.delta-positivo { color: var(--ok); }
.delta-negativo { color: var(--bad); }
.delta-neutro, .delta-stabile, .delta-na { color: var(--gray); }
.all-metrics { margin-top: 10px; }
.all-metrics summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); padding: 4px 0; }
.all-metrics table { margin-top: 8px; }

/* Grafici */
.chart { margin: 0; }
.chart-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.chart-title { font-weight: 600; color: var(--gray); }
.chart-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--gray); }
.chart-head .link-btn { margin-left: auto; font-size: 12.5px; }
.key { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--series); vertical-align: middle; margin-left: 6px; }
.key-cmp { border-top: 2px dashed var(--series-cmp); }
.chart-plot { position: relative; padding-left: 52px; height: 220px; outline: none; }
.doc-chart .chart-plot { height: 180px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: calc(100% - 0px); overflow: visible; }
.chart-plot svg .grid { stroke: #edf0f4; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-plot svg .crosshair { stroke: #b8c0cc; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-plot:focus-visible { box-shadow: 0 0 0 2px var(--blue); border-radius: 4px; }
.chart-yaxis span { position: absolute; left: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-xaxis span { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart-dot, .chart-hover-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); pointer-events: none; }
.chart-dot.hollow { background: var(--surface); box-shadow: inset 0 0 0 2px var(--series), 0 0 0 2px var(--surface); }
.chart-endlabel { position: absolute; transform: translate(-100%, -150%); font-size: 12px; font-weight: 700; color: var(--text); background: rgba(255,255,255,.85); padding: 0 3px; border-radius: 3px; pointer-events: none; white-space: nowrap; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; pointer-events: none; z-index: 5; min-width: 150px; }
.tip-head { color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row .key { margin-left: 0; }
.tip-row span:last-child { color: var(--gray); }
.chart-table { margin-top: 10px; max-height: 260px; overflow: auto; }
.chart-empty { padding: 30px 0; text-align: center; }

/* Insight */
.insights-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.insights-panel h3 { font-size: 15px; }
.insights { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.insight { display: flex; gap: 6px; align-items: flex-start; border-left: 3px solid #d5dbe4; padding: 6px 0 6px 10px; }
.insight-negativo, .insight-criticita { border-left-color: var(--bad); }
.insight-positivo, .insight-opportunita { border-left-color: var(--ok); }
.insight-avviso { border-left-color: var(--amber); }
.insight-check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; flex: 1; }
.insight-check input { margin-top: 3px; accent-color: var(--blue); flex: none; }
.insight-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.45; }
.insight-text strong { font-size: 13.5px; }
.insight-text span:not(.origin) { color: var(--gray); }
.origin { font-family: var(--font-head); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.origin-ai { color: #6b4fbb; }
.effect-negativo { color: var(--bad); }
.effect-positivo { color: var(--ok); }
.effect-avviso { color: var(--warn); }
.ai-box { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.ai-summary { background: #f5f2fc; border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; }
.ai-questions { font-size: 13px; background: var(--blue-lighter); padding: 8px 10px; border-radius: var(--radius-sm); }
.ai-questions ul { margin: 4px 0 0; padding-left: 18px; }
.ai-card { border-color: #d9d0f3; background: #fcfbff; }
.ai-card .eyebrow { color: #6b4fbb; }
.ai-text { margin: 4px 0 12px 26px; font-size: 14px; color: var(--gray); }
.save-box { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }

/* Stati e avanzamento */
.status { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.status-raggiunto, .status-in_linea { background: var(--ok-bg); color: var(--ok); }
.status-attenzione { background: var(--warn-bg); color: var(--warn); }
.status-critico { background: var(--bad-bg); color: var(--bad); }
.status-senza_dati { background: #eef0f3; color: var(--gray); }
.meter { position: relative; display: inline-block; width: 110px; height: 8px; border-radius: 4px; background: #e8edf4; vertical-align: middle; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--series); }
.meter-raggiunto .meter-fill, .meter-in_linea .meter-fill { background: var(--ok); }
.meter-attenzione .meter-fill { background: var(--amber); }
.meter-critico .meter-fill { background: var(--bad); }
.meter-target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); border-radius: 1px; }
.stat-status .stat-value { font-size: 22px; }
.status-bg-raggiunto .stat-value, .status-bg-in_linea .stat-value { color: var(--ok); }
.status-bg-attenzione .stat-value { color: var(--warn); }
.status-bg-critico .stat-value { color: var(--bad); }
.budget-row { margin-top: 12px; }
.budget-row h3 { font-size: 14px; margin-bottom: 4px; }

/* Piano */
.plan-card { display: flex; flex-direction: column; gap: 6px; margin: 0; color: var(--text); text-decoration: none !important; }
.plan-card:hover { border-color: var(--blue); }
.period-edit { max-width: 420px; }
.input-unit { display: inline-flex; align-items: center; gap: 4px; }
.input-unit .input { width: 110px; }
.targets-table select { min-width: 220px; }
.actions-table .input { min-width: 90px; }
.actions-table td:nth-child(2) .input { min-width: 200px; }
.choice { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.commentary textarea { resize: vertical; }

/* Blocchi nei documenti */
.doc-block { margin-bottom: 28px; break-inside: auto; }
.doc-table { font-size: 13.5px; }
.doc-table-wrap { border-radius: var(--radius-sm); }
.doc-table .group-row td { background: var(--blue-lighter); font-family: var(--font-head); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--blue); }
.doc-table .total-row td { border-top: 2px solid var(--blue); }
.doc-insights { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.doc-insights li { display: flex; flex-direction: column; gap: 2px; border-left: 3px solid #d5dbe4; padding-left: 12px; font-size: 14.5px; }
.doc-insights li.insight-negativo, .doc-insights li.insight-criticita { border-left-color: var(--bad); }
.doc-insights li.insight-positivo, .doc-insights li.insight-opportunita { border-left-color: var(--ok); }
.doc-insights li span:last-child { color: var(--gray); }
.doc-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 28px; }
.doc-chart { break-inside: avoid; }
.blocks-card { border-left: 4px solid var(--series); }
/* Audit per sezioni: i dati della sezione (tabelle, grafici) prima del testo di analisi */
.doc-sec-blocks { margin: 8px 0 18px; }
.doc-sec-blocks .doc-block { margin-bottom: 18px; }
.doc-sec-blocks .doc-block > h2 { font-size: 15px; margin: 0 0 8px; color: var(--blue); }
.doc-block h3 { font-size: 14px; margin: 16px 0 6px; }
.doc-kpi-grid { margin-bottom: 8px; }
.doc-kpi-grid .kpi small { font-size: 11.5px; }
.doc-method { margin-top: 6px; }
.doc-forecasts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; }
.doc-forecast h3 { margin-top: 0; }
/* Editor: dati della sezione ripiegabili e suggerimenti AI */
.sec-blocks { margin: 6px 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--blue-lighter); }
.sec-blocks > summary { cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--blue); display: flex; gap: 6px; align-items: center; }
.sec-blocks-body { padding: 4px 12px 8px; background: var(--surface); border-top: 1px solid var(--border); max-height: 520px; overflow: auto; }
.ai-suggest { color: #8a5a00; white-space: nowrap; }
.ai-suggest:hover:not(:disabled) { background: #fff6e0; color: #6b4600; }
.ai-proposal { border-left: 3px solid #eda100; padding: 4px 0 4px 14px; margin-bottom: 10px; max-height: 50vh; overflow: auto; }
.kpi-pick { display: flex; flex-direction: column; gap: 8px; }
.kpi-pick-item { align-items: flex-start; }
.doc-published { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 1100px) {
  .analysis-layout { grid-template-columns: 1fr; }
  .insights-panel { position: static; max-height: none; }
  .stepper { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 860px) {
  .stepper { grid-template-columns: repeat(9, auto); overflow-x: auto; }
  .step-text small { display: none; }
  .platform-group { grid-template-columns: 1fr; gap: 4px; }
  .cm-row { grid-template-columns: 1fr 1fr; }
  .doc-charts { grid-template-columns: 1fr; }
  .chart-plot { height: 180px; }
}
/* Gestione (views/gestione.js): riquadri in cima, schede Studio e Clienti, obiettivi con traguardi e attività */
.gs-boxes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1200px) { .gs-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .gs-boxes { grid-template-columns: 1fr; } }
.gs-box.is-blocked h2 { color: var(--amber-dark); }
.gs-box.is-blocked .gs-count { background: var(--amber-light, #fff4dc); color: var(--amber-dark); }
.gs-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.gs-bar .gs-tabs { margin-bottom: 0; }
.gs-filters { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; justify-content: flex-end; }
.gs-filters .input { width: auto; min-width: 0; max-width: 220px; }
.gs-filters input[type="search"] { flex: 1 1 200px; max-width: 280px; }
@media (max-width: 700px) { .gs-filters { justify-content: stretch; } .gs-filters .input, .gs-filters input[type="search"] { flex: 1 1 100%; max-width: none; } }
.gs-badges { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.gs-badges .badge { display: inline-flex; align-items: center; gap: 4px; }
.gs-badges .badge .icon { width: 11px; height: 11px; }
.gs-goal h2 a { color: inherit; }
.gs-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; margin: 10px 0 0; }
.gs-summary dt { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--gray); }
.gs-summary dd { margin: 2px 0 0; }
.gs-summary .gs-missing { grid-column: 1 / -1; }
.gs-missing ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.gs-missing li { display: flex; gap: 6px; align-items: baseline; }
.gs-details > summary { cursor: pointer; font-size: 13px; color: var(--blue); margin-top: 6px; }
.gs-details[open] > summary { margin-bottom: 8px; }
.gs-auto-dot { width: 18px; height: 18px; flex: none; margin-top: 2px; border: 2px solid var(--border); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.gs-auto-dot.is-done { background: var(--green, #1baf7a); border-color: var(--green, #1baf7a); color: #fff; }
.gs-auto-dot .icon { width: 12px; height: 12px; }
.gs-act.is-done a { text-decoration: line-through; color: var(--gray); }
.gs-client-name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gs-client-name small { font-size: 12px; font-weight: 400; }
.gs-ai-goal { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; display: grid; gap: 8px; }
.gs-ai-row { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.gs-ai-row input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.gs-ai-row > span { display: grid; gap: 2px; min-width: 0; }
.gs-ai-ms { padding-left: 22px; display: grid; gap: 6px; }
.gs-ai-act { padding-left: 22px; }
.gs-brief-on { align-self: end; padding-bottom: 12px; }
.gs-brief-sec + .gs-brief-sec { margin-top: 14px; }
.gs-brief-sec h3 { display: flex; align-items: center; gap: 8px; }
.gs-agent-text { white-space: pre-wrap; }
.gs-missing-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.gs-box h2 { display: flex; align-items: center; gap: 6px; }
.gs-box.is-late h2 { color: var(--red); }
.gs-count { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--blue-light); color: var(--blue); border-radius: 999px; padding: 1px 8px; }
.gs-box.is-late .gs-count { background: var(--red-light); color: var(--red); }
.gs-box-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.gs-box-list li { display: grid; gap: 1px; }
.gs-box-list .link-btn, .gs-act .link-btn { text-align: left; }
.gs-tabs { margin-bottom: 14px; }
.gs-list > * + * { margin-top: 14px; }
.gs-client-name { font-size: 15px; margin: 6px 0 10px; }
.gs-client > .card + .card { margin-top: 12px; }
.gs-goal.is-late { border-left: 3px solid var(--red); }
.gs-progress { display: flex; align-items: center; gap: 10px; }
.gs-progress .progress { flex: 1; max-width: 420px; }
.gs-ms { border-top: 1px solid var(--line, #e5e8ec); padding-top: 10px; }
.gs-ms-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gs-ms.is-late .gs-ms-head small { color: var(--red); }
.gs-ms-actions { margin-left: auto; display: inline-flex; gap: 4px; }
.gs-acts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.gs-act { display: flex; gap: 10px; align-items: flex-start; }
.gs-act.is-done .link-btn { text-decoration: line-through; color: var(--gray); }
.gs-check input { width: 18px; height: 18px; margin-top: 2px; }
.gs-act-main { display: grid; gap: 3px; min-width: 0; }
.gs-flags { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.gs-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--amber-dark); }
.gs-flag.is-blocked { color: var(--red); }
a.gs-flag { color: var(--blue); }
.gs-flag .icon { width: 13px; height: 13px; }

/* Preventivi dei partner (views/partner-quotes.js, views/public-partner-quote.js): voci con costo, markup e margine, riepiloghi, pagina pubblica */
.pq-table .input-num { width: 96px; text-align: right; }
.pq-table td { vertical-align: middle; }
.pq-table td .input { min-width: 0; }
.pq-table td:first-child .input { min-width: 240px; width: 100%; }
.pq-table td:first-child small { display: block; margin-top: 4px; }
.pq-sum + .card-title-sm, .pq-sum + h3 { margin-top: 22px; }
.pq-table + .actions, .table-wrap + .pq-sum { margin-top: 4px; }
@media (max-width: 760px) {
  .pq-table td:first-child .input { min-width: 0; width: 100%; }
  .pq-table td { vertical-align: top; }
  .pq-sum { justify-content: flex-start; }
  .pq-sum > span:first-child { width: 100%; }
}
.partner-mk .card-title-sm { margin-top: 18px; }
.partner-mk .card-head + .card-title-sm { margin-top: 14px; }
.pq-sum { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: flex-end; padding: 10px 4px; font-size: 14px; }
.pq-sum > span:first-child { margin-right: auto; font-weight: 600; }
.pq-totals { display: grid; gap: 4px; max-width: 340px; margin: 12px 0 0 auto; }
.pq-totals div { display: flex; justify-content: space-between; gap: 12px; }
.pq-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.pq-totals .is-total { font-weight: 700; border-top: 1px solid var(--line, #cfd5dd); padding-top: 6px; }
.pq-brand { display: flex; flex-direction: column; gap: 4px; }
.pq-brand img { max-width: 200px; max-height: 56px; object-fit: contain; object-position: left center; }
.pq-public .card + .card { margin-top: 14px; }

@media print {
  .chart-head .link-btn, .chart-tip, .chart-hover-dot, .all-metrics summary { display: none !important; }
  .doc-charts { grid-template-columns: 1fr 1fr; }
  .doc-table, .kpi-tile { break-inside: avoid; }
  .table-wrap { overflow: visible !important; box-shadow: none; }
}

/* =====================================================================
   GANTT, TIMELINE, FATTURE, DASHBOARD CLIENTE
   ===================================================================== */
.view-switch { margin-left: auto; }
.card-title-sm { font-size: 15px; margin-bottom: 12px; }
.gantt-card { padding: 14px 14px 10px; }
.gantt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.g-legend { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.g-key { display: inline-block; width: 14px; height: 8px; border-radius: 3px; margin-left: 6px; }
.g-key-ms { display: inline-block; width: 9px; height: 9px; transform: rotate(45deg); background: var(--text); margin-left: 8px; margin-right: 2px; }
.gantt { position: relative; overflow: auto; max-height: 70vh; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.g-row { display: flex; min-width: max-content; }
.g-label { position: sticky; left: 0; z-index: 3; width: var(--label-w); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 13px; min-height: 40px; }
.g-label-text { min-width: 0; display: flex; flex-direction: column; }
.g-label-text a { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label-text a:hover { color: var(--blue); }
.g-label-text small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row-group .g-label { background: var(--blue-lighter); }
.g-row-group .g-label-text a { font-family: var(--font-head); font-weight: 700; }
.g-toggle { border: 0; background: none; cursor: pointer; color: var(--gray); padding: 0 2px; font-size: 12px; width: 16px; }
.g-head { position: sticky; top: 0; z-index: 5; }
.g-head .g-label { z-index: 6; background: var(--surface); font-family: var(--font-head); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); border-bottom: 1px solid var(--border); min-height: 48px; }
.g-head .g-track { background: var(--surface); border-bottom: 1px solid var(--border); height: 48px; }
.g-months, .g-ticks { position: relative; height: 24px; }
.g-months span, .g-ticks span { position: absolute; top: 0; height: 24px; line-height: 24px; font-size: 11px; color: var(--gray); padding-left: 4px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.g-months span { font-family: var(--font-head); font-weight: 700; color: var(--text); text-transform: capitalize; overflow: visible; }
.g-months span b { position: sticky; left: calc(var(--label-w) + 6px); font-weight: 700; }
.g-ticks span.we { background: #f4f6f9; }
.g-rows { position: relative; }
.g-bg { position: absolute; top: 0; bottom: 0; left: var(--label-w); pointer-events: none; z-index: 0; }
.g-weekend { position: absolute; top: 0; bottom: 0; background: #f6f8fb; }
.g-vline { position: absolute; top: 0; bottom: 0; border-left: 1px solid #eef1f5; }
.g-today { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--amber); z-index: 2; }
.g-today span { position: absolute; top: 2px; left: 4px; font-size: 10px; font-weight: 700; color: var(--amber-dark); background: var(--amber-light); padding: 0 4px; border-radius: 3px; }
.g-track { position: relative; flex: none; z-index: 1; }
.g-rows .g-row { border-bottom: 1px solid #f0f2f5; }
.g-rows .g-row:hover .g-label { background: var(--blue-lighter); }
.g-bar { position: absolute; top: 9px; height: 22px; border-radius: 5px; background: #9aa3b2; color: #fff; font-size: 11.5px; font-weight: 600; display: flex; align-items: center; overflow: hidden; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.08); user-select: none; touch-action: none; }
.g-bar:focus-visible, .g-milestone:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.g-bar.g-dragging { cursor: grabbing; opacity: .85; box-shadow: var(--shadow-md); z-index: 4; }
.g-bar-label { position: relative; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; z-index: 1; }
.g-outside-label, .g-milestone-label { position: absolute; top: 12px; font-size: 11.5px; color: var(--gray); white-space: nowrap; pointer-events: none; }
.g-status-da_fare { background: #8e98a8; }
.g-status-in_corso { background: var(--series); }
.g-status-revisione { background: #c98a12; }
.g-status-fatto { background: var(--ok); }
.g-group.g-bar { background: #c8d6ea; color: var(--blue-dark); height: 16px; top: 12px; border-radius: 4px; }
.g-group .g-progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 4px 0 0 4px; }
.g-group .g-bar-label { color: #fff; mix-blend-mode: normal; text-shadow: 0 0 2px rgba(1,42,86,.6); }
.g-dueonly { opacity: .75; background-image: repeating-linear-gradient(135deg, transparent 0 5px, rgba(255,255,255,.25) 5px 10px); }
.g-overdue { box-shadow: 0 0 0 2px var(--bad); }
.g-handle { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; z-index: 2; }
.g-handle-l { left: 0; }
.g-handle-r { right: 0; }
.g-bar:hover .g-handle { background: rgba(255,255,255,.35); }
.g-milestone { position: absolute; top: 13px; width: 14px; height: 14px; transform: translateX(-50%) rotate(45deg); border-radius: 2px; cursor: grab; box-shadow: 0 0 0 2px var(--surface); touch-action: none; }
.g-hint { position: absolute; left: 8px; top: 12px; font-size: 11.5px; color: var(--muted); font-style: italic; white-space: nowrap; }
.g-drag-tip { position: fixed; z-index: 300; background: var(--blue-dark); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; pointer-events: none; }
.g-row-task[data-row] .g-track { cursor: default; }

.stat-attention .stat-value { color: var(--amber-dark); }
.doc-group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); margin: 12px 0 4px; display: flex; gap: 6px; align-items: center; }
.doc-group-title:first-of-type { margin-top: 0; }
.file-btn { cursor: pointer; }
.totals-net td { font-family: var(--font-head); font-weight: 800; color: var(--text); border-top: 1px solid var(--border); padding-top: 8px; }
.list-row a.list-main { color: var(--text); text-decoration: none; }
.list-row a.list-main:hover strong { color: var(--blue); }

/* Gantt: scale del tempo, legenda richiudibile, telefono */
.g-vline-strong { border-left-color: #d9dfe8; }
.g-label-flip { transform: translateX(-100%); text-align: right; }
.g-legend-wrap { margin-left: auto; }
.g-legend-wrap summary { cursor: pointer; list-style: none; padding: 4px 8px; border-radius: 6px; }
.g-legend-wrap summary::-webkit-details-marker { display: none; }
.g-legend-wrap[open] summary { display: none; }
.g-legend-wrap .g-legend { margin-left: 0; }
.g-touch .g-bar, .g-touch .g-milestone { cursor: pointer; touch-action: auto; }
@media (max-width: 640px) {
  .gantt-card { padding: 10px 8px 8px; }
  .gantt-toolbar { gap: 6px; }
  .gantt-toolbar .segmented button { padding: 6px 9px; font-size: 12.5px; }
  .gantt { max-height: 65vh; }
  .g-label { padding: 6px 6px; font-size: 12px; min-height: 44px; }
  .g-label-text small { font-size: 10.5px; }
  .g-row-group .g-label-text a { font-size: 12.5px; }
  .g-toggle { width: 14px; }
  .g-legend-wrap { flex-basis: 100%; margin-left: 0; }
  .g-legend-wrap[open] summary { display: block; }
  .g-bar { height: 24px; top: 10px; }
  .g-outside-label, .g-milestone-label { font-size: 11px; }
}
@media print {
  .gantt-toolbar { display: none; }
  .gantt { max-height: none; overflow: visible; }
}

/* Registrazione fatture */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; cursor: pointer; text-align: center; background: var(--blue-lighter); }
.dropzone:hover, .dropzone.over { border-color: var(--blue); background: var(--blue-light); }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-bg); }
.dropzone-text { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); }
.invoice-card { max-width: 640px; }
.invoice-amount { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.invoice-amount strong { font-family: var(--font-head); font-size: 30px; font-weight: 800; color: var(--text); }
.invoice-card .actions { margin-top: 14px; }
.notes-plain { margin-top: 12px; font-size: 14px; color: var(--gray); }
.menu-file { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.menu-file:hover { background: var(--blue-lighter); }

/* Pagamento con bonifico */
.pay-box { border-left: 4px solid var(--ok); }
.pay-amount { font-family: var(--font-head); font-size: 22px; font-weight: 800; }
.pay-list { margin: 0; }
.pay-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pay-row:last-child { border-bottom: 0; }
.pay-row dt { color: var(--muted); font-size: 13px; }
.pay-row dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.pay-value { font-weight: 600; overflow-wrap: anywhere; }
.pay-row:nth-child(2) .pay-value { font-family: ui-monospace, Menlo, monospace; font-size: 14.5px; letter-spacing: .3px; }
.pay-copy { padding: 3px 8px; font-size: 12px; }
.pay-notes { margin-top: 10px; }
.invoice-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.invoice-layout .invoice-card { max-width: none; }
.text-ok { color: var(--ok); }
.settings-cols { align-items: start; }
@media (max-width: 1100px) { .invoice-layout { grid-template-columns: 1fr; } }
@media print { .pay-copy { display: none; } }

/* Barra superiore sempre visibile con campanella */
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 36px; background: var(--bg); position: sticky; top: 0; z-index: 40; justify-content: flex-end; }
.topbar #menu-toggle, .topbar .topbar-logo { display: none; }
.topbar-right { position: relative; margin-left: auto; }
.bell { position: relative; width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.bell .icon { width: 20px; height: 20px; }
.bell-count { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff; font-family: var(--font-head); font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, calc(100vw - 32px)); max-height: 70vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.notif-list { list-style: none; margin: 0; padding: 4px; }
.notif { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; }
.notif:hover { background: var(--blue-lighter); }
.notif.unread { background: #f3f7fd; }
.notif-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
.notif.urgent .notif-icon { background: var(--bad-bg); color: var(--bad); }
.notif-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.notif-text strong { font-size: 13.5px; }
.notif.unread .notif-text strong::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.notif-text span { color: var(--gray); }
.notif-text time { color: var(--muted); font-size: 11.5px; }
.notif-empty { padding: 20px 14px; text-align: center; }
@media (max-width: 860px) {
  .topbar { padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); justify-content: flex-start; }
  .topbar #menu-toggle, .topbar .topbar-logo { display: inline-grid; }
  .topbar .topbar-logo { display: block; }
}
.sticky-head { top: 60px; }
@media (max-width: 860px) { .sticky-head { top: 61px; } }

/* Stato di pagamento delle fatture */
.pay-state { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.pay-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pay-state-overdue { background: var(--bad-bg); color: var(--bad); }
.pay-state-due { background: var(--warn-bg); color: var(--warn); }
.pay-state-open { background: var(--blue-light); color: var(--blue); }
.pay-state-paid { background: var(--ok-bg); color: var(--ok); }
.pay-state-void { background: #eef0f3; color: var(--gray); }
tr.inv-overdue td { background: #fff6f6; }
tr.inv-overdue td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
tr.inv-due td { background: #fffaf0; }
tr.inv-due td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
tr.inv-paid td { color: var(--gray); }
.uncovered { border-left: 4px solid var(--bad); }
.uncovered.only-due { border-left-color: var(--amber); }
.uncovered-list li .list-meta { gap: 10px; }
.callout-danger { background: var(--bad-bg); border-color: #f2c9c9; }
.callout-danger > .icon { color: var(--bad); }
.list li.li-overdue { box-shadow: inset 4px 0 0 var(--bad); background: #fff6f6; }
.list li.li-due { box-shadow: inset 4px 0 0 var(--amber); background: #fffaf0; }

/* Firma elettronica */
.sig-tabs { margin-bottom: 10px; }
.sig-canvas { width: 100%; height: 150px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-foot { display: flex; justify-content: space-between; margin-top: 4px; }
.sig-typed-preview { display: block; font-family: 'Brush Script MT', 'Segoe Script', 'Snell Roundhand', cursive; font-size: 34px; color: #0b2a57; min-height: 50px; padding: 8px 4px; border-bottom: 1px solid var(--border-strong); margin-top: 8px; }
.sign-steps { display: flex; flex-direction: column; gap: 14px; }
.sign-legal { font-size: 13px; background: var(--blue-lighter); padding: 10px 12px; border-radius: var(--radius-sm); }
.otp-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.otp-row .input { width: 160px; letter-spacing: 4px; font-family: ui-monospace, Menlo, monospace; font-size: 18px; text-align: center; }
.certificate { border-left: 4px solid var(--ok); }
.certificate h2 { display: flex; align-items: center; gap: 8px; }
.cert-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cert-signature { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; text-align: center; background: #fff; }
.cert-signature img { max-width: 100%; margin: 0 auto; }
.hash { font-size: 12px; overflow-wrap: anywhere; }
.sign-link-box { display: flex; gap: 8px; align-items: center; }
.sign-link-box .input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.public-sign { max-width: 900px; margin: 0 auto; padding: 24px 16px 60px; }
.public-sign-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.public-sign-head img { width: 180px; }
@media (max-width: 760px) { .cert-grid { grid-template-columns: 1fr; } }
@media print { body.print-cert .view > *:not(#certificate) { display: none !important; } body.print-cert #certificate { border: 0; box-shadow: none; } }

/* Richieste e videochiamate */
.req-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.req-type input { position: absolute; opacity: 0; }
.req-type span { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1.5px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; height: 100%; }
.req-type span .icon { color: var(--blue); }
.req-type small { color: var(--muted); font-size: 12px; }
.req-type input:checked + span { border-color: var(--blue); background: var(--blue-lighter); box-shadow: inset 0 0 0 1px var(--blue); }
.req-type input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.slot-days { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.slot-days button { flex: none; display: flex; flex-direction: column; align-items: center; width: 58px; padding: 6px 0; border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-size: 11px; color: var(--gray); text-transform: capitalize; }
.slot-days button strong { font-family: var(--font-head); font-size: 18px; color: var(--text); }
.slot-days button[aria-selected=true] { border-color: var(--blue); background: var(--blue); color: #fff; }
.slot-days button[aria-selected=true] strong { color: #fff; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-bottom: 8px; }
.slot { padding: 8px 0; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-family: var(--font-head); font-weight: 600; font-size: 13px; }
.slot:hover { border-color: var(--blue); }
.slot.chosen { background: var(--ok); border-color: var(--ok); color: #fff; }
.req-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
li.req-unread .list-main strong { color: var(--blue-dark); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 6px; vertical-align: 1px; }
.meet-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--ok); }
.meet-card.past { border-left-color: var(--border-strong); opacity: .8; }
.meet-when { display: flex; gap: 12px; align-items: center; }
.meet-when > .icon { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); box-sizing: content-box; }
.meet-when div { display: flex; flex-direction: column; }
.meet-when strong { font-family: var(--font-head); font-size: 18px; text-transform: capitalize; }
.proposed { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.proposed-slot { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); text-transform: capitalize; }
.messages { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; background: #f1f4f8; }
.msg.staff { background: var(--blue-lighter); border: 1px solid var(--blue-light); }
.msg.mine { align-self: flex-end; }
.msg-meta { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-body p { margin: 0; font-size: 14.5px; }
.msg-body p + p { margin-top: 6px; }
.msg-system { align-self: center; font-size: 12px; color: var(--gray); background: #f6f8fb; padding: 4px 12px; border-radius: 20px; text-align: center; }
.reply { display: flex; gap: 10px; align-items: flex-end; }
.reply .input { flex: 1; }
.agenda-row { align-items: flex-start; }
.agenda-time { width: 110px; flex: none; font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); padding-top: 2px; }
.agenda-day { margin-bottom: 18px; }
.agenda-day .group-title { text-transform: capitalize; }
.google-card { margin-top: 18px; }
.google-card h2 { display: flex; align-items: center; gap: 8px; }
.google-card h3 { margin: 18px 0 10px; font-size: 15px; }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick input { position: absolute; opacity: 0; }
.day-pick span { display: inline-block; padding: 6px 12px; border: 1.5px solid var(--border-strong); border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600; }
.day-pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.day-pick input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.window-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; max-width: 320px; }
@media (max-width: 640px) { .req-types { grid-template-columns: 1fr; } .msg { max-width: 95%; } .agenda-time { width: 80px; } }
.req-type, .day-pick { position: relative; }
.contact-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--blue); }
.contact-card h2 { margin-bottom: 4px; }
.open-req { width: 100%; margin: 0; border-top: 1px solid var(--border); padding-top: 10px; }
/* La modale non si allarga oltre lo schermo per contenuti lunghi (es. fila dei giorni) */
.modal { min-width: 0; max-width: 100%; }
.modal-body { min-width: 0; overflow-x: hidden; }
.modal-body .field, .modal-body [data-slots] { min-width: 0; }

/* Area contenuti: live, articoli, formazione */
.content-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 26px; }
.content-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; margin: 0; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.content-card:hover { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.content-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--blue-light); }
.content-cover.placeholder { display: grid; place-items: center; color: var(--blue); }
.content-cover.placeholder .icon { width: 40px; height: 40px; opacity: .5; }
.content-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.content-card h3 { font-size: 16.5px; line-height: 1.3; }
.content-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.content-foot { margin-top: auto; color: var(--gray); }
.content-foot .icon { width: 14px; height: 14px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 20px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip[aria-pressed=true] .muted { color: rgba(255,255,255,.75); }
.content-article { max-width: 780px; margin: 0 auto; }
.content-article header { margin-bottom: 18px; }
.content-article h1 { font-size: 32px; margin: 4px 0 6px; }
.content-article .cover { width: 100%; border-radius: var(--radius); margin: 8px 0 20px; }
.lead { font-size: 18px; color: var(--gray); margin-bottom: 18px; line-height: 1.6; }
.rich { font-size: 16.5px; line-height: 1.75; }
.rich p, .rich ul, .rich ol, .rich blockquote { margin: 0 0 16px; }
.rich h2 { font-size: 22px; margin: 28px 0 10px; }
.rich h3 { font-size: 18px; margin: 22px 0 8px; }
.rich blockquote { border-left: 4px solid var(--amber); padding: 6px 16px; background: var(--amber-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text); }
.rich ul, .rich ol { padding-left: 24px; }
.rich h4 { font-size: 16.5px; margin: 18px 0 6px; }
.rich figure { margin: 8px 0 20px; }
.rich img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.video-embed { position: relative; aspect-ratio: 16 / 9; margin: 8px 0 22px; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.live-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--blue); }
.live-box.live-in_corso { border-left-color: var(--bad); }
.live-box.live-conclusa { border-left-color: var(--border-strong); }
.content-done { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.content-editor { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.content-side { position: sticky; top: 76px; }
.content-body { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px; line-height: 1.6; }
.cover-edit { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cover-preview { width: 200px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); background: var(--blue-lighter); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-box { max-height: 70vh; overflow-y: auto; font-size: 14.5px; }
.preview-box .cover { width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px; }
@media (max-width: 1100px) { .content-editor { grid-template-columns: 1fr; } .content-side { position: static; } }
@media (max-width: 640px) { .content-article h1 { font-size: 25px; } .rich { font-size: 16px; } }

/* ================= Navigazione e barra superiore (revisione UX) ================= */
.sidebar { padding: 18px 12px 14px; }
.brand { padding: 2px 10px 18px; display: block; }
.brand img { width: 158px; height: auto; display: block; }
.sidebar-client { margin: 0 6px 12px; }
.nav { gap: 14px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-label { margin: 0 0 4px; padding: 0 12px; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .45); }
.nav a { padding: 8px 12px; gap: 11px; font-size: 13.5px; }
.nav a .icon { width: 18px; height: 18px; flex: none; opacity: .9; }

.nav-badge { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.nav-badge-danger { background: var(--red); }
.nav-badge[hidden] { display: none; }
.sidebar-user { margin-top: 10px; padding-top: 10px; }

.topbar { gap: 10px; padding: 12px 36px; }
.search-trigger {
  display: inline-flex; align-items: center; gap: 10px; width: min(420px, 100%); margin-right: auto; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.search-trigger .icon { width: 18px; height: 18px; color: var(--gray); }
.search-trigger span { flex: 1; }
.search-trigger kbd, .palette kbd { font-family: var(--font-head); font-size: 11px; font-weight: 700; color: var(--gray); background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }
.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: 0; }
.topbar .btn-sm { height: 40px; padding: 0 14px; border-radius: 999px; }
.topbar .btn-sm .icon { width: 17px; height: 17px; }
.menu-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; }
.dropdown button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: var(--radius-sm); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-align: left; }
.dropdown button .icon { width: 17px; height: 17px; color: var(--blue); }
.dropdown button:hover, .dropdown button:focus-visible { background: var(--blue-lighter); outline: none; }
.notif-panel { top: calc(100% + 8px); }

/* Ricerca globale */
.palette-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(1, 26, 54, .35); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.palette-input .icon { width: 20px; height: 20px; color: var(--gray); }
.palette-input input { flex: 1; border: 0; outline: none; font: inherit; font-size: 16px; color: var(--text); background: none; min-width: 0; }
.palette-input input::-webkit-search-cancel-button { display: none; }
.palette-results { overflow-y: auto; padding: 6px; }
.palette-group + .palette-group { margin-top: 6px; }
.palette-group-title { margin: 6px 10px 4px; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.palette-item.active { background: var(--blue-light); }
.palette-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--blue-lighter); color: var(--blue); display: grid; place-items: center; flex: none; }
.palette-icon .icon { width: 16px; height: 16px; }
.palette-item.active .palette-icon { background: var(--surface); }
.palette-text { display: flex; flex-direction: column; min-width: 0; }
.palette-text strong { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-text small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-empty { padding: 22px; text-align: center; color: var(--muted); margin: 0; }

@media (max-width: 860px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .search-trigger { width: 40px; height: 40px; padding: 0; justify-content: center; margin-right: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .hide-sm { display: none; }
  .topbar .btn-sm { width: 40px; padding: 0; justify-content: center; }
  .topbar-logo { margin-right: auto; }
}

/* ================= Dashboard (revisione UX) ================= */
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .stats-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-alert .stat-hint { color: var(--red); font-weight: 600; }
.stat-warn .stat-hint { color: var(--amber-dark); font-weight: 600; }
.inbox-card { padding-bottom: 8px; }
.inbox { margin: 0 -20px; }
/* Fino a 860px la card ha 16px di margine interno: l'elenco a tutta larghezza non deve uscire */
@media (max-width: 860px) { .card > .inbox { margin: 0 -16px; } }
.inbox .list-row { padding: 11px 20px; }
.inbox-row:hover { background: var(--blue-lighter); }
.inbox-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: #eef0f3; color: var(--gray); }
.inbox-icon .icon { width: 17px; height: 17px; }
.inbox-icon.tone-danger { background: var(--red-light); color: var(--red); }
.inbox-icon.tone-warn { background: var(--amber-light); color: var(--amber-dark); }
.inbox-icon.tone-brand { background: var(--blue-light); color: var(--blue); }
.inbox-meta { font-size: 12.5px; font-weight: 600; color: var(--gray); }
.inbox-more { margin: 6px 0 4px; }
.all-clear { display: flex; gap: 14px; align-items: center; padding: 6px 0 10px; }
.all-clear > .icon { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--green-light); color: var(--green); flex: none; }
.date-chip { width: 44px; flex: none; text-align: center; border-radius: 8px; background: var(--blue-lighter); color: var(--blue); font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; line-height: 1.2; padding: 5px 0; }
.date-chip b { display: block; font-size: 17px; font-weight: 800; }
.activity-card summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.activity-card summary::-webkit-details-marker { display: none; }
.activity-card summary h2::after { content: '▾'; margin-left: 8px; font-size: 13px; color: var(--muted); display: inline-block; transition: transform .15s; }
.activity-card:not([open]) summary h2::after { transform: rotate(-90deg); }
.activity-card[open] summary { margin-bottom: 12px; }
@media (max-width: 860px) { .inbox-row { flex-wrap: wrap; row-gap: 2px; } .inbox-meta { width: 100%; padding-left: 48px; } }
.summary-line { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; font-size: 14px; color: var(--gray); }
.summary-line > span[aria-hidden] { color: var(--border-strong); }
.source-actions { display: flex; align-items: center; gap: 2px; flex-wrap: nowrap; margin: auto -8px -6px; padding-top: 8px; border-top: 1px solid var(--border); }
.source-actions .btn-sm { padding: 6px 8px; }
.source-actions [data-delete] { margin-left: auto; }
.source-google .source-actions { flex-wrap: wrap; margin: 4px -8px 0; border-top: 0; padding-top: 2px; }
.info dd a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= Framework: funnel ================= */
.funnel-card .card-head { align-items: flex-start; }
.funnel { display: flex; flex-direction: column; gap: 0; }
.funnel-row { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 90px; gap: 14px; align-items: center; }
.funnel-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.funnel-label strong { font-family: var(--font-head); font-size: 14px; }
.funnel-label small { color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.funnel-bar-wrap { display: flex; justify-content: center; }
.funnel-bar { height: 40px; border-radius: 6px; display: grid; place-items: center; min-width: 90px; font-family: var(--font-head); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
/* Scala sequenziale di un solo blu: le fasi sono ordinate, dalla più ampia alla più profonda */
.phase-bg-see { background: #86b6ef; color: #0d366b; }
.phase-bg-think { background: #5598e7; color: #0d2a52; }
.phase-bg-do { background: #256abf; color: #fff; }
.phase-bg-care { background: #104281; color: #fff; }
.phase { align-self: flex-start; font-family: var(--font-head); font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); }
.funnel-delta { text-align: right; }
.funnel-row, .funnel-step { display: grid; grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) 90px; gap: 14px; align-items: center; }
.funnel-step-mid { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 5px 0; font-size: 12.5px; color: var(--gray); flex-wrap: wrap; }
.funnel-step-rate { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.funnel-step-rate .icon { width: 13px; height: 13px; }
.funnel-step-cmp { color: var(--muted); }
.funnel-step-cmp.neg { color: var(--red); }
.funnel-step-cmp.pos { color: var(--green); }
.funnel-bottleneck .funnel-step-rate { color: var(--red); }
.funnel-flag { background: var(--red-light); color: var(--red); font-family: var(--font-head); font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.funnel-overall { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--gray); }
.fn-stage { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; }
.fn-stage-head { display: flex; gap: 6px; align-items: center; }
.fn-stage-head .input:first-of-type { flex: 1; }
.fn-stage-head select { width: 170px; flex: none; }
.fn-terms { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0 30px; }
.fn-term { display: flex; gap: 6px; align-items: center; }
@media (max-width: 700px) {
  .funnel-row { grid-template-columns: 1fr; gap: 6px; }
  .funnel-bar-wrap { justify-content: flex-start; }
  .funnel-delta { text-align: left; }
  .funnel-step { grid-template-columns: 1fr; gap: 0; }
  .funnel-step > span { display: none; }
  .funnel-step-mid { justify-content: flex-start; margin: 6px 0 8px 10px; padding: 2px 0 2px 10px; border-left: 2px dashed var(--border-strong); }
  .fn-stage-head { flex-wrap: wrap; }
  .fn-terms { margin-left: 0; }
}

/* ================= Framework nei documenti ================= */
.fw-wrap { margin-top: 6px; }
.fw-axis-top { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-left: 0; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); text-align: center; margin-bottom: 6px; }
.fw-body { display: flex; gap: 8px; }
.fw-axis-side { display: grid; grid-auto-rows: 1fr; gap: 10px; width: 22px; flex: none; }
.fw-axis-side span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.fw-wrap:has(.fw-axis-side) .fw-axis-top { margin-left: 30px; }
.fw-grid { flex: 1; display: grid; grid-template-columns: repeat(var(--fw-cols, 2), minmax(0, 1fr)); gap: 10px; }
.fw-cell { background: var(--blue-lighter); border: 1px solid var(--border); border-top: 3px solid var(--blue); border-radius: 8px; padding: 12px 14px; break-inside: avoid; }
.fw-cell h4 { margin: 0 0 6px; font-family: var(--font-head); font-size: 13px; color: var(--blue-dark); }
.fw-cell ul { margin: 0; padding-left: 18px; font-size: 14px; }
.fw-cell li + li { margin-top: 3px; }
.fw-cell p { margin: 0; font-size: 14px; }

.fw-bmc { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-areas:
  "partners partners activities activities value value relationships relationships segments segments"
  "partners partners resources resources value value channels channels segments segments"
  "costs costs costs costs costs revenues revenues revenues revenues revenues"; }
.fw-bmc [data-area=partners] { grid-area: partners; } .fw-bmc [data-area=activities] { grid-area: activities; }
.fw-bmc [data-area=resources] { grid-area: resources; } .fw-bmc [data-area=value] { grid-area: value; border-top-color: var(--amber); }
.fw-bmc [data-area=relationships] { grid-area: relationships; } .fw-bmc [data-area=channels] { grid-area: channels; }
.fw-bmc [data-area=segments] { grid-area: segments; } .fw-bmc [data-area=costs] { grid-area: costs; } .fw-bmc [data-area=revenues] { grid-area: revenues; }
.fw-table-wrap { overflow-x: auto; }
.fw-table { width: 100%; border-collapse: separate; border-spacing: 6px; table-layout: fixed; font-size: 13.5px; }
.fw-table th { font-family: var(--font-head); font-size: 12px; color: var(--blue-dark); text-align: left; padding: 8px 10px; background: var(--blue-light); border-radius: 6px; }
.fw-table tbody th { width: 150px; background: transparent; color: var(--gray); vertical-align: top; }
.fw-table td { background: var(--blue-lighter); border-radius: 6px; padding: 8px 10px; vertical-align: top; }
.fw-table td p { margin: 0; }
.fw-purpose { display: flex; gap: 8px; align-items: baseline; margin: 4px 0 10px; }
.fw-tag { flex: none; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; background: var(--blue-light); color: var(--blue); padding: 2px 7px; border-radius: 4px; }
.fw-edit { display: grid; grid-template-columns: repeat(var(--fw-cols, 2), minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.fw-edit-cell { display: flex; flex-direction: column; gap: 4px; }
.fw-edit-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fw-edit-table fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; margin: 0; }
.fw-edit-table legend { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); padding: 0 4px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fw-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fw-pick-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.fw-pick-item:has(input:checked) { border-color: var(--blue); background: var(--blue-lighter); }
.fw-pick-item input { margin-top: 3px; accent-color: var(--blue); }
.fw-pick-item small { display: block; color: var(--gray); font-size: 12.5px; margin-top: 2px; }
@media (max-width: 760px) {
  .fw-grid, .fw-edit, .fw-edit-table, .fw-pick, .add-row { grid-template-columns: 1fr; }
  .fw-axis-top, .fw-axis-side { display: none; }
  .fw-bmc { grid-template-columns: 1fr; grid-template-areas: none; }
  .fw-bmc [data-area] { grid-area: auto !important; }
}
@media print { .fw-cell, .fw-table td { background: #fff !important; } }

/* ================= Matrice di Eisenhower ================= */
.matrix-help { margin: -6px 0 12px; }
.eisenhower { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 6px 8px; }
.eh-axis { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.eh-top { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
.eh-side { grid-column: 1; grid-row: 2; display: grid; grid-template-rows: 1fr 1fr; }
.eh-side span { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.eh-grid { grid-column: 2; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; }
.eh-q { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--border-strong); border-radius: var(--radius); padding: 14px; min-height: 220px; display: flex; flex-direction: column; transition: box-shadow .15s, background .15s; }
.eh-q header h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.eh-q header p { margin: 2px 0 10px; font-size: 12.5px; color: var(--gray); }
.q-do { border-top-color: var(--red); }
.q-plan { border-top-color: var(--blue); }
.q-delegate { border-top-color: var(--amber); }
.q-drop { border-top-color: #9aa3b2; background: #fafbfc; }
.eh-q.drop-over { box-shadow: 0 0 0 2px var(--blue) inset; background: var(--blue-lighter); }
.eh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.eh-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; cursor: grab; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow-sm); }
.eh-card:hover { border-color: var(--blue); }
.eh-card.dragging { opacity: .5; }
.eh-card strong { font-size: 14px; font-weight: 600; }
.eh-card small { color: var(--muted); font-size: 12px; }
.eh-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; margin-top: 4px; }
.eh-empty { color: var(--muted); font-size: 13px; padding: 10px 0; text-align: center; border: 1.5px dashed var(--border); border-radius: 8px; }
@media (max-width: 760px) {
  .eisenhower { grid-template-columns: 1fr; }
  .eh-axis { display: none; }
  .eh-grid { grid-column: 1; grid-template-columns: 1fr; grid-template-rows: none; }
}

/* ================= SMART, ICE e matrice impatto / sforzo ================= */
.smart { display: inline-flex; gap: 3px; }
.smart-chip { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-family: var(--font-head); font-size: 11px; font-weight: 800; cursor: help; }
.smart-chip.ok { background: var(--green-light); color: var(--green); }
.smart-chip.ko { background: var(--amber-light); color: var(--amber-dark); box-shadow: inset 0 0 0 1px #f0cf92; }
.ice-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ice-select { width: 62px; text-align: right; }
.ice-score { font-family: var(--font-head); font-size: 15px; color: var(--blue); }
.ie-matrix { margin: 0; }
.ie-matrix svg { width: 100%; height: auto; display: block; }
.ie-q { stroke: var(--surface); stroke-width: 2; }
.ie-win { fill: var(--green-light); }
.ie-major { fill: var(--blue-light); }
.ie-fill { fill: #f1f3f6; }
.ie-avoid { fill: var(--red-light); }
.ie-label { font-family: var(--font-head); font-size: 10.5px; font-weight: 700; fill: var(--gray); text-transform: uppercase; letter-spacing: .5px; }
.ie-axis { font-size: 11px; fill: var(--muted); }
.ie-pt circle { fill: var(--blue); stroke: var(--surface); stroke-width: 2; }
.ie-pt text { fill: #fff; font-family: var(--font-head); font-size: 11px; font-weight: 800; pointer-events: none; }
.ie-matrix figcaption { margin-top: 4px; }
@media (max-width: 1100px) { .ice-layout { grid-template-columns: 1fr; } .ie-matrix { max-width: 360px; } }

/* ================= Pagina Framework ================= */
.fw-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.fw-lib-card { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.fw-lib-card h3 { font-size: 16px; }
.fw-lib-card p { margin: 0; font-size: 14px; color: var(--gray); }
.fw-where { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-weight: 700; font-size: 13px; }
.fw-where .icon { width: 15px; height: 15px; }
.fw-example summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); }
.fw-example[open] { grid-column: 1 / -1; }
.fw-example .fw-wrap { margin-top: 10px; }

/* ================= Solleciti, promemoria e approvazioni ================= */
.rem-card .card-head h2, .approval-card h2 { display: flex; align-items: center; gap: 8px; }
.rem-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
.rem-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rem-history li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.rem-text { display: flex; flex-direction: column; min-width: 0; }
.rem-text small { color: var(--muted); font-size: 12px; }
.rem-mode { flex: none; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 10px; margin-top: 1px; }
.rem-auto { background: var(--blue-light); color: var(--blue); }
.rem-manuale { background: #eef0f3; color: var(--gray); }
.rem-details { margin-top: 12px; }
.rem-details summary { cursor: pointer; color: var(--blue); font-weight: 600; margin-bottom: 8px; }
.callout-inline { display: block; padding: 10px 12px; }
.approval-card summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.approval-card summary::-webkit-details-marker { display: none; }
.approval-card[open] summary { margin-bottom: 12px; }
.approval-staff { display: flex; flex-direction: column; gap: 10px; }
.approval-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.approval-note { margin: 0; padding: 8px 12px; border-left: 3px solid var(--amber); background: var(--amber-light); border-radius: 0 6px 6px 0; font-size: 14px; }
.approval-client { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; border-left: 4px solid var(--amber); }
.approval-client strong { display: flex; align-items: center; gap: 8px; }
.approval-done { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 600; font-size: 14px; margin: 0 0 14px; }
.approval-done.warn { color: var(--amber-dark); }
.approval-done .icon { width: 18px; height: 18px; }
.rules { display: flex; flex-direction: column; gap: 14px; }
.rule { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rule-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13.5px; color: var(--gray); padding-left: 26px; }
.rule-fields .input { width: 160px; }
.rule-fields .input.num { width: 70px; }
.client-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 200px; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.radio-row { display: flex; gap: 18px; margin-bottom: 10px; }

/* Grafico a barre */
.bar-chart { margin: 0; }
.bar-chart .chart-legend { display: flex; gap: 16px; font-size: 12.5px; margin-bottom: 6px; }
.bar-chart .chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bar-chart svg { width: 100%; height: auto; display: block; }
.bar-chart .grid { stroke: #edf0f4; }
.bar-chart .baseline { stroke: #cad0db; }
.bar-chart .axis { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.bar-chart .bar:hover { opacity: .8; }

/* ================= Trattative ================= */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.pipe-col { background: #eef2f7; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; min-height: 260px; transition: box-shadow .15s; }
.pipe-col header { margin-bottom: 8px; }
.pipe-col header h2 { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pipe-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pipe-empty { color: var(--muted); font-size: 12.5px; text-align: center; border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 14px 0; margin: 0; }
.drop-over { box-shadow: 0 0 0 2px var(--blue) inset; }
.deal-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: grab; display: flex; flex-direction: column; gap: 3px; }
.deal-card:hover { border-color: var(--blue); }
.deal-card.dragging { opacity: .5; }
.deal-title { font-weight: 600; font-size: 14px; color: var(--text); padding-right: 26px; }
.deal-card > small { color: var(--muted); font-size: 12px; }
.deal-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; font-size: 12.5px; }
.deal-value { font-family: var(--font-head); font-weight: 700; color: var(--blue-dark); }
.chip-src { font-size: 11px; background: var(--blue-lighter); color: var(--gray); border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.deal-next { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gray); margin-top: 4px; }
.deal-next .icon { width: 13px; height: 13px; }
.deal-next.late { color: var(--red); font-weight: 600; }
.avatar-xs { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; font-size: 9.5px; background: var(--blue-light); color: var(--blue); }
.pipe-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.pipe-drop { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 14px; border-radius: var(--radius); border: 1.5px dashed var(--border-strong); font-family: var(--font-head); font-weight: 700; }
.pipe-drop .icon { width: 18px; height: 18px; }
.pipe-drop.won { color: var(--green); background: #f3faf6; }
.pipe-drop.lost { color: var(--red); background: #fdf6f6; }
.stage { display: inline-flex; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--blue-light); color: var(--blue); white-space: nowrap; vertical-align: middle; }
.stage-vinto { background: var(--green-light); color: var(--green); }
.stage-perso { background: var(--red-light); color: var(--red); }
.stage-nuovo { background: #eef0f3; color: var(--gray); }
.stage-bar { display: flex; margin: 0 0 18px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.stage-bar button { flex: 1; border: 0; background: none; padding: 9px 6px; font-family: var(--font-head); font-size: 12.5px; font-weight: 600; color: var(--gray); cursor: pointer; border-right: 1px solid var(--border); }
.stage-bar button:last-child { border-right: 0; }
.stage-bar button:hover { background: var(--blue-lighter); }
.stage-bar button.current { background: var(--blue); color: #fff; }
.stage-bar button.current.won { background: var(--green); }
.stage-bar button.current.lost { background: var(--red); }
.activity-form { display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; align-items: start; margin-bottom: 14px; }
.deal-activities { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.deal-activities li { display: flex; gap: 10px; }
.deal-activities p { margin: 2px 0 0; font-size: 14px; white-space: pre-wrap; }
.act-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-lighter); color: var(--blue); display: grid; place-items: center; flex: none; }
.act-icon .icon { width: 14px; height: 14px; }
@media (max-width: 760px) { .activity-form { grid-template-columns: 1fr; } .stage-bar { flex-wrap: wrap; } .stage-bar button { flex: 1 1 33%; } }

/* ================= B.I. ================= */
.info-dot { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #eef0f3; color: var(--gray); font-size: 10px; font-weight: 700; cursor: help; vertical-align: 1px; }
.bi-table td { vertical-align: middle; }
.bar-cell { width: 45%; }
.bar-cell .small { margin-left: 6px; }
.hbar { display: inline-block; width: calc(100% - 90px); min-width: 60px; height: 10px; background: #eef2f7; border-radius: 5px; vertical-align: middle; overflow: hidden; }
.hbar span { display: block; height: 100%; background: #2a78d6; border-radius: 5px; }
.bi-table tr.best td { background: #f5fbf7; }
.stats-4 + .card { margin-top: 0; }

/* ================= Piano editoriale ================= */
.month-nav { display: flex; align-items: center; gap: 4px; }
.month-nav strong { min-width: 150px; text-align: center; font-family: var(--font-head); text-transform: capitalize; }
.editorial-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.editorial-layout.no-side { grid-template-columns: 1fr; }
.ed-ideas { display: flex; flex-direction: column; gap: 6px; }
.ed-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ed-wd { background: var(--surface); padding: 6px 8px; font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.ed-day { background: var(--surface); min-height: 108px; padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ed-day.other { background: #fafbfc; }
.ed-day.other .ed-day-head span { color: var(--border-strong); }
.ed-day.today .ed-day-head span { background: var(--blue); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.ed-day-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--gray); padding: 0 2px; }
.ed-add { border: 0; background: none; color: var(--muted); cursor: pointer; opacity: 0; padding: 0; width: 20px; height: 20px; border-radius: 4px; display: grid; place-items: center; }
.ed-add .icon { width: 14px; height: 14px; }
.ed-day:hover .ed-add, .ed-add:focus-visible { opacity: 1; }
.ed-add:hover { background: var(--blue-light); color: var(--blue); }
.ed-chip { display: flex; align-items: center; gap: 5px; background: var(--blue-lighter); border-radius: 5px; padding: 3px 6px; font-size: 12px; cursor: pointer; min-width: 0; color: var(--text); text-decoration: none !important; border-left: 3px solid var(--c, #868e96); }
.ed-chip:hover { background: var(--blue-light); }
.ed-chip.dragging { opacity: .5; }
.ed-chip.st-idea, .ed-chip.st-bozza { background: #f4f5f7; }
.ed-chip.st-pubblicato .ed-title { color: var(--gray); }
.ed-chip.st-pubblicato::after { content: '✓'; color: var(--green); font-weight: 700; margin-left: auto; }
.ed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, #868e96); flex: none; }
.ed-time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.ed-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-client { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70px; }
.ed-content { background: #fff8ec; border-left-color: var(--amber); }
.ed-content .ed-dot { background: var(--amber); }
.ed-legend-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--gray); }
.ed-legend { display: inline-flex; align-items: center; gap: 5px; }
/* Colori dei canali: palette categoriale validata, in ordine fisso; il nome del canale è sempre indicato */
.ch-instagram { --c: #2a78d6; } .ch-facebook { --c: #eb6834; } .ch-linkedin { --c: #1baf7a; } .ch-blog { --c: #eda100; }
.ch-newsletter { --c: #e87ba4; } .ch-live { --c: #008300; } .ch-youtube { --c: #4a3aa7; } .ch-tiktok { --c: #e34948; }
.ch-gbp, .ch-altro { --c: #868e96; }
.copy-box { background: var(--blue-lighter); border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.drop-over.ed-day { background: var(--blue-lighter); }
@media (max-width: 1000px) { .editorial-layout { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .ed-cal { grid-template-columns: 1fr; } .ed-wd, .ed-day.other { display: none; } .ed-day { min-height: 0; } .ed-day:not(:has(.ed-chip)) { display: none; } }
.ed-cal .ed-chip { flex-wrap: wrap; row-gap: 1px; align-items: center; }
.ed-cal .ed-title { flex-basis: 100%; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.ed-cal .ed-time { font-size: 11px; }
.ed-cal .ed-client { flex-basis: 100%; max-width: none; }
.ed-cal .ed-chip.st-pubblicato::after { order: 2; }
@media (max-width: 1350px) { .editorial-layout { grid-template-columns: 1fr; } .ed-ideas { flex-direction: row; flex-wrap: wrap; align-items: center; } .ed-ideas .ed-chip { max-width: 280px; } .ed-ideas h2 { flex-basis: 100%; } }

/* ================= Menu a gruppi (sottomenu) ================= */
.nav { gap: 4px; }
.nav-section { margin-bottom: 4px; }
.nav-group-head { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 12px; border: 0; background: none; border-radius: var(--radius-sm); color: rgba(255, 255, 255, .78); font-family: var(--font-head); font-weight: 600; font-size: 13.5px; cursor: pointer; text-align: left; }
.nav-group-head:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-group-head .icon { width: 18px; height: 18px; flex: none; }
.nav-group-head > span:nth-of-type(1) { flex: 1; }
.nav-caret { font-size: 11px; opacity: .6; transition: transform .15s; }
.nav-group:not(.open) .nav-caret { transform: rotate(-90deg); }
.nav-group.has-active > .nav-group-head { color: #fff; }
.nav-sub { display: none; flex-direction: column; gap: 1px; margin: 1px 0 6px 20px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .14); }
.nav-group.open .nav-sub { display: flex; }
.nav-sub a { padding: 7px 10px; font-size: 13px; }
.nav-sub a .icon { display: none; }
.nav-group.open .nav-badge-sum { display: none; }
.gear .icon { width: 20px; height: 20px; }
.dropdown-settings { min-width: 260px; }
.dropdown-label { margin: 8px 10px 4px; font-family: var(--font-head); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.dropdown-label:first-child { margin-top: 4px; }
.dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text); text-decoration: none !important; }
.dropdown a .icon { width: 17px; height: 17px; color: var(--blue); }
.dropdown a:hover, .dropdown a:focus-visible { background: var(--blue-lighter); outline: none; }
.nav-section + .nav-section { margin-top: 10px; }

/* ================= Avatar e profili ================= */
.avatar-img { border-radius: 50%; object-fit: cover; flex: none; display: inline-block; background: var(--blue-light); }
.person { display: flex; align-items: center; gap: 10px; }
.profile-fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px 4px; margin: 12px 0 0; }
.profile-fieldset legend { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); padding: 0 4px; }
.photo-pick { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.photo-pick .avatar { background: var(--blue-light); color: var(--blue); }

/* ================= Widget del consulente (clienti) ================= */
.cw { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.cw-launcher { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 10px 30px rgba(2, 63, 130, .35); }
.cw-launcher:hover { background: var(--blue-dark); }
.cw-face { width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: grid; place-items: center; overflow: hidden; }
.cw-face .avatar { background: var(--amber); color: var(--blue-dark); }
.cw-dot { position: absolute; top: 4px; left: 36px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--blue); }
.cw.open .cw-label { display: none; }
.cw.open .cw-launcher { padding-right: 6px; }
.cw-panel { width: min(380px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; border: 1px solid var(--border); }
.cw-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(150deg, var(--blue), var(--blue-dark)); color: #fff; }
.cw-head .avatar { background: var(--amber); color: var(--blue-dark); }
.cw-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cw-who strong { font-family: var(--font-head); font-size: 16px; }
.cw-who span { font-size: 12.5px; opacity: .8; }
.cw-close { color: rgba(255, 255, 255, .8); }
.cw-close:hover { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }
.cw-bio { margin: 0; padding: 10px 16px; font-size: 13px; color: var(--gray); border-bottom: 1px solid var(--border); }
.cw-actions { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.cw-act { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 10px; background: var(--blue-lighter); color: var(--blue); font-size: 11.5px; font-weight: 600; text-decoration: none !important; }
.cw-act:hover { background: var(--blue-light); }
.cw-act .icon { width: 18px; height: 18px; }
.cw-messages { flex: 1; min-height: 140px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #fafbfd; }
.cw-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.cw-msg p { margin: 0; padding: 8px 11px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.cw-msg time { display: block; font-size: 10.5px; color: var(--muted); margin: 2px 6px 0; }
.cw-msg.them p { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.cw-msg.me { align-self: flex-end; }
.cw-msg.me p { background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.cw-msg.me time { text-align: right; }
.cw-sys, .cw-empty { text-align: center; font-size: 12.5px; color: var(--muted); margin: 6px 0; }
.cw-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; scrollbar-width: none; }
.cw-quick button { flex: none; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; color: var(--gray); cursor: pointer; }
.cw-quick button:hover { border-color: var(--blue); color: var(--blue); }
.cw-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; }
.cw-compose textarea { flex: 1; resize: none; border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 14px; max-height: 120px; }
.cw-compose textarea:focus { outline: none; border-color: var(--blue); }
.cw-compose .btn { height: 38px; width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.cw-foot { display: flex; justify-content: space-between; padding: 8px 14px 12px; border-top: 1px solid var(--border); }
@media (max-width: 600px) { .cw { right: 12px; bottom: 12px; } .cw-label { display: none; } .cw-launcher { padding: 6px; } }
@media print { .cw { display: none !important; } }

/* ================= Guida introduttiva ================= */
.tour-layer { position: fixed; inset: 0; z-index: 300; }
.tour-layer.centered { background: rgba(1, 26, 54, .55); display: grid; place-items: center; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(1, 26, 54, .55); transition: all .25s ease; pointer-events: none; outline: 2px solid var(--amber); }
.tour-card { position: fixed; background: var(--surface); border-radius: 14px; padding: 18px 18px 14px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); transition: top .25s ease, left .25s ease; }
.tour-layer.centered .tour-card { position: relative; width: min(440px, calc(100vw - 32px)); }
.tour-card h2 { font-size: 18px; margin-bottom: 6px; }
.tour-card p { margin: 0 0 12px; font-size: 14px; color: var(--gray); }
.tour-count { font-family: var(--font-head); font-size: 11px !important; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue) !important; margin-bottom: 4px !important; }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-actions [data-tour=skip] { margin-right: auto; }
.tour-dots { display: flex; gap: 4px; margin-right: 6px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.tour-dots i.on { background: var(--blue); }

/* ================= Come usare la piattaforma ================= */
.help-search { margin-bottom: 14px; }
.help-search .input { max-width: 520px; }
.help-topics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.help-topics a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--gray); }
.help-topics a:hover { border-color: var(--blue); color: var(--blue); }
.help-topics .icon { width: 15px; height: 15px; }
.help-section h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 8px; }
.help-section h2 .icon { width: 19px; height: 19px; color: var(--blue); }
.help-item { border-top: 1px solid var(--border); }
.help-item summary { cursor: pointer; padding: 11px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.help-item summary::after { content: '+'; color: var(--blue); font-weight: 700; }
.help-item[open] summary::after { content: '–'; }
.help-item summary::-webkit-details-marker { display: none; }
.help-item p { margin: 0 0 12px; color: var(--gray); font-size: 14.5px; }
.help-contact { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.tour-actions { flex-wrap: wrap; row-gap: 8px; }
.tour-card { box-sizing: border-box; }
.cw { flex-direction: column-reverse; }

/* ================= Dashboard (riprogettata) ================= */
.dash-hero { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff; box-shadow: var(--shadow-md); }
.dash-hero .eyebrow { color: var(--amber); }
.dash-hero h1 { color: #fff; font-size: 26px; }
.dash-hero-text p { margin: 6px 0 0; color: rgba(255, 255, 255, .85); font-size: 15px; }
.dash-hero-text strong { color: #fff; }
.focus-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.focus-chip { display: flex; flex-direction: column; align-items: flex-start; min-width: 104px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none !important; font: inherit; cursor: pointer; text-align: left; }
.focus-chip:hover { background: rgba(255, 255, 255, .18); }
.focus-chip strong { font-family: var(--font-head); font-size: 24px; line-height: 1.1; }
.focus-chip span { font-size: 12px; opacity: .85; }
.focus-chip.danger { background: rgba(192, 52, 52, .9); border-color: transparent; }
.focus-chip.ok strong::after { content: ' ✓'; font-size: 16px; color: #9be3b4; }
.goals-card { margin-bottom: 18px; border-top: 4px solid var(--blue); }
.goals-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.goals-card .eyebrow { margin: 0 0 2px; }
.goals-period { text-transform: capitalize; }
/* Obiettivi del mese (goals-card.js): venduto con le linee a sinistra, «Da fare questa settimana» a destra, indicatori in una tabella richiudibile */
.goals-top { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.goals-revenue { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--blue-light); }
.goals-amount-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.goals-amount { font-family: var(--font-head); font-size: 30px; line-height: 1.1; }
.goals-lines { width: 100%; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); border-collapse: collapse; font-size: 13.5px; }
.goals-lines th { text-align: left; font-weight: 500; padding: 4px 0; }
.goals-lines td { padding: 4px 0; white-space: nowrap; }
.goals-week h3 { margin: 0 0 8px; font-size: 16px; }
.goals-week-line { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); }
.goals-week ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14.5px; }
.goals-week a { color: inherit; text-decoration: none; }
.goals-week a:hover { color: var(--blue); text-decoration: underline; }
.goals-week b { font-family: var(--font-head); font-size: 18px; color: var(--blue); margin-right: 2px; }
.goals-week .is-done, .goals-week-done { color: #14663d; }
.goals-detail { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.goals-detail summary { cursor: pointer; font-weight: 600; }
.goals-detail .table-wrap { margin-top: 8px; }
.goals-detail .table-wrap + p, .goals-week ul + .goals-hint { margin-top: 10px; }
.goals-ok { color: #14663d; font-size: 13px; }
.goals-table { max-width: 760px; }
.goals-table th.num, .goals-table td.num { text-align: right; width: 140px; }
.goal-bar { position: relative; display: block; height: 10px; border-radius: 5px; background: var(--border); }
.goals-revenue .goal-bar { background: #fff; }
.goal-fill { display: block; height: 100%; border-radius: 5px; background: #2a78d6; }
.goal-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text, #1d2433); border-radius: 1px; }
.goals-hint { margin: 0 0 10px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
@media (max-width: 760px) { .goals-top { grid-template-columns: 1fr; } }
/* Business → Obiettivi: come si calcolano (modello, catene, tassi e prezzi) chiuso in fondo alla pagina */
.bt-how > summary { cursor: pointer; }
.bt-how[open] > summary { margin-bottom: 14px; }
.bt-how .card { box-shadow: none; border: 1px solid var(--border); }
.bt-how .kpi-grid { margin-bottom: 14px; }
.kpi-strip .stat { padding: 14px 16px; }
.kpi-strip .stat-value { font-size: 22px; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.dash-main > .card, .dash-side > .card, .dash-side > details { margin-bottom: 18px; }
.inbox-row .list-main { text-decoration: none !important; color: inherit; }
.inbox-act { flex: none; }
.task-quick .task-check { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.task-quick .task-done strong { text-decoration: line-through; color: var(--muted); }
.text-warn { color: var(--amber-dark); font-weight: 600; }
.date-chip.today { background: var(--blue); color: #fff; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.mini-kpis div { background: var(--blue-lighter); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; }
.mini-kpis strong { font-family: var(--font-head); font-size: 15px; color: var(--blue-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-kpis span { font-size: 11.5px; color: var(--gray); }
.hero-card { display: flex; align-items: center; gap: 12px; background: var(--surface); color: var(--text); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-md); min-width: 300px; }
.hero-card > div:not(.hero-card-actions) { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.hero-card strong { font-family: var(--font-head); font-size: 15px; }
.hero-card .avatar { background: var(--amber); color: var(--blue-dark); }
.hero-card-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
.hero-card-actions { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 1180px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
/* Le colonne non si allargano con il contenuto (il Gantt scorre dentro la sua scheda) */
.dash-main, .dash-side { min-width: 0; }
@media (max-width: 700px) {
  .dash-hero { padding: 18px; }
  .focus-chip { min-width: 0; flex: 1 1 40%; }
  .hero-card { min-width: 0; width: 100%; flex-wrap: wrap; }
  .inbox-act { display: none; }
}

/* ================= Assistente AI (team) ================= */
.aw { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.aw[hidden] { display: none; }
.aw-launcher { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--blue), #1d5fb0); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 10px 30px rgba(2, 63, 130, .35); }
.aw-launcher .icon { width: 18px; height: 18px; color: var(--amber); }
.aw-launcher:hover { filter: brightness(1.08); }
.aw.open .aw-launcher span { display: none; }
.aw-panel { width: min(420px, calc(100vw - 24px)); height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; }
.aw-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 16px; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
.aw-head .icon { width: 18px; height: 18px; color: var(--amber); }
.aw-head strong { flex: 1; font-family: var(--font-head); }
.aw-expand, .aw-close { color: rgba(255, 255, 255, .8) !important; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; }
.aw-expand .icon, .aw-close .icon { color: inherit !important; width: 16px; height: 16px; }
.aw-expand { transform: rotate(-45deg); }
.aw-expand:hover, .aw-close:hover { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }
.aw-body { flex: 1; min-height: 0; display: flex; }
.as { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.as-page { padding: 0; height: calc(100vh - 250px); min-height: 460px; display: flex; overflow: hidden; }
.as-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #fafbfd; }
.as-welcome { text-align: center; margin: auto; max-width: 360px; color: var(--gray); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.as-welcome .icon { width: 32px; height: 32px; color: var(--amber); }
.as-welcome p { margin: 0; font-size: 13.5px; }
.as-msg { display: flex; gap: 8px; align-items: flex-start; }
.as-msg.user { justify-content: flex-end; }
.as-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: var(--amber); display: grid; place-items: center; flex: none; }
.as-avatar .icon { width: 15px; height: 15px; }
.as-bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 4px; }
.as-msg.user .as-bubble { background: var(--blue); color: #fff; border-color: var(--blue); border-top-left-radius: 14px; border-top-right-radius: 4px; }
.as-bubble p { margin: 0 0 8px; } .as-bubble p:last-child { margin-bottom: 0; }
.as-bubble ul, .as-bubble ol { margin: 4px 0 8px; padding-left: 20px; }
.as-bubble a { font-weight: 600; }
.as-typing { display: flex; gap: 4px; padding: 12px 14px; }
.as-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: as-blink 1.2s infinite ease-in-out; }
.as-typing i:nth-child(2) { animation-delay: .2s; } .as-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes as-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.as-prop { margin-top: 10px; border: 1.5px solid var(--amber); background: #fffbf3; border-radius: 10px; padding: 10px 12px; }
.as-prop.done { border-color: var(--green); background: #f3faf6; }
.as-prop.cancelled { opacity: .6; border-color: var(--border); background: #f7f8fa; }
.as-prop-head { display: flex; align-items: center; gap: 6px; }
.as-prop-head .icon { width: 16px; height: 16px; color: var(--amber-dark); }
.as-prop.done .as-prop-head .icon { color: var(--green); }
.as-prop ul { margin: 6px 0; padding-left: 18px; font-size: 13px; color: var(--gray); }
.as-prop-preview { font-size: 12.5px; white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin: 6px 0; max-height: 160px; overflow-y: auto; }
.as-prop-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.as-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px 0; }
.as-suggest:empty { display: none; }
.as-suggest button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 12.5px; color: var(--gray); cursor: pointer; text-align: left; }
.as-suggest button:hover { border-color: var(--blue); color: var(--blue); }
.as-compose { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 6px; border-top: 1px solid var(--border); }
.as-compose textarea { flex: 1; resize: none; border: 1.5px solid var(--border-strong); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 14px; max-height: 140px; }
.as-compose textarea:focus { outline: none; border-color: var(--blue); }
.as-compose .btn { height: 38px; width: 38px; padding: 0; justify-content: center; border-radius: 50%; }
.as-note { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--muted); }
@media (max-width: 600px) { .aw { right: 12px; bottom: 12px; } .aw-launcher span { display: none; } .aw-launcher { padding: 12px; } }
@media print { .aw { display: none !important; } }

/* Barra AI in alto (team) */
.search-trigger.compact { width: auto; margin-right: 0; flex: none; }
.search-trigger.compact span { display: none; }

.update-banner { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 400; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: var(--blue-dark); color: #fff; border-radius: 999px; box-shadow: var(--shadow-lg); font-size: 14px; }
.update-banner .icon { width: 18px; height: 18px; color: var(--amber); }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; }
  .search-trigger.compact { margin-left: auto; }
}

/* ================= Time management e prezzi ================= */
.tm-btn { display: flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--gray); cursor: pointer; font-family: var(--font-head); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.tm-btn .icon { width: 19px; height: 19px; }
.tm-btn:hover { border-color: var(--blue); color: var(--blue); }
.tm-btn.on { background: var(--green); border-color: var(--green); color: #fff; }
.tm-btn.on .icon { animation: tm-pulse 2s infinite; }
@keyframes tm-pulse { 50% { opacity: .5; } }
.tm-time:empty { display: none; }
.tm-panel { width: 320px; padding: 8px 12px 12px; }
.tm-form .field { margin-bottom: 8px; }
.tm-big { display: block; font-family: var(--font-head); font-size: 30px; color: var(--green); font-variant-numeric: tabular-nums; margin: 2px 0 4px; }
.tm-run p { margin: 0 0 4px; }
.tm-run .actions { margin-top: 10px; }
.week-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.day-card { margin: 0; }
.day-card.today { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.day-card h2 { font-size: 15px; text-transform: capitalize; }
.day-card .card-head { gap: 8px; }
.day-card .card-head h2 { flex: 1; }
.time-list { margin: 0 -8px; }
.time-row { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; border-radius: 6px; padding: 8px !important; }
.time-row:hover { background: var(--blue-lighter); }
.time-dur { font-family: var(--font-head); font-weight: 800; font-size: 13px; color: var(--blue); min-width: 58px; font-variant-numeric: tabular-nums; }
.pricing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.rates-card { position: sticky; top: 76px; }
.rate-big { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 10px; background: var(--blue-lighter); margin-bottom: 10px; }
.rate-big span { font-size: 12.5px; color: var(--gray); }
.rate-big strong { font-family: var(--font-head); font-size: 26px; color: var(--blue-dark); }
.rate-big small { font-size: 12px; color: var(--muted); }
.rate-big.floor { background: #fdf6f6; }
.rate-big.floor strong { color: var(--red); font-size: 20px; }
.people-table .input { width: 90px; margin-left: auto; }
.budget-card { border-left: 4px solid var(--amber); }
.budget-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.budget-card .card-head h2 .icon { color: var(--amber-dark); width: 18px; height: 18px; }
.budget-inputs { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 12px; }
.budget-inputs .field { margin: 0; }
.budget-inputs select { min-width: 260px; }
.budget-inputs .segmented button { text-transform: capitalize; }
.budget-main { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px; }
.budget-price { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.budget-price span { font-size: 12.5px; opacity: .85; }
.budget-price strong { font-family: var(--font-head); font-size: 28px; }
.budget-price small { font-size: 12px; opacity: .8; }
.budget-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.budget-facts div, .time-facts > div { background: var(--blue-lighter); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.budget-facts span, .time-facts span { font-size: 12px; color: var(--gray); }
.budget-facts strong, .time-facts strong { font-family: var(--font-head); font-size: 17px; color: var(--blue-dark); }
.budget-facts small, .time-facts small { font-size: 11.5px; color: var(--muted); }
.budget-conf { font-size: 13px; color: var(--gray); margin: 10px 0 6px; }
.budget-cmp { display: flex; gap: 6px; align-items: center; font-size: 13.5px; font-weight: 600; padding: 8px 10px; border-radius: 8px; margin: 6px 0; }
.budget-cmp .icon { width: 16px; height: 16px; flex: none; }
.budget-cmp.ok { background: var(--green-light); color: var(--green); }
.budget-cmp.warn { background: var(--amber-light); color: var(--amber-dark); }
.budget-cmp.bad { background: var(--red-light); color: var(--red); }
.budget-detail { margin: 8px 0; }
.budget-detail summary { cursor: pointer; font-weight: 600; color: var(--blue); font-size: 13px; }
.time-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.time-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
/* «Condiviso con i partner» e «Cliente del partner» (project-partner-share.js): stessa testata delle altre card del Team, righe allineate al testo */
.pps-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.pps-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
.pps-card .list { margin: 12px 0; }
.pps-card .list-row { padding-left: 0; padding-right: 0; gap: 12px; }
.pps-card .list-main small { display: block; }
.pps-card .inline-form { margin-top: 12px; }
.pps-card .inline-form > .input { min-width: 0; max-width: 100%; }
@media (max-width: 600px) { .pps-card .list-row { flex-wrap: wrap; } .pps-card .inline-form > .input, .pps-card .inline-form > .btn { flex: 1 1 100%; } }
.time-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.time-bar { height: 8px; background: #e3e8f0; border-radius: 4px; overflow: hidden; margin: 6px 0 2px; }
.time-bar span { display: block; height: 100%; background: var(--green); }
.time-bar.warn span { background: var(--amber); }
.time-bar.bad span { background: var(--red); }
@media (max-width: 1000px) { .pricing-layout, .budget-main { grid-template-columns: minmax(0, 1fr); } .rates-card { position: static; } }
@media (max-width: 700px) { .budget-facts, .time-facts { grid-template-columns: 1fr; } .budget-inputs select { min-width: 0; width: 100%; } }
.sticky-head { top: var(--topbar-h, 60px); }
@media (max-width: 860px) { .sticky-head { top: var(--topbar-h, 61px); } }
/* Timer sulle card della board */
.task-meta .task-timer { margin-left: auto; width: 26px; height: 26px; opacity: .55; }
.task:hover .task-meta .task-timer, .task-meta .task-timer:focus-visible { opacity: 1; }

/* ---------- Processo di consulenza: fasi della pipeline, brief, prossimo passo, percorso del cliente ---------- */
.stage-brief, .stage-qualifica { background: var(--amber-light); color: var(--amber-dark); }
.stage-meet { background: var(--blue-light); color: var(--blue); }
.stage-proposta { background: #e9e6f6; color: #4a3aa7; }
.stage-bar.process button { font-size: 12px; }
.verdict { display: inline-flex; align-items: center; font-family: var(--font-head); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #eef0f3; color: var(--gray); }
.verdict-sm { font-size: 10.5px; padding: 1px 8px; align-self: flex-start; }
.verdict-good { background: var(--ok-bg); color: var(--ok); }
.verdict-warn { background: var(--warn-bg); color: var(--warn); }
.verdict-bad { background: var(--bad-bg); color: var(--bad); }

.next-step { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--blue); margin-bottom: 18px; }
.next-step p { margin: 2px 0 0; }
.next-step .eyebrow { margin: 0; }

.brief-wait p { margin: 0 0 10px; }
.brief-wait .actions { margin-top: 10px; }
.brief-result { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.brief-result p { margin: 4px 0 0; }
.brief-score { display: flex; align-items: baseline; justify-content: center; min-width: 74px; padding: 12px 10px; border-radius: var(--radius); font-family: var(--font-head); }
.brief-score strong { font-size: 28px; line-height: 1; }
.brief-score span { font-size: 12px; margin-left: 2px; }
.score-good { background: var(--ok-bg); color: var(--ok); }
.score-warn { background: var(--warn-bg); color: var(--warn); }
.score-bad { background: var(--bad-bg); color: var(--bad); }
.brief-signals { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.brief-signals li { display: flex; gap: 8px; align-items: flex-start; }
.brief-signals .icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.brief-signals .sig-good .icon { color: var(--ok); }
.brief-signals .sig-warn .icon { color: var(--warn); }
.brief-signals .sig-bad .icon { color: var(--bad); }
.brief-answers summary { cursor: pointer; font-family: var(--font-head); font-weight: 700; padding: 6px 0; }
.brief-answers section { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 10px; }
.brief-answers h3 { margin: 0; font-size: 14px; }
.brief-purpose { margin: 2px 0 8px; font-size: 12px; color: var(--muted); font-style: italic; }
.brief-answers dl { margin: 0; display: grid; gap: 4px; }
.brief-answers dt { font-size: 12.5px; color: var(--gray); font-weight: 600; margin-top: 6px; }
.brief-answers dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

/* Questionario pubblico */
.public-brief { max-width: 720px; margin: 0 auto; padding: 24px 16px 60px; }
.brief-card { padding: 28px; }
.brief-card h1 { font-size: 24px; margin: 4px 0 12px; }
.brief-facts { list-style: none; padding: 0; margin: 18px 0; display: flex; gap: 10px 20px; flex-wrap: wrap; color: var(--gray); font-size: 14px; }
.brief-facts li { display: flex; align-items: center; gap: 6px; }
.brief-facts .icon { width: 16px; height: 16px; color: var(--blue); }
.brief-progress { height: 6px; border-radius: 6px; background: var(--blue-light); overflow: hidden; margin-bottom: 16px; }
.brief-progress span { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .3s; }
.brief-form { display: grid; gap: 22px; margin-top: 8px; }
.brief-q-label { margin: 0 0 4px; font-weight: 700; font-family: var(--font-head); font-size: 15px; }
.brief-q-label .req { color: var(--red); }
.brief-q-hint { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.brief-q .input { width: 100%; }
.brief-options { display: grid; gap: 8px; }
.brief-option { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); font-size: 14.5px; }
.brief-option:hover { border-color: var(--blue); }
.brief-option.on { border-color: var(--blue); background: var(--blue-lighter); }
.brief-option input { accent-color: var(--blue); width: 17px; height: 17px; flex-shrink: 0; }
.brief-other { margin-top: 8px; }
.brief-q.has-error .brief-options, .brief-q.has-error > .input { outline: 2px solid var(--red-light); outline-offset: 2px; border-radius: var(--radius-sm); }
.brief-q-error { color: var(--red); font-size: 13px; margin: 6px 0 0; font-weight: 600; }
.brief-nav { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 16px; }
.brief-done { text-align: center; }
.brief-done > .icon { width: 44px; height: 44px; color: var(--ok); background: var(--ok-bg); border-radius: 50%; padding: 10px; }

/* Percorso di consulenza (scheda cliente e portale) */
.journey { margin-bottom: 18px; }
.journey-steps { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: j; }
.jstep { position: relative; min-width: 0; }
.jstep > a, .jstep > .jlink { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 0 10px 0 0; color: inherit; text-decoration: none; }
.jstep > a[aria-disabled="true"] { pointer-events: none; }
.jstep::before { content: ''; position: absolute; top: 15px; left: 32px; right: 0; height: 2px; background: var(--border-strong); }
.jstep:last-child::before { display: none; }
.jstep-fatto::before { background: var(--ok); }
.jdot { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; font-family: var(--font-head); font-weight: 700; font-size: 13px; background: var(--surface); border: 2px solid var(--border-strong); color: var(--muted); }
.jdot .icon { width: 15px; height: 15px; }
.jstep-fatto .jdot { background: var(--ok); border-color: var(--ok); color: #fff; }
.jstep-in_corso .jdot { border-color: var(--blue); color: var(--blue); }
.jstep-saltato .jdot { border-style: dashed; }
.jstep.current .jdot { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 5px var(--blue-light); }
.jtext { display: flex; flex-direction: column; min-width: 0; }
.jtext strong { font-family: var(--font-head); font-size: 13.5px; }
.jtext small { color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.jstep.current .jtext strong { color: var(--blue); }
.phase-chip { display: inline-flex; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; background: var(--blue-light); color: var(--blue); }
.phase-chip.phase-brief, .phase-chip.phase-meet { background: var(--amber-light); color: var(--amber-dark); }
.phase-chip.phase-monitoraggio { background: var(--ok-bg); color: var(--ok); }

/* Portale: timeline in evidenza con il passo richiesto */
.journey-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 22px 24px; margin-bottom: 18px; }
.journey-hero.needs-action { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light), var(--shadow-md); }
.journey-hero > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.journey-hero > header .eyebrow { margin: 0; }
.journey-count { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--blue); background: var(--blue-light); padding: 3px 10px; border-radius: 20px; }
.journey-steps.big .jdot { width: 40px; height: 40px; font-size: 15px; }
.journey-steps.big .jstep::before { top: 19px; left: 40px; }
.journey-steps.big .jtext strong { font-size: 15px; }
.journey-action { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); background: var(--blue-lighter); }
.journey-action.action-required { background: var(--blue); color: #fff; }
.journey-action.action-required p { color: #dce7f4; }
.journey-action.action-required .btn-primary { background: #fff; color: var(--blue); border-color: #fff; }
.journey-action.action-required .journey-badge { background: rgba(255,255,255,.18); color: #fff; }
.journey-action-text { flex: 1 1 260px; min-width: 0; }
.journey-action h2 { margin: 0; font-size: 18px; color: inherit; }
.journey-action p { margin: 4px 0 0; font-size: 14px; }
.journey-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-head); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: var(--surface); color: var(--blue); }
.journey-badge .icon { width: 14px; height: 14px; }
.btn-lg { padding: 12px 20px; font-size: 15px; }
@media (max-width: 760px) {
  .journey-steps { grid-template-columns: 1fr; gap: 12px; }
  .jstep > a, .jstep > .jlink { flex-direction: row; align-items: center; }
  .jstep::before { top: 32px; bottom: -12px; left: 15px; right: auto; width: 2px; height: auto; }
  .journey-steps.big .jstep::before { top: 40px; left: 19px; }
  .journey-hero { padding: 18px 16px; }
  .brief-card { padding: 20px 16px; }
}

.info dd { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Analisi avanzate: journey, segmenti, trend, previsioni ---------- */
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.key-fc { border-top: 2px dashed #2a78d6; }
.key-band { height: 9px; border: 0; background: rgba(42, 120, 214, .22); border-radius: 2px; }
.key-trend { border-top: 1.5px dashed #52514e; }
.key-cp { width: 0; height: 12px; border: 0; border-left: 2px solid #eb6834; }
.key-anom { width: 9px; height: 9px; border: 2px solid #e34948; border-radius: 50%; }
.chart-legend .key[style] { height: 9px; width: 9px; border: 0; border-radius: 2px; }
.chart-plot svg .divider { stroke: #c3c2b7; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-plot svg .cp-line { stroke: #eb6834; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-note { position: absolute; top: -2px; transform: translateX(-50%); font-size: 11px; color: var(--muted); background: var(--surface); padding: 0 3px; }
.chart-anom { position: absolute; width: 12px; height: 12px; border: 2px solid #e34948; border-radius: 50%; transform: translate(-50%, -50%); background: var(--surface); pointer-events: none; }
.fc-row td { background: #f5f9fe; }
.badge-mini { font-size: 10.5px; font-weight: 700; color: var(--red); text-transform: uppercase; }

.ci-rows { display: grid; gap: 6px; margin: 6px 0 12px; }
.ci-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2.4fr minmax(90px, auto); align-items: center; gap: 12px; font-size: 13px; }
.ci-label { overflow-wrap: anywhere; }
.ci-track { position: relative; height: 22px; background: linear-gradient(#edf0f4, #edf0f4) center / 100% 1px no-repeat; }
.ci-whisk { position: absolute; top: 50%; height: 6px; transform: translateY(-50%); background: rgba(42, 120, 214, .28); border-radius: 3px; }
.ci-dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: #2a78d6; box-shadow: 0 0 0 2px var(--surface); transform: translate(-50%, -50%); }
.ci-dot.muted { background: #9aa3b2; }
.ci-ref { position: absolute; top: 0; bottom: 0; border-left: 1.5px dashed #52514e; }
.ci-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ci-value small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.ci-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.ci-ref-key { display: inline-block; height: 12px; border-left: 1.5px dashed #52514e; }
.sig-flag { color: var(--blue); font-weight: 700; font-size: 12px; }

.sig { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.sig .icon { width: 12px; height: 12px; }
.sig-yes { background: var(--blue-light); color: var(--blue); }
.sig-no { background: #eef0f3; color: var(--gray); font-weight: 600; }

.method { margin-top: 10px; font-size: 12.5px; color: var(--gray); }
.method summary { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 600; }
.method summary .icon { width: 14px; height: 14px; }
.method p { margin: 6px 0; line-height: 1.5; }
.method table { margin-top: 6px; }

.flow-chart .flow-plot { height: auto; padding-left: 0; }
.flow-chart .flow-plot svg { position: static; width: 100%; height: auto; overflow: visible; }
.flow-chart .axis { font-size: 11px; fill: var(--muted); }
.flow-label { font-size: 11.5px; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.flow-link { cursor: pointer; transition: stroke-opacity .15s; }
.path-cell { max-width: 380px; overflow-wrap: anywhere; }

.cohort-table th, .cohort-table td { padding: 5px 7px; font-size: 12px; }
.cohort-cell { font-variant-numeric: tabular-nums; border: 2px solid var(--surface); }
.cohort-na { background: #fafafa; }

.season-bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 180px; margin: 8px 0; }
.season-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; background: linear-gradient(#c3c2b7, #c3c2b7) center 50% / 100% 1px no-repeat; }
.season-bar { position: absolute; left: 22%; right: 22%; border-radius: 3px; }
.season-val { position: absolute; top: 0; font-size: 10.5px; color: var(--gray); font-variant-numeric: tabular-nums; }
.season-m { position: absolute; bottom: -2px; font-size: 11px; color: var(--muted); }

.tp-matrix th[scope=row] { font-weight: 600; white-space: nowrap; }
.tp-cell { min-width: 130px; vertical-align: top; }
.tp-cell strong { display: block; font-variant-numeric: tabular-nums; }
.tp-cell small { display: block; font-size: 11px; opacity: .85; }
.tp-empty { color: var(--muted); text-align: center; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 14px 0; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); }
.stat-card h3 { margin: 0 0 4px; font-size: 12.5px; color: var(--gray); text-transform: uppercase; letter-spacing: .03em; }
.stat-card .big { margin: 0 0 4px; font-family: var(--font-head); font-size: 20px; font-weight: 700; }
.stat-card p { margin: 0 0 4px; }
.seg-card h3 { margin: 0; font-size: 16px; }
.seg-card .card-head p { margin: 4px 0 0; }
h3.sub { font-size: 14px; margin: 6px 0; }
.trend-table tr[data-open] { cursor: pointer; }
.trend-table tr[data-open]:hover td { background: var(--blue-lighter); }
.trend-table .spark { width: 110px; height: 26px; }
.picker { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.anom-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.stage-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.stage-steps li { position: relative; display: grid; grid-template-columns: 220px 1fr; gap: 2px 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: #f6f8fb; overflow: hidden; }
.stage-steps li > * { position: relative; }
.stage-steps small { grid-column: 2; color: var(--muted); }
.stage-bar-fill { position: absolute !important; left: 0; top: 0; bottom: 0; background: rgba(42, 120, 214, .14); }
.rec-summary { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; font-size: 13.5px; }
.rec-summary li { display: flex; gap: 10px; flex-wrap: wrap; }
.rec-attrs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.rec-imports { margin-top: 12px; font-size: 13px; }
.rec-imports summary { cursor: pointer; color: var(--blue); font-weight: 600; }
@media (max-width: 760px) {
  .ci-row { grid-template-columns: 1fr auto; }
  .ci-track { grid-column: 1 / -1; order: 3; }
  .stage-steps li { grid-template-columns: 1fr; }
  .stage-steps small { grid-column: 1; }
  .season-bars { gap: 2px; }
  .season-val { display: none; }
}

/* ---------- Miglioramenti della piattaforma ---------- */
.opt-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.opt-gauge { position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.opt-gauge svg { width: 100%; height: 100%; }
.opt-gauge .g-track { fill: none; stroke: #edf0f4; stroke-width: 10; }
.opt-gauge .g-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .4s; }
.gauge-good .g-fill { stroke: #0ca30c; } .gauge-mid .g-fill { stroke: #2a78d6; } .gauge-low .g-fill { stroke: #eb6834; }
.opt-gauge strong { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 24px; }
.opt-text { flex: 1 1 260px; min-width: 0; }
.opt-text h2 { margin: 0 0 4px; }
.opt-text p { margin: 0 0 4px; }
.opt-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.impr-filters { gap: 12px; flex-wrap: wrap; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-row .chip[aria-pressed=true] { background: var(--blue); color: #fff; border-color: var(--blue); }
/* Respiro tra schede, filtri e contenuto: nessuna barra di schede o di filtri attaccata al testo sopra o al blocco sotto */
.chip-row { margin: 14px 0 20px; }
.settings-crumb { margin: 0 0 18px; }
.tabs + .muted, .settings-tabs + .muted { margin-top: 0; }
/* Preventivi: note sotto i numeri e gruppi per stato separati */
.quotes-note { margin: 12px 0 0; }
.quote-group { margin-top: 28px; }
.quote-group:first-child { margin-top: 4px; }
.quote-group > .section-title { display: flex; align-items: baseline; gap: 8px; margin: 0 0 4px; }
.quote-group > p.muted { margin: 0 0 10px; }
/* Nota sotto l'imponibile («una tantum + canone × mesi»): va a capo nella sua colonna invece di finire sopra il totale */
.quote-group .table td.num small { white-space: normal; line-height: 1.35; margin-top: 2px; }
/* Stesse colonne in tutti i gruppi (tabelle a larghezze fisse): codice, oggetto, cliente, data, validità, stato, imponibile, totale */
@media (min-width: 861px) {
  .quote-group .table { table-layout: fixed; width: 100%; }
  .quote-group .table th:nth-child(1) { width: 120px; }
  .quote-group .table th:nth-child(3) { width: 18%; }
  .quote-group .table th:nth-child(4), .quote-group .table th:nth-child(5) { width: 96px; }
  .quote-group .table th:nth-child(6) { width: 120px; }
  .quote-group .table th:nth-child(7) { width: 200px; }
  .quote-group .table th:nth-child(8) { width: 120px; }
}
.impr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 22px; }
.impr-grid > .empty { grid-column: 1 / -1; }
.impr-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.impr-card:hover, .impr-card:focus-visible { border-color: var(--blue); box-shadow: var(--shadow-md); outline: none; }
.impr-card header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.impr-card h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.impr-card p { margin: 0; color: var(--gray); font-size: 13.5px; line-height: 1.45; flex: 1; }
.impr-card footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }
.impr-actions { margin-left: auto; display: flex; gap: 4px; }
.impr-kind, .impr-aud, .impr-ai { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-head); font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 20px; }
.impr-kind .icon { width: 13px; height: 13px; }
.kind-funzionalita { background: var(--blue-light); color: var(--blue); }
.kind-uso { background: #eef0f3; color: var(--gray); }
.kind-correzione { background: var(--amber-light); color: var(--amber-dark); }
.impr-aud { background: none; color: var(--muted); border: 1px solid var(--border); font-weight: 600; }
.impr-ai { background: #4a3aa7; color: #fff; }
.impr-uplift { font-family: var(--font-head); font-weight: 800; font-size: 15px; color: var(--blue); background: var(--blue-lighter); border-radius: 6px; padding: 2px 8px; }
.impr-state { font-size: 12.5px; font-weight: 600; color: var(--gray); display: inline-flex; align-items: center; gap: 4px; }
.impr-state .icon { width: 14px; height: 14px; }
.state-applicato { color: var(--green); }
.impr-impact { font-size: 12px; color: var(--gray); display: inline-flex; align-items: center; gap: 6px; }
.impact-meter { display: inline-flex; gap: 2px; align-items: flex-end; }
.impact-meter i { display: block; width: 5px; background: #d6dbe3; border-radius: 1px; }
.impact-meter i:nth-child(1) { height: 7px; } .impact-meter i:nth-child(2) { height: 10px; } .impact-meter i:nth-child(3) { height: 13px; }
.impact-meter i.on { background: var(--blue); }
.impr-detail section { margin-bottom: 16px; }
.impr-detail h3 { font-size: 14px; margin: 0 0 6px; }
.impr-detail h3:focus { outline: none; }
.impr-detail p { margin: 0 0 6px; line-height: 1.55; }
.impr-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.impr-evidence { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.impr-evidence div { background: #f6f8fb; border-radius: var(--radius-sm); padding: 8px 10px; }
.impr-evidence dt { font-size: 11.5px; color: var(--muted); }
.impr-evidence dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.impr-impact-box { background: var(--blue-lighter); border-radius: var(--radius); padding: 12px 14px; }
.impr-impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.impr-impact-grid > div > span { display: block; font-size: 11.5px; color: var(--muted); }
.impr-impact-grid strong { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.impr-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.impr-prompt { width: 100%; font-size: 12.5px; line-height: 1.45; background: #f6f8fb; }
.usage-details { margin-top: 10px; }
.usage-details > summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; list-style: none; margin-bottom: 12px; }
.usage-details > summary h2 { margin: 0; font-size: 18px; }
.usage-details > summary::before { content: '▸'; color: var(--blue); }
.usage-details[open] > summary::before { content: '▾'; }
.adopt-bar { display: inline-block; width: 70px; height: 6px; background: #edf0f4; border-radius: 3px; vertical-align: middle; overflow: hidden; }
.adopt-bar i { display: block; height: 100%; background: #2a78d6; }
@media (max-width: 760px) {
  .impr-grid { grid-template-columns: 1fr; }
  .opt-head { gap: 14px; }
  .opt-gauge { width: 88px; height: 88px; }
}

/* ---------- Finestre del percorso (benvenuto, questionario, meet) e porta d'ingresso ---------- */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(1, 25, 52, .52); display: flex; align-items: center; justify-content: center; padding: 24px; animation: sheet-fade .16s ease-out; }
.sheet-backdrop.out { opacity: 0; transition: opacity .15s; }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(14px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet { position: relative; width: 100%; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); animation: sheet-up .2s ease-out; }
.sheet-sm { max-width: 440px; } .sheet-md { max-width: 560px; } .sheet-lg { max-width: 760px; }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; background: var(--surface); }
.sheet-body { padding: 34px 38px 30px; }
.sheet-body h2 { font-size: 24px; margin: 4px 0 12px; line-height: 1.25; outline: none; }
.sheet-body > div > p { line-height: 1.6; }
.sheet-center { text-align: center; display: flex; flex-direction: column; align-items: center; }
.sheet-center .sheet-steps { text-align: left; width: 100%; max-width: 480px; }
.sheet-big-icon { width: 54px; height: 54px; color: #1f7a45; background: var(--green-light); border-radius: 50%; padding: 12px; margin-bottom: 6px; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.brief-intro .sheet-actions, .meet-pick .sheet-actions { justify-content: flex-start; }
.sheet-steps { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; gap: 0; }
.sheet-steps li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.sheet-steps li:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 30px; bottom: 2px; width: 2px; background: var(--border-strong); }
.sheet-steps li.ss-done:not(:last-child)::before { background: #1f7a45; }
.ss-dot { position: relative; z-index: 1; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 13px; background: #eef0f3; color: var(--muted); }
.ss-dot .icon { width: 15px; height: 15px; }
.ss-done .ss-dot { background: #1f7a45; color: #fff; }
.ss-current .ss-dot { background: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-light); }
.sheet-steps strong { display: block; font-family: var(--font-head); font-size: 15px; }
.ss-current strong { color: var(--blue); }
.sheet-steps small { display: block; color: var(--gray); font-size: 13px; margin-top: 2px; line-height: 1.45; }
.sheet-consultant { display: flex; align-items: center; gap: 12px; background: #f6f8fb; border-radius: 12px; padding: 12px 14px; margin: 14px 0; text-align: left; }
.sheet-consultant strong { display: block; font-family: var(--font-head); }
.sheet-consultant small { color: var(--gray); }
.brief-step-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sheet .brief-nav { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); padding-top: 16px; position: sticky; bottom: -30px; background: var(--surface); padding-bottom: 6px; }

.welcome-hero { text-align: center; }
.welcome-logo { width: 190px; margin: 0 auto 10px; display: block; }
.welcome-consultant { display: flex; gap: 16px; align-items: center; background: var(--blue-lighter); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
.welcome-consultant strong { display: block; font-family: var(--font-head); font-size: 17px; }
.welcome-consultant small { color: var(--gray); }
.welcome-consultant p { margin: 6px 0 0; font-size: 13.5px; color: var(--gray); line-height: 1.5; }
.welcome-consultant .eyebrow { margin: 0; }
.welcome h3 { font-size: 15px; margin: 8px 0 0; }
.welcome-note { text-align: center; margin-top: 8px; }

.meet-days { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 8px 0; scroll-snap-type: x mandatory; }
.meet-days button { flex: 0 0 auto; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 78px; padding: 10px 8px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 12px; cursor: pointer; font-family: var(--font-head); }
.meet-days button span { font-size: 12px; text-transform: uppercase; color: var(--muted); }
.meet-days button strong { font-size: 15px; }
.meet-days button small { font-size: 11px; color: var(--muted); }
.meet-days button[aria-selected=true] { border-color: var(--blue); background: var(--blue); color: #fff; }
.meet-days button[aria-selected=true] span, .meet-days button[aria-selected=true] small { color: #dce7f4; }
.meet-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.meet-slots button { padding: 11px 6px; border: 1.5px solid var(--border-strong); background: var(--surface); border-radius: 10px; font-family: var(--font-head); font-weight: 700; font-size: 15px; cursor: pointer; }
.meet-slots button:hover { border-color: var(--blue); color: var(--blue); }
.meet-slots button[aria-pressed=true] { background: var(--blue); border-color: var(--blue); color: #fff; }
.meet-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; width: 100%; margin: 14px 0 4px; text-align: left; }
.meet-summary div { background: var(--blue-lighter); border-radius: 10px; padding: 12px 14px; }
.meet-summary span { display: block; font-size: 12px; color: var(--muted); }
.meet-summary strong { font-family: var(--font-head); }
.meet-prep { width: 100%; text-align: left; margin-top: 18px; border-top: 1px solid var(--border); padding-top: 12px; }
.meet-prep h3 { font-size: 14px; margin: 0 0 6px; }
.meet-prep ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--gray); line-height: 1.6; }

.brief-track { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 4px; font-size: 13.5px; color: var(--gray); }
.brief-track li { display: flex; align-items: center; gap: 6px; }
.brief-track .icon { width: 15px; height: 15px; }
.brief-track li.ok { color: #1f7a45; }

/* Porta d'ingresso (link dell'email) */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 440px) 1fr; background: var(--bg); }
.gate-single { display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-side { background: linear-gradient(160deg, #023F82 0%, #012a56 100%); color: #fff; padding: 44px 40px; display: flex; flex-direction: column; gap: 16px; }
.gate-logo-light { width: 190px; }
.gate-side h2 { color: #fff; font-size: 26px; line-height: 1.25; margin: 18px 0 0; }
.gate-side p { color: #d4e1f1; line-height: 1.6; margin: 0; }
.gate-steps { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 14px; }
.gate-steps li { display: flex; gap: 12px; align-items: flex-start; opacity: .8; }
.gate-steps li.current { opacity: 1; }
.gate-steps li > span { flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.gate-steps li.current > span { background: #fff; color: var(--blue); border-color: #fff; }
.gate-steps strong { display: block; font-family: var(--font-head); }
.gate-steps small { color: #c4d5ea; }
.gate-consultant { margin-top: auto; display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; }
.gate-consultant small { display: block; color: #c4d5ea; font-size: 12px; }
.gate-consultant strong { display: block; font-family: var(--font-head); }
.gate-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.gate-card { width: 100%; max-width: 460px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); padding: 34px 32px; }
.gate-card h1 { font-size: 26px; margin: 4px 0 8px; }
.gate-logo { width: 180px; margin-bottom: 18px; }
.gate-form { display: grid; gap: 12px; }
.gate-form .btn-lg { width: 100%; justify-content: center; }
.gate-form .field-hint.ok { color: #1f7a45; font-weight: 600; }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { width: 100%; padding-right: 72px; }
.pw-wrap .link-btn { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.gate-privacy { align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.gate-privacy input { margin-top: 3px; }

@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; }
  .gate-side { padding: 26px 20px; gap: 10px; }
  .gate-side h2 { font-size: 21px; margin-top: 8px; }
  .gate-steps, .gate-consultant { display: none; }
  .gate-main { padding: 20px 16px 40px; align-items: flex-start; }
  .gate-card { padding: 24px 18px; }
}
@media (max-width: 640px) {
  .sheet-backdrop { padding: 0; align-items: stretch; }
  .sheet { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .sheet-body { padding: 56px 18px 24px; }
  .sheet-body h2 { font-size: 21px; }
  .welcome-consultant { flex-direction: column; text-align: center; }
  .sheet .brief-nav { bottom: -24px; }
}

.update-banner { top: auto; bottom: 20px; }
.update-banner span { min-width: 0; }
.update-banner .btn { flex: none; white-space: nowrap; }
/* Telefono: barra a tutta larghezza (col 50% + pillola il testo andato a capo diventava un ovale) */
@media (max-width: 720px) {
  .update-banner { left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: none; width: auto; max-width: none; border-radius: 14px; padding: 12px 12px 12px 14px; line-height: 1.35; }
  .update-banner .icon { flex: none; }
}

/* ================= Piano dei pagamenti ================= */
.plan-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.plan-card .card-head h2 .icon { width: 18px; height: 18px; color: var(--blue); }
.plan-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.plan-presets .chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--gray); }
.plan-presets .chip:hover { border-color: var(--blue); color: var(--blue); }
.plan-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.plan-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 90px 110px minmax(140px, 1fr) 130px 34px; gap: 8px; align-items: center; }
.plan-row.saldo { padding-top: 6px; border-top: 1px dashed var(--border-strong); }
.plan-pct { display: flex; align-items: center; gap: 4px; }
.plan-pct input { width: 64px; }
.plan-pct strong { font-family: var(--font-head); padding-left: 6px; }
.plan-amt { font-family: var(--font-head); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.pay-plan { margin: 18px 0; }
.pay-plan h2 { font-size: 16px; margin-bottom: 6px; }
.pay-plan-what { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.pay-plan .qfold-btn { margin-top: 8px; }
.pay-plan .qfold-body { margin-top: 10px; }
.pay-plan-months td, .pay-plan-months th { font-size: 13px; }
/* Telefono: ogni rata è una scheda con l'etichetta della colonna a sinistra */
@media (max-width: 640px) {
  .pay-plan-table, .pay-plan-table tbody, .pay-plan-table tr, .pay-plan-table td { display: block; width: 100%; }
  .pay-plan-table thead { display: none; }
  .pay-plan-table tr { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .pay-plan-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0 !important; border: 0 !important; text-align: right; }
  .pay-plan-table td::before { content: attr(data-label); flex: none; color: var(--muted); font: 700 11px var(--font-head); letter-spacing: .5px; text-transform: uppercase; padding-top: 2px; text-align: left; }
  .pay-plan-table td:first-child { display: block; text-align: left; }
  .pay-plan-table td:first-child::before { display: none; }
  .pay-plan-table td.pay-plan-nopct { display: none; }
}
.plan-pick { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.fw-pick-item.disabled { opacity: .55; }
@media (max-width: 760px) { .plan-row { grid-template-columns: 1fr 90px; } .plan-row .plan-amt { text-align: left; } }

/* ================= Timing ================= */
.timing-list { display: flex; flex-direction: column; gap: 10px; }
.timing-card { padding: 0; margin: 0; overflow: hidden; }
.timing-head { display: grid; grid-template-columns: 18px minmax(0, 2fr) repeat(2, minmax(90px, .8fr)) minmax(170px, 1fr); gap: 12px; align-items: center; width: 100%; padding: 14px 16px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; color: var(--text); }
.timing-head:hover { background: var(--blue-lighter); }
.timing-caret { color: var(--muted); transition: transform .15s; }
.timing-card.open .timing-caret { transform: rotate(90deg); }
.timing-name { display: flex; flex-direction: column; min-width: 0; }
.timing-name strong { font-family: var(--font-head); font-size: 15px; }
.timing-name small, .timing-num small { color: var(--muted); font-size: 11.5px; }
.timing-num { display: flex; flex-direction: column; font-family: var(--font-head); font-weight: 700; font-variant-numeric: tabular-nums; }
.timing-num small { font-family: var(--font-body); font-weight: 400; }
.timing-use { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.var.over { color: var(--red); }
.var.under { color: var(--green); }
.var small { font-weight: 400; }
.use-bar { display: inline-block; width: 110px; height: 7px; border-radius: 4px; background: #e3e8f0; overflow: hidden; vertical-align: middle; }
.use-bar span { display: block; height: 100%; background: var(--green); }
.use-bar.warn span { background: var(--amber); }
.use-bar.over span { background: var(--red); }
.timing-tasks .use-bar { width: 60px; margin-left: 6px; }
.timing-body { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: #fbfcfd; }
.timing-project-est { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 13.5px; }
.timing-project-est label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.est-in, .timing-project-est input { width: 80px; }
.timing-tasks tr.task-done td:first-child { color: var(--muted); }
@media (max-width: 1000px) { .timing-head { grid-template-columns: 18px 1fr 1fr; } .timing-use { grid-column: 2 / -1; } }
.budget-mods { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin: 8px 0; padding: 8px 10px; background: var(--blue-lighter); border-radius: 8px; }
.budget-mods .field-label { flex-basis: 100%; }
.budget-client { flex-basis: 100%; margin: 4px 0 0; display: flex; gap: 6px; align-items: center; }
.budget-client .icon { width: 15px; height: 15px; flex: none; }
.budget-client.warn { color: var(--amber-dark); }
.budget-client.ok { color: var(--green); }

/* Ritaglio della foto del profilo (photo-crop.js) */
.sheet-backdrop.sheet-over-modal { z-index: 110; }
.crop { max-width: 420px; margin: 0 auto; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #0b1f38; cursor: grab; touch-action: none; user-select: none; outline-offset: 3px; }
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-mask { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(1, 25, 52, .55); border: 2px solid rgba(255, 255, 255, .85); pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--blue); }
.crop .form-error { margin-top: 10px; text-align: center; }

/* Agenda: selettore del calendario e del periodo */
.agenda-controls { display: flex; gap: 8px; flex-wrap: wrap; }
/* Profilo: il mio Google Calendar */
.my-google { margin-top: 18px; }
.my-google h2 { display: flex; align-items: center; gap: 8px; }
.g-sync { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px 12px; margin: 12px 0 4px; display: grid; gap: 6px; }
.g-sync legend { font-weight: 700; font-size: 13px; padding: 0 6px; }
.g-sync small { margin-left: 4px; }
.source-google { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
/* Schede delle fonti: nulla deve uscire dalla scheda, e quelle collegate a un'integrazione sono in risalto */
.source-card { min-width: 0; overflow-wrap: anywhere; }
.source-card .source-actions { flex-wrap: wrap; row-gap: 2px; gap: 0; }
.source-card .source-actions .btn-sm { padding: 6px 6px; }
.source-head { gap: 6px; flex-wrap: wrap; }
.source-card.is-linked { border-color: #9dbbe0; box-shadow: inset 4px 0 0 var(--blue), var(--shadow-sm, 0 1px 2px rgba(0,0,0,.04)); background: linear-gradient(180deg, var(--blue-lighter) 0, var(--surface) 90px); }
.source-card.is-linked.has-error { border-color: #efb4b4; box-shadow: inset 4px 0 0 var(--red); background: linear-gradient(180deg, var(--red-light) 0, var(--surface) 90px); }
.source-card.is-linked .source-google { border-top-color: #d5e2f1; }
.link-pill { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; padding: 3px 9px; border-radius: 999px; background: var(--blue); color: #fff; font: 600 12px var(--font-head); white-space: nowrap; }
.link-pill .cov-ico { width: 13px; height: 13px; }
.link-pill.link-error { background: var(--red); }
.link-pill.link-paused { background: var(--muted, #6b7280); }
.linked-count { font-weight: 400; margin-left: 8px; }
.source-google p { margin: 2px 0; }

/* Contenuti: sito web, relatori e domande frequenti, lezioni dei corsi */
.repeat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.repeat-row-stack { grid-template-columns: 1fr auto; }
.repeat-row-stack textarea { grid-column: 1; }
.repeat-row-stack .icon-btn { grid-column: 2; grid-row: 1; }
.counter { text-align: right; }
.seo-advanced { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.seo-advanced summary { cursor: pointer; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
.lesson-list { list-style: none; margin: 0; padding: 0; counter-reset: lesson; }
.lesson-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); counter-increment: lesson; }
.lesson-list li::before { content: counter(lesson); width: 26px; height: 26px; border-radius: 13px; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.lesson-list .list-main { flex: 1; min-width: 0; }
.lesson-list .list-main small { display: block; }
.lesson-list .actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.course { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 22px; align-items: start; }
.course > * { min-width: 0; }
.course-side { position: sticky; top: 76px; }
.course-title { font-size: 20px; margin: 4px 0; }
.lesson-nav { list-style: none; margin: 8px 0 12px; padding: 0; }
.lesson-nav a { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.lesson-nav a:hover { background: var(--blue-lighter); }
.lesson-nav a[aria-current="page"] { background: var(--blue-light); }
.lesson-dot { width: 24px; height: 24px; border-radius: 12px; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.lesson-dot.done { background: var(--ok); color: #fff; }
.lesson-dot .icon { width: 14px; height: 14px; }
.course-lesson header h2 { font-size: 26px; margin: 2px 0 14px; }
.content-editor h3.card-title-sm { margin-top: 18px; }
@media (max-width: 860px) {
  .course { grid-template-columns: minmax(0, 1fr); }
  .course-side { position: static; }
  .repeat-row { grid-template-columns: 1fr auto; }
  .repeat-row > :nth-child(2) { grid-column: 1; }
}

/* Registrazione e accesso dal sito: campo trappola per i bot, separatore, pulsante Google */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.gate-form .grid-2 { gap: 12px; }
.login-alt { text-align: center; margin: 4px 0 0; }
@media (max-width: 520px) { .gate-form .grid-2 { grid-template-columns: 1fr; } .gate-card { padding: 26px 20px; } }
.welcome-target { display: flex; gap: 8px; align-items: center; background: var(--blue-lighter); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 12px; }
.live-confirm h2 { margin: 4px 0 6px; }
.live-confirm .sheet-actions { flex-wrap: wrap; }
.signup-link { margin: 6px 0 12px; display: grid; gap: 6px; }
.signup-link code { background: var(--blue-lighter); padding: 4px 8px; border-radius: 6px; word-break: break-all; flex: 1; min-width: 0; }

/* ---------------- Modalità Demo: interruttori, fascia, casi d'uso ---------------- */
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--blue-light); gap: 2px; flex-shrink: 0; }
.seg button { border: 0; background: transparent; font: 600 12px var(--font-head); color: var(--blue); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }
.demo-mode .mode-switch button[data-mode="demo"][aria-pressed="true"] { background: var(--amber); color: #3b2604; }
/* Modalità Demo attiva: etichetta in alto per tornare ai dati veri (Live/Demo non sta più nella barra, è nell'ingranaggio) */
.demo-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 0; border-radius: 999px; background: var(--amber); color: #3b2604; font-size: 13px; font-weight: 700; cursor: pointer; }
.demo-chip .icon { width: 16px; height: 16px; }
.seg-dark { background: rgba(255, 255, 255, .1); width: 100%; }
.seg-dark button { flex: 1; color: rgba(255, 255, 255, .85); }
.seg-dark button[aria-pressed="true"] { background: #fff; color: var(--blue); }
.demo-side { margin: 0 6px 14px; padding: 10px; border-radius: var(--radius-sm); background: rgba(245, 165, 36, .16); border: 1px solid rgba(245, 165, 36, .45); display: grid; gap: 8px; }
.demo-case { display: grid; gap: 4px; font: 600 11px var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: rgba(255, 255, 255, .75); }
.demo-case select { font: 14px var(--font-body); padding: 6px 8px; border-radius: var(--radius-sm); border: 0; }
.demo-mode .topbar { box-shadow: inset 0 3px 0 var(--amber); }
.demo-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 36px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--amber-light); color: var(--amber-dark); border: 1px solid #f3d9a8; font-size: 14px; }
.demo-banner span { flex: 1; min-width: 220px; }
.demo-banner strong { margin-right: 6px; }
@media (max-width: 900px) { .demo-banner { margin: 12px 16px 0; } }
.demo-method { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.demo-method li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 4px; }
.demo-method small { color: var(--gray); font-size: 13px; line-height: 1.4; }
.demo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.demo-card { display: grid; gap: 14px; align-content: start; min-width: 0; }
.demo-card > * { min-width: 0; }
.demo-table-wrap { overflow-x: auto; }
.demo-card-head h2 { margin: 6px 0 2px; }
.demo-card h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 4px; }
.demo-story { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.demo-story p { margin: 0; line-height: 1.5; }
.demo-results { font-size: 13px; }
.demo-results th, .demo-results td { padding: 8px 10px; }
.demo-results .num { text-align: right; font-variant-numeric: tabular-nums; }
.demo-show summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.demo-show ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.5; }
.demo-links { display: flex; flex-wrap: wrap; gap: 6px; }
.demo-card-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }
.demo-card-foot .muted { flex: 1; min-width: 180px; }
@media (max-width: 600px) { .demo-results th:nth-child(2), .demo-results td:nth-child(2) { display: none; } .mode-switch button { padding: 5px 9px; } }

/* Progetto | cliente accanto al titolo */
/* Il nome del cliente accanto al titolo va a capo: un nome lungo (es. una ragione sociale intera) non deve allargare la pagina sul telefono */
.title-client { font-weight: 400; color: var(--muted, #6b7280); font-size: .7em; overflow-wrap: anywhere; }
.page-head h1 { overflow-wrap: anywhere; min-width: 0; }
h3 .title-client { font-size: .85em; }
/* Gruppo di caselle (es. tipologie del progetto) */
.check-group { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.check-group legend { margin-bottom: 4px; }

/* ================= Barra in alto (revisione): ricerca al centro, comandi a destra ================= */
/* Desktop: [ · ricerca grande al centro · ] [Live/Demo · Nuovo · Timer · Notifiche · Impostazioni] */
.topbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 640px) minmax(auto, 1fr); align-items: center; gap: 16px; padding: 12px 36px; justify-content: stretch; }
.topbar .search-trigger { grid-column: 2; width: 100%; height: 46px; margin: 0; padding: 0 16px; font-size: 15px; box-shadow: var(--shadow-sm); }
.topbar .search-trigger .icon { width: 20px; height: 20px; }
.topbar .search-trigger span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .topbar-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; }
.topbar #menu-toggle, .topbar .topbar-logo-link { display: none; }
.timer-slot:empty { display: none; }
.drawer-label { display: none; }
@media (max-width: 1280px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar .search-trigger { grid-column: 1; max-width: 560px; }
  .topbar .topbar-right { grid-column: 2; }
}

/* Telefono: [menu][logo] … [notifiche][+]; ricerca in cima al menu laterale, in fondo Impostazioni ed Esci.
   Live/Demo, timer e ingranaggio non compaiono su telefono */
.sidebar-search, .sidebar-foot { display: none; }
@media (max-width: 860px) {
  .topbar { grid-template-columns: 44px auto minmax(0, 1fr) auto; gap: 4px; padding: 8px 12px; flex-wrap: nowrap; }
  .topbar #menu-toggle { display: inline-grid; grid-column: 1; grid-row: 1; width: 44px; height: 44px; }
  .topbar .topbar-logo-link { display: flex; grid-column: 2; grid-row: 1; justify-self: start; margin-left: 4px; }
  .topbar .topbar-logo { display: block; height: 32px; width: auto; max-width: 52vw; object-fit: contain; margin: 0; }
  .topbar .search-trigger { display: none; }
  .topbar .topbar-right { grid-column: 4; grid-row: 1; gap: 4px; }
  .topbar .topbar-right .mode-switch, .topbar .topbar-right .timer-slot, .topbar .topbar-right #settings-wrap { display: none !important; }
  .topbar .topbar-right .bell-wrap { order: 1; }
  .topbar .topbar-right #create-wrap, .topbar .topbar-right > .btn { order: 2; }
  .topbar .topbar-right .btn-sm { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .topbar .topbar-right .hide-sm { display: none; }
  .topbar .topbar-right .menu-wrap { position: static; }
  /* Pannelli di notifiche e menu «Nuovo»: larghi quanto lo schermo, sotto la barra */
  .topbar .topbar-right .dropdown, .topbar .topbar-right .notif-panel { position: fixed; left: 12px; right: 12px; top: calc(var(--topbar-h, 61px) + 4px); width: auto; min-width: 0; max-height: 70vh; overflow-y: auto; }
  /* Menu laterale: logo, ricerca, voci, profilo e in fondo Impostazioni ed Esci */
  .sidebar { overflow-y: auto; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .sidebar .nav { flex: 1 0 auto; }
  .sidebar-search { display: flex; flex: none; align-items: center; gap: 10px; width: 100%; height: 44px; margin: 4px 0 14px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); font: 500 14px var(--font-body, inherit); cursor: pointer; text-align: left; }
  .sidebar-search .icon { width: 18px; height: 18px; flex: none; }
  .sidebar-search span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sidebar-search:hover, .sidebar-search:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; }
  .sidebar-foot { display: grid; flex: none; gap: 6px; margin-top: 10px; }
  .sidebar-foot-link { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16);
    background: rgba(255, 255, 255, .08); color: #fff; font: 600 14px var(--font-body, inherit); text-decoration: none; cursor: pointer; text-align: left; }
  .sidebar-foot-link .icon { width: 18px; height: 18px; flex: none; }
  .sidebar-foot-link:hover { background: rgba(255, 255, 255, .16); }
  .sidebar-user #logout { display: none; }
  .sticky-head { top: var(--topbar-h, 61px); }
}

/* Foto del consulente nella barra laterale */
.sidebar-user .avatar-img { border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }

/* Modalità Demo: punto di vista (Studio / Cliente) e caso d'uso in un widget in basso a destra */
.demo-widget { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 250px; padding: 12px; border-radius: 16px; background: var(--blue-dark); color: #fff;
  box-shadow: var(--shadow-lg); display: grid; gap: 10px; border: 1px solid rgba(255, 255, 255, .12); }
.demo-widget-title { margin: 0; display: flex; align-items: center; gap: 6px; font: 700 12px var(--font-head); letter-spacing: .8px; text-transform: uppercase; color: var(--amber); }
.demo-widget-title .icon { width: 15px; height: 15px; }
.demo-widget-seg { width: 100%; background: rgba(255, 255, 255, .12); }
.demo-widget-seg button { flex: 1; color: rgba(255, 255, 255, .85); padding: 7px 12px; font-size: 13px; }
.demo-widget-seg button[aria-pressed="true"] { background: #fff; color: var(--blue-dark); }
.demo-widget-case { display: grid; gap: 4px; font: 600 11px var(--font-head); text-transform: uppercase; letter-spacing: .5px; color: rgba(255, 255, 255, .75); }
.demo-widget-case select { font: 14px var(--font-body, inherit); padding: 7px 8px; border-radius: 8px; border: 0; background: #fff; color: var(--text); }
/* Vista cliente: sopra il widget del consulente */
.client-view .demo-widget { bottom: 92px; }
@media (max-width: 600px) { .demo-widget { right: 12px; bottom: 12px; width: 220px; padding: 10px; } .client-view .demo-widget { bottom: 76px; } }
@media print { .demo-widget { display: none !important; } }

/* Barra in alto: la ricerca non si sovrappone mai ai comandi */
.topbar .search-trigger { min-width: 0; }
@media (max-width: 1480px) and (min-width: 861px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar .search-trigger { grid-column: 1; justify-self: center; max-width: 640px; }
  .topbar .topbar-right { grid-column: 2; }
}
.demo-mode #toasts { bottom: 190px; }
.nav-open .demo-widget { display: none; }

/* Condizioni contrattuali da scorrere prima della firma; approvazione dello studio sul preventivo */
.terms-scroll { max-height: 220px; overflow-y: auto; padding: 12px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; font-size: 13.5px; }
.terms-scroll.terms-read { border-color: var(--success, #1f7a45); }
.studio-sign { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; margin-top: 28px; break-inside: avoid; }
.studio-sign img { max-height: 80px; max-width: 240px; object-fit: contain; }
.sig-upload-preview { max-height: 90px; max-width: 280px; object-fit: contain; background: repeating-conic-gradient(#f1f3f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; }
.service-pick { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.tpl-row { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }

/* Attività incluse in ogni voce del preventivo */
.item-block { border-top: 1px solid var(--border); padding: 6px 0; }
.item-block:first-child { border-top: 0; }
.item-acts { padding: 2px 0 6px 18px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.act-row { display: flex; align-items: center; gap: 6px; width: 100%; }
.act-row .input { flex: 1; }
.act-dot { color: var(--gray); }
.item-activities { margin: 4px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--gray); }
.item-activities li { margin: 1px 0; }

/* Servizi del catalogo come accordion, con attività modificabili una per una */
.svc-list { display: flex; flex-direction: column; gap: 10px; }
.svc-acc { border: 1px solid var(--border); border-radius: var(--radius); background: #fff; transition: box-shadow .15s ease, border-color .15s ease; }
.svc-acc[open] { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(11, 42, 87, .07); }
.svc-acc > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; border-radius: var(--radius); }
.svc-acc > summary::-webkit-details-marker { display: none; }
.svc-acc > summary:hover { background: #f5f8fc; }
.svc-acc > summary:focus-visible { outline: 2px solid var(--brand, #023f82); outline-offset: -2px; }
.svc-chevron { display: inline-flex; transition: transform .18s ease; color: var(--gray); }
.svc-acc[open] .svc-chevron { transform: rotate(180deg); }
.svc-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc-body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border); }
.act-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.act-item { display: flex; align-items: center; gap: 6px; }
.act-item .input { flex: 1; min-width: 0; }
.act-num { width: 22px; height: 22px; flex: none; border-radius: 50%; background: #e8eff7; color: var(--brand, #023f82); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.act-item .icon-btn[disabled] { opacity: .3; cursor: default; }
@media (prefers-reduced-motion: reduce) { .svc-chevron, .svc-acc { transition: none; } }

/* Impostazioni per categorie: navigazione a sinistra, contenuto a destra */
.settings-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); display: flex; flex-direction: column; gap: 20px; padding: 14px 10px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.settings-cat { display: flex; flex-direction: column; gap: 2px; }
.settings-cat-title { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; padding: 0 10px; font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gray); }
.settings-cat-title .icon { width: 15px; height: 15px; }
.settings-link { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: var(--radius-sm); font: inherit; font-size: 14px; font-weight: 600; color: var(--text, #212836); cursor: pointer; transition: background .12s ease; }
.settings-link:hover { background: #eef3fa; }
.settings-link:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.settings-link[aria-current=page] { background: #e4edf9; color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); }
.settings-body { min-width: 0; }
.settings-crumb { margin: 0 0 14px; }
.settings-crumb strong { color: var(--blue); }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; gap: 14px; }
  .settings-nav { position: static; flex-direction: row; gap: 16px; overflow-x: auto; padding: 10px; scrollbar-width: thin; }
  .settings-cat { flex: none; flex-direction: row; align-items: center; gap: 4px; padding-right: 14px; border-right: 1px solid var(--border); }
  .settings-cat:last-child { border-right: 0; }
  .settings-cat-title { margin: 0 4px 0 0; }
  .settings-link { width: auto; white-space: nowrap; }
  .settings-hint { display: none; }
}
/* Menu laterale più compatto sugli schermi bassi, così le tre sezioni stanno senza scorrere */
@media (min-width: 901px) and (max-height: 860px) {
  .nav { gap: 8px; }
  .nav a { padding: 6px 12px; }
  .brand { padding-bottom: 12px; }
}

/* Guide di marketing (Formazione) */
.view-switch { margin: 0 0 18px; }
.seg-count { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 9px; background: rgba(2, 63, 130, .1); font-size: 11px; font-weight: 700; }
.seg button[aria-pressed=true] .seg-count { background: rgba(255, 255, 255, .25); }
.guides-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.guides-intro { margin: 0; max-width: 560px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; font: inherit; color: inherit; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.guide-card:hover { border-color: var(--border-strong); box-shadow: 0 6px 18px rgba(11, 42, 87, .09); transform: translateY(-2px); }
.guide-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.guide-card h3 { font-size: 16.5px; line-height: 1.3; }
.guide-card p { margin: 0; color: var(--gray); font-size: 14px; }
.guide-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--gray); }
.guide-go { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; color: var(--blue); }
.guide-go .icon { width: 15px; height: 15px; }
.guide-article { max-width: 760px; }
.guide-article h2 { font-size: 26px; margin: 6px 0 8px; }
.guide-article h3 { font-size: 17px; margin: 26px 0 8px; }
.guide-article p, .guide-article li { font-size: 15.5px; line-height: 1.65; }
.guide-article ul { padding-left: 20px; }
.guide-article li { margin: 4px 0; }
.guide-lead { font-size: 17px !important; color: var(--gray); }
.guide-back { margin-bottom: 8px; display: inline-flex; align-items: center; gap: 6px; }
.guide-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--border); }
.guide-next button { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font: inherit; cursor: pointer; }
.guide-next button:hover { border-color: var(--border-strong); background: #f5f8fc; }
.guide-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.guide-tools .input { max-width: 460px; }
.glossary-layout { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 18px; align-items: start; }
.letter-rail { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; font-weight: 700; }
.letter-rail a { display: block; text-align: center; padding: 3px 0; border-radius: 6px; color: var(--blue); text-decoration: none; }
.letter-rail a:hover { background: #e4edf9; }
.glossary-group { scroll-margin-top: calc(var(--topbar-h, 64px) + 16px); margin-bottom: 20px; }
.glossary-group h3 { font-size: 20px; color: var(--blue); padding-bottom: 4px; border-bottom: 2px solid #e4edf9; margin-bottom: 4px; }
.glossary-group dl { margin: 0; }
.glossary-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.glossary-item:last-child { border-bottom: 0; }
.glossary-item dt { font-weight: 700; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.glossary-item dd { margin: 4px 0 0; color: #3b4356; line-height: 1.6; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.kpi-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.kpi-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.kpi-card h3 { font-size: 16.5px; }
.kpi-card p { margin: 0; line-height: 1.55; }
.kpi-formula { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: #f3f7fb; border-left: 3px solid var(--blue); border-radius: 6px; }
.kpi-formula code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--text); white-space: normal; }
.kpi-card dl { margin: 0; display: grid; gap: 2px; }
.kpi-card dt { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray); margin-top: 6px; }
.kpi-card dd { margin: 0; font-size: 14px; line-height: 1.55; }
.kpi-where { display: flex; align-items: center; gap: 6px; color: var(--blue); margin-top: auto !important; }
.kpi-where .icon { width: 15px; height: 15px; flex: none; }
@media (max-width: 700px) {
  .glossary-layout { grid-template-columns: 1fr; }
  .letter-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .letter-rail a { width: 28px; }
  .guide-next { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
}

/* Dashboard: KPI con icona, filtri della lista, percorso dei clienti, scheletro di caricamento */
.stat { position: relative; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
a.stat:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(11, 42, 87, .1); border-color: var(--border-strong); text-decoration: none; }
a.stat:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.stat-icon { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-alert .stat-icon { background: var(--red-light); color: var(--red); }
.stat-warn .stat-icon, .stat-attention .stat-icon { background: var(--amber-light); color: var(--amber-dark); }
.inbox-filters { margin: 0 0 10px; }
.inbox-row.row-danger { box-shadow: inset 3px 0 0 var(--red); }
.inbox-row.row-warn { box-shadow: inset 3px 0 0 var(--amber); }
.inbox-row.row-brand { box-shadow: inset 3px 0 0 var(--blue); }
.inbox-more { display: block; margin: 8px 0 4px; }
.follow-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); font-family: var(--font-head); font-weight: 800; }
.pathway { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 4px 0 10px; padding: 0; counter-reset: ph; }
.pathway li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px; border-radius: 10px; background: #f3f5f8; text-align: center; }
.pathway li strong { font-family: var(--font-head); font-size: 22px; line-height: 1; color: var(--gray); font-variant-numeric: tabular-nums; }
.pathway li span { font-size: 10.5px; font-weight: 700; letter-spacing: .02em; color: var(--gray); }
.pathway li.has { background: var(--blue-light); }
.pathway li.has strong, .pathway li.has span { color: var(--blue); }
.sk { border-radius: 14px; background: linear-gradient(100deg, #eceff4 30%, #f6f8fb 50%, #eceff4 70%); background-size: 200% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
.sk-hero { height: 132px; margin-bottom: 18px; }
.sk-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.sk-stat { height: 96px; }
.sk-card { height: 240px; margin-bottom: 18px; }
.sk-card-sm { height: 150px; }
@keyframes sk-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (max-width: 700px) { .sk-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pathway li strong { font-size: 18px; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } a.stat:hover { transform: none; } }

.guide-article { scroll-margin-top: calc(var(--topbar-h, 64px) + 12px); }

/* Rifiniture per telefono: impostazioni a righe per categoria, KPI senza icona che copre i valori */
@media (max-width: 700px) {
  .stat-icon { display: none; }
  .kpi-strip .stat-value { font-size: 22px; }
}

/* Voci del preventivo: descrizione, attività con titolo e descrizione */
.item-details-input { width: 100%; resize: vertical; }
.act-row-full { align-items: flex-start; }
.act-fields { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.act-fields textarea { resize: vertical; }
.item-details { margin: 6px 0 0; font-size: 13px; color: var(--gray); }
.item-activities li strong { font-weight: 600; color: var(--text); }
.item-activities li span { display: block; font-size: 12px; }
.act-item-full { align-items: flex-start; }
.act-item-full .act-num { margin-top: 6px; }
.act-tools { display: flex; align-items: center; gap: 2px; flex: none; }
@media (max-width: 700px) { .act-item-full { flex-wrap: wrap; } .act-item-full .act-tools { margin-left: auto; } }

/* Termini di marketing evidenziati, con scheda esplicativa */
.term { cursor: help; border-bottom: 1.5px dotted currentColor; border-radius: 2px; transition: background .12s ease; text-decoration: none; }
.term:hover, .term:focus-visible { background: rgba(2, 63, 130, .12); outline: none; }
.dash-hero .term:hover, .dash-hero .term:focus-visible, .sidebar .term:hover { background: rgba(255, 255, 255, .22); }
.term-pop { position: absolute; z-index: 400; width: min(340px, calc(100vw - 16px)); padding: 14px 16px; background: #fff; color: var(--text); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: 0 12px 32px rgba(11, 42, 87, .22); font-size: 13.5px; line-height: 1.5; text-align: left; letter-spacing: 0; text-transform: none; font-weight: 400; }
.term-pop[hidden] { display: none; }
.term-pop h4 { font-size: 15px; margin: 2px 0 6px; }
.term-pop p { margin: 0 0 8px; }
.term-pop-cat { font-size: 10.5px !important; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gray); }
.term-pop-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 0 !important; }
.term-pop-links a { font-weight: 700; color: var(--blue); text-decoration: none; }
.term-pop-links a:hover { text-decoration: underline; }
.glossary-item.flash, .kpi-card.flash { animation: term-flash 2.2s ease; }
@keyframes term-flash { 0%, 60% { background: #fff6d6; box-shadow: 0 0 0 6px #fff6d6; } 100% { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .glossary-item.flash, .kpi-card.flash { animation: none; background: #fff6d6; } }

/* Strategia e analisi di mercato: presentazione delle sezioni */
.st-stack { display: flex; flex-direction: column; gap: 20px; }
.st-lead p { font-size: 15.5px; line-height: 1.65; margin: 0 0 10px; }
.st-sub { font-size: 15px; margin: 0 0 10px; color: var(--blue); }
.st-block h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray); }
.st-block p { margin: 0 0 8px; line-height: 1.6; }
.st-block.st-good { border-left: 3px solid var(--green); padding-left: 12px; }
.st-block.st-bad { border-left: 3px solid var(--red); padding-left: 12px; }
.st-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.st-cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.st-list { margin: 0; padding-left: 18px; }
.st-list li { margin: 3px 0; line-height: 1.5; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip { background: var(--blue-light); color: var(--blue); padding: 3px 11px; border-radius: 14px; font-size: 13px; font-weight: 600; }
.st-statement { margin: 0; padding: 18px 22px; border-left: 4px solid var(--blue); background: var(--blue-lighter, #f3f7fb); border-radius: 8px; font-size: 17px; line-height: 1.6; }
.st-promise { margin: 0; padding: 12px 16px; border-radius: 8px; background: var(--amber-light); font-weight: 600; }
.st-promise span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-dark); margin-bottom: 2px; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.st-card, .st-channel, .st-persona { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: #fff; break-inside: avoid; }
.st-card header, .st-channel header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 6px; }
.st-card h4, .st-channel h4, .st-persona h4 { margin: 0; font-size: 15.5px; }
.st-card p, .st-channel p { margin: 0 0 6px; line-height: 1.55; }
.st-pill { display: inline-block; flex: none; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; background: #eef0f3; color: var(--gray); }
.st-pill-alta { background: var(--red-light); color: var(--red); }
.st-pill-media { background: var(--amber-light); color: var(--amber-dark); }
.st-pill-bassa { background: #eef0f3; color: var(--gray); }
.st-pill-kind { background: var(--blue-light); color: var(--blue); }
.st-dl { margin: 8px 0 0; display: grid; gap: 1px; }
.st-dl dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gray); margin-top: 6px; }
.st-dl dd { margin: 0; font-size: 14px; line-height: 1.5; }
.st-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; }
.st-persona header { display: flex; gap: 12px; align-items: center; }
.st-persona header p { margin: 2px 0 0; }
.st-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: 17px; }
.st-persona blockquote { margin: 12px 0 4px; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--gray); font-style: italic; }
.st-map-row { display: grid; grid-template-columns: minmax(300px, 480px) minmax(0, 1fr); gap: 24px; align-items: start; }
.st-map { margin: 0; }
.st-map svg { width: 100%; height: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.st-map figcaption { margin-top: 6px; }
.st-grid { stroke: #eef0f3; }
.st-frame { fill: none; stroke: var(--border-strong); }
.st-dot { fill: #8a94a6; }
.st-dot-us { fill: var(--blue); stroke: #fff; stroke-width: 2; }
.st-dot-label { font-size: 11px; fill: #3b4356; }
.st-dot-label-us { font-size: 12px; font-weight: 700; fill: var(--blue); }
.st-axis { font-size: 11.5px; fill: var(--gray); }
.st-map-side { display: flex; flex-direction: column; gap: 18px; }
.st-canvas { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-areas: "p a v r s" "p k v c s" "x x x y y"; border: 1.5px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: #fff; }
.st-canvas-cell { padding: 12px 14px; border: 1px solid var(--border); min-height: 96px; }
.st-canvas-cell h4 { margin: 0 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.st-canvas-cell .st-list { padding-left: 16px; font-size: 13.5px; }
.st-canvas-cell.is-value { background: var(--blue-lighter, #f3f7fb); }
.area-p { grid-area: p; } .area-a { grid-area: a; } .area-k { grid-area: k; } .area-v { grid-area: v; } .area-r { grid-area: r; } .area-c { grid-area: c; } .area-s { grid-area: s; } .area-x { grid-area: x; } .area-y { grid-area: y; }
.st-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.st-funnel-col { display: flex; flex-direction: column; gap: 10px; }
.st-funnel-col > header { padding: 10px 12px; border-radius: 10px; background: var(--blue); color: #fff; }
.st-funnel-col:nth-child(2) > header { background: #2f5f9e; } .st-funnel-col:nth-child(3) > header { background: #1f7a45; } .st-funnel-col:nth-child(4) > header { background: #8a5a00; }
.st-funnel-col > header h3 { margin: 0; font-size: 14.5px; color: #fff; }
.st-funnel-col > header span { color: rgba(255, 255, 255, .8); }
.st-empty { margin: 0; padding: 14px; border: 1.5px dashed var(--border-strong); border-radius: 10px; color: var(--gray); font-size: 13px; text-align: center; }
.st-total { margin: 0; padding: 10px 14px; background: var(--blue-lighter, #f3f7fb); border-radius: 8px; }
.st-swot { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.st-swot-cell { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
.st-swot-cell h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14.5px; }
.st-swot-cell h4 span { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; }
.st-swot-cell.st-good { background: #f1faf4; } .st-swot-cell.st-good h4 span { background: var(--green); }
.st-swot-cell.st-warn { background: #fff8e8; } .st-swot-cell.st-warn h4 span { background: var(--amber-dark); }
.st-swot-cell.st-info { background: #f1f6fd; } .st-swot-cell.st-info h4 span { background: var(--blue); }
.st-swot-cell.st-bad { background: #fdf2f2; } .st-swot-cell.st-bad h4 span { background: var(--red); }
@container (max-width: 900px) { .st-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-map-row { grid-template-columns: 1fr; } .st-canvas { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "v v" "s r" "c a" "k p" "x y"; } }
@container (max-width: 620px) {
  .st-cols, .st-cols3, .st-swot, .st-funnel { grid-template-columns: 1fr; }
  .st-personas { grid-template-columns: 1fr; }
  .st-canvas { grid-template-columns: 1fr; grid-template-areas: "v" "s" "c" "r" "y" "x" "a" "k" "p"; }
}
@media print { .st-card, .st-persona, .st-channel, .st-swot-cell, .st-canvas-cell { break-inside: avoid; } }

/* Calendario delle azioni nei documenti */
.st-road-cell { padding: 4px 2px; min-width: 34px; }
.st-road-bar { display: block; height: 10px; border-radius: 5px; background: #2a78d6; }
.st-road-completata { background: #1baf7a; }
.st-road-annullata { background: #c8ced6; }
.st-road-pianificata { background: #9bbfec; }

/* Spazio di lavoro Strategia */
.st-work { display: grid; gap: 16px; }
.st-progress { display: grid; gap: 8px; padding: 14px 16px; }
.st-progress .progress { max-width: 420px; }
.st-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.st-rail { display: grid; gap: 6px; position: sticky; top: 76px; }
.st-rail-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1.5px solid var(--border); background: var(--white, #fff); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; }
.st-rail-item:hover { border-color: var(--blue); }
.st-rail-item.active { border-color: var(--blue); background: var(--blue-light); }
.st-rail-text { display: grid; gap: 2px; }
.st-rail-text strong { font-family: var(--font-head); font-size: 13.5px; }
.st-rail-text small { color: var(--gray); font-size: 12px; }
.st-rail-dot { flex: 0 0 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: #c8ced6; }
.st-dot-bozza { background: #eda100; }
.st-dot-in_revisione { background: #eb6834; }
.st-dot-approvata { background: #1baf7a; }
.st-section { padding: 20px; display: grid; gap: 18px; }
.st-section-head { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.st-section-head h2 { margin: 0 0 4px; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.st-comments { border-top: 1.5px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }
.st-comments h3 { margin: 0; font-size: 15px; }
.st-comment { background: var(--bg, #f6f8fb); border-radius: 10px; padding: 8px 12px; }
.st-comment p { margin: 4px 0 0; }
.st-comment-form { display: flex; gap: 8px; align-items: flex-end; }
.st-comment-form textarea { flex: 1; }
.st-edit { display: grid; gap: 14px; }
.st-edit-fields { display: grid; gap: 12px; }
.st-edit-items { display: grid; gap: 8px; }
.st-edit-items-head { display: grid; gap: 2px; }
.st-items { display: grid; gap: 10px; }
.st-item { position: relative; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px 14px; margin: 0; }
.st-item legend { font: 700 12px var(--font-head); color: var(--blue); padding: 0 6px; }
.st-item-del { position: absolute; top: 4px; right: 6px; }
.st-item-fields { display: grid; gap: 10px; }
@media (max-width: 860px) {
  .st-layout { grid-template-columns: 1fr; }
  .st-rail { position: static; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); overflow-x: auto; padding-bottom: 4px; }
}

.st-body, .doc-block { container-type: inline-size; min-width: 0; }
.st-body { overflow-x: auto; }
.st-main { min-width: 0; }

/* Suggerimenti AI nella Strategia */
.st-ai { display: grid; gap: 14px; }
.st-ai h2 { margin: 0; display: flex; gap: 8px; align-items: center; }
.st-ai-preview { max-height: 46vh; overflow: auto; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px; container-type: inline-size; }
.st-ai-mode { border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 14px; display: grid; gap: 6px; }
.st-ai-mode legend { font: 700 12px var(--font-head); padding: 0 6px; color: var(--blue); }

/* Guide lette / da leggere */
.guide-progress { display: grid; gap: 10px; margin-bottom: 14px; }
.guide-card.is-read { border-color: var(--green, #1baf7a); background: linear-gradient(0deg, rgba(27, 175, 122, .05), rgba(27, 175, 122, .05)), var(--surface, #fff); }
.guide-read { margin-left: 6px; }
.guide-read svg { width: 12px; height: 12px; vertical-align: -1px; }
.guide-done { margin: 22px 0 6px; padding-top: 14px; border-top: 1.5px solid var(--border); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Domande al cliente e suggerimenti mirati */
.st-field-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.st-ai-mini { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--border); background: var(--blue-light); color: var(--blue); border-radius: 999px; padding: 3px 10px; font: 700 11.5px var(--font-head); cursor: pointer; }
.st-ai-mini:hover:not(:disabled) { border-color: var(--blue); }
.st-ai-mini:disabled { opacity: .6; cursor: progress; }
.st-ai-mini svg { width: 13px; height: 13px; }
.st-questions { border-top: 1.5px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }
.st-questions:has(#st-questions:empty) { display: none; }
.st-q-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.st-q-head h3, .st-questions h3 { margin: 0; font-size: 15px; }
.st-q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.st-q { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; background: var(--white, #fff); }
.st-q-top { display: flex; justify-content: space-between; align-items: center; }
.st-q-text { margin: 0; font-weight: 600; }
label.st-q-text { display: block; }
.st-q-answer { margin: 0; padding: 8px 12px; border-left: 3px solid #1baf7a; background: rgba(27, 175, 122, .07); border-radius: 0 8px 8px 0; }
.st-q-answer footer { margin-top: 4px; }
.st-q-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-q-add { display: flex; gap: 8px; }
.st-q-add input { flex: 1; }
@media (max-width: 560px) { .st-q-add, .st-comment-form { flex-direction: column; align-items: stretch; } }

/* Rifiniture di layout su schermi stretti: testi lunghi che vanno a capo, contenitori che non allargano la pagina */
.info-row > * { min-width: 0; overflow-wrap: anywhere; }
.pipeline { max-width: 100%; }
#view, #view > * { min-width: 0; }
@media (max-width: 560px) { .info-row { grid-template-columns: 1fr; gap: 2px; } .info-row dt { font-size: 12px; } }
.detail-grid > * { min-width: 0; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .pipe-outcomes { grid-template-columns: 1fr; } .pipe-drop { flex-wrap: wrap; text-align: center; } }

/* Passi del Marketing su telefono: una fila scorrevole con etichette leggibili */
@media (max-width: 760px) {
  .stepper { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .step { flex: 0 0 auto; scroll-snap-align: center; padding: 8px 12px; }
  .step-text strong { white-space: nowrap; font-size: 13px; }
  .step-text small { display: none; }
}

/* Team e risorse */
.st-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.st-stat { border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; background: var(--blue-light); }
.st-stat strong { font: 800 22px var(--font-head); color: var(--blue); }
.st-stat span { font-size: 12.5px; color: var(--gray); }
.st-find-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-find { border: 1.5px solid var(--border); border-left-width: 4px; border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; }
.st-find p { margin: 0; color: var(--gray); font-size: 13.5px; }
.st-find-level { font: 700 10.5px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gray); }
.st-find-alta { border-left-color: #e34948; } .st-find-media { border-left-color: #eda100; } .st-find-bassa { border-left-color: #2a78d6; }

/* Risultati del piano */
.res-plan { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 20px; align-items: center; padding: 18px 20px; margin-bottom: 16px; }
.res-plan h2 { margin: 0 0 2px; }
.res-summary { margin: 8px 0 0; }
.res-plan-side { display: grid; gap: 6px; }
.res-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.res-pick { min-width: 220px; margin: 0; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.res-card { padding: 16px 18px; display: grid; gap: 10px; align-content: start; border-top: 4px solid var(--border); }
.res-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.res-card h3 { margin: 0; font-size: 16px; }
.res-raggiunto, .res-in_linea { border-top-color: #1baf7a; }
.res-attenzione { border-top-color: #eda100; }
.res-critico { border-top-color: #e34948; }
.res-flow { display: grid; grid-template-columns: 1fr auto 1.2fr auto 1fr; gap: 6px; align-items: center; text-align: center; background: var(--blue-light); border-radius: 12px; padding: 10px 8px; }
.res-flow strong { display: block; font: 800 17px var(--font-head); color: var(--blue); }
.res-flow-label { display: block; font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; }
.res-flow small { display: block; font-size: 11.5px; font-weight: 700; }
.res-now strong { font-size: 21px; }
.res-arrow { color: var(--gray); } .res-arrow svg { width: 14px; height: 14px; }
.res-progress { display: flex; align-items: center; gap: 10px; }
.res-progress .meter { flex: 1; }
.res-dev { margin: 0; }
.res-trend { width: 100%; height: auto; }
.res-line-actual { fill: none; stroke: #2a78d6; stroke-width: 2.4; }
.res-line-target { fill: none; stroke: #9aa6b6; stroke-width: 1.8; stroke-dasharray: 5 4; }
.res-dot { fill: #2a78d6; }
.res-axis { font-size: 10px; fill: var(--gray); }
.res-table { padding: 12px 16px; margin-bottom: 16px; }
.res-table summary { cursor: pointer; font-weight: 700; }
.res-side { padding: 16px 18px; margin-bottom: 16px; }
.res-method { max-width: 760px; }
@media (max-width: 760px) { .res-plan { grid-template-columns: 1fr; } .res-grid { grid-template-columns: 1fr; } .res-flow { grid-template-columns: 1fr; } .res-arrow { transform: rotate(90deg); } }

/* Piano editoriale: scadenze e attività collegate (piano di marketing, report, incontri) */
.ed-events-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.ev-toggle svg { width: 14px; height: 14px; vertical-align: -2px; }
.ed-event { border-left: 3px solid var(--ev, #2a78d6); background: color-mix(in srgb, var(--ev, #2a78d6) 10%, #fff); text-decoration: none; color: inherit; }
.ed-event .ed-dot { background: var(--ev, #2a78d6); }
.ev-azione { --ev: #1baf7a; } .ev-report { --ev: #eb6834; } .ev-meet { --ev: #4a3aa7; } .ev-piano { --ev: #2a78d6; }
.ev-toggle.ev-azione[aria-pressed="true"], .ev-toggle.ev-report[aria-pressed="true"], .ev-toggle.ev-meet[aria-pressed="true"], .ev-toggle.ev-piano[aria-pressed="true"] { background: var(--ev); border-color: var(--ev); color: #fff; }
.evs-completata .ed-title, .evs-pubblicato .ed-title { text-decoration: line-through; opacity: .7; }
.evs-in_ritardo { outline: 1.5px solid #e34948; }

/* Esempi nelle guide, nel glossario e nelle schede dei termini */
.gl-example { margin: 8px 0 0; padding: 8px 12px; border-left: 3px solid #2a78d6; background: var(--blue-light); border-radius: 0 8px 8px 0; font-size: 13.5px; }
.gl-guide { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; font: 700 12.5px var(--font-head); }
.gl-guide svg { width: 12px; height: 12px; }
.guide-example { border: 1.5px solid var(--border); border-left: 4px solid #eda100; border-radius: 12px; padding: 4px 16px 10px; background: #fffaf0; }
.guide-example h3 svg { width: 16px; height: 16px; vertical-align: -2px; color: #eda100; }
.term-pop-ex { font-size: 12.5px; margin: 6px 0 0; padding-left: 8px; border-left: 2px solid #2a78d6; }
.guide-article section.flash { animation: term-flash 2.2s ease; }
.guide-terms { margin-top: 18px; padding-top: 12px; border-top: 1.5px solid var(--border); }
.guide-terms dl { display: grid; gap: 10px; margin: 0; }
.guide-terms dt { font: 700 14px var(--font-head); }
.guide-terms dd { margin: 2px 0 0; color: var(--gray); font-size: 13.5px; }
.guide-terms dd em { display: block; margin-top: 4px; color: var(--text); }
.guide-terms > dl > div.flash { animation: term-flash 2.2s ease; border-radius: 8px; }

/* Menù a tendina con ricerca */
.combo { position: relative; }
.combo-box { position: relative; }
.combo-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 12px; box-shadow: var(--shadow-md, 0 8px 24px rgba(0,0,0,.12)); }
.combo-group { font: 700 10.5px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gray); padding: 8px 10px 3px; }
.combo-opt { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.combo-opt.active, .combo-opt:hover { background: var(--blue-light); }
.combo-opt[aria-selected="true"] { font-weight: 700; }
.combo-opt small { white-space: nowrap; }
.combo-empty { padding: 10px; color: var(--gray); }
.task-client { color: var(--gray); font-weight: 600; }
.task-client::before { content: ' | '; }
.tk-ai { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--blue-light); display: grid; gap: 8px; }
.tk-ai ol { margin: 0; padding-left: 20px; }
.tk-ai h4 { margin: 0; }

/* Pulsante dei suggerimenti AI: solo icona e «AI», nell'angolo in alto a destra */
.ai-btn { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--blue); background: #fff; color: var(--blue); border-radius: 999px; padding: 4px 11px 4px 9px; font: 800 12px var(--font-head); letter-spacing: .04em; cursor: pointer; line-height: 1.2; flex: none; }
.ai-btn svg { width: 14px; height: 14px; }
.ai-btn:hover:not(:disabled) { background: var(--blue-light); }
.ai-btn:focus-visible { outline: 3px solid rgba(42, 120, 214, .35); outline-offset: 1px; }
.ai-btn:disabled { opacity: .45; cursor: not-allowed; }
.ai-btn.busy { cursor: progress; opacity: .8; }
.ai-busy svg, [data-ai-confirm].busy svg { animation: ai-spin 1.1s linear infinite; }
.ai-status { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-size: 13px; color: var(--blue); font-weight: 600; vertical-align: middle; }
.ai-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: ai-pulse 1.2s ease-in-out infinite; }
.ai-status.is-error { color: var(--red); }
.ai-status.is-error::before { animation: none; }
.ai-working { position: relative; }
.ai-working :is(input, textarea, select) { pointer-events: none; opacity: .65; }
.ai-working::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(42, 120, 214, .07) 50%, transparent 70%); background-size: 200% 100%; animation: ai-sheen 1.6s linear infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes ai-sheen { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-reduced-motion: reduce) { .ai-busy svg, [data-ai-confirm].busy svg, .ai-status::before, .ai-working::after { animation: none; } }
.ai-btn.busy svg { animation: ai-spin 1.1s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-btn.busy svg { animation: none; } }
.ai-btn-sm { padding: 2px 8px 2px 7px; font-size: 11px; }
.ai-btn-sm svg { width: 12px; height: 12px; }
.card-head > .ai-btn, .page-head > .ai-btn { margin-left: auto; }
.st-head-right { display: flex; align-items: flex-start; }
.st-section-head + .st-actions { margin-top: -6px; }
.modal-foot .foot-left-group { margin-right: auto; display: flex; align-items: center; gap: 10px; }

/* Selettore Demo riducibile */
.demo-widget-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.demo-widget-min { border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; padding: 0; }
.demo-widget-min:hover { background: rgba(255, 255, 255, .25); }
.demo-widget-min svg { width: 14px; height: 14px; transition: transform .15s; }
.demo-widget.is-min { width: auto; padding: 8px 10px; gap: 0; }
.demo-widget.is-min .demo-widget-seg, .demo-widget.is-min .demo-widget-case { display: none; }
.demo-widget.is-min .demo-widget-min svg { transform: rotate(180deg); }

/* Impostazioni: categorie a sinistra, schede della categoria in alto, panoramica con lo stato di ognuna */
.settings-link-cat { display: flex; align-items: center; gap: 10px; }
.settings-link-cat .icon { width: 17px; height: 17px; flex: none; }
.settings-link-cat > span:nth-child(2) { flex: 1; }
.settings-count { font: 700 11px var(--font-head); color: var(--gray); background: #eef2f7; border-radius: 999px; padding: 1px 8px; }
.settings-link[aria-current=page] .settings-count { background: #fff; color: var(--blue); }
.settings-head { margin-bottom: 4px; }
.settings-head h2 { margin: 0; font-size: 22px; }
.settings-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1.5px solid var(--border); margin: 10px 0 14px; }
.settings-tab { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 10px 14px; font: 700 14px var(--font-head); color: var(--gray); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.settings-tab:hover { color: var(--blue); }
.settings-tab[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }
.settings-dot { width: 8px; height: 8px; border-radius: 50%; background: #c8ced6; }
.settings-dot.ok { background: #1baf7a; }
.settings-dot.off { background: #eda100; }
.settings-dot.ko { background: #e34948; }
.pay-state.conn-ok, .pay-state.conn-ko { display: inline-flex; align-items: center; gap: 6px; }
.pay-state.conn-ok { background: #e6f6ef; color: #0f7a53; }
.pay-state.conn-ko { background: #fdecea; color: #b42318; }
.conn-why { color: #b42318; font-size: 12px; }
.conn-inline { display: inline-flex; align-items: center; gap: 6px; }
.conn-inline.conn-ok { color: #0f7a53; }
.conn-inline.conn-ko { color: #b42318; }
.settings-tab .settings-dot { display: inline-block; margin-right: 6px; vertical-align: middle; }
.settings-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.settings-ov-card { padding: 18px 20px; display: grid; gap: 12px; align-content: start; }
.settings-ov-card header { display: flex; gap: 12px; align-items: flex-start; }
.settings-ov-card h2 { margin: 0; font-size: 18px; }
.settings-ov-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; flex: none; }
.settings-ov-icon svg { width: 19px; height: 19px; }
.settings-ov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.settings-ov-item { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 1.5px solid transparent; background: none; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; }
.settings-ov-item:hover { background: #f3f7fc; border-color: var(--border); }
.settings-ov-main { flex: 1; display: grid; gap: 1px; }
.settings-ov-main strong { font: 700 14px var(--font-head); }
.settings-ov-item > svg { width: 14px; height: 14px; color: var(--gray); }
.dropdown-sep { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
@media (max-width: 900px) { .settings-nav { flex-direction: row; overflow-x: auto; padding: 8px; } .settings-link-cat { flex: 0 0 auto; width: auto; white-space: nowrap; } .settings-count { display: none; } }
.settings-body .table td:first-child { min-width: 240px; }
.st-section-head { flex-wrap: nowrap; align-items: flex-start; } .st-section-head > div:first-child { flex: 1; min-width: 0; } .st-section-head + .st-actions { margin-top: 0; }

/* Telefono: i pulsanti con etichetta lunga vanno a capo invece di uscire dallo schermo; i gruppi di azioni si dispongono su più righe */
@media (max-width: 700px) {
  .btn { white-space: normal; height: auto; min-height: 40px; line-height: 1.25; max-width: 100%; text-align: center; }
  .btn-sm { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .actions, .card-head, .page-head { flex-wrap: wrap; }
  .actions > .btn { flex: 1 1 auto; }
  .icon-btn { min-width: 36px; min-height: 36px; }
}

/* Layout a griglia: le colonne possono restringersi (senza, un modulo largo allarga la pagina su telefono e tablet) */
.settings-layout > *, .detail-grid > *, .cols > *, .grid-2 > *, .form-stack > *, .editorial-layout > * { min-width: 0; }
.form-stack .input, .form-stack select, .form-stack textarea { max-width: 100%; }
@media (max-width: 900px) { .cols { grid-template-columns: minmax(0, 1fr); } .settings-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Schermi a tocco: bersagli di almeno 36 px */
@media (pointer: coarse) {
  .btn-sm, .chip, .seg button, .link-btn, .tabs button, .settings-tab, .ai-btn, .icon-btn, .ed-add, .task-timer, [data-view], [data-scope] { min-height: 36px; }
  .icon-btn { min-width: 36px; }
  .ai-btn { padding-top: 7px; padding-bottom: 7px; }
  .ed-add { width: 32px; height: 32px; }
  .link-btn { padding: 6px 8px; }
  .chip { padding-top: 6px; padding-bottom: 6px; }
}
.pricing-layout > *, .budget-main > * { min-width: 0; }
/* Il pulsante flottante dell'assistente non deve allargare la pagina */
@media (max-width: 600px) { .aw { max-width: calc(100vw - 24px); } }

/* Assistente AI: intestazione con azioni, conversazione più leggibile, a tutto schermo su telefono */
.aw-panel { width: min(440px, calc(100vw - 24px)); height: min(680px, calc(100vh - 100px)); }
.aw-head { padding: 12px 10px 12px 14px; gap: 10px; }
.aw-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255, 255, 255, .14); flex: none; }
.aw-title { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.aw-title small { font-size: 11.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aw-head .aw-new { color: rgba(255, 255, 255, .8); }
.aw-head .aw-new:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.aw-head .aw-new .icon { color: inherit; width: 16px; height: 16px; }
.as-log { scroll-behavior: smooth; padding: 16px 14px; gap: 14px; }
.as-bubble { overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.as-bubble code { background: rgba(16, 24, 40, .07); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
.as-msg.user .as-bubble code { background: rgba(255, 255, 255, .2); }
.as-h { font: 700 14px var(--font-head); color: var(--blue-dark); margin: 6px 0 4px !important; }
.as-table { overflow-x: auto; margin: 6px 0; }
.as-table table { border-collapse: collapse; font-size: 12.5px; min-width: 100%; }
.as-table th, .as-table td { border-bottom: 1px solid var(--border); padding: 5px 8px; text-align: left; white-space: nowrap; }
.as-table th { font-weight: 700; color: var(--gray); }
.as-welcome { padding: 8px 0; }
.as-welcome .icon { width: 36px; height: 36px; padding: 10px; box-sizing: content-box; border-radius: 16px; background: #fff4de; }
.as-suggest { padding: 10px 12px 2px; max-height: 132px; overflow-y: auto; }
.as-suggest button { text-align: left; line-height: 1.35; }
.as-compose { position: relative; padding: 10px 12px 4px; background: var(--surface); }
.as-compose textarea { line-height: 1.4; }
.as-note { padding: 2px 12px 10px; }
@media (max-width: 600px) {
  .aw { right: 0; bottom: 0; left: 0; align-items: stretch; }
  .aw:not(.open) { left: auto; right: 12px; bottom: 12px; }
  .aw.open .aw-launcher { display: none; }
  .aw-panel { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; }
  .aw-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .as-compose textarea { font-size: 16px; }
  .as-compose { padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
  .as-bubble { max-width: 92%; }
  .demo-mode #toasts { bottom: 24px; }
}
.doc-preview { padding: 4px 4px 0; }
.doc-preview .doc-read { box-shadow: none; border: 0; padding: 0; margin: 0; max-width: none; }
.doc-preview + .actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 4px; justify-content: flex-end; }
td.row-actions .icon-btn { display: inline-grid; }
/* Documenti: le azioni restano sempre visibili anche quando la tabella scorre */
.table td.row-actions.doc-actions, .table th.row-actions { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
.sidebar-foot-link[hidden] { display: none; }
.pwa-steps { margin: 12px 0; padding-left: 22px; display: grid; gap: 8px; }
.pwa-steps .icon { width: 16px; height: 16px; vertical-align: -3px; }
/* App installata: niente rimbalzo di scorrimento e tocchi senza ritardo né evidenziazione */
@media (display-mode: standalone) { html, body { overscroll-behavior-y: none; } }
html { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Scelta delle attività standard nei servizi e nei preventivi */
.act-pick { max-height: min(52vh, 460px); overflow-y: auto; margin: 12px 0; display: grid; gap: 10px; }
.act-pick-group { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.act-pick-group legend { padding: 0 6px; font: 700 12px var(--font-head); letter-spacing: .4px; text-transform: uppercase; color: var(--gray); }
.act-pick-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.act-pick-item.is-added { opacity: .55; cursor: default; }
.act-pick-item input { margin-top: 3px; flex: none; }
.act-pick-item .block { display: block; }
/* Impostazioni: profilo, team e guida incorporati (il titolo è già nell'intestazione della scheda) */
.settings-embed .page-head h1, .settings-embed .page-head .eyebrow { display: none; }
.settings-embed .page-head:not(:has(.btn, p)) { display: none; }
.settings-embed .page-head { margin-top: 0; }
.settings-embed > .back { display: none; }
/* Risultati: i numeri grandi (fatturato, visite, milioni) non sfasano più le schede */
.res-grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.res-card, .res-plan, .res-flow > * { min-width: 0; }
.res-flow { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.2fr) auto minmax(0, 1fr); }
.res-flow strong { font-size: clamp(12.5px, 1.3vw + 6px, 17px); overflow-wrap: anywhere; line-height: 1.2; }
.res-now strong { font-size: clamp(15px, 1.6vw + 7px, 21px); }
.res-flow small, .res-flow-label { overflow-wrap: anywhere; }
@media (max-width: 700px) { .res-flow { grid-template-columns: 1fr; } .res-flow .res-arrow { transform: rotate(90deg); justify-self: center; } }
.funnel-bar-empty { background: repeating-linear-gradient(135deg, #eef1f6 0 8px, #f7f9fc 8px 16px); color: var(--gray); border: 1px dashed var(--border-strong); }
.funnel-bar-empty span { font-size: 12.5px; font-weight: 600; }
.funnel-method { margin-top: 6px; }
/* Guide e glossario: strumenti dell'admin */
.guide-admin { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.gl-edit { vertical-align: middle; }
.ge-section { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; display: grid; gap: 8px; min-width: 0; }
.ge-head { display: flex; gap: 6px; align-items: center; }
.ge-head .input { flex: 1; min-width: 0; }
.ge-opts { display: flex; gap: 16px; flex-wrap: wrap; }

/* Piè di pagina dei documenti: ragione sociale e contatti con icona */
.doc-foot { display: grid; gap: 6px; justify-items: center; }
.doc-foot strong { color: var(--gray); font-weight: 700; }
.doc-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; }
.doc-foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); text-decoration: none; }
.doc-foot-links a:hover { text-decoration: underline; }
.doc-foot-links .icon { width: 14px; height: 14px; }
/* Risultati: la riga di avanzamento va a capo invece di uscire dalla scheda */
.res-progress { flex-wrap: wrap; row-gap: 4px; }
.res-progress > span { min-width: 0; overflow-wrap: anywhere; }
.res-progress .meter { min-width: 120px; }

/* Preventivo: intestazione dell'introduzione con il pulsante AI in alto a destra; date dei lavori */
.field-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.quote-dates .actions { align-items: flex-start; }
.quote-dates .muted.small { flex: 1 1 260px; min-width: 0; }
.quote-preview .doc-read { box-shadow: none; border: 0; padding: 0; margin: 0; max-width: none; }
.quote-preview-actions { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 4px; justify-content: flex-end; }

/* Preventivo: fornitore / cliente / oggetto, voci con attività leggibili e importo in evidenza, firma con timbro */
.quote-parties { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.quote-party { background: var(--blue-lighter, #f2f6fc); border-radius: 12px; padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.quote-party p { margin: 2px 0 0; font-size: 13.5px; }
.quote-party .eyebrow { margin: 0 0 4px; }
.quote-party a { color: var(--blue); }
.qitems { margin-top: 22px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.qitems-head { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 20px; padding: 10px 20px; background: var(--blue-lighter, #f2f6fc); font: 700 12px var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--gray); }
.qitems-head span:last-child { text-align: right; }
.qitem { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 20px; padding: 18px 20px; border-top: 1px solid var(--border); break-inside: avoid; }
.qitems-head + .qitem { border-top: 0; }
.qitem h3 { margin: 0 0 4px; font-size: 16.5px; }
.qitem .item-details { margin: 0 0 10px; font-size: 13.5px; color: var(--gray); }
.qitem-price { text-align: right; align-self: start; }
.qitem-amount { display: block; font: 800 20px var(--font-head); color: var(--blue); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qitem-calc { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.qitem-acts-title { margin: 12px 0 6px; font: 700 12px var(--font-head); letter-spacing: .4px; text-transform: uppercase; color: var(--gray); }
.qitem-acts { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.qitem-acts li { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; break-inside: avoid; font-size: 13.5px; }
.qitem-acts li > span:last-child { min-width: 0; }
.qitem-acts strong { font-weight: 600; display: block; }
.qitem-acts small { display: block; color: var(--gray); font-size: 12.5px; line-height: 1.4; }
.qitem-check { flex: none; width: 18px; height: 18px; border-radius: 50%; background: #e3f5ec; color: var(--green); display: grid; place-items: center; margin-top: 1px; }
.qitem-check .icon { width: 11px; height: 11px; stroke-width: 2.6; }
.quote-demo { display: flex; align-items: center; gap: 14px; margin-top: 24px; padding: 14px 16px; border: 1px dashed var(--blue); border-radius: 12px; background: var(--blue-lighter, #f2f6fc); }
.quote-demo p { margin: 2px 0 0; font-size: 13px; color: var(--gray); }
.quote-demo > div { flex: 1; min-width: 0; }
.quote-demo-icon { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--blue); flex: none; }
.studio-sign { align-items: stretch; margin-top: 30px; }
.studio-sign-body { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.studio-sign-sig { display: flex; flex-direction: column; gap: 2px; min-width: 200px; }
.studio-sign-blank { display: block; width: 220px; height: 60px; border-bottom: 1px solid var(--border-strong); margin-bottom: 4px; }
.studio-stamp { width: 220px; max-width: 100%; height: auto; transform: rotate(-3deg); opacity: .92; }
@media (max-width: 900px) {
  .quote-parties { grid-template-columns: 1fr; }
  .qitems-head { display: none; }
  .qitem { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .qitem-price { display: flex; justify-content: space-between; align-items: baseline; text-align: left; border-top: 1px dashed var(--border); padding-top: 8px; }
  .qitem-acts { columns: 1; }
  .quote-demo { flex-wrap: wrap; }
}
@media print { .quote-demo { display: none !important; } .qitem-acts { columns: 2; } }
/* Documenti di esempio (pagina pubblica) */
.public-demo { max-width: 980px; margin: 0 auto; padding: 24px 20px 60px; display: grid; gap: 16px; }
.public-demo-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.public-demo-head img { height: 40px; width: auto; }
.public-demo-head h1 { margin: 0; }
.demo-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.demo-doc-card { text-align: left; display: grid; gap: 8px; align-content: start; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; font: inherit; }
.demo-doc-card:hover, .demo-doc-card:focus-visible { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.demo-doc-card strong { font-size: 15.5px; }
.demo-doc-go { color: var(--blue); font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.demo-note { text-align: center; }
/* Editor dei campi di testo */
.rte { display: grid; gap: 0; min-width: 0; border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--surface); overflow: hidden; }
.rte:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 120, 214, .15); }
.rte > textarea.input { border: 0; border-radius: 0; box-shadow: none; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px; background: var(--blue-lighter, #f2f6fc); border-bottom: 1px solid var(--border); }
.rte-btn { border: 0; background: none; border-radius: 6px; min-width: 30px; height: 28px; padding: 0 8px; font: 600 13px var(--font-body, inherit); color: var(--gray); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.rte-btn:hover, .rte-btn[aria-pressed="true"] { background: #e3ebf7; color: var(--blue); }
.rte-btn .icon { width: 14px; height: 14px; }
.md-h { margin: 8px 0 4px; font: 700 14px var(--font-head); color: var(--blue-dark, var(--blue)); }
.quote-read .qitem-acts { padding: 0; margin: 0; list-style: none; }
.quote-read .qitem-acts li { margin: 0; }
.quote-read .quote-party p { margin: 2px 0 0; line-height: 1.4; }
.quote-read .quote-party strong { display: block; line-height: 1.3; }
.quote-read .qitem h3 { font-family: var(--font-head); }
.sheet .quote-head, .sheet .doc-head { padding-right: 36px; }

/* Loghi di piattaforme e social */
.brand-ico { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; flex: none; }
.brand-ico + .brand-ico { margin-left: -2px; }
.brand-lg { width: 26px; height: 26px; vertical-align: -7px; }

/* Documenti: indicatori in evidenza e test di visibilità nelle risposte AI */
.doc-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.doc-fact { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--border); border-top: 4px solid var(--border-strong); background: #fff; }
.doc-fact strong { font: 800 22px var(--font-head); line-height: 1.15; }
.doc-fact .fact-label { font-weight: 600; font-size: 13.5px; }
.doc-fact small { color: var(--gray); font-size: 12.5px; }
.fact-tone { font: 700 11px var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--gray); }
.doc-fact.fact-ok { border-top-color: var(--green); } .doc-fact.fact-ok .fact-tone { color: var(--green); }
.doc-fact.fact-warn { border-top-color: #eda100; } .doc-fact.fact-warn .fact-tone { color: #a86f00; }
.doc-fact.fact-bad { border-top-color: #e34948; } .doc-fact.fact-bad .fact-tone { color: #c0302f; }
.geo-summary { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: #f4f7fb; border-left: 4px solid var(--border-strong); margin-bottom: 12px; }
.geo-summary strong { font: 800 24px var(--font-head); }
.geo-summary.fact-ok { border-left-color: var(--green); } .geo-summary.fact-warn { border-left-color: #eda100; } .geo-summary.fact-bad { border-left-color: #e34948; }
.geo-engine { text-align: center; white-space: nowrap; }
.geo-engine span { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; }
.geo-engine .brand-ico { margin: 0; }
.geo-cell { text-align: center; }
.geo-yes, .geo-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-weight: 800; }
.geo-yes { background: #e3f5ec; color: var(--green); } .geo-no { background: #f1f3f6; color: var(--muted); }

/* Documenti: testo impaginato a schede, raccomandazioni come passi, introduzione in evidenza */
.doc-lead { font-size: 16px; line-height: 1.6; color: var(--text); margin: 0 0 14px; }
.doc-lead p { margin: 0 0 8px; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 6px 0 16px; }
.doc-card { border: 1px solid var(--border); border-top: 4px solid var(--border-strong); border-radius: 12px; padding: 14px 16px; background: #fff; break-inside: avoid; }
.doc-card h3 { margin: 0 0 8px; font-size: 14px; letter-spacing: .2px; }
.doc-card p, .doc-card li { font-size: 13.5px; line-height: 1.5; }
.doc-card ul, .doc-card ol { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.doc-card p { margin: 0 0 6px; }
.doc-card-good { border-top-color: var(--green); background: #f6fcf9; } .doc-card-good h3 { color: #12805a; }
.doc-card-warn { border-top-color: #eda100; background: #fffaf0; } .doc-card-warn h3 { color: #a86f00; }
.doc-card-info { border-top-color: var(--blue); background: #f5f9ff; } .doc-card-info h3 { color: var(--blue); }
.doc-recs { margin: 16px 0 6px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(135deg, #eaf2fd, #f5f9ff); border: 1px solid #c9dcf5; break-inside: avoid; }
.doc-recs h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--blue); }
.doc-recs ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc-recs li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.doc-rec-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font: 700 12px var(--font-head); display: grid; place-items: center; margin-top: 1px; }
.num-hl { font-weight: 800; color: var(--blue); white-space: nowrap; }
.doc-brands { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: middle; } .doc-brands .brand-ico { margin: 0; }
.doc-foot-logo { height: 40px; width: auto; max-width: 260px; object-fit: contain; }
.quote-read .quote-id strong { color: var(--text); }
.studio-stamp { width: 250px; }

/* Preventivo: box Oggetto con le date, documento che si riceve per servizio, firme di studio e cliente */
.quote-party .quote-rep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.quote-party .quote-rep strong { display: inline; }
.quote-dates-list { display: grid; gap: 4px; margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--border); }
.quote-dates-list div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.quote-dates-list dt { color: var(--gray); }
.quote-dates-list dd { margin: 0; font-weight: 700; text-align: right; }
.qitem-deliver { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px 16px; background: linear-gradient(135deg, #eaf2fd, #f5f9ff); border: 1px solid #c9dcf5; border-left: 4px solid var(--blue); border-radius: 12px; break-inside: avoid; }
.qitem-deliver-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; background: #fff; display: grid; place-items: center; color: var(--blue); }
.qitem-deliver-body { flex: 1; min-width: 0; }
.qitem-deliver-body .eyebrow { margin: 0 0 2px; }
.qitem-deliver-body strong { display: block; font-size: 15px; }
.qitem-deliver-body p:last-child { margin: 3px 0 0; font-size: 13px; color: var(--gray); }
.quote-signs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; break-inside: avoid; }
.quote-signs .studio-sign, .quote-signs .client-sign { margin-top: 0; }
.client-sign { display: flex; flex-direction: column; gap: 2px; }
.client-sign-body { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.client-sign-name { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 24px; color: #1d4f9c; line-height: 1.3; }
@media (max-width: 720px) {
  .quote-signs { grid-template-columns: 1fr; }
  .qitem-deliver { flex-wrap: wrap; }
}
@media print { .qitem-deliver .btn { display: none !important; } }
.qitem .item-details p { margin: 0 0 6px; }
.info-row dt { color: var(--gray); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.info-row:has(.plain-list) { grid-template-columns: 90px 1fr; }
.quote-dates-list dt { white-space: nowrap; }
.qitem-deliver { width: 100%; box-sizing: border-box; flex-wrap: wrap; }
.qitem-deliver-body { flex: 1 1 240px; }
.qitem-deliver-body .eyebrow { white-space: normal; letter-spacing: .6px; }
.qitem-acts strong strong, .qitem-acts small strong { display: inline; }
.quote-dates-list div { flex-wrap: wrap; }
.quote-dates-list dd { white-space: nowrap; }

/* Codice del preventivo come etichetta in elenchi e dashboard */
.quote-code { display: inline-block; padding: 1px 8px; margin-right: 4px; border-radius: 6px; background: #eaf2fd; color: var(--blue); font: 700 12px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .3px; white-space: nowrap; }

/* Preventivo: layout rinnovato — intestazione, riepilogo «In breve», servizi numerati, totali in evidenza */
.quote-read { --qr-shadow: 0 1px 2px rgba(16, 42, 84, .06), 0 6px 18px rgba(16, 42, 84, .05); }
.quote-read .quote-head { align-items: center; padding-bottom: 18px; border-bottom: 3px solid var(--blue); margin-bottom: 22px; }
.quote-read .quote-id { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.quote-read .quote-id h1 { margin: 0; }
.quote-code-lg { font-size: 22px; padding: 4px 14px; border-radius: 10px; background: var(--blue); color: #fff; letter-spacing: 1px; }
.quote-read .quote-parties { gap: 14px; }
.quote-read .quote-party { background: #fff; border: 1px solid var(--border); box-shadow: var(--qr-shadow); border-radius: 14px; padding: 16px 18px; }
.quote-read .quote-party .eyebrow { display: inline-block; padding-bottom: 6px; margin-bottom: 8px; border-bottom: 2px solid var(--blue); }
.quote-read .quote-subject { background: linear-gradient(180deg, #f5f9ff, #fff); }
.quote-glance { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 8px; }
.glance-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: #fff; box-shadow: var(--qr-shadow); min-width: 0; }
.glance-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: #eaf2fd; color: var(--blue); display: grid; place-items: center; }
.glance-ico .icon { width: 18px; height: 18px; }
.glance-tile > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.glance-label { font: 700 11px var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--gray); }
.glance-tile strong { font: 800 18px var(--font-head); line-height: 1.2; overflow-wrap: anywhere; }
.glance-tile small { color: var(--gray); font-size: 12.5px; }
.glance-main { background: var(--blue); border-color: var(--blue); }
.glance-main .glance-ico { background: rgba(255, 255, 255, .18); color: #fff; }
.glance-main .glance-label, .glance-main small { color: rgba(255, 255, 255, .8); }
.glance-main strong { color: #fff; font-size: 22px; }
.glance-warn { border-color: #eda100; background: #fffaf0; }
.glance-warn small { color: #a86f00; font-weight: 700; }
.quote-read .prose { margin-top: 18px; font-size: 15.5px; line-height: 1.65; }
.quote-read .qitems { border: 0; overflow: visible; display: grid; gap: 14px; margin-top: 24px; }
.quote-read .qitems-head { background: none; padding: 0 4px; }
.quote-read .qitem { border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--qr-shadow); background: #fff; padding: 20px 22px; }
.quote-read .qitem h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.qitem-n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font: 800 13px var(--font-head); display: grid; place-items: center; }
.quote-read .qitem-price { padding-left: 18px; border-left: 1px dashed var(--border-strong); }
.quote-read .qitem-acts-wrap { background: #f8fafc; border-radius: 12px; padding: 4px 16px 10px; margin-top: 12px; }
.quote-read .totals { margin-left: auto; margin-top: 18px; min-width: 320px; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--qr-shadow); padding: 8px 18px; }
.quote-read .totals-grand td { font: 800 20px var(--font-head); color: var(--blue); }
.quote-read .terms { margin-top: 26px; padding: 18px 22px; background: #f8fafc; border-radius: 14px; border: 1px solid var(--border); }
.quote-read .terms h2 { font-size: 15px; letter-spacing: .4px; text-transform: uppercase; color: var(--blue); margin-top: 0; }
.quote-read .terms p, .quote-read .terms li { font-size: 13.5px; line-height: 1.6; }
/* «In breve» delle condizioni: sempre a vista, sopra il testo completo richiudibile */
.quote-read .terms-brief { margin: 4px 0 14px; padding: 12px 16px; background: var(--card, #fff); border: 1px solid var(--border); border-left: 3px solid var(--blue); border-radius: 10px; }
.quote-read .terms-brief h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .3px; text-transform: uppercase; color: var(--blue); }
.quote-read .terms-brief ul { margin: 0; padding-left: 18px; }
.quote-read .terms-brief li { margin: 3px 0; color: var(--text, inherit); }
.quote-read .terms-brief p { margin: 8px 0 0; }
.quote-read .quote-signs { padding: 18px 22px; border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--qr-shadow); background: #fff; }
@media (max-width: 900px) { .quote-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .quote-read .quote-id { align-items: flex-start; }
  .quote-read .qitem-price { border-left: 0; padding-left: 0; text-align: left; }
  .quote-read .totals { min-width: 0; max-width: none; }
}
@media (max-width: 480px) { .quote-glance { grid-template-columns: 1fr; } }
@media print {
  .quote-read .quote-party, .glance-tile, .quote-read .qitem, .quote-read .totals, .quote-read .quote-signs { box-shadow: none; }
  .glance-main { background: #fff; border-color: var(--blue); } .glance-main strong, .glance-main .glance-label, .glance-main small { color: var(--blue); }
  .quote-code-lg { background: none; color: var(--blue); border: 1px solid var(--blue); }
}
.quote-read .quote-parties { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.quote-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1500px) { .quote-glance { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 480px) { .quote-glance { grid-template-columns: 1fr; } }
.glance-tile strong { white-space: nowrap; overflow-wrap: normal; }
.quote-dates-list div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.quote-read .quote-subject { grid-column: 1 / -1; }
/* Tempi del preventivo: una riga per fase (lavori, test, servizi ricorrenti) con l'intervallo e una nota */
.quote-phases { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.quote-phases li { position: relative; padding: 8px 12px 8px 14px; border-radius: 10px; background: var(--card, #fff); border: 1px solid var(--border); border-left: 3px solid var(--blue); display: grid; gap: 2px; }
.quote-phases .qp-label { font-size: 11.5px; letter-spacing: .3px; text-transform: uppercase; color: var(--gray); }
.quote-phases strong { font-size: 14px; }
.quote-phases small { color: var(--gray); font-size: 12px; }
.quote-read .quote-dates-list { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; }
.quote-read .quote-dates-list div { display: flex; flex-direction: column; gap: 0; }
.quote-read .quote-dates-list dd { text-align: left; font-size: 14.5px; }
.quote-read .table-wrap { overflow-x: auto; }

/* Correzioni di visualizzazione: buyer persona, riquadri stretti (finestre), totali del preventivo */
.st-persona .st-block h4 { font-size: 11.5px; letter-spacing: .08em; margin: 0 0 6px; }
.st-cols3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.st-personas { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.st-persona li, .st-persona p { overflow-wrap: anywhere; }
.quote-read { container-type: inline-size; }
.quote-read .totals { border-collapse: separate; border-spacing: 0; overflow: hidden; }
.quote-read .qitem { display: block; }
.qitem-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.qitem-head h3 { margin: 0; flex: 1; min-width: 0; }
.quote-read .qitem-head .qitem-price { border-left: 0; padding-left: 0; text-align: right; flex: none; }
.qitem-body { margin-top: 6px; }
/* Descrizione del servizio sempre a vista sotto il titolo, allineata al testo del titolo (dopo il numero) */
.quote-read .qitem-desc { margin: 8px 0 0 38px; }
.quote-read .qitem > .qitem-incl, .quote-read .qitem > .incl-list { margin-left: 38px; }
@container (max-width: 640px) { .quote-read .qitem-desc, .quote-read .qitem > .qitem-incl, .quote-read .qitem > .incl-list { margin-left: 0; } }
.quote-read .qitem-acts { columns: 2; }
@container (max-width: 640px) { .quote-read .qitem-acts { columns: 1; } .qitem-head { flex-direction: column; gap: 6px; } .quote-read .qitem-head .qitem-price { text-align: left; } }
@media (min-width: 1500px) { .quote-glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 900px) { .quote-glance { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (max-width: 480px) { .quote-glance { grid-template-columns: 1fr; } }
.quote-read .totals { width: auto; display: table; margin-left: auto; }
.quote-read .totals-wrap { margin: 18px 0 0 auto; width: min(100%, 400px); background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--qr-shadow); padding: 8px 18px; }
.quote-read .totals-wrap .totals { display: table; width: 100%; min-width: 0; max-width: none; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; border-radius: 0; }

/* Consulenza di marketing: sessioni della voce e tabella dei prezzi */
.item-sessions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; padding: 8px 12px; background: #eaf2fd; border-radius: 10px; }
.item-sessions .field-inline { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.item-sessions input { width: 80px; }
.budget-packs { margin-top: 14px; }
.budget-packs h3 { margin: 0 0 4px; font-size: 15px; }

/* Consulenze di marketing (area del cliente e scheda del preventivo) */
.cons-group { margin-top: 24px; }
.cons-progress { height: 6px; background: #e8eef7; border-radius: 99px; overflow: hidden; margin: 6px 0 14px; }
.cons-progress span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.cons-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cons-card { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.cons-card header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cons-card h3 { margin: 0; font-size: 16px; }
.cons-card.cons-da_fissare { border-left-color: #eda100; } .cons-card.cons-proposta { border-left-color: var(--blue); }
.cons-card.cons-prenotata { border-left-color: var(--green); } .cons-card.cons-svolta { opacity: .92; }
.cons-when { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.cons-actions, .cons-slots { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cons-summary { background: #f8fafc; border-radius: 10px; padding: 10px 14px; }
.cons-summary h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--blue); }

/* Verifica generale: cifre grandi che non vanno mai tagliate nei riquadri stretti, bersagli più comodi da toccare */
.stat { min-width: 0; }
.stat-value { overflow-wrap: anywhere; line-height: 1.15; }
@media (max-width: 480px) { .stat-value { font-size: clamp(19px, 6.4vw, 24px); } }
@media (hover: none) and (max-width: 900px) {
  .btn-sm { min-height: 38px; }
  .icon-btn { min-width: 38px; min-height: 38px; }
  .input-sm, select.input-sm { min-height: 38px; }
  .chip, .seg button { min-height: 36px; }
}
code, .mono { overflow-wrap: anywhere; }

/* Calendario: viste, mese/settimana/elenco, impegni per tipo */
.cal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 4px 0 14px; background: #eef2f8; border-radius: 14px; scrollbar-width: none; }
.cal-tabs::-webkit-scrollbar { display: none; }
.cal-tabs button { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 16px; border: 0; background: transparent; border-radius: 10px; font: 700 14px var(--font-head); color: var(--gray); cursor: pointer; white-space: nowrap; }
.cal-tabs button .icon { width: 16px; height: 16px; }
.cal-tabs button[aria-selected=true] { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(16, 42, 84, .14); }
.cal-count { min-width: 20px; padding: 1px 6px; border-radius: 99px; background: #dde6f3; color: var(--text); font: 700 11px var(--font-head); text-align: center; }
.cal-tabs button[aria-selected=true] .cal-count { background: var(--blue); color: #fff; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--blue)); flex: none; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-toolbar .month-nav { display: flex; align-items: center; gap: 4px; }
.cal-label { min-width: 150px; text-align: center; text-transform: capitalize; font: 800 17px var(--font-head); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cal-filter { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1.5px solid var(--border-strong); border-radius: 99px; background: #fff; font: 600 13px var(--font-body, inherit); cursor: pointer; }
.cal-filter.off { opacity: .45; background: #f4f6fa; }
.cal-hint { margin: 0 0 12px; }
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #fff; }
.cal-wd { padding: 8px 6px; text-align: center; font: 700 11px var(--font-head); letter-spacing: .6px; text-transform: uppercase; color: var(--gray); background: #f6f8fc; border-bottom: 1px solid var(--border); }
.cal-day { min-height: 118px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); cursor: pointer; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: #fafbfd; } .cal-day.other .cal-day-head span:first-child { color: var(--muted); }
.cal-day:hover { background: #f5f9ff; }
.cal-day.selected { outline: 2px solid var(--blue); outline-offset: -2px; background: #f5f9ff; }
.cal-day-head { display: flex; justify-content: space-between; align-items: center; font: 700 13px var(--font-head); }
.cal-day.today .cal-day-head span:first-child { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; }
.cal-day-n { display: none; font-size: 11px; color: var(--gray); }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; gap: 5px; align-items: baseline; width: 100%; padding: 2px 6px; border: 0; border-left: 3px solid var(--tc, var(--blue)); border-radius: 4px; background: color-mix(in srgb, var(--tc, var(--blue)) 12%, #fff); font-size: 12px; text-align: left; cursor: pointer; min-width: 0; overflow: hidden; }
.cal-chip-t { font-weight: 700; color: var(--gray); flex: none; }
.cal-chip-x { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-meeting { --tc: #2a78d6; } .t-task { --tc: #1baf7a; } .t-editoriale { --tc: #e87ba4; } .t-scadenza { --tc: #eda100; }
.cal-chip.is-done, .cal-row.is-done { opacity: .55; text-decoration: line-through; }
.cal-more { border: 0; background: none; color: var(--blue); font: 700 12px var(--font-head); cursor: pointer; text-align: left; padding: 2px 4px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cal-grid.is-week .cal-day { min-height: 260px; }
.cal-side { position: sticky; top: 76px; }
.cal-side-sub { margin: 16px 0 6px; font: 700 12px var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--gray); }
.cal-list { list-style: none; margin: 0; padding: 0; display: grid; }
.cal-list.card { padding: 4px; }
.cal-row { display: grid; grid-template-columns: 62px 34px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; width: 100%; padding: 10px 8px; border: 0; border-radius: 10px; background: none; text-align: left; cursor: pointer; }
.cal-row:hover { background: #f5f9ff; }
.cal-row-time { font: 700 12px var(--font-head); color: var(--gray); display: flex; flex-direction: column; }
.cal-row-time b { color: var(--text); font-size: 12px; }
.cal-row-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.cal-row-ico .icon { width: 17px; height: 17px; }
.cal-row-main { min-width: 0; display: flex; flex-direction: column; }
.cal-row-main strong { font-size: 14px; overflow-wrap: anywhere; }
.cal-row-main small { color: var(--gray); font-size: 12.5px; }
.cal-none { margin: 4px 0; }
.cal-daygroup { margin-top: 16px; } .cal-daygroup.today .group-title { color: var(--blue); }
.cal-detail h2 { margin: 4px 0 12px; font-size: 20px; }
.cal-detail .eyebrow { display: flex; align-items: center; gap: 6px; }
.cal-detail .eyebrow .icon { width: 15px; height: 15px; }
@media (max-width: 900px) { .cal-layout { grid-template-columns: 1fr; } .cal-side { position: static; } }
@media (max-width: 720px) {
  .cal-label { min-width: 0; font-size: 16px; }
  .cal-day { min-height: 56px; align-items: center; padding: 4px 2px; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; justify-content: center; }
  .cal-grid.is-week .cal-day { min-height: 70px; }
  .cal-row { grid-template-columns: 52px 30px minmax(0, 1fr); }
  .cal-row .badge, .cal-row .cal-meet { grid-column: 3; justify-self: start; }
  .cal-toolbar select { flex: 1 1 140px; }
}
/* Pannello laterale del giorno: riga compatta (orario, icona, testo) con i dettagli sotto il titolo */
.cal-side .cal-row { grid-template-columns: 52px 30px minmax(0, 1fr); }
.cal-side .cal-row .badge, .cal-side .cal-row .cal-meet { grid-column: 3; justify-self: start; }

/* Contenuti → Live → Registrazioni */
.live-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cover-edit .field-hint { max-width: 420px; }

/* Accessi dell'azienda: richiesta di cancellazione dell'account */
.deletion-row { display: flex; gap: 10px 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 14px 12px; padding: 10px 12px; background: var(--bad-bg, #fdecec); border: 1px solid #f2c9c9; border-radius: 10px; }
.deletion-row p { margin: 0; flex: 1 1 320px; }
.deletion-row .icon { width: 16px; height: 16px; vertical-align: -3px; color: var(--red); }
/* Password temporanea consegnata a mano (email non inviata) */
.big-code { display: inline-block; padding: 8px 14px; font: 700 20px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; background: var(--blue-light); color: var(--blue-dark); border-radius: 8px; user-select: all; }
/* Anagrafica: sito web con AI, verifica dell'indirizzo con Google */
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline .input { flex: 1; min-width: 0; }
.field-inline .btn, .field-inline .ai-btn { flex: none; }
.input.flash { animation: field-flash 1.5s ease; }
@keyframes field-flash { 0%, 40% { background: #fff6d6; } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .input.flash { animation: none; background: #fff6d6; } }
.ai-check { padding: 14px 16px; background: #f7faff; border: 1px solid var(--blue-light); box-shadow: none; }
.ai-check header { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-bottom: 4px; }
.ai-check header .btn { margin-left: auto; }
.ai-check .actions { margin-top: 10px; }
.ai-check-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.ai-check-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto auto; gap: 8px 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.ai-check-list li:first-child { border-top: 0; }
.ai-check-label { color: var(--gray); font: 600 12px var(--font-head); text-transform: uppercase; letter-spacing: .03em; }
.ai-check-values { overflow-wrap: anywhere; }
.form-warn { color: var(--amber-dark); }
@media (max-width: 720px) {
  .ai-check-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .ai-check-label { grid-column: 1 / -1; }
  .field-inline { flex-wrap: wrap; }
}

/* Sito web: traffico e canali */
.web-controls { display: grid; gap: 10px; margin-bottom: 18px; padding: 14px 16px; }
.web-ctl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.web-ctl > .small { min-width: 96px; }
.web-custom { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.web-custom[hidden] { display: none; }
.web-ctl .seg { flex-wrap: wrap; flex-shrink: 1; max-width: 100%; border-radius: 16px; }
.web-ctl select { max-width: 100%; }
.web-controls { min-width: 0; }
.web-custom label { display: inline-flex; gap: 6px; align-items: center; }
.web-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.web-kpi { gap: 4px; padding: 16px; }
.web-kpi-v { font: 700 26px/1.1 var(--font-head); color: var(--blue-dark); }
.web-kpi-sub { font-size: 13px; }
.web-kpi-v .small { font-size: 12px; font-weight: 500; }
.web-delta { font-weight: 700; }
.web-delta.up { color: var(--green); }
.web-delta.down { color: var(--red); }
.web-share { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin: 4px 0 14px; background: var(--blue-lighter); }
.web-share span { min-width: 3px; }
.web-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.web-table td { vertical-align: top; }
.web-table .badge { white-space: normal; text-align: left; line-height: 1.3; }
.web-table td:last-child { min-width: 200px; }
.web-bars { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.web-bars li { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.web-bar { height: 10px; border-radius: 5px; background: var(--blue-lighter); overflow: hidden; }
.web-bar i { display: block; height: 100%; background: #2a78d6; border-radius: 5px; }
.web-snippet { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--blue-lighter); border-radius: 10px; margin-bottom: 12px; }
.web-snippet code { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.web-notes { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.web-method summary { cursor: pointer; }
.web-method ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.web-kpis + .card, .web-method, #web-install, #web-body > .card, #web-body > .cols { margin-bottom: 18px; }
@media (max-width: 720px) {
  .web-bars li { grid-template-columns: 1fr auto; }
  .web-bars .web-bar { grid-column: 1 / -1; order: 3; }
  .web-kpi-v { font-size: 22px; }
}
/* Automazioni */
.auto-table .auto-cat td { background: var(--blue-lighter); border-top: 2px solid var(--border); }
.auto-table .auto-kind td { font-size: 13px; color: var(--gray); padding-top: 6px; padding-bottom: 6px; }
.auto-table .auto-kind td:first-child { padding-left: 28px; }
.auto-range { align-self: flex-end; }
.auto-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 18px; }
.auto-kpi { gap: 4px; padding: 16px; }
.auto-kpi-v { font: 700 24px/1.15 var(--font-head); color: var(--blue-dark); }
.auto-kpi-v .small { font-size: 12px; font-weight: 500; }
.auto-kpi-sub { font-size: 13px; }
.auto-t td { vertical-align: top; }
.auto-method summary { cursor: pointer; }
.auto-method ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
#auto-body > .card, #auto-body > .auto-kpis + .card, .auto-method { margin-bottom: 18px; }

/* Ottimizzazione dei contenuti: SEO, GEO, AIO */
.seo-ai-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 10px 0; }
.seo-ai-row > span { flex: 1 1 260px; min-width: 0; }
.seo-ai-result { margin-bottom: 14px; }
.seo-report { border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--blue-lighter); display: grid; gap: 10px; }
.seo-top { display: grid; grid-template-columns: auto 1fr; gap: 14px 22px; align-items: center; margin-bottom: 6px; }
.seo-top > p { grid-column: 1 / -1; margin: 0; }
.seo-score { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.seo-score strong { font: 800 40px/1 var(--font-head); color: var(--blue-dark); }
.seo-score span { color: var(--gray); font-weight: 700; }
.seo-score .badge { margin-left: 8px; align-self: center; }
.seo-bars { display: grid; gap: 6px; min-width: 0; }
.seo-bar { display: grid; grid-template-columns: minmax(110px, 190px) 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.seo-bar-t { height: 9px; border-radius: 5px; background: var(--border); overflow: hidden; }
.seo-bar-t i { display: block; height: 100%; background: #2a78d6; border-radius: 5px; }
.seo-bar b { text-align: right; }
.seo-summary { margin: 0; line-height: 1.55; }
.seo-prio, .seo-issues, .seo-list, .seo-sug, .seo-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.seo-list { list-style: disc; padding-left: 18px; }
.seo-mini { gap: 2px; font-size: 13px; }
.seo-prio li, .seo-issues li { line-height: 1.45; }
.seo-sug li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.seo-sug li > div { min-width: 0; }
.seo-sug-v { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.seo-checks summary { cursor: pointer; }
#web-optimization .seo-top { margin-bottom: 14px; }
@media (max-width: 720px) {
  .seo-top { grid-template-columns: 1fr; }
  .seo-bar { grid-template-columns: minmax(90px, 140px) 1fr 30px; }
}
.seo-side { display: grid; gap: 10px; }
.seo-card { display: grid; gap: 10px; }
.seo-card .seo-score strong { font-size: 34px; }
.seo-card-h { margin: 2px 0 0; }
.seo-card-ai { margin: 0; }
.seo-side .seo-bar { grid-template-columns: 52px 1fr 30px; }
.seo-h4 { margin: 10px 0 4px; font: 700 13px var(--font-head); color: var(--blue-dark); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seo-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.seo-checklist li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; line-height: 1.4; }
.seo-checklist li > span { font-weight: 800; }
.seo-checklist li.ok > span { color: var(--green); }
.seo-checklist li.ko > span { color: var(--red); }
.seo-busy { margin-top: 12px; }
.seo-report section { display: grid; gap: 6px; }
.sheet .seo-report { background: transparent; border: 0; padding: 0; margin-top: 8px; }

/* Onboarding: dati dell'azienda */
.gate-wide .gate-card { max-width: 660px; }
.gate-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }

/* Modulo dei dati dell'azienda: sezioni con icona (onboarding e profilo) */
.cf { display: grid; gap: 14px; }
.cf-section { border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px 6px; background: var(--blue-lighter); }
.cf-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cf-head h3 { font-size: 15px; }
.cf-head p { margin: 1px 0 0; }
.cf-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.cf-ico .icon { width: 18px; height: 18px; }
.cf-section .grid-2 { row-gap: 2px; }
.cf-section .input { background: #fff; }
.gate-company .gate-card { max-width: 680px; }
.gate-company .gate-main { align-items: flex-start; }
.gate-company .gate-actions { position: sticky; bottom: 0; background: linear-gradient(to top, var(--surface) 70%, rgba(255,255,255,0)); padding: 14px 0 4px; margin-top: 4px; }
.gate-company .gate-actions .btn-lg { width: auto; min-width: 180px; }
@media (max-width: 720px) { .cf-section { padding: 14px 14px 4px; } .gate-company .gate-actions .btn-lg { width: 100%; } }

/* Email marketing */
.em-title { min-width: min(560px, 80vw); font: inherit; color: inherit; border: 0; border-bottom: 2px dashed transparent; background: transparent; width: 100%; padding: 0; }
.em-title:hover, .em-title:focus { border-bottom-color: var(--border-strong); outline: none; }
.em-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 18px; align-items: start; }
.em-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.em-side { position: sticky; top: 12px; min-width: 0; }
@media (max-width: 1024px) { .em-grid { grid-template-columns: 1fr; } .em-side { position: static; } }
.em-head-tools { display: inline-flex; gap: 8px; align-items: center; }
.em-sources { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.em-audience { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--blue-lighter); }
.em-inbox { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.em-frame-wrap { background: #f1f4f8; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; justify-content: center; }
.em-frame { width: 100%; height: 640px; border: 0; background: #f1f4f8; }
.em-frame-wrap.mobile .em-frame { width: 380px; max-width: 100%; }
.em-style { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.em-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--border-strong); cursor: pointer; padding: 0; }
.em-swatch.on { box-shadow: 0 0 0 2.5px var(--blue); }
.em-blocks { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.em-empty { padding: 14px; text-align: center; border: 1.5px dashed var(--border-strong); border-radius: 8px; margin: 0; }
.em-block { border: 1.5px solid var(--border); border-radius: 10px; background: #fff; }
.em-block.open { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 120, 214, .12); }
.em-block.dragging { opacity: .5; }
.em-block-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; min-width: 0; }
.em-handle { cursor: grab; color: var(--gray); letter-spacing: -2px; user-select: none; padding: 0 2px; }
.em-block-type { font: 700 13px var(--font-head); white-space: nowrap; }
.em-block-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-block-tools { display: inline-flex; gap: 2px; }
.em-block-body { padding: 4px 14px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; border-top: 1px solid var(--border); }
.em-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.em-row { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; display: grid; gap: 6px; }
.em-add { margin-top: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.em-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.em-pal { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font: 600 13px var(--font-head); color: var(--ink); text-align: left; }
.em-pal:hover { border-color: var(--blue); background: var(--blue-lighter); }
.em-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 18px; }
.em-tpl { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1.5px solid var(--border); border-radius: 10px; background: #fff; }
.em-tpl p { margin: 0; }
.em-tpl .actions { margin-top: auto; display: flex; gap: 6px; align-items: center; }
.em-tpl-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.em-tpl-btn:hover { border-color: var(--blue); background: var(--blue-lighter); }
.em-start { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.em-start-card { display: grid; gap: 4px; text-align: left; padding: 16px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.em-start-card span { font-size: 26px; }
.em-start-card:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-lighter); }
.em-start-card:disabled { opacity: .5; cursor: not-allowed; }
.em-chip { border: 1px solid var(--border-strong); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12.5px; cursor: pointer; }
.em-chip:hover { background: var(--blue-lighter); }
.em-ai-res { margin-top: 16px; padding: 14px; border: 1.5px solid var(--blue); border-radius: 10px; background: var(--blue-lighter); }
.em-ai-blocks { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 2px; }
.em-when { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.em-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.em-kpi-v { font: 700 24px/1.15 var(--font-head); color: var(--blue-dark); }
.em-kpi-sub { font-size: 13px; }
.em-url { overflow-wrap: anywhere; font-size: 13px; }
.em-progress { height: 10px; border-radius: 5px; background: var(--blue-lighter); overflow: hidden; }
.em-progress i { display: block; height: 100%; background: #2a78d6; transition: width .4s; }
.em-method summary { cursor: pointer; }
.em-method ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; }
@media (max-width: 720px) { .em-start { grid-template-columns: 1fr; } .em-frame { height: 520px; } }
/* Editor delle email: strumenti, blocchi con icone, formattazione */
.em-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.em-hist { display: inline-flex; gap: 2px; }
.em-toolbar .em-style { margin: 0; }
.em-block-ic, .em-pal-ic, .em-start-ic { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 6px; background: var(--blue-lighter); color: var(--blue); flex: none; }
.em-block-ic .icon, .em-pal-ic .icon { width: 16px; height: 16px; }
.em-block-type { display: inline-flex; align-items: center; gap: 8px; }
.em-add-title { font: 700 13px var(--font-head); color: var(--blue-dark); }
.em-pal-group { display: grid; gap: 4px; }
.em-pal { gap: 8px; }
.em-start-ic { width: 40px; height: 40px; border-radius: 10px; }
.em-start-ic .icon { width: 22px; height: 22px; }
.em-cat { margin: 18px 0 8px; }
.em-fmt { display: inline-flex; gap: 0; margin-left: 8px; vertical-align: middle; }
.em-fmt .icon-btn { width: 26px; height: 26px; }
.em-label-ai { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.em-line-opts { display: grid; gap: 6px; padding: 10px 12px; border: 1.5px solid var(--blue); border-radius: 10px; background: var(--blue-lighter); }
.em-line-opts[hidden] { display: none; }
.em-line-opts p { margin: 0; }
.em-opt { text-align: left; border: 1px solid var(--border-strong); background: #fff; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.em-opt:hover { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(42, 120, 214, .12); }

.em-main > .card, .em-main > section { min-width: 0; max-width: 100%; }
.em-block, .em-block-body .field, .em-row { min-width: 0; }

/* Email marketing: diagnosi dei destinatari e consenso registrato dallo studio */
.em-diag-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.em-diag-act { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.em-diag-soft { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border, #e3e8ef); }
.em-consent-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* Email marketing: sequenze */
.sheet-xl { max-width: 960px; }
.em-grid-one { grid-template-columns: minmax(0, 1fr); }
.em-step { display: grid; gap: 10px; }
.em-step-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .em-step-grid { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) minmax(0, 1fr); } }
.em-delay { display: flex; gap: 6px; }
.em-delay .input { min-width: 0; }
.em-step-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.em-sub { margin-left: 22px; }
.em-step + .em-step { margin-top: 10px; }

/* CRM: la persona al centro, l'azienda come collegata */
.company-line { margin: 2px 0 6px; color: var(--muted, #6b7385); display: flex; align-items: center; gap: 6px; font-size: 15px; }
.company-line svg, td small svg { width: 14px; height: 14px; vertical-align: -2px; }

/* CRM: viste e filtri in stile HubSpot */
.crm-views { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--border, #e3e8ef); margin-bottom: 12px; scrollbar-width: thin; }
.crm-views { flex-wrap: wrap; gap: 0 18px; align-items: flex-end; }
.crm-view-group { display: flex; align-items: flex-end; gap: 2px; overflow-x: auto; scrollbar-width: thin; position: relative; padding-top: 18px; }
.crm-view-group + .crm-view-group { border-left: 1px solid var(--border, #e3e8ef); padding-left: 14px; }
.crm-view-label { position: absolute; top: 0; left: 14px; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b7385); font-weight: 700; }
.crm-view-group:first-child .crm-view-label { left: 0; }
.crm-view-n { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2, #eef2f7); color: var(--muted, #6b7385); font-size: .75rem; font-weight: 600; text-align: center; }
.crm-view.active .crm-view-n { background: var(--blue, #023F82); color: #fff; }
@media (max-width: 720px) { .crm-view-group + .crm-view-group { border-left: 0; padding-left: 0; } .crm-view-label { left: 0; } }
.crm-view { flex: 0 0 auto; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 14px; font: inherit; font-weight: 600; color: var(--muted, #6b7385); cursor: pointer; white-space: nowrap; }
.crm-view:hover { color: var(--blue, #023F82); }
.crm-view.active { color: var(--blue, #023F82); border-bottom-color: var(--blue, #023F82); }
.crm-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crm-toolbar .input[type=search] { flex: 1 1 260px; min-width: 0; }
.crm-view-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crm-panel { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; background: var(--surface, #fff); padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.crm-filter-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(160px, 2fr) auto; gap: 8px; align-items: center; }
@media (max-width: 720px) { .crm-filter-row { grid-template-columns: 1fr 1fr; } .crm-filter-val { grid-column: 1 / -1; } }
.crm-filter-val { min-width: 0; }
.crm-filter-val .input { width: 100%; }
.crm-multi { position: relative; border: 1px solid var(--border-strong, #cfd6e2); border-radius: 8px; padding: 8px 10px; background: var(--surface, #fff); }
.crm-multi summary { cursor: pointer; font-size: 14px; list-style: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-multi-list { display: grid; gap: 4px; padding-top: 8px; max-height: 220px; overflow: auto; }
.crm-panel-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.crm-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--blue-lighter, #e8f0fa); color: var(--blue, #023F82); border-radius: 20px; padding: 2px 4px 2px 12px; font-size: 13px; font-weight: 600; }
.crm-chip .icon-btn { width: 24px; height: 24px; }
.crm-count { margin: 4px 0 6px; }
.crm-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; }
.th-sort { background: none; border: 0; font: inherit; color: inherit; font-weight: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; }
.th-sort:hover { color: var(--blue, #023F82); }
/* Casi studio: scheda con il risultato in evidenza e carosello scorrevole */
.cs-carousel { position: relative; }
.cs-track { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 4px; padding: 4px 4px 14px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.cs-track:focus-visible { outline: 2px solid var(--blue, #023F82); outline-offset: 2px; border-radius: 10px; }
.cs-card { flex: 0 0 min(320px, 82%); scroll-snap-align: start; text-align: left; font: inherit; color: inherit; background: var(--surface, #fff); border: 1px solid var(--border, #e3e8ef); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 6px rgba(2, 63, 130, .06); }
button.cs-card { cursor: pointer; }
button.cs-card:hover { border-color: var(--blue, #023F82); }
.cs-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
/* Casi studio in video: miniatura di YouTube con il pulsante play, citazione del cliente, player e indice nel dettaglio */
.cs-video { position: relative; padding: 0; border: 0; cursor: pointer; background: #0b1320; overflow: hidden; }
.cs-video img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .2s; }
.cs-video:hover img, .cs-video:focus-visible img { opacity: 1; }
.cs-play { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 50%; background: rgba(2, 63, 130, .9); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .3); }
.cs-play .icon { width: 24px; height: 24px; margin-left: 3px; }
.cs-video-tag { position: absolute; top: 10px; left: 10px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, .65); color: #fff; font: 700 11px var(--font-head); letter-spacing: .4px; text-transform: uppercase; }
.cs-quote { margin: 4px 0 10px; padding: 0 0 0 12px; border-left: 3px solid var(--blue, #023f82); font-style: italic; color: var(--text); font-size: 14px; line-height: 1.45; }
.cs-quote cite { display: block; margin-top: 4px; font-style: normal; font-size: 12.5px; color: var(--muted); }
.cs-quote-lg { font-size: 16px; margin: 14px 0; }
.cs-player { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin: 10px 0; }
.cs-player.is-vertical { aspect-ratio: 9 / 16; max-width: 340px; margin-inline: auto; }
.cs-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cs-chapters { margin: 6px 0 12px; }
.cs-chapters summary { cursor: pointer; font-weight: 600; }
.cs-chapters ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.cs-chapters .link-btn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.cs-chapters .link-btn:hover .cs-ch-time, .cs-chapters .link-btn:focus-visible .cs-ch-time { text-decoration: underline; }
.cs-ch-time { display: inline-block; min-width: 3.4em; color: var(--blue, #023f82); font-weight: 700; font-variant-numeric: tabular-nums; }
.cs-h3 { font-size: 15px; margin: 16px 0 6px; }
.cs-deliver { margin: 0 0 10px; padding-left: 20px; display: grid; gap: 4px; }
.cs-kind { margin: 4px 0 8px; }
.cs-kind button .icon { width: 15px; height: 15px; vertical-align: -2px; }
.cs-body { padding: 16px 18px 18px; display: grid; gap: 8px; align-content: start; }
.cs-tags { margin: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.cs-tag { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--blue-lighter, #e8f0fa); color: var(--blue, #023F82); }
.cs-tag-area { background: #e9f7f1; color: #0b6b49; }
.cs-result { margin: 0; display: grid; gap: 0; }
.cs-pct { font-size: 38px; line-height: 1.05; font-weight: 800; color: var(--blue, #023F82); letter-spacing: -.5px; }
.cs-metric { font-weight: 600; }
.cs-time { color: var(--muted, #6b7385); font-size: 14px; }
.cs-title { margin: 4px 0 0; font-size: 16px; }
.cs-summary, .cs-client, .cs-note { margin: 0; font-size: 14px; color: var(--muted, #6b7385); }
.cs-client { font-weight: 600; color: inherit; }
.cs-note { font-size: 12.5px; }
.cs-extras { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; font-size: 14px; }
.cs-nav { position: absolute; top: 40%; z-index: 1; background: var(--surface, #fff); border: 1px solid var(--border, #e3e8ef); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); border-radius: 50%; width: 38px; height: 38px; }
.cs-prev { left: -10px; }
.cs-next { right: -10px; }
.cs-nav:disabled { opacity: .35; cursor: default; }
@media (max-width: 640px) { .cs-nav { display: none; } .cs-prev { left: 0; } .cs-next { right: 0; } }
.cs-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cs-filters .chip.active { background: var(--blue, #023F82); border-color: var(--blue, #023F82); color: #fff; }
.cs-preview { max-width: 340px; margin: 0 auto 16px; }
.cs-preview .cs-card { flex-basis: auto; }
/* Area clienti: schede compatte, solo titolo e descrizione (il resto si legge aprendo il caso) */
.cs-card-compact .cs-body { flex: 1; display: flex; flex-direction: column; }
.cs-card-compact .cs-summary { display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cs-card-compact .cs-more { margin-top: auto; align-self: flex-start; }
.cs-extras-edit { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 8px 12px 12px; }
.cs-flags { display: grid; gap: 6px; }

/* Casi studio: numeri, periodo e aiuto dell'AI */
.cs-calc { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 8px 12px 12px; display: grid; gap: 8px; }
.grid-3 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cs-calc-out { margin: 0; font-weight: 600; color: var(--blue, #023F82); }
.cs-ai { display: grid; gap: 8px; padding: 12px; }
.cs-ai-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cs-ai-row { border-top: 1px solid var(--border, #e3e8ef); padding: 8px 0; display: grid; gap: 4px; justify-items: start; }
.cs-ai-row p { margin: 0; font-size: 14px; }

/* Casi studio: i risultati scorrono nella scheda, uno alla volta */
.cs-slider { display: grid; gap: 6px; }
.cs-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; border-radius: 8px; }
.cs-slides::-webkit-scrollbar { display: none; }
.cs-slides:focus-visible { outline: 2px solid var(--blue, #023F82); outline-offset: 2px; }
.cs-slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; gap: 0; align-content: start; min-height: 104px; }
.cs-from { color: var(--muted, #6b7385); font-size: 12.5px; margin-top: 2px; }
.cs-dots { display: flex; gap: 8px; justify-content: center; }
.cs-dot { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--border-strong, #cfd6e2); cursor: pointer; }
.cs-dot.on { background: var(--blue, #023F82); transform: scale(1.2); }
.cs-more { justify-self: start; margin-top: 4px; }
.cs-all { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 4px; }
.cs-pct-sm { color: var(--blue, #023F82); font-size: 20px; }
.cs-res { display: grid; gap: 8px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; margin-bottom: 6px; }
@media (max-width: 720px) { .cs-res { grid-template-columns: 1fr 1fr; } .cs-res-metric { grid-column: 1 / -1; } }
.cs-opts { border: 1px solid var(--border, #e3e8ef); border-radius: 10px; padding: 8px 12px; }
.cs-opts > summary { cursor: pointer; font-weight: 600; }
.cs-opts[open] > summary { margin-bottom: 10px; }

/* CRM: colonna Azioni (visualizza, modifica, elimina) */
.crm-actions { white-space: nowrap; text-align: right; position: sticky; right: 0; background: var(--surface, #fff); box-shadow: -10px 0 8px -8px rgba(2, 63, 130, .18); }
.table tbody tr:hover .crm-actions { background: var(--blue-lighter, #f3f7fb); }
.crm-actions .icon-btn + .icon-btn { margin-left: 2px; }

/* CRM: tabella compatta, così «Creato» e le azioni stanno nella pagina senza scorrere (da schermi di circa 1280 px) */
.crm-table th, .crm-table td { padding-left: 10px; padding-right: 10px; }
.crm-table td { vertical-align: middle; }
.crm-table .crm-actions { padding-left: 6px; padding-right: 8px; }
.crm-table .icon-btn { width: 32px; height: 32px; }

/* CRM: livelli del ciclo di vita come schede, barra con ricerca, liste e filtri, tabella ariosa */
.crm-head { margin-bottom: 18px; }
.crm-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crm-stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.crm-stage { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.crm-stage strong { font-family: var(--font-head); font-size: 24px; line-height: 1.1; color: var(--text); }
.crm-stage-name { font-weight: 700; color: var(--blue); }
.crm-stage small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.crm-stage:hover { border-color: var(--blue); }
.crm-stage.active { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 1px var(--blue) inset; }
.crm-stage.active strong { color: var(--blue); }
@media (max-width: 1100px) { .crm-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .crm-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.crm-toolbar { gap: 10px; margin-bottom: 6px; }
.crm-toolbar .crm-search { flex: 1 1 280px; }
.crm-select { flex: 0 1 230px; min-width: 170px; }
.crm-select .input { width: 100%; }
.crm-view-actions:not(:empty) { display: flex; margin: 6px 0; }
.crm-stats-panel { margin: 10px 0 14px; }
.crm-table th, .crm-table td { padding: 14px 14px; }
.crm-table .crm-who { min-width: 200px; }
.crm-table .crm-who strong { display: block; }
.crm-table .crm-lc { min-width: 150px; }
.crm-table .crm-lc .badge, .crm-table td > .badge { white-space: nowrap; }
.crm-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.crm-table .crm-when { white-space: nowrap; }
.crm-table small.block { margin-top: 3px; line-height: 1.35; }
/* Nuovo contatto: scelta del livello */
.lc-stage-pick { border: 0; padding: 0; margin: 10px 0 4px; }
.lc-stage-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.lc-stage-option { position: relative; display: block; cursor: pointer; }
.lc-stage-option input { position: absolute; opacity: 0; }
.lc-stage-option span { display: flex; flex-direction: column; gap: 3px; height: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.lc-stage-option small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.lc-stage-option input:checked + span { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 1px var(--blue) inset; }
.lc-stage-option input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (max-width: 760px) { .lc-stage-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.lc-new [hidden] { display: none; }
.gate-note { display: flex; gap: 8px; align-items: flex-start; background: var(--green-light); color: var(--green); border-radius: 8px; padding: 9px 12px; margin: 0; }
.gate-note .icon { flex: none; margin-top: 2px; }

/* Collegamento guidato a HubSpot con la chiave di servizio (analisi marketing) */
.hs-form { display: grid; gap: 14px; }
.hs-steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; }
.hs-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 999px; background: var(--bg); color: var(--gray); font-size: 13px; font-weight: 600; }
.hs-steps li > span { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--border-strong); color: #fff; font-size: 12px; }
.hs-steps li > span .icon { width: 13px; height: 13px; }
.hs-steps li.current { background: var(--blue-light); color: var(--blue); }
.hs-steps li.current > span { background: var(--blue); }
.hs-steps li.done > span { background: var(--green); }
.hs-how { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.hs-scopes { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.hs-scopes li { background: var(--blue-lighter); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.hs-scopes code { font-weight: 700; }
.hs-form .sheet-actions { justify-content: center; flex-wrap: wrap; }

/* Grafici di stagionalità e dispersione */
.chart-plot .sc-dot { position: absolute; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.18); cursor: pointer; }
.chart-plot .sc-dot:hover, .chart-plot .sc-dot:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.chart-plot .sc-xlabel { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); font-size: 12px; color: var(--gray); }
[data-sc] .chart, .doc-stat .chart { margin-bottom: 26px; }
.scatter-grid, .seasonal-grid { display: grid; gap: 22px; }

/* Avanzamento delle importazioni dalle integrazioni */
.sync-steps { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.sync-steps li { display: flex; align-items: flex-start; gap: 10px; color: var(--gray); font-size: 14px; }
.sync-steps li > span { width: 20px; height: 20px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border-strong); box-sizing: border-box; }
.sync-steps li.done { color: var(--text, inherit); }
.sync-steps li.done > span { background: #1baf7a; border-color: #1baf7a; color: #fff; }
.sync-steps li.done > span svg { width: 12px; height: 12px; }
.sync-steps li.current { color: var(--text, inherit); font-weight: 600; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #2a78d6; border-right-color: transparent; display: inline-block; animation: sync-spin .8s linear infinite; }
.sync-live .spin { vertical-align: -1px; margin-right: 4px; }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* ---------- Area marketing: panoramica dei progetti e progetto di consulenza ---------- */
.mk-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 14px; }
.mk-toolbar .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip .count { margin-left: 4px; height: 18px; min-width: 20px; font-size: 11px; }
.chip[aria-pressed=true] .count { background: rgba(255,255,255,.2); color: #fff; }
.chip-warn:not([aria-pressed=true]) { border-color: var(--amber); }
.chip-warn:not([aria-pressed=true]) .count { background: var(--warn-bg); color: var(--warn); }
.mk-search { position: relative; display: flex; align-items: center; }
.mk-search .icon { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); }
.mk-search .input { padding-left: 32px; width: 240px; }
.mk-projects { display: grid; gap: 10px; }
.mk-project { display: grid; grid-template-columns: minmax(180px, 1.1fr) minmax(200px, 1fr) minmax(220px, 1.6fr) 240px; /* ultima colonna fissa: le colonne di tutte le schede restano allineate */ gap: 18px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.mk-project:hover, .mk-project:focus-visible { border-color: var(--blue); box-shadow: var(--shadow-md); }
.mk-project-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-project-who strong { font-family: var(--font-head); font-size: 15px; }
.mk-project-who .badge { align-self: flex-start; }
.mk-project-phase { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.mk-project-work { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.mk-project-label { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.mk-project-alerts { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; display: grid; gap: 2px; }
.mk-project-alerts .icon { width: 14px; height: 14px; vertical-align: -2px; }
.mk-project-next { justify-self: end; }
.mk-phase-pill { font-family: var(--font-head); font-weight: 700; font-size: 13px; padding: 3px 10px; border-radius: 20px; background: var(--blue-light); color: var(--blue); }
.mk-phase-da_fare { background: #eef0f3; color: var(--gray); }
.mk-phase-fatto { background: var(--ok-bg); color: var(--ok); }
.mk-steps-bar { display: inline-flex; gap: 3px; max-width: 100%; flex-wrap: wrap; } /* non .mk-bar: è la barra della pagina pubblica dei mockup */
.mk-bar-seg { width: 22px; height: 6px; border-radius: 3px; background: #e3e7ee; }
.mk-bar-fatto { background: var(--blue); }
.mk-bar-in_corso { background: #7fa6d6; }
.mk-bar-seg.is-current { outline: 2px solid var(--amber); outline-offset: 1px; }

.mkp-head { align-items: flex-start; }
.mkp-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; color: var(--gray); font-size: 14px; margin-top: 4px; }
.mkp-meta a { display: inline-flex; gap: 5px; align-items: center; font-weight: 600; }
.mkp-meta .icon { width: 15px; height: 15px; }
.mkp-phase { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--amber);
  border-radius: var(--radius); padding: 12px 16px; min-width: 260px; max-width: 380px; box-shadow: var(--shadow-sm); }
.mkp-phase-label { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--amber-dark); }
.mkp-phase strong { font-family: var(--font-head); font-size: 17px; }
.mkp-phase .btn { margin-top: 8px; }
.mkp { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 24px; align-items: start; }
.mkp-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm); }
.mkp-nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
.mkp-nav-item:hover { background: var(--blue-lighter); }
.mkp-nav-item.active { background: var(--blue-light); }
.mkp-nav-item.active strong { color: var(--blue); }
.mkp-nav-item + .mkp-nav-item::before { content: ''; position: absolute; left: 21px; top: -6px; height: 10px; border-left: 2px solid var(--border); }
.mkp-nav-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mkp-nav-text strong { font-family: var(--font-head); font-size: 14px; }
.mkp-nav-text small { color: var(--muted); font-size: 12px; }
.mkp-nav-text small.is-current { color: var(--amber-dark); font-weight: 700; }
.mkp-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-family: var(--font-head); font-weight: 800; font-size: 12px;
  border: 2px solid var(--border-strong); color: var(--gray); background: var(--surface); }
.mkp-dot .icon { width: 14px; height: 14px; }
.mkp-dot-fatto { background: var(--blue); border-color: var(--blue); color: #fff; }
.mkp-dot-in_corso { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.mkp-dot.is-current { box-shadow: 0 0 0 3px var(--amber-light), 0 0 0 5px var(--amber); }
.mkp-dot-home { border-color: transparent; background: var(--blue-lighter); color: var(--blue); }
.mkp-main { min-width: 0; }
.mkp-tabs a { padding: 10px 14px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--gray); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; text-decoration: none !important; }
.mkp-tabs a[aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }
.mk-lead { margin-bottom: 14px; }
.mk-next { margin-top: 18px; justify-content: flex-end; }

.mko-hero { display: flex; gap: 24px; align-items: center; justify-content: space-between; border-left: 4px solid var(--amber); margin-bottom: 14px; }
.mko-hero h2 { font-size: 22px; margin: 2px 0 4px; }
.mko-working { color: var(--gray); margin-bottom: 12px; }
.mko-hero-side { text-align: center; flex: none; }
.mko-ring { --p: 0; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 4px;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), #e3e7ee 0); }
.mko-ring span { width: 70px; height: 70px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-family: var(--font-head); color: var(--gray); font-size: 13px; }
.mko-ring strong { font-size: 24px; color: var(--text); line-height: 1; }
.mko-alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.mko-alert { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: 14px; }
.mko-alert span { flex: 1; }
.mko-alert-danger { background: var(--red-light); color: var(--red); }
.mko-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 14px; align-items: start; }
.mko-steps ol { list-style: none; margin: 12px 0 0; padding: 0; }
.mko-step { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 12px 4px; border-top: 1px solid var(--border); }
.mko-step:first-child { border-top: 0; }
.mko-step.is-current { background: var(--amber-light); border-radius: var(--radius-sm); padding-left: 10px; padding-right: 10px; }
.mko-step-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mko-step-text a { color: var(--text); font-family: var(--font-head); }
.mko-step-da_fare .mko-step-text a { color: var(--gray); }
.mko-nums h2 { margin-bottom: 6px; }
.mko-num { display: flex; flex-direction: column; padding: 9px 0; border-top: 1px solid var(--border); }
.mko-num:first-of-type { border-top: 0; }
.mko-num > span { font-size: 12px; color: var(--muted); font-family: var(--font-head); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.mko-num strong { font-family: var(--font-head); font-size: 15px; }
.mko-num small { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  .mk-project { grid-template-columns: minmax(160px, 1fr) minmax(0, 1.4fr); }
  .mk-project-next { grid-column: 1 / -1; justify-self: start; }
  .mkp { grid-template-columns: 1fr; }
  .mkp-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .mkp-nav-item { flex: none; }
  .mkp-nav-item + .mkp-nav-item::before { display: none; }
  .mko-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .mkp-phase { max-width: none; width: 100%; }
  .mk-project { grid-template-columns: 1fr; gap: 10px; }
  .mk-search, .mk-search .input { width: 100%; }
  .mko-hero { flex-direction: column-reverse; align-items: flex-start; }
}

/* Fonti e dati · Sito web */
.site-head { display: flex; gap: 20px; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.site-head > div { flex: 1; min-width: 0; }
.site-head h2 { margin-bottom: 4px; }
.site-meta { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.site-form { display: flex; gap: 10px; align-items: flex-end; min-width: 320px; }
.site-form .field { flex: 1; margin: 0; }
.site-scores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.site-score { display: flex; flex-direction: column; gap: 2px; border-top: 4px solid var(--border-strong); }
.site-score > span { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--gray); }
.site-score strong { font-family: var(--font-head); font-size: 28px; line-height: 1.1; }
.site-score strong small { font-size: 13px; color: var(--muted); font-weight: 600; }
.site-ok { border-top-color: var(--ok); } .site-ok strong { color: var(--ok); }
.site-warn { border-top-color: var(--amber); } .site-warn strong { color: var(--warn); }
.site-bad { border-top-color: var(--red); } .site-bad strong { color: var(--red); }
.site-profile { margin-bottom: 14px; }
.site-summary { font-size: 16px; margin: 6px 0 12px; }
.site-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; margin: 0 0 14px; }
.site-facts dt { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.site-facts dd { margin: 2px 0 0; }
.site-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.site-block { background: var(--blue-lighter); border-radius: var(--radius-sm); padding: 10px 14px; }
.site-block h4 { font-family: var(--font-head); font-size: 13px; margin: 0 0 4px; color: var(--blue); }
.site-block ul { margin: 0; padding-left: 18px; font-size: 14px; }
.site-block.is-bad { background: var(--red-light); } .site-block.is-bad h4 { color: var(--red); }
.site-block.is-good { background: var(--ok-bg); } .site-block.is-good h4 { color: var(--ok); }
.site-block.is-ask { background: var(--amber-light); } .site-block.is-ask h4 { color: var(--amber-dark); }
.site-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr); gap: 14px; align-items: start; }
.site-area { font-size: 13px; color: var(--gray); margin: 14px 0 4px; text-transform: uppercase; letter-spacing: .6px; }
.site-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.site-check .icon { width: 16px; height: 16px; margin-top: 2px; }
.site-check-ok .icon { color: var(--ok); } .site-check-warn .icon { color: var(--warn); } .site-check-bad .icon { color: var(--red); }
.site-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.site-pages-title { margin-top: 18px; }
.site-pages { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.site-pages li { display: flex; flex-direction: column; gap: 1px; }
.site-pages a { overflow-wrap: anywhere; }
.mk-method { margin-top: 12px; }
@media (max-width: 1100px) { .site-scores { grid-template-columns: repeat(2, minmax(0, 1fr)); } .site-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .site-head { flex-direction: column; } .site-form { min-width: 0; width: 100%; flex-direction: column; align-items: stretch; } }

/* Analisi · Libreria di report (studio) e Report (portale) */
.lib-intro { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 8px; }
.lib-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--gray); font-size: 14px; white-space: nowrap; }
.lib-counts strong { font-family: var(--font-head); font-size: 22px; color: var(--text); margin-right: 4px; }
.lib-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 8px; }
.lib-report { display: flex; flex-direction: column; gap: 6px; }
.lib-report h3 { font-size: 16px; }
.lib-report h3 a { color: var(--text); }
.lib-report .actions { margin-top: auto; padding-top: 6px; }
.lib-report-link { color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.lib-report-link:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.lib-open { margin-top: auto; font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); display: inline-flex; gap: 6px; align-items: center; }
.lib-type { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--blue); }
.lib-share { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.lib-share .icon { width: 13px; height: 13px; }
.lib-group { font-size: 13px; color: var(--gray); text-transform: uppercase; letter-spacing: .6px; margin: 16px 0 8px; }
.lib-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.lib-typecard { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.lib-typecard strong { font-family: var(--font-head); }
.lib-typecard .btn { margin-top: auto; }
.lib-typecard.is-off { background: transparent; opacity: .75; }
.lib-reason { color: var(--gray); display: flex; gap: 6px; }
.lib-reason .icon { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.lib-builder, .lib-detail { margin-bottom: 14px; }
.lib-builder-head, .lib-detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.lib-builder-head h2, .lib-detail-head h2 { font-size: 20px; }
.lib-notes { border-top: 1px solid var(--border); padding-top: 12px; }
.lib-preview { border: 2px dashed var(--border); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.lib-comment { border-left: 4px solid var(--blue); margin-bottom: 14px; }
.lib-comment h2 { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.lib-note-preview { color: var(--gray); }
.report-frozen select:disabled, .report-frozen input:disabled, .report-frozen button[data-grain]:disabled { opacity: 1; cursor: default; background: transparent; }
@media (max-width: 860px) { .lib-intro { flex-direction: column; align-items: flex-start; } }

/* Piano: creazione dalla strategia */
.plan-from-strategy { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--blue-lighter); padding: 10px 14px; margin: 4px 0 14px; }
.plan-from-strategy p { margin: 4px 0 0 26px; }
.plan-from-list { margin: 6px 0 0 26px; padding-left: 16px; font-size: 13px; }

/* Schede come link (Risultati) e bacheca delle attività del piano */
.tabs a[role=tab] { padding: 10px 14px; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--gray); border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; text-decoration: none !important; }
.tabs a[role=tab][aria-selected=true] { color: var(--blue); border-bottom-color: var(--blue); }
.act-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.act-progress { min-width: 260px; flex: 1; max-width: 420px; }
.act-progress .progress { margin-bottom: 6px; }
.act-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.act-col { background: var(--blue-lighter); border-radius: var(--radius); padding: 10px; display: grid; gap: 8px; }
.act-col h3 { font-size: 14px; display: flex; gap: 6px; align-items: center; padding: 2px 4px; }
.act-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm); }
.act-card.is-late { border-left: 3px solid var(--red); }
.act-card strong { font-family: var(--font-head); font-size: 14px; line-height: 1.35; }
.act-card .icon { width: 13px; height: 13px; vertical-align: -2px; }
.act-channel { font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--blue); }
.act-status { margin-top: 4px; }
@media (max-width: 860px) { .act-board { grid-template-columns: 1fr; } }

/* Libreria di report: catalogo dei modelli e anteprima */
.sheet-xl { max-width: 1240px; width: 100%; }
.lib-catalog { margin-top: 18px; }
.lib-cat-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.lib-cat-head h2 { font-size: 18px; }
.lib-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.lib-toolbar .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip:disabled { opacity: .5; cursor: default; }
.lib-rec-note { margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.lib-group-block + .lib-group-block { margin-top: 6px; }
.lib-group { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--text); }
.lib-group .icon { width: 16px; height: 16px; color: var(--blue); align-self: center; }
.lib-group small { font-weight: 400; font-size: 13px; }
.lib-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.lib-model { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.lib-model:hover { border-color: var(--blue); box-shadow: var(--shadow-md); }
.lib-model.is-off { box-shadow: none; background: #fbfcfd; }
.lib-model.is-off strong { color: var(--gray); }
.lib-model strong { font-family: var(--font-head); font-size: 15px; }
.lib-model-top { display: flex; justify-content: space-between; align-items: center; }
.lib-model-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-light); color: var(--blue); }
.lib-model.is-off .lib-model-icon { background: #eef0f3; color: var(--muted); }
.lib-model-status .icon { width: 14px; height: 14px; vertical-align: -2px; }
.lib-model .actions { margin-top: auto; padding-top: 4px; }
.lib-rec { white-space: nowrap; }
.lib-preview-sheet h2 { margin-bottom: 4px; }
.lib-pv-head { margin-bottom: 16px; padding-right: 40px; }
.lib-pv-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.lib-pv-label { font-family: var(--font-head); font-weight: 700; font-size: 13px; color: var(--blue); display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.lib-pv-box { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; background: var(--bg); max-height: 68vh; overflow: auto; }
.lib-pv-info { position: sticky; top: 0; background: var(--blue-lighter); border-radius: var(--radius); padding: 16px; font-size: 14px; }
.lib-pv-info h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--gray); margin: 14px 0 4px; }
.lib-pv-info ul { margin: 0; padding-left: 18px; }
.lib-pv-status { font-weight: 600; border-radius: var(--radius-sm); padding: 8px 10px; display: flex; gap: 6px; align-items: flex-start; }
.lib-pv-status .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.lib-pv-status.is-ok { background: var(--ok-bg); color: var(--ok); }
.lib-pv-status.is-off { background: var(--warn-bg); color: var(--warn); }
.lib-pv-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.rep-period { margin-bottom: 10px; }
.rep-metrics { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.rep-metrics span { display: flex; flex-direction: column; min-width: 110px; }
.rep-metrics small { color: var(--muted); font-size: 12px; }
.rep-share { display: inline-block; width: 70px; height: 8px; background: #e3e7ee; border-radius: 4px; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.rep-share span { display: block; height: 100%; background: #2a78d6; }
.rep-insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
@media (max-width: 960px) { .lib-pv-grid { grid-template-columns: 1fr; } .lib-pv-info { position: static; } .lib-pv-box { max-height: none; } }

/* Report «Ricerca e AI generativa» */
.sa-head h2 { display: flex; gap: 8px; align-items: center; }
.sa-verdict { margin-top: 8px; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--blue-lighter); }
.sa-verdict.is-bad { background: var(--warn-bg); color: var(--warn); }
.sa-verdict.is-good { background: var(--ok-bg); color: var(--ok); }
.sa-chart { margin: 0; }
.sa-chart svg { width: 100%; height: auto; display: block; }
.sa-legend { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.sa-legend i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 6px; }
.sa-legend i.dash { height: 0; border-top: 2px dashed; }
.sa-legend .link-btn { margin-left: auto; }
.sa-grid { stroke: var(--border); }
.sa-axis { font-size: 11px; fill: var(--muted); font-family: var(--font-body); }
.sa-cut { stroke: var(--amber); stroke-width: 2; stroke-dasharray: 3 3; }
.lib-pv-actions .btn { white-space: normal; text-align: center; }

/* Funnel: avviso «trattative vinte» contro contatti diventati clienti */
.funnel-alt { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; }
.funnel-alt p { margin: 0; }
.funnel-alt .btn { margin-left: 6px; }
/* Ricerca e AI generativa: impression nelle risposte AI (export di Search Console) */
.sa-sub { font-size: 15px; margin: 18px 0 8px; }
.sa-url { word-break: break-all; }
.sa-ai-empty .actions { margin-top: 4px; }

/* Sito web: visite dello studio escluse (dispositivi e reti) */
.ex-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.ex-grid .actions { flex-wrap: wrap; margin: 8px 0; }
.ex-net { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0; }
.ex-net .field { margin: 0; flex: 1 1 200px; }
.ex-list { margin-top: 10px; }
.ex-list .list-main .badge { align-self: flex-start; display: inline-block; width: auto; margin: 2px 0; }

/* Guide di Marketing sul sito: campi «Sul sito web» negli editor di guide, termini e framework */
.gs-site { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 12px; background: var(--blue-lighter); }
.gs-site legend { font-weight: 600; display: inline-flex; gap: 6px; align-items: center; padding: 0 6px; }
.gs-site .switch-row { display: flex; gap: 10px; align-items: flex-start; }
.gs-site .switch-row input { margin-top: 4px; }
.gs-slug { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gs-slug .input { flex: 1 1 140px; min-width: 0; }
.gs-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.gs-chip { display: inline-flex; align-items: center; gap: 4px; }
.gs-chip .icon-btn { width: 22px; height: 22px; }
.gs-cover { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gs-more summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.gs-more .field { margin-top: 8px; }
.gs-steps { display: grid; gap: 8px; margin-bottom: 8px; }
.gs-step { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 8px; align-items: start; }
.gs-step textarea { grid-column: 2; }
.gs-step .icon-btn { grid-column: 3; grid-row: 1; }
@media (max-width: 640px) { .gs-site { padding: 12px; } }

/* Campanella: non lette in evidenza, lette attenuate; azioni (letta/da leggere, elimina) su ogni notifica */
.notif-head-actions { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.notif-group { margin: 0; padding: 10px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.notif-group .count { background: var(--blue); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; letter-spacing: 0; }
.notif-item { position: relative; display: flex; align-items: stretch; gap: 2px; border-radius: var(--radius-sm); margin: 2px 0; }
.notif-item .notif { flex: 1; min-width: 0; }
.notif-item.is-unread { background: #eaf2fc; box-shadow: inset 3px 0 0 var(--blue); }
.notif-item.is-unread .notif.unread { background: none; }
.notif-item.is-unread .notif-text strong { font-weight: 700; color: var(--ink, #0f1b2d); }
.notif-item.is-unread .notif-text time em { font-style: normal; color: var(--blue); font-weight: 600; }
.notif-item.is-read .notif-text strong { font-weight: 500; color: var(--gray); }
.notif-item.is-read .notif-icon { background: var(--surface-2, #f1f4f8); color: var(--muted); }
.notif-item.is-read .notif-text span, .notif-item.is-read .notif-text time { color: var(--muted); }
.notif-actions { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding-right: 4px; opacity: 0; transition: opacity .15s; }
.notif-item:hover .notif-actions, .notif-item:focus-within .notif-actions { opacity: 1; }
.notif-actions .icon-btn { width: 28px; height: 28px; }
.notif-actions [data-del]:hover { color: var(--bad); }
.notif-undo { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border: 1px dashed var(--border); border-radius: var(--radius-sm); margin: 2px 0; list-style: none; }
@media (hover: none) { .notif-actions { opacity: 1; } }

/* Impostazioni → Attività standard dei task: riepilogo, filtri e attività raggruppate per tipologia con il tempo stimato in evidenza */
.tt-tiles { margin: 4px 0 16px; }
.tt-tile-btn { font: inherit; text-align: left; background: var(--surface); cursor: pointer; }
.tt-tile-btn:hover { border-color: var(--blue); }
.tt-tile-btn.is-alert { border-color: #f3dcae; background: var(--amber-light); }
.tt-tile-btn.is-alert .kpi-tile-value { color: var(--amber-dark); }
.tt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.tt-toolbar [data-q] { flex: 1 1 240px; min-width: 0; }
.tt-toolbar [data-cat] { flex: 0 1 240px; min-width: 0; }
.tt-group { margin: 22px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--gray); }
.tt-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tt-item { display: grid; grid-template-columns: minmax(0, 1fr) 210px auto; gap: 6px 16px; align-items: center; padding: 12px 14px; }
.tt-item + .tt-item { border-top: 1px solid var(--border); }
.tt-item.is-off { opacity: .62; }
.tt-main .badge { margin-left: 6px; vertical-align: 1px; }
.tt-time { display: flex; flex-direction: column; text-align: right; }
.tt-time-value { font-family: var(--font-head); font-weight: 800; font-size: 19px; color: var(--blue); font-variant-numeric: tabular-nums; }
.tt-time small { font-size: 12px; line-height: 1.3; }
.tt-actions { display: flex; gap: 2px; }
.tt-warn { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: var(--amber-light); border: 1px solid #f3dcae; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; }
.tt-warn > .icon { color: var(--amber-dark); width: 16px; height: 16px; }
.tt-warn > span { flex: 1 1 240px; }
.tt-empty { margin: 18px 0; }
.tt-method { margin-top: 18px; }
.tt-method summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--blue); }
.tt-est { display: flex; gap: 10px; }
.tt-est-part { display: flex; align-items: center; gap: 6px; }
.tt-est-part .input { width: 90px; }
.tt-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tt-quick .chip { padding: 4px 10px; font-size: 12.5px; }
@media (max-width: 720px) {
  .tt-toolbar [data-cat] { flex: 1 1 100%; }
  .tt-tiles .kpi-tile-value { font-size: 18px; }
  .tt-item { grid-template-columns: minmax(0, 1fr) auto; }
  .tt-time { grid-column: 1; grid-row: 2; text-align: left; }
  .tt-actions { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
}

/* Sito web → Presentazione: imbuto e abbandoni per slide (barre orizzontali, la slide con il calo più forte in arancio) */
.pres-funnel { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pres-funnel li { display: flex; flex-direction: column; gap: 4px; }
.pres-funnel-head { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.pres-funnel .web-bar { display: block; height: 12px; }
.pres-slides li.is-hot span:first-child { font-weight: 700; color: #b5461a; }
.deal-presentation .info { margin-bottom: 6px; }
.pres-table td:last-child { min-width: 0; }
.pres-table th { white-space: normal; }
.pres-table th, .pres-table td { padding-left: 10px; padding-right: 10px; font-size: 13.5px; }

/* Impostazioni → Loghi e favicon: anteprima su sfondo chiaro (logo a colori) e scuro (logo bianco) */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 8px; }
.brand-tile { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.brand-preview { position: relative; height: 92px; border-radius: var(--radius-sm); background: #fff; border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; padding: 10px; }
.brand-preview.is-dark { background: #0a1a33; border-color: #0a1a33; }
.brand-preview img { max-width: 100%; max-height: 70px; object-fit: contain; }
.brand-preview img.is-fallback { opacity: .45; }
.brand-default { position: absolute; top: 6px; right: 8px; font-size: 11px; color: var(--gray); background: rgba(255,255,255,.85); border-radius: 10px; padding: 1px 7px; }
.brand-actions { display: flex; gap: 6px; flex-wrap: wrap; }
/* Traduzioni dei contenuti (translations-panel.js): stato per lingua nell'editor e revisione affiancata italiano/lingua */
.tr-langs { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.tr-langs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; }
.tr-lang .badge { margin-left: 6px; }
.tr-badges { display: inline-flex; gap: 4px; flex-wrap: wrap; vertical-align: middle; }
.tr-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tr-head h2 { margin: 0; flex: 1 1 auto; }
.tr-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 18px; align-items: start; margin: 12px 0; }
.tr-col-head { position: sticky; top: 0; background: var(--surface); padding: 6px 0; border-bottom: 1px solid var(--border); z-index: 1; }
.tr-src { background: var(--bg, #f6f8fb); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; }
.tr-src p { margin: 4px 0 0; }
.tr-src-html { max-height: 340px; overflow: auto; font-size: 14px; }
.tr-html { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.tr-changes { border: 1px solid #f3dcae; background: var(--amber-light); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; max-height: 300px; overflow: auto; }
.tr-change + .tr-change { border-top: 1px dashed #f3dcae; margin-top: 6px; padding-top: 6px; }
.tr-changes ins { background: #d9f2e3; text-decoration: none; }
.tr-changes del { background: #fbdcdc; }
@media (max-width: 760px) { .tr-grid { grid-template-columns: 1fr; } .tr-col-head { display: none; } }

/* Barra laterale: logo più grande e pulsante per ridurla alle sole icone (solo su schermi larghi, scelta memorizzata) */
.brand-row { display: flex; align-items: flex-start; gap: 4px; }
.brand-row .brand { flex: 1; min-width: 0; padding: 2px 6px 20px 8px; }
.brand-row .brand img.brand-full { width: 100%; max-width: 196px; height: auto; display: block; }
.brand-mark { display: none; }
.sidebar-collapse { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; margin-top: 2px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .75); cursor: pointer; }
.sidebar-collapse:hover, .sidebar-collapse:focus-visible { background: rgba(255, 255, 255, .16); color: #fff; }
.sidebar-collapse .icon { width: 16px; height: 16px; }
@media (max-width: 860px) { .sidebar-collapse { display: none; } }
@media (min-width: 861px) {
  .sidebar { transition: width .18s ease; }
  .sidebar-mini { --sidebar: 76px; }
  .sidebar-mini .sidebar { padding-left: 10px; padding-right: 10px; }
  .sidebar-mini .brand-row { flex-direction: column; align-items: center; gap: 10px; margin-bottom: 14px; }
  .sidebar-mini .brand-row .brand { padding: 0; flex: none; }
  .sidebar-mini .brand-full { display: none !important; }
  .sidebar-mini .brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #fff; }
  .sidebar-mini .brand-mark img { width: 28px; height: 28px; object-fit: contain; }
  .sidebar-mini .sidebar-client, .sidebar-mini .nav-label, .sidebar-mini .nav-group-head { display: none; }
  .sidebar-mini .nav { gap: 2px; margin: 0; padding: 0; overflow-x: hidden; }
  .sidebar-mini .nav-section + .nav-section, .sidebar-mini .nav-group + .nav-group, .sidebar-mini .nav-section + .nav-group, .sidebar-mini .nav-group + .nav-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .sidebar-mini .nav-sub { display: flex; margin: 0; padding: 0; border: 0; }
  .sidebar-mini .nav a { position: relative; justify-content: center; padding: 10px 0; }
  .sidebar-mini .nav a .icon, .sidebar-mini .nav-sub a .icon { display: block; width: 20px; height: 20px; }
  /* Da ridotta restano solo le icone, centrate in un quadrato: il nome si legge al passaggio del mouse (title) */
  .sidebar-mini .nav a { width: 46px; height: 40px; margin: 0 auto; padding: 0; border-radius: 12px; gap: 0; }
  .sidebar-mini .nav-section + .nav-section { margin-top: 6px !important; padding-top: 6px !important; }
  .sidebar-mini .brand-row { margin-bottom: 8px; }
  .sidebar-mini .nav a > span:not(.nav-badge) { display: none; }
  .sidebar-mini .nav a::after { display: none; }
  .sidebar-mini .nav a.active { background: var(--blue); box-shadow: inset 3px 0 0 var(--amber); }
  .sidebar-mini .sidebar-collapse { margin: 0 auto; }

  .sidebar-mini .nav a .nav-badge { position: absolute; top: 3px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
  .sidebar-mini .sidebar-user { flex-direction: column; gap: 4px; }
  .sidebar-mini .user-chip { justify-content: center; flex: none; }
  .sidebar-mini .user-chip > span:last-child { display: none; }
}

/* Collaboratori: elenco con filtri, scheda, «Trova collaboratori» (partner-match.js), impostazioni */
.pt-filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; }
.pt-filters .pt-search { grid-column: 1 / -1; }
.pt-kinds { margin: 0 0 12px; flex-wrap: wrap; }
.pt-kinds .count { color: var(--gray); font-weight: 600; margin-left: 2px; }
.pt-skill { display: inline-block; margin: 0 2px 2px 0; padding: 1px 7px; border-radius: 10px; background: var(--blue-light); color: var(--blue); font-size: 12px; white-space: nowrap; }
.pt-score { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--blue-light); color: var(--blue); font-weight: 800; font-size: 13px; }
.pt-score.is-high { background: #d9f2e3; color: #14663d; }
.pt-score.is-low { background: var(--amber-light); color: #8a5a00; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--bg, #f6f8fb); }
.pt-detail { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.pt-main, .pt-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pt-case { white-space: normal; line-height: 1.6; }
.pt-ratings { display: grid; gap: 6px; margin: 8px 0 12px; }
.pt-rate { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; }
.pt-rate select { width: 76px; }
.pt-props { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pt-props li { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.pt-prop-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.pt-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pt-timeline li { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 10px; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.pt-timeline p { margin: 2px 0 0; }
.pt-ev-when { font-size: 12.5px; color: var(--gray); }
.pt-checks { border: 0; padding: 0; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.pt-checks legend { width: 100%; margin-bottom: 4px; }
.pt-ext { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--amber-light); color: #6b4a00; }
.pt-ext .icon { width: 13px; height: 13px; }
.pt-ai .check { margin-right: 12px; }
.pm h2 { display: flex; align-items: center; gap: 8px; }
.pm-brief fieldset { border: 0; padding: 0; margin: 10px 0; }
.pm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-chip { display: inline-flex; }
.pm-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pm-chip span { padding: 5px 11px; border: 1px solid var(--border); border-radius: 16px; font-size: 13px; cursor: pointer; background: var(--surface); }
.pm-chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.pm-chip input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.pm-list { display: grid; gap: 10px; margin: 10px 0; }
.pm-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface); }
.pm-card.is-excluded { opacity: .8; background: var(--bg, #f6f8fb); }
.pm-card-head { display: flex; align-items: flex-start; gap: 10px; }
.pm-card-head > div { flex: 1; min-width: 0; }
.pm-pick input { width: 18px; height: 18px; margin-top: 3px; }
.pm-score { display: flex; align-items: baseline; gap: 1px; color: var(--blue); }
.pm-score strong { font-size: 24px; font-family: var(--font-head); }
.pm-reasons { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.pm-reasons .is-ok { color: #14663d; }
.pm-reasons .is-ko { color: #8a5a00; }
.pm-excluded summary { cursor: pointer; font-weight: 600; margin-top: 8px; }
.pts-weights { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; align-items: end; }
.pts-weights .muted, .pts-weights .actions { grid-column: 1 / -1; }
.pts-templates fieldset { border: 0; padding: 0; margin: 14px 0; }
@media (max-width: 900px) { .pt-detail { grid-template-columns: minmax(0, 1fr); } .pt-timeline li { grid-template-columns: minmax(0, 1fr); } }
.web-funnel-bar { display: block; width: 100%; min-width: 120px; height: 10px; border-radius: 5px; background: var(--blue-light); overflow: hidden; }
.web-funnel-bar span { display: block; height: 100%; background: #2a78d6; border-radius: 5px; }

/* Pagine a schede (views/tab-host.js) ed Email marketing → Automazioni: della vista incorporata restano solo i pulsanti d'azione */
.tab-host-panel > .page-head .eyebrow, .tab-host-panel > .page-head h1, .tab-host-panel > .page-head > div > p.muted,
.em-auto > .page-head .eyebrow, .em-auto > .page-head h1, .em-auto > .page-head > div > p.muted { display: none; }
.tab-host-panel > .page-head, .em-auto > .page-head { margin-top: 0; justify-content: flex-end; }
.tab-host-panel > .page-head > div:empty, .em-auto > .page-head > div:empty { display: none; }

/* Business → Obiettivi (views/business-targets.js) */
.bt-kpis .kpi-card strong small { font-size: 13px; font-weight: 600; color: var(--gray); }
.bt-chain { list-style: none; margin: 4px 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.bt-chain li { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface); }
.bt-step { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; font-size: 12px; }
.bt-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bt-label { min-width: 150px; text-align: center; text-transform: capitalize; }
.bt-revenue td { border-top: 2px solid var(--border); }
.bt-ok { color: #14663d; font-weight: 700; }
.bt-ko { color: var(--gray); }
.bt-line-head td { background: var(--blue-light); font-weight: 700; color: var(--blue); }
.bt-line-head td small { font-weight: 500; color: var(--gray); }
.field-group-title { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray); }

.pg-form { display: grid; gap: 4px; }
.pg-form .check { margin-bottom: 8px; }

.pg-tick { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; margin-top: 1px; border-radius: 7px; border: 2px solid var(--gray-light, #b9c0cc); background: #fff; color: #fff; cursor: pointer; }
.pg-tick[aria-pressed="true"] { background: #1baf7a; border-color: #1baf7a; }
.pg-tick svg { width: 16px; height: 16px; }

.pg-ticked { color: #14663d; display: flex; gap: 6px; align-items: center; }
.pg-ticked svg { width: 16px; height: 16px; }

.nowrap { white-space: nowrap; }

.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.chip-check:has(input:checked) { border-color: var(--blue); background: var(--blue-light); }

.item-hub { flex-wrap: wrap; gap: 10px; }

#hub-settings .table .input-sm.num { width: 110px; }
#hub-settings .table td.actions { white-space: nowrap; }

/* Completa il profilo: percentuale, barra da 0 a 100 e le cose richieste (riusa barra ed elenco qui sotto) */
.pc-pct { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.pc-pct strong { font-family: var(--font-head); font-size: 32px; line-height: 1; color: var(--blue); }
.pc-head { margin-bottom: 18px; }
.pc-bar { height: 12px; }
.pc-dash .pc-pct strong { font-size: 24px; }
.pc-dash .pc-bar { margin-bottom: 10px; }
.gr-list.pc-list li { grid-template-columns: 26px minmax(0, 1fr) auto; }

.gr-bar { display: block; height: 10px; border-radius: 5px; background: var(--border); overflow: hidden; }
.gr-bar span { display: block; height: 100%; background: #2a78d6; border-radius: 5px; }

.gr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gr-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr) 70px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.gr-list li:last-child { border-bottom: 0; }
.gr-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); color: #fff; }
.gr-mark svg { width: 14px; height: 14px; }
.gr-list li.is-earned .gr-mark { border-color: #2a78d6; background: #2a78d6; }
.gr-list li.is-complete .gr-mark { border-color: #1baf7a; background: #1baf7a; }
.gr-count { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--gray); }

@media (max-width: 760px) {
  .gr-list li { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .gr-list li .btn { grid-column: 2 / -1; justify-self: start; }
}

@keyframes pts-pop { 0% { transform: scale(1); } 35% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(2, 63, 130, .12); } 100% { transform: scale(1); } }

/* Pannello: al passaggio del mouse (schermi con puntatore) e al clic */
.dropdown-pts { width: 340px; padding: 16px; display: flex; flex-direction: column; gap: 14px; right: 0; }
.dropdown-pts[hidden] { display: none; }

.dropdown-pts a { color: inherit; }

.dropdown-call { min-width: 270px; padding: 10px; }
.dropdown-call-head { display: flex; flex-direction: column; gap: 2px; margin: 2px 4px 10px; font-size: 14px; }
.dropdown-call a.btn { justify-content: center; color: #fff; margin-bottom: 4px; }
.dropdown-call a.btn .icon { color: #fff; }

/* I tuoi colleghi (impostazioni del cliente) */
.col-list { list-style: none; margin: 0 0 18px; padding: 0; }
.col-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.col-list .col-name { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.col-form h3 { margin: 0 0 10px; font-size: 16px; }

.reading-hint { margin-left: 10px; }

/* Framework del Marketing Hub: copertine del sito, guida gratuita e scheda di output professionale */
.fw-lib-card.has-cover { padding-top: 0; overflow: hidden; }

.fw-sheet { margin: 10px 0 0; background: #fff; color: #1d2433; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(2, 63, 130, .10); overflow: hidden; }
.fw-sheet-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 16px 20px; background: linear-gradient(120deg, #023f82, #2a78d6); color: #fff; }
.fw-sheet-head h3 { margin: 2px 0 0; font-size: 20px; color: #fff; }
.fw-sheet-kicker { margin: 0; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; opacity: .85; }
.fw-sheet-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; opacity: .95; }
.fw-sheet-meta .badge { background: rgba(255,255,255,.2); color: #fff; }
.fw-sheet-purpose { margin: 0; padding: 10px 20px; font-size: 13px; color: #5b6475; border-bottom: 1px solid #eef1f5; }
.fw-sheet-body { padding: 16px 20px; }
.fw-sheet-foot { display: flex; justify-content: space-between; padding: 8px 20px; font-size: 11px; letter-spacing: .5px; text-transform: uppercase; color: #8a93a3; background: #f7f9fc; border-top: 1px solid #eef1f5; }
.fw-sheet.is-sample .fw-sheet-body { position: relative; }
@media (max-width: 640px) { .fw-sheet-meta { align-items: flex-start; } .fw-sheet-body, .fw-sheet-head { padding-left: 12px; padding-right: 12px; } }
@media print { .fw-sheet { box-shadow: none; } }

/* Metodi di pagamento nel preventivo: bonifico istantaneo consigliato in risalto, badge di commissioni e verifica */
.pm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-bottom: 12px; }
.pm-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.pm-card.is-recommended { border: 2px solid #1baf7a; box-shadow: 0 6px 18px rgba(27, 175, 122, .15); }
.pm-reco { position: absolute; top: -11px; left: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; background: #1baf7a; color: #fff; font-size: 12px; font-weight: 700; }
.pm-reco .icon { width: 13px; height: 13px; }
.pm-head { display: flex; align-items: center; gap: 8px; }
.pm-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--blue-lighter); color: var(--blue); }
.pm-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; }
.pm-good { background: #e9f8f1; color: #0d6e4b; border-color: #bfe9d6; }
.pm-warn { background: #fff4e0; color: #8a5a00; border-color: #f4d9a6; }
.pm-info { background: var(--blue-lighter); color: var(--blue-dark); }
.pm-card .btn { align-self: flex-start; margin-top: auto; }
.pm-calc { padding-top: 6px; border-top: 1px dashed var(--border); }
.pm-sum { margin: 0 0 8px; }
.pm-sum > div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 2px 0; }
.pm-sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.pm-sum .pm-total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }
.pm-set { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; }
.pm-set legend { font-weight: 700; padding: 0 6px; }

/* Area dei collaboratori (/collaboratori/area): barra con il profilo completato, Da fare, richieste e offerte */
.pa { max-width: 980px; margin: 0 auto; padding: 16px; }
.pa-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 12px 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.pa-logo { height: 34px; width: auto; }
.pa-me { display: flex; flex-direction: column; margin-right: auto; }
.pa-progress { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.pa-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.pa-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--blue-lighter); overflow: hidden; min-width: 120px; }
.pa-bar > span { display: block; height: 100%; background: #2a78d6; border-radius: 999px; }
.pa-bell { display: inline-flex; align-items: center; gap: 4px; border: 0; background: #eb6834; color: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 700; cursor: pointer; }
.pa-bell .icon { width: 15px; height: 15px; }
.pa-tabs { margin-bottom: 14px; flex-wrap: wrap; }
.pa-todo { list-style: none; margin: 0; padding: 0; }
.pa-todo li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pa-todo li .btn { margin-left: auto; }
.pa-todo li.is-done .gr-mark { background: #1baf7a; border-color: #1baf7a; }
.pa-todo li.is-done span:not(.gr-mark) { color: var(--muted); }
.pa-callout { display: flex; align-items: center; gap: 12px; border-left: 4px solid #eb6834; }
.pa-callout div { margin-right: auto; }
.pa-req.is-open { border-left: 4px solid #2a78d6; }
.pa-req-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pa-req-head h3 { margin: 2px 0; }
.pa-req-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 8px 0; padding: 0; font-size: 14px; color: var(--gray); }
.pa-req-meta .icon { width: 15px; height: 15px; }
.pa-req-desc { white-space: normal; }
.pa-offer { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-lighter); margin: 8px 0; }
.pa-offer-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.pa-offer-form h4 { margin: 0 0 8px; }
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pa-chip span { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; cursor: pointer; }
.pa-chip input:checked + span { background: #2a78d6; border-color: #2a78d6; color: #fff; }
.pa-chip input:focus-visible + span { outline: 2px solid #2a78d6; outline-offset: 2px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .grid-3 { grid-template-columns: 1fr; } }

.is-reco { border: 2px solid #2a78d6 !important; box-shadow: 0 6px 18px rgba(42, 120, 214, .14); }
.hg-reco-badge { display: inline-flex; align-items: center; gap: 4px; background: #2a78d6; color: #fff; font-weight: 700; align-self: flex-start; margin-bottom: 6px; }
.hg-reco-badge .icon { width: 13px; height: 13px; }

@keyframes rw-in { from { transform: translateY(24px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rw-out { to { transform: translateY(12px); opacity: 0; } }
@keyframes rw-glow { 50% { box-shadow: 0 0 0 10px rgba(237, 161, 0, .18); } }

.dropdown-pts > * { flex-shrink: 0; }

/* Marketing Hub: badge «Accesso con Marketing Hub», guide passo passo in stile card, scheda dei benefici e finestra di accesso */
.badge-hub { display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(90deg, #023F82, #2a78d6); color: #fff; font-weight: 700; }
.badge-hub .icon { width: 12px; height: 12px; color: #fff; }
.guide-card-hub { position: relative; overflow: hidden; border-color: rgba(2, 63, 130, .25); }
.guide-card-hub.is-reco { box-shadow: 0 0 0 2px rgba(2, 63, 130, .25); }
.guide-card-cover { display: block; margin: -18px -18px 4px; aspect-ratio: 16 / 7; overflow: hidden; background: var(--blue-lighter, #eef4fb); }
.guide-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.guide-card-hub .guide-meta { flex-wrap: wrap; }
.guide-run { display: flex; flex-direction: column; gap: 4px; }
.guide-grid-hub { margin-bottom: 26px; }
.guides-free-title { display: flex; align-items: center; gap: 8px; }

.hubx { display: flex; flex-direction: column; gap: 14px; }

/* Impostazioni → Pagamenti: metodi visibili nel preventivo */
.pm-settings .card-head { align-items: flex-start; gap: 12px; }
.pm-set-title { display: flex; align-items: center; gap: 8px; margin-top: 24px; }
.pm-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pm-set-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface, #fff); transition: opacity .15s, border-color .15s; }
.pm-set-card header { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; }
.pm-set-card.is-off { opacity: .6; border-style: dashed; }
.pm-set-card p { margin: 0; }
.pm-reco-inline { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; color: var(--ok, #1baf7a); }
.pm-reco-inline svg { width: 12px; height: 12px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border, #cfd6e0); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--blue, #023F82); }
.mockup-switches { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 6px; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray); cursor: pointer; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue, #023F82); outline-offset: 2px; }

.guide-sector { border-left: 3px solid var(--blue); }

.is-level-locked { position: relative; }
.is-level-locked::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(255, 255, 255, .45); pointer-events: none; }
.is-level-locked .content-cover, .is-level-locked h3 { filter: grayscale(.4); }

/* Barra laterale: icona dell'azienda (favicon del sito) al posto dell'avatar */
.user-chip-icon { display: flex; flex: none; }
.company-icon { width: 36px; height: 36px; padding: 4px; border-radius: 50%; background: #fff; object-fit: contain; }

.guide-card.has-cover { padding-top: 18px; overflow: hidden; }
.guide-card.has-cover .guide-card-cover { aspect-ratio: 16 / 9; }
.guide-art-cover { margin: 8px 0 14px; border-radius: var(--radius); overflow: hidden; }
.guide-art-cover img { display: block; width: 100%; max-height: 260px; object-fit: cover; }

/* Guide: libere e del Marketing Hub nella stessa griglia, con i filtri a lato (area tematica, accesso, stato) */
.guides-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.guides-filters { position: sticky; top: calc(var(--topbar-h, 64px) + 12px); margin: 0; padding: 16px; }
.guides-filters h3 { margin: 14px 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gray); }
.guides-filters h3:first-child { margin-top: 0; }
.gf-group { display: flex; flex-direction: column; gap: 2px; }
.gf-opt { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; font-size: 14px; color: var(--text); text-align: left; cursor: pointer; }
.gf-opt small { color: var(--muted); font-size: 12px; }
.gf-opt:hover { background: var(--blue-lighter); }
.gf-opt[aria-pressed="true"] { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.guides-filters .guide-progress { margin-top: 16px; }
.guides-main .group-title { margin-top: 0; }
@media (max-width: 860px) {
  .guides-layout { grid-template-columns: 1fr; }
  .guides-filters { position: static; }
  .gf-group { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .gf-opt { width: auto; border: 1px solid var(--border); border-radius: 999px; }
}
.guide-grid .guide-card-cover { aspect-ratio: 16 / 9; }

/* Conoscenza di base: schede Piattaforma, Glossario, KPI */
.kb-tabs { margin-bottom: 16px; }
.help-compact-head { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.guide-card.is-reco { box-shadow: 0 0 0 2px rgba(42, 120, 214, .35); }

.fw-lib-card > .badge-hub{ align-self: flex-start; }

/* Panoramica del cliente: colonna laterale con Marketing Hub, fatture e preventivi */
.client-dash-grid { grid-template-columns: minmax(0, 1fr) 380px; }
.client-dash-grid .dash-side .list-row { flex-wrap: wrap; row-gap: 4px; }
.client-dash-grid .dash-side .list-main { flex: 1 1 100%; min-width: 0; }
.client-dash-grid .dash-side .list-meta { margin-left: auto; }
@media (max-width: 1180px) { .client-dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* Card delle guide: una riga di badge (accesso, livello, consigliata), poi titolo e testo, in fondo tempo e stato.
   Le card di un livello non ancora raggiunto restano nitide: il lucchetto sul livello e, al clic, la finestra «cosa ti manca» */
.guide-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.guide-badges .badge { white-space: nowrap; }
.guide-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--gray); }
.guide-foot .icon { width: 14px; height: 14px; vertical-align: -2px; }
.guide-time { display: inline-flex; align-items: center; gap: 4px; }
.guide-state.is-done { color: var(--green); font-weight: 600; }
.guide-card .guide-go { margin-top: 0; }
.is-level-locked::after { content: none; }
.is-level-locked .content-cover, .is-level-locked h3 { filter: none; }

.seg a { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--font-head); color: var(--blue); padding: 5px 12px; border-radius: 999px; text-decoration: none !important; }
.seg a .icon { width: 14px; height: 14px; }
.seg a[aria-pressed="true"] { background: var(--blue); color: #fff; box-shadow: var(--shadow-sm); }

#call-open { position: relative; }

.req-type.is-off { opacity: .6; cursor: not-allowed; }
.req-hub-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); background: #fff8e8; border: 1px solid #f1d9a4; color: #6b4708; }
.req-hub-note .icon { width: 16px; height: 16px; color: #b7791f; }

/* Schede dei gruppi del menu del cliente (Knowledge Center, Strumenti, Supporto): sopra la pagina, ognuna al suo indirizzo */
.section-tabs-wrap { padding: 24px 36px 0; max-width: 1320px; width: 100%; }
.section-tabs-wrap .eyebrow { margin: 0 0 6px; }
.section-tabs { margin-bottom: 0; }
.section-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font: 600 14px var(--font-head); color: var(--gray); text-decoration: none !important; border-bottom: 2.5px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.section-tabs a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }

.section-tabs-wrap:not([hidden]) + .view { padding-top: 18px; }
@media (max-width: 860px) { .section-tabs-wrap { padding: 12px 16px 0; } }

/* Analisi → Sito web (views/analysis.js) */
.sa-start-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.sa-start-form .field { flex: 1 1 280px; margin: 0; }
.sa-row { display: flex; align-items: center; gap: 12px; }
.sa-row .list-main { flex: 1; min-width: 0; }
.sa-row-score { min-width: 38px; text-align: center; font-size: 14px; }
.sa-wait { display: flex; gap: 16px; align-items: center; }
.sa-hero-score { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.sa-hero-score h2 { margin: 2px 0 4px; font-size: 26px; }
.sa-summary { margin: 14px 0 0; font-size: 15px; line-height: 1.55; }
.sa-ring-bg { fill: none; stroke: var(--blue-light); stroke-width: 10; }
.sa-ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; stroke: #2a78d6; }
.sa-ring-success .sa-ring-fg { stroke: #1baf7a; } .sa-ring-warn .sa-ring-fg { stroke: #eda100; } .sa-ring-danger .sa-ring-fg { stroke: #e34948; }
.sa-ring text { font: 700 30px var(--font-head); fill: var(--ink, #10243e); }
.sa-five { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 10px 0; }
.sa-five > div { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--blue-light); }
.sa-five small { color: var(--gray); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.sa-five .sa-five-miss { background: #fdecec; }
.sa-chart { width: 100%; height: auto; max-width: 760px; display: block; }
.sa-chart-label { font: 600 12px var(--font-body, sans-serif); fill: var(--ink, #10243e); }
.sa-chart-val, .sa-chart-axis { font: 600 11px var(--font-body, sans-serif); fill: var(--gray, #5b6b7f); }
.sa-chart-track { fill: var(--blue-light); } .sa-chart-grid { stroke: rgba(2, 63, 130, .08); }
.sa-chart-bar { fill: #2a78d6; } .sa-bar-success { fill: #1baf7a; } .sa-bar-warn { fill: #eda100; } .sa-bar-danger { fill: #e34948; }
.sa-table { margin-top: 8px; } .sa-table summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); }
.sa-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.sa-two > .card { margin: 0; }
.sa-list { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.sa-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sa-filters .seg { flex-wrap: wrap; flex-shrink: 1; max-width: 100%; border-radius: 18px; }
/* Pagina pubblica dell'analisi (views/public-site-audit.js): indirizzi lunghi che vanno a capo */
.sa-public h1 { overflow-wrap: anywhere; }
.sa-int-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sa-int { border: 1px solid var(--border, #e3e8ef); border-left: 4px solid #2a78d6; border-radius: 10px; padding: 12px 14px; }
.sa-int-subito { border-left-color: #e34948; } .sa-int-pianifica { border-left-color: #eda100; } .sa-int-quando_puoi { border-left-color: #b8c2cf; }
.sa-int-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sa-int-meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 6px 0; color: var(--gray); }
.sa-int-meta .icon { width: 13px; height: 13px; vertical-align: -2px; }
.sa-int p { margin: 4px 0; }
.sa-int-res summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); }
.sa-int-res summary .icon { width: 14px; height: 14px; vertical-align: -2px; }
.sa-res { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.sa-res-item { display: grid; padding: 6px 10px; border-radius: 8px; background: var(--blue-light); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--blue); }
.sa-res-item small { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray); font-weight: 600; }
.sa-area { border-top: 1px solid var(--border, #e3e8ef); padding: 10px 0; }
.sa-area summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; }
.sa-checks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.sa-checks li { display: flex; gap: 8px; align-items: flex-start; }
.sa-checks .icon { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }
.sa-check-ok .icon { color: #1baf7a; } .sa-check-warn .icon { color: #eda100; } .sa-check-bad .icon { color: #e34948; }
.sa-pages { margin: 0; padding-left: 18px; display: grid; gap: 4px; word-break: break-word; }
@media print { .sa-filters, [data-again], [data-print], .sa-start { display: none !important; } }

.flag-row { display: grid; gap: 8px; padding: 6px 0; }
.flag-row header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Posti, colleghi e referente (E6): riepilogo dei posti e azioni del referente nell'elenco dei colleghi */
.col-seats { margin: 0 0 12px; }
.col-seats p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.col-list .col-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }

/* Sicurezza e compliance (E14): verifica in due passaggi, codici di recupero, accordo art. 28 nella firma, sub-responsabili */
.twofa-steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.twofa-secret code, .twofa-list code { font-size: 1.05em; letter-spacing: .06em; overflow-wrap: anywhere; }
.twofa-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 8px 0 12px; padding-left: 20px; }
.dpa-box summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.sub-row { padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }

/* Obiettivi e risultati → Obiettivi del cliente (views/goals.js): obiettivi scelti nel questionario e risposte collegate */
.cg-card { margin-bottom: 18px; }
.cg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cg-list li { display: flex; align-items: center; gap: 12px; font-size: 17px; }
.cg-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue-light); color: var(--blue); font-weight: 700; flex: none; }
.cg-answers { display: grid; gap: 14px; margin: 0; }
.cg-answers dt { color: var(--muted); font-size: 13px; }
.cg-answers dd { margin: 2px 0 0; font-weight: 600; }
.cg-pre { white-space: pre-line; }

/* Brand Digitalandmore nelle trattative e report dell'analisi del sito (views/deals.js) */
.chip-brand { background: #fdeee6; color: #9a3d12; }
.lead-report { margin-top: 12px; }
.lead-report summary { cursor: pointer; font-weight: 600; }
.lead-report-html { margin-top: 10px; max-height: 480px; overflow: auto; border: 1px solid var(--border, #e3e8ef); border-radius: 8px; padding: 12px 16px; font-size: 14px; overflow-wrap: anywhere; }
.lead-report-html table { max-width: 100%; }
.lead-report-text { white-space: pre-wrap; font-size: 13px; max-height: 480px; overflow: auto; }

/* Progetti web: etichetta nelle trattative e nel CRM, demo del progetto nel preventivo (quote-read.js, quote-demos.js) */
.chip-web { background: #e6f4ee; color: #12643f; }
.quote-demos { margin: 28px 0; break-inside: avoid; }
.quote-demos h2 { margin: 0 0 4px; }
.quote-demos-list { display: grid; gap: 12px; margin-top: 12px; }
.quote-demo-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: linear-gradient(135deg, #eaf2fd, #f5f9ff); border: 1px solid #c9dcf5; border-left: 4px solid var(--blue); border-radius: 12px; break-inside: avoid; }
.quote-demo-body { flex: 1; min-width: 0; display: grid; gap: 2px; justify-items: start; }
.quote-demo-body strong { font-size: 16px; line-height: 1.3; }
.quote-demo-body small { display: block; font-size: 12.5px; }
.quote-demo-body p { margin: 2px 0; font-size: 14px; color: var(--gray); }
.quote-demo-body strong { overflow-wrap: anywhere; }
.demo-admin-list .list-main strong { display: inline-flex; align-items: center; gap: 6px; }
.demo-admin-list .list-main small { overflow-wrap: anywhere; }
.web-projects .list { margin: 0; }
@media (max-width: 640px) { .quote-demo-card { flex-wrap: wrap; } }

/* Anteprima del preventivo per lo studio: metodi di pagamento come li vede il cliente dopo la firma (views/quote.js) */
.pm-preview { margin-top: 24px; padding-top: 16px; border-top: 2px dashed var(--border-strong); }
.pm-preview .pm-wrap { margin-top: 8px; }

/* Pagamento solo con bonifico istantaneo (payment-methods.js, quote-read.js) */
.pm-only p { margin: 0 0 8px; }
.pm-warning { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--amber-light); color: var(--amber-dark); }
.pm-steps { margin: 8px 0 12px; padding-left: 20px; display: grid; gap: 4px; }
.pm-notice { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--green-light); display: grid; gap: 8px; justify-items: start; }
.pm-notice p, .pm-pending { margin: 0; }
.pm-pending { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--blue-lighter); display: flex; gap: 8px; align-items: flex-start; }
.quote-paynote { display: flex; gap: 14px; margin: 20px 0; padding: 14px 16px; border: 1px solid #c9dcf5; border-left: 4px solid var(--blue); border-radius: 12px; background: var(--blue-lighter); break-inside: avoid; }
.quote-paynote p { margin: 4px 0 0; font-size: 14px; }
.pm-ready li { margin-bottom: 10px; }

/* Caricamento dei file con avanzamento (frontend/js/upload.js) */
.upload-sheet { padding: 26px 26px 22px; display: grid; gap: 10px; }
.upload-sheet h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.upload-sheet h2 .icon { color: var(--blue); }
.upload-name { margin: 0; overflow-wrap: anywhere; color: var(--gray); }
.upload-bar { height: 12px; border-radius: 999px; background: var(--blue-light, #e8f0fb); overflow: hidden; position: relative; }
.upload-bar > span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width .2s ease; }
.upload-bar.is-busy > span { width: 35% !important; position: absolute; animation: upload-busy 1.1s ease-in-out infinite; }
@keyframes upload-busy { 0% { left: -35%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .upload-bar.is-busy > span { animation: none; width: 100% !important; opacity: .5; } }
.upload-status { margin: 0; color: var(--gray); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.upload-sheet .actions { justify-content: flex-end; }

/* Informativa privacy in una finestra (frontend/js/privacy-popup.js): testo di iubenda leggibile su telefono e computer */
.sheet-body:has(> .privacy-sheet) { padding: 0; height: 100%; }
.privacy-sheet { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.privacy-sheet > h2 { display: flex; align-items: center; gap: 10px; margin: 0; padding: 22px 56px 14px 24px; font-size: 20px; border-bottom: 1px solid var(--border); }
.privacy-sheet > h2 .icon { color: var(--blue); }
.privacy-doc { flex: 1; min-height: 160px; overflow-y: auto; padding: 18px 24px; font-size: 15px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; -webkit-overflow-scrolling: touch; }
.privacy-doc h1, .privacy-doc h2, .privacy-doc h3, .privacy-doc h4 { font-size: 16px; margin: 20px 0 6px; padding: 0; border: 0; line-height: 1.35; }
.privacy-doc h1:first-child, .privacy-doc h2:first-child, .privacy-doc h3:first-child { margin-top: 0; }
.privacy-doc p, .privacy-doc ul, .privacy-doc ol { margin: 0 0 10px; }
.privacy-doc ul, .privacy-doc ol { padding-left: 20px; }
.privacy-doc a { color: var(--blue); }
.privacy-doc table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 12px; font-size: 14px; }
.privacy-doc th, .privacy-doc td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.privacy-doc-frame { padding: 0; position: relative; min-height: 60vh; }
.privacy-doc-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.privacy-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 24px; border-top: 1px solid var(--border); background: var(--surface); }
@media (max-width: 640px) {
  .privacy-sheet { max-height: none; height: 100%; }
  .privacy-sheet > h2 { padding: 18px 52px 12px 16px; font-size: 18px; }
  .privacy-doc { padding: 14px 16px; font-size: 15px; }
  .privacy-foot { flex-direction: column-reverse; align-items: stretch; gap: 6px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .privacy-foot .btn { justify-content: center; }
}

/* Ciclo di vita del CRM (lifecycle.js): suspect → lead → prospect → opportunity → customer */
.lc-card .card-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lc-steps { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; counter-reset: none; }
.lc-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); text-align: center; font-size: 13px; }
.lc-steps li.is-done { border-color: #bfe5d2; background: #f1faf5; }
.lc-steps li.is-current { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 1px var(--blue) inset; }
.lc-dot { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--border); color: var(--text); font-weight: 800; font-size: 12px; }
.lc-steps li.is-done .lc-dot { background: #1baf7a; color: #fff; }
.lc-steps li.is-current .lc-dot { background: var(--blue); color: #fff; }
.lc-dot svg { width: 14px; height: 14px; }
.lc-next, .lc-gaps { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-light); font-size: 14px; }
.lc-gaps { background: #fff7e6; display: flex; gap: 8px; align-items: flex-start; }
.lc-missing { margin: 4px 0 0 18px; padding: 0; }
.lc-bant { margin: 0 0 8px; }
.lc-log { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.lc-form .grid-2 { margin-top: 8px; }
.lc-form .lc-error .form-error { margin: 8px 0; }
.lc-stats-wrap { margin: 0 0 14px; }
.lc-stats-wrap > summary { cursor: pointer; font-weight: 600; color: var(--blue); display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.lc-stats-wrap > summary svg { width: 16px; height: 16px; }
.lc-counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.lc-counts div { display: flex; flex-direction: column; padding: 10px; border-radius: var(--radius-sm); background: var(--blue-light); text-align: center; }
.lc-counts strong { font-family: var(--font-head); font-size: 22px; color: var(--blue); }
@media (max-width: 640px) { .lc-steps, .lc-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Appuntamenti: finestra di creazione, riquadro in attesa, impostazioni (frontend/js/appointments.js, appointments-settings.js) */
.ap-form fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.ap-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.ap-options-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ap-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); }
.ap-option:has(input:checked) { border-color: var(--blue); background: var(--blue-light); }
.ap-option input { margin-top: 3px; accent-color: var(--blue); }
.ap-option strong { display: block; font-size: 14px; }
.ap-option small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; }
.ap-who { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--blue-light); margin-bottom: 14px; }
.ap-who svg { width: 16px; height: 16px; vertical-align: -3px; }
.ap-search { margin-bottom: 14px; }
.ap-results { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; }
.ap-results li button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; font: inherit; }
.ap-results li button:hover, .ap-results li button:focus-visible { background: var(--blue-light); }
.ap-results li.muted { padding: 9px 12px; }
.ap-external { margin-top: 10px; }
.ap-external summary { cursor: pointer; font-size: 14px; color: var(--blue); }
.ap-external .grid-2 { margin-top: 10px; }
.ap-pending .list { margin: 0; }
.ap-row { width: 100%; text-align: left; border: 0; background: none; font: inherit; cursor: pointer; }
.ap-cancel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: grid; gap: 10px; }
.ap-profile fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.ap-days { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.ap-day { position: relative; cursor: pointer; }
.ap-day input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ap-day span { display: inline-block; padding: 7px 12px; border: 1.5px solid var(--border-strong); border-radius: 999px; font-size: 13.5px; }
.ap-day input:checked + span { border-color: var(--blue); background: var(--blue); color: #fff; }
.ap-day input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.ap-windows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.ap-window { display: flex; align-items: center; gap: 8px; }
.ap-window .input { min-width: 0; }
.ap-map { display: grid; gap: 8px; justify-items: start; }
.ap-map iframe { width: 100%; height: 260px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
@media (max-width: 640px) { .ap-options, .ap-options-2, .ap-windows { grid-template-columns: 1fr; } }

/* CRM: selettore Contatti / Aziende e vista per azienda; moduli con l'anagrafica uniforme (contact-fields.js) */
.crm-mode { flex: none; }
.crm-mode button { display: inline-flex; align-items: center; gap: 6px; }
.crm-mode .icon { width: 15px; height: 15px; }
.crm-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.crm-people a { font-weight: 600; }
.cf-form > .cf-head { margin: 14px 0 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.cf-form > .cf-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* Collaboratori: viste Attivi / Archiviati accanto a quelle per tipo */
.pt-views { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; margin: 0 0 12px; }
.pt-views .pt-kinds { margin: 0; }
.pt-archive .count { color: var(--gray); font-weight: 600; margin-left: 2px; }
.pt-archive button { display: inline-flex; align-items: center; gap: 6px; }
.pt-archive .icon { width: 15px; height: 15px; }
.pt-restore { margin-top: 6px; white-space: nowrap; }

/* Calendario: appuntamenti in attesa in una barra chiudibile; gruppi di task, contenuti e scadenze nella cella del mese */
.ap-pending { margin: 0 0 14px; border: 1px solid #f1d9a6; border-radius: 12px; background: #fffaf0; }
.ap-pending > summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.ap-pending > summary::-webkit-details-marker { display: none; }
.ap-pending > summary::after { content: '▾'; margin-left: auto; color: var(--gray); }
.ap-pending[open] > summary::after { content: '▴'; }
.ap-pending > summary .icon { width: 16px; height: 16px; color: #b07800; }
.ap-pending .count { min-width: 22px; padding: 1px 7px; border-radius: 99px; background: #eda100; color: #fff; font: 700 12px var(--font-head); text-align: center; }
.ap-pending-names { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 200px; }
.ap-pending-list { list-style: none; margin: 0; padding: 0 8px 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.ap-pending-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid #f1e3c4; border-radius: 8px; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.ap-pending-row:hover { border-color: #eda100; }
.ap-pending-row span:first-child { display: flex; flex-direction: column; min-width: 0; }
.ap-pending-row small { color: var(--gray); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-pending-row .badge { flex: none; }
.cal-group { font-weight: 600; }
.cal-group b { font-family: var(--font-head); }
.cal-side-sub { display: flex; align-items: center; gap: 6px; }
.cal-side-sub:first-of-type { margin-top: 4px; }
/* Pannello del giorno più compatto: niente «Tutto il giorno» per task e contenuti senza orario, stato accanto al testo */
.cal-side .cal-row { grid-template-columns: 46px 28px minmax(0, 1fr); padding: 7px 6px; row-gap: 2px; }
.cal-side .cal-row-ico { width: 28px; height: 28px; border-radius: 8px; }
.cal-side .cal-row-time.is-allday { font-size: 0; }
.cal-side .cal-row-time.is-allday b { font-size: 12px; }
.cal-side .cal-row .badge { font-size: 11px; padding: 1px 7px; }

/* Telefono: le tabelle di elenco diventano schede (app.js → cardTables): la prima cella fa da titolo, le altre hanno l'etichetta della
   colonna a sinistra e il valore a destra; le azioni in fondo, allineate a destra. Le tabelle compatte e le matrici restano a scorrimento */
@media (max-width: 640px) {
  .table-wrap:has(> .table.is-cards) { background: transparent; border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
  .table.is-cards, .table.is-cards > tbody { display: block; width: 100%; }
  .table.is-cards > thead { display: none; }
  .table.is-cards > tbody > tr { display: block; margin: 0 0 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
  /* Etichetta a sinistra (float) e valore che scorre a destra: testo, righe secondarie (.block) e chip vanno a capo invece di
     dividersi la riga in colonne strette */
  .table.is-cards > tbody > tr > td { display: flow-root; padding: 6px 0; border: 0; text-align: right; min-width: 0 !important; white-space: normal; overflow-wrap: anywhere; position: static; box-shadow: none; background: none; }
  .table.is-cards > tbody > tr > td::before { content: attr(data-label); float: left; max-width: 50%; margin-right: 12px; overflow-wrap: normal; text-align: left; font: 700 11px var(--font-head); letter-spacing: .5px; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
  .table.is-cards > tbody > tr > td[data-label=""]::before { display: none; }
  .table.is-cards > tbody > tr > td:first-child { display: block; text-align: left; padding-top: 2px; font-size: 15px; }
  .table.is-cards > tbody > tr > td:first-child::before { display: none; }
  .table.is-cards > tbody > tr > td.row-actions, .table.is-cards > tbody > tr > td.crm-actions, .table.is-cards > tbody > tr > td.num:last-child:has(button, a.btn) { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; border-top: 1px solid var(--border); margin-top: 4px; padding-top: 8px; }
  .table.is-cards > tbody > tr > td.row-actions::before, .table.is-cards > tbody > tr > td.crm-actions::before { display: none; }
  .table.is-cards > tbody > tr > td:empty { display: none; }
  .table.is-cards > tbody > tr:hover > td { background: none; }
  .table.is-cards > tbody > tr.is-overdue, .table.is-cards > tbody > tr.row-danger { border-left: 3px solid var(--danger, #e34948); }
}
/* Collaboratori: filtri in un riquadro apribile (sul computer aperto e senza intestazione), viste che scorrono sul telefono */
.pt-filters { display: block; }
.pt-filters .pt-search { margin-bottom: 10px; }
.pt-more > summary { display: none; }
.pt-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; }
.pt-more .count { min-width: 20px; padding: 1px 7px; border-radius: 99px; background: var(--blue); color: #fff; font: 700 11px var(--font-head); }
@media (max-width: 640px) {
  .pt-views { flex-wrap: nowrap; flex-direction: column; gap: 8px; }
  .pt-views .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .pt-views .seg.is-end { -webkit-mask-image: none; mask-image: none; }
  .pt-skill { max-width: 100%; margin: 2px 0 2px 4px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
  .pt-views .seg::-webkit-scrollbar { display: none; }
  .pt-views .seg button { white-space: nowrap; flex: none; }
  .pt-more > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font: 700 14px var(--font-head); color: var(--blue); padding: 4px 0; list-style: none; }
  .pt-more > summary::-webkit-details-marker { display: none; }
  .pt-more > summary::after { content: '▾'; margin-left: auto; color: var(--gray); }
  .pt-more[open] > summary::after { content: '▴'; }
  .pt-more[open] .pt-more-grid { margin-top: 10px; grid-template-columns: 1fr 1fr; }
}
/* Telefono: righe degli elenchi (task, solleciti…) con testo e dettagli su due righe invece che schiacciati; Timing a griglia ordinata */
@media (max-width: 640px) {
  .list-row { flex-wrap: wrap; row-gap: 6px; }
  .list-row > .list-main { flex: 1 1 200px; min-width: 0; }
  .list-row > .list-meta { flex-wrap: wrap; margin-left: auto; justify-content: flex-end; row-gap: 6px; }
  .task-row > .list-meta { margin-left: 30px; justify-content: flex-start; }
}
@media (max-width: 1000px) {
  .timing-head { grid-template-columns: 18px repeat(2, minmax(0, 1fr)); }
  .timing-head .timing-name, .timing-head .timing-use { grid-column: 2 / -1; }
  .timing-head .timing-caret { grid-row: 1; }
}
@media (max-width: 640px) {
  /* Le colonne azioni fisse a destra (documenti, CRM) nelle schede tornano normali, senza ombra */
  .table.is-cards > tbody > tr > td.row-actions, .table.is-cards > tbody > tr > td.crm-actions, .table.is-cards > tbody > tr > td.doc-actions { position: static !important; box-shadow: none !important; background: none !important; }
  /* Schede dentro un riquadro: senza ombra né secondo bordo pieno */
  .card .table.is-cards > tbody > tr { box-shadow: none; background: var(--bg, #f6f8fc); }
}
@media (max-width: 1000px) {
  .timing-head > .timing-num:nth-child(3) { grid-column: 2; }
}
/* Con una finestra aperta il pulsante dell'assistente non copre i campi */
body:has(.sheet-backdrop) .aw-launcher, body:has(.modal-backdrop) .aw-launcher { display: none; }
/* Appuntamenti: cestino dentro le righe (Calendario, schede del collaboratore e del CRM) e pulsante «Sposta» accanto alla videochiamata */
.ap-del { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--gray); cursor: pointer; flex: none; }
.ap-del:hover, .ap-del:focus-visible { color: var(--danger, #e34948); background: #fdecec; outline: none; }
.ap-del svg { width: 16px; height: 16px; }
.cal-row:has(.ap-del) { position: relative; padding-right: 40px; }
.cal-row .ap-del { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); }
.cal-side .cal-row .ap-del { top: 6px; transform: none; }
.ap-row .list-meta { align-items: center; gap: 6px; }
.pt-interview { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pt-interview p { margin: 0; }
/* Marketing dello studio (Lo studio → Marketing): pubblico e segmenti, buyer personas, canali e mappa del funnel */
.smk { display: grid; gap: 18px; }
.smk > * { min-width: 0; }
.smk .card-head h2 { display: flex; align-items: center; gap: 8px; }
.smk .card-head p { margin: 2px 0 0; }
.smk-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.smk-head-actions select.input { width: auto; min-width: 180px; }
.smk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.smk-card, .smk-persona, .smk-channel { display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: left; width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, #fff); font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.smk-card:hover, .smk-persona:hover, .smk-channel:hover, .smk-card:focus-visible, .smk-persona:focus-visible, .smk-channel:focus-visible { border-color: var(--blue); box-shadow: var(--shadow-sm); outline: none; }
.smk-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.smk-card-head strong { margin-right: auto; }
.smk-meta { display: flex; align-items: center; gap: 6px; color: var(--gray); font-size: 13.5px; }
.smk-meta .icon { width: 16px; height: 16px; }
.smk-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.smk-chip { display: inline-block; max-width: 100%; padding: 2px 9px; border-radius: 99px; background: var(--blue-light); color: var(--blue); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.smk-chip.is-zone { background: #e8f6f0; color: #0d7a52; }
.smk-chip.is-stage { background: #fff4dc; color: #8a5d00; }
.smk-chip.is-format { background: #f1ecfb; color: #4a3aa7; }
.smk-personas { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.smk-persona-head { display: flex; align-items: center; gap: 12px; }
.smk-persona-head > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.smk-avatar { width: var(--s, 56px); height: var(--s, 56px); flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; font-family: var(--font-head); font-weight: 800; font-size: calc(var(--s, 56px) * .34); }
.smk-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.smk-block h4 { margin: 0 0 4px; font: 700 11px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gray); }
.smk-block ul { margin: 0; padding-left: 16px; font-size: 13.5px; }
.smk-persona blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--border-strong, #cfd6e2); color: var(--gray); font-style: italic; font-size: 13.5px; }
.smk-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.smk-channel.is-off { opacity: .7; }
.smk-formats { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.smk-formats li { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 8px; background: var(--bg, #f5f7fb); font-size: 13.5px; }
.smk-funnel th, .smk-funnel td { vertical-align: top; }
.smk-funnel td .smk-chip { margin: 0 4px 4px 0; }
.smk-funnel td:empty::after { content: '—'; color: var(--muted, #9aa3b2); }
.smk-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.smk-checks.smk-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-height: 260px; overflow-y: auto; padding: 4px 0; }
.smk-area { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.smk-area [name=a_type] { flex: 0 0 205px; }
.smk-area [name=a_city] { flex: 1 1 140px; min-width: 0; }
.smk-area [name=a_km] { flex: 0 0 84px; }
.smk-area [name=a_province] { flex: 1 1 170px; min-width: 0; }
.smk-area .icon-btn { flex: none; }
.smk-form fieldset { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
.smk-form fieldset legend { padding: 0; margin-bottom: 6px; }
.smk-area [hidden] { display: none; }
.smk-format { display: grid; gap: 8px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; }
.smk-format-top { display: grid; grid-template-columns: 170px minmax(0, 1fr) 180px 36px; gap: 8px; align-items: center; }
.smk-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.smk-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.smk-colors input { position: absolute; opacity: 0; pointer-events: none; }
.smk-colors span { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent; }
.smk-colors input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.smk-colors input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (max-width: 640px) {
  .smk-grid, .smk-personas, .smk-channels { grid-template-columns: 1fr; }
  .smk-area [name=a_type] { flex-basis: 100%; }
  .smk-format-top { grid-template-columns: 1fr 36px; }
  .smk-format-top [name=f_title], .smk-format-top [name=f_frequency] { grid-column: 1 / -1; }
  .smk-head-actions { justify-content: flex-start; }
}
/* Ricerca suspect con l'AI (Lo studio → Marketing → Ricerca suspect) */
.ss-budget { display: grid; gap: 6px; max-width: 520px; }
.ss-bar { height: 8px; border-radius: 99px; background: var(--blue-light); overflow: hidden; }
.ss-bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.ss-legal { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; }
.ss-legal .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.ss-missions .list-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ss-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.ss-card { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, #fff); }
.ss-card.has-deep { border-color: #b9cdf0; box-shadow: 0 0 0 1px #e3ecfb inset; }
.ss-card-head { display: flex; align-items: flex-start; gap: 10px; }
.ss-pick { padding-top: 2px; }
.ss-title { display: flex; flex-direction: column; min-width: 0; margin-right: auto; }
.ss-score { flex: none; font-size: 13px; }
.ss-summary { margin: 0; }
.ss-links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; }
.ss-links a, .ss-links span { display: inline-flex; align-items: center; gap: 5px; }
.ss-links .icon { width: 15px; height: 15px; }
.ss-nosite { color: #8a5d00; }
.ss-signals { display: flex; flex-wrap: wrap; gap: 6px; }
.ss-signal { padding: 3px 9px; border-radius: 8px; background: #fff4dc; color: #6b4a00; font-size: 12.5px; }
.ss-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.ss-block h4, .ss-deep h4 { margin: 0 0 4px; font: 700 11px var(--font-head); letter-spacing: .06em; text-transform: uppercase; color: var(--gray); }
.ss-block ul { margin: 0; padding-left: 16px; font-size: 13.5px; }
.ss-flags { margin: 0; display: flex; gap: 6px; align-items: flex-start; color: var(--danger, #e34948); font-size: 13.5px; }
.ss-flags .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.ss-deep { padding: 10px 12px; border-radius: 10px; background: #f2f7ff; display: grid; gap: 6px; font-size: 13.5px; }
.ss-deep h4 { display: flex; align-items: center; gap: 6px; color: var(--blue); }
.ss-deep h4 .icon { width: 15px; height: 15px; }
.ss-deep p { margin: 0; }
.ss-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.ss-est td { padding: 6px 8px; }
.ss-est .is-total td { border-top: 2px solid var(--border); }
@media (max-width: 640px) { .ss-cards { grid-template-columns: 1fr; } }

/* Centro notifiche: una riga per tipo di avviso con gli interruttori di campanella e push */
.nc { display: grid; gap: 16px; }
.nc .card { margin: 0; }
.nc-head { display: grid; grid-template-columns: 1fr 84px 84px; align-items: end; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border, #e3e8ef); }
.nc-head h3 { margin: 0; font-size: 1rem; }
.nc-col { font-size: .75rem; font-weight: 700; color: var(--gray); text-align: center; text-transform: uppercase; letter-spacing: .04em; }
.nc-row { display: grid; grid-template-columns: 1fr 84px 84px; align-items: center; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--border, #eef1f5); }
.nc-row:last-child { border-bottom: 0; }
.nc-master .nc-row { grid-template-columns: 1fr 84px; }
.nc-text { display: grid; gap: 2px; min-width: 0; }
.nc-text small { color: var(--gray); line-height: 1.4; }
.nc-sw { display: flex; justify-content: center; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .55; }
/* Colonne: testo su schermi larghi, icona sui telefoni */
.nc-col-icon { display: none; }
.nc-col-icon svg { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .nc-head, .nc-row { grid-template-columns: 1fr 56px 56px; }
  .nc-master .nc-row { grid-template-columns: 1fr 56px; }
  .nc-col-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .nc-col-icon { display: flex; justify-content: center; color: var(--gray); }
}

/* Trascina per aggiornare (app installata sul telefono, js/pull-refresh.js); sui telefoni l'icona «Aggiorna» dell'header non serve */
@media (max-width: 860px) { #page-reload { display: none; } }
.ptr { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); left: 50%; z-index: 90; transform: translate(-50%, -48px); opacity: 0; pointer-events: none; }
.ptr.is-back { transition: transform .2s ease, opacity .2s ease; }
.ptr-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface, #fff); color: var(--gray); box-shadow: 0 4px 14px rgba(2, 30, 70, .18); }
.ptr-dot svg { width: 20px; height: 20px; }
.ptr.is-ready .ptr-dot { color: var(--blue, #023F82); }
.ptr.is-loading .ptr-dot svg { animation: ptr-spin .7s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ptr.is-loading .ptr-dot svg { animation-duration: 2s; } }

/* ==========================================================================================================================
   Mobile come un'app (≤ 860 px): barra di navigazione in basso, finestre che salgono dal basso, campi a 16 px (niente zoom
   dell'iPhone), pulsanti da toccare comodi, margini per notch e barra home, pulsanti flottanti sopra la barra
   ========================================================================================================================== */
:root { --tabbar-h: 76px; }
.tabbar { display: none; }
/* Pulsanti flottanti (assistente, consulente) mai sopra finestre e fogli aperti */
body:has(.sheet-backdrop) .cw, body:has(.modal-backdrop) .cw, body:has(.sheet-backdrop) .aw, body:has(.modal-backdrop) .aw { display: none; }

@media (max-width: 860px) {
  /* Barra in basso come nelle app social: pillola che galleggia staccata dai bordi e sopra la barra home dell'iPhone, solo icone
     (le etichette restano per i lettori di schermo e come suggerimento), la voce attiva in una pillola */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 70;
    left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 2px));
    height: 62px; padding: 0 6px; border-radius: 31px; background: rgba(255, 255, 255, .9); border: 1px solid rgba(2, 30, 70, .08);
    box-shadow: 0 10px 30px rgba(2, 30, 70, .16), 0 2px 6px rgba(2, 30, 70, .06);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
  .tabbar a, .tabbar-more { display: flex; align-items: center; justify-content: center; height: 50px; padding: 0;
    border: 0; background: none; color: var(--gray); text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar-icon { position: relative; display: grid; place-items: center; width: 56px; height: 46px; border-radius: 23px; transition: background .18s, color .18s, transform .12s; }
  .tabbar-icon svg { width: 26px; height: 26px; stroke-width: 1.9; }
  .tabbar .active { color: var(--blue); }
  .tabbar .active .tabbar-icon { background: #eef1f6; }
  .tabbar .active .tabbar-icon svg { stroke-width: 2.4; }
  .tabbar a:active .tabbar-icon, .tabbar-more:active .tabbar-icon { transform: scale(.92); }
  .tabbar-badge { position: absolute; top: 4px; right: 8px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff;
    font-size: 10px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
  .tabbar-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* Spazio in fondo per la barra; il menu completo si apre da «Altro», quindi niente hamburger nell'header */
  .view { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); }
  /* In orizzontale la tacca dell'iPhone sta di lato: il contenuto non ci finisce sotto */
  .main-wrap { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
  .topbar #menu-toggle { display: none; }
  .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  /* La zona di orario, rete e batteria (app installata su iPhone) prende lo sfondo della pagina radice: bianca come l'header,
     così la barra in alto è un'unica fascia. Il grigio delle pagine resta sul body, alto almeno quanto lo schermo */
  html { background: var(--surface); }
  body { min-height: 100dvh; }
  /* Pulsanti flottanti sopra la barra in basso */
  .cw, .aw:not(.open) { bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom, 0px)) !important; right: 14px !important; }
  /* Mentre si scorre verso il basso i pulsanti flottanti si fanno da parte e tornano appena si risale (come nelle app) */
  .cw, .aw { transition: transform .22s ease, opacity .22s ease; }
  .cw-panel { max-height: calc(100dvh - var(--tabbar-h) - 150px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .scroll-down .cw:not(.open), .scroll-down .aw:not(.open) { transform: translateY(24px) scale(.85); opacity: 0; pointer-events: none; }
  /* Menu completo («Altro»): sopra la barra, fino in fondo allo schermo */
  .sidebar { z-index: 95; }
  .nav-open .sidebar-scrim { z-index: 92; }

  /* Finestre e fogli: salgono dal basso, a tutta larghezza, con la maniglia */
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal, .modal-wide { width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheet-up .22s ease-out; }
  .modal::before, .sheet::before { content: ''; display: block; flex: 0 0 auto; width: 38px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 8px auto 2px; }
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 20px 20px 0 0; max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); }

  /* Campi a 16 px: sotto, Safari ingrandisce la pagina a ogni tocco */
  .input, select.input, textarea.input, input.input, .field input, .field select, .field textarea { font-size: 16px; }
  /* Bersagli da toccare comodi */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .icon-btn { min-width: 44px; min-height: 44px; }

  /* Intestazioni: la descrizione lunga resta di 3 righe, il contenuto sale */
  .page-head > div > p.muted:not(.small) { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

  /* Schede e filtri orizzontali: una riga che scorre, senza barra di scorrimento, con la sfumatura che invita a scorrere */
  .tabs, .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .tabs { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
  /* Impostazioni: le schede di una categoria in una riga che scorre, non su tre righe */
  .settings-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-right: 24px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .settings-tabs::-webkit-scrollbar { display: none; }
  .settings-tab { white-space: nowrap; flex: 0 0 auto; }
}

/* Filtri raccolti dietro «Filtri» sui telefoni (js/app.js → mobileFilters) */
.m-filter-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text); font: 600 14px var(--font-head); cursor: pointer; }
.m-filter-btn svg { width: 18px; height: 18px; }
.m-filter-btn.has-active { border-color: var(--blue); color: var(--blue); background: var(--blue-lighter); }
.m-filter-btn[aria-expanded="true"] { border-color: var(--blue); }
.m-filter-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.m-filter-panel { flex: 1 0 100%; display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.m-filter-panel[hidden] { display: none; }
.m-filter-panel .input, .m-filter-panel select { width: 100%; min-width: 0; }
.m-filter-panel label { display: block; }

/* Telefono: schede degli elenchi più da app (sovrascrive lo schema «etichetta a sinistra, valore a destra» qui sopra): la prima cella
   è il titolo, le altre stanno su due colonne con l'etichetta piccola sopra il valore, le righe che si aprono hanno la freccia */
@media (max-width: 640px) {
  .table.is-cards > tbody > tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; row-gap: 10px; padding: 14px 16px; border-radius: 16px; }
  .table.is-cards > tbody > tr > td { display: block; padding: 0; text-align: left; }
  .table.is-cards > tbody > tr > td::before { float: none; display: block; max-width: none; margin: 0 0 2px; padding: 0; font-size: 10.5px; }
  .table.is-cards > tbody > tr > td:first-child { grid-column: 1 / -1; font-size: 16px; font-weight: 600; line-height: 1.35; }
  .table.is-cards > tbody > tr > td.row-actions, .table.is-cards > tbody > tr > td.crm-actions, .table.is-cards > tbody > tr > td.doc-actions,
  .table.is-cards > tbody > tr > td.num:last-child:has(button, a.btn) { grid-column: 1 / -1; justify-content: flex-start; margin-top: 2px; }
  .table.is-cards > tbody > tr[data-href] { position: relative; padding-right: 36px; cursor: pointer; }
  .table.is-cards > tbody > tr[data-href]::after { content: ''; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -4px;
    border-right: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); transform: rotate(-45deg); }
  .table.is-cards > tbody > tr[data-href]:active { background: var(--blue-lighter); }
}

/* Titolo modificabile su telefono: stessa grandezza degli altri titoli, va a capo */
@media (max-width: 860px) { .input-h1 { font-size: 22px; } }

/* Editor (preventivo, documento, contenuto) su telefono: le azioni in una barra fissa in basso, sopra la navigazione, a portata di
   pollice; il titolo scorre con la pagina; il menu «⋯» si apre verso l'alto */
@media (max-width: 860px) {
  .page-head.sticky-head { position: static; margin-top: 0; padding: 0; }
  .page-head.sticky-head > .actions { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); z-index: 65; margin: 0;
    display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border);
    box-shadow: 0 -6px 18px rgba(2, 30, 70, .06); }
  .page-head.sticky-head > .actions > * { flex: 0 0 auto; }
  .page-head.sticky-head > .actions .btn { padding-left: 12px; padding-right: 12px; }
  .page-head.sticky-head > .actions .btn-primary { order: 9; margin-left: auto; }
  @media (max-width: 480px) { .page-head.sticky-head > .actions .btn-primary { order: -1; margin-left: 0; } }
  .page-head.sticky-head > .actions .save-state { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head.sticky-head > .actions .menu-list { position: fixed; top: auto; right: 12px; bottom: calc(var(--tabbar-h) + 72px + env(safe-area-inset-bottom, 0px)); }
  /* Tante azioni (preventivo inviato: stato, Anteprima, Invia aggiornamento, Salva…): la barra scorre di lato invece di uscire dallo
     schermo, e l'azione principale resta in vista per prima */
  .page-head.sticky-head > .actions { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .page-head.sticky-head > .actions::-webkit-scrollbar { display: none; }
  .view:has(.page-head.sticky-head) { padding-bottom: calc(var(--tabbar-h) + 110px + env(safe-area-inset-bottom, 0px)); }
  /* La barra delle azioni copre il pulsante flottante: sale anche lui */
  body:has(.page-head.sticky-head) .cw:not(.open), body:has(.page-head.sticky-head) .aw:not(.open) { bottom: calc(var(--tabbar-h) + 82px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* Caricamento sul telefono: al posto della rotellina, lo scheletro della pagina che arriva (titolo e schede che luccicano), come
   nelle app. Solo per i caricamenti a pagina intera (.view > .loading); quelli dentro le schede restano con la rotellina */
@media (max-width: 860px) {
  .view > .loading, .view > div > .loading:only-child { display: block; width: 100%; min-height: 70vh; padding-top: 4px; position: relative; overflow: hidden; }
  .view > .loading span, .view > div > .loading:only-child span { display: none; }
  .view > .loading::before, .view > div > .loading:only-child::before { content: ''; display: block; width: 100%; height: 100%; min-height: 70vh;
    background:
      linear-gradient(#e9edf3, #e9edf3) 0 0 / 55% 26px no-repeat,
      linear-gradient(#eef1f6, #eef1f6) 0 40px / 80% 14px no-repeat,
      linear-gradient(#eef1f6, #eef1f6) 0 80px / 100% 96px no-repeat,
      linear-gradient(#eef1f6, #eef1f6) 0 188px / 100% 96px no-repeat,
      linear-gradient(#eef1f6, #eef1f6) 0 296px / 100% 96px no-repeat,
      linear-gradient(#eef1f6, #eef1f6) 0 404px / 100% 96px no-repeat; }
  .view > .loading::after, .view > div > .loading:only-child::after { content: ''; position: absolute; inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 50%, transparent 80%) -150% 0 / 60% 100% no-repeat;
    animation: skeleton 1.3s ease-in-out infinite; }
}
@keyframes skeleton { to { background-position: 250% 0; } }
@media (prefers-reduced-motion: reduce) { .view > .loading::after { animation: none; } }

/* Rifiniture da app sul telefono: ingresso della pagina, stati vuoti con l'illustrazione, tocco sulle schede */
@media (max-width: 860px) {
  .view.view-in { animation: view-in .22s ease-out; }
  .empty { padding: 44px 24px; }
  .empty::before { content: ''; display: block; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
    background: var(--blue-lighter) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232a78d6' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 30px no-repeat; }
  .empty-title { font-size: 17px; }
  .empty p { max-width: 300px; margin-left: auto; margin-right: auto; line-height: 1.5; }
  /* Le schede e le righe toccabili rispondono al dito */
  a.card:active, .card[data-href]:active, .list-row:active, .table-cards tbody tr:active { transform: scale(.985); transition: transform .08s; }
}
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .view.view-in { animation: none; } }

/* ==========================================================================================================================
   App mobile (≤ 860 px): componenti da app nativa, sopra gli stili del computer. Un solo linguaggio per tutte le pagine:
   - intestazione con il titolo grande e, scorrendo, il titolo piccolo nella barra in alto (app.js → compactTitle);
   - pulsanti a pillola, azioni della pagina in una riga che scorre;
   - numeri (.stats, .kpi-grid) in un carosello orizzontale con l'aggancio;
   - schede (.tabs) e selettori (.segmented) come pillole che scorrono;
   - campi riempiti, ricerca a pillola con la lente;
   - elenchi (tabelle .is-cards) come liste raggruppate: righe separate da una linea sottile, titolo, dettagli in riga, freccia;
   - schede (.card) con angoli ampi e senza bordo; pipeline a colonne che si agganciano.
   ========================================================================================================================== */
@media (max-width: 860px) {
  :root { --bg: #f2f4f8; --m-radius: 18px; --m-hair: rgba(2, 30, 70, .08); }
  body { background: var(--bg); }

  /* Barra in alto: bianca piena, con il titolo della pagina che compare scorrendo al posto del logo. Niente trasparenza né
     backdrop-filter: su iOS 26 una barra traslucida in cima non viene riconosciuta come intestazione e il sistema ci stende sopra la
     sua sfocatura della zona di stato (logo e pulsanti sfocati); con lo sfondo pieno Safari la usa come colore della barra */
  .topbar { background: var(--surface); border-bottom: 1px solid transparent; transition: border-color .2s; }
  .scrolled .topbar { border-bottom-color: var(--m-hair); }
  .topbar-logo-link { transition: opacity .18s, transform .18s; }
  .topbar-title { position: absolute; left: 64px; right: 120px; top: calc(env(safe-area-inset-top, 0px) + 10px); height: 40px; display: flex; align-items: center;
    justify-content: center; font: 700 16px/1.2 var(--font-head); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; pointer-events: none; }
  .topbar-title span { overflow: hidden; text-overflow: ellipsis; }
  .title-docked .topbar-title { opacity: 1; transform: none; }
  .title-docked .topbar-logo-link { opacity: 0; transform: translateY(-6px); pointer-events: none; }

  /* Intestazione della pagina: titolo grande, sezione piccola sopra, descrizione al massimo su due righe */
  .view { padding-top: 14px; }
  .page-head { display: block; margin-bottom: 16px; }
  .page-head h1 { font-size: 30px; line-height: 1.12; letter-spacing: -.02em; font-weight: 800; }
  .page-head .eyebrow { font-size: 11px; letter-spacing: 1.4px; color: var(--muted); margin-bottom: 2px; }
  .page-head > div:first-child > p.muted, .page-head > div:first-child > .page-desc, .page-head > div:first-child > p:not(.eyebrow):not(.mkp-meta) {
    font-size: 14px; line-height: 1.45; color: var(--gray); margin-top: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .page-head > div:first-child > p.is-open { -webkit-line-clamp: unset; display: block; }
  .page-head > .actions:not(.sticky-head > .actions) { display: flex; flex-wrap: wrap; gap: 8px; }
  .page-head > .actions::-webkit-scrollbar { display: none; }
  .page-head > .actions > * { flex: 0 0 auto; }

  .page-head > * + * { margin-top: 14px; }
  /* Livelli del CRM: pillole con il numero, in una riga che scorre */
  .crm-stages { display: flex !important; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
  .crm-stages::-webkit-scrollbar { display: none; }
  .crm-stage { flex: 0 0 auto; flex-direction: row; align-items: baseline; gap: 6px; padding: 8px 14px; border: 0; border-radius: 999px; background: #e6eaf1; box-shadow: none; }
  .crm-stage strong { font-size: 15px; }
  .crm-stage .crm-stage-name { font-size: 14px; font-weight: 600; color: var(--gray); }
  .crm-stage small { display: none; }
  .crm-stage.active { background: var(--text); }
  .crm-stage.active strong, .crm-stage.active .crm-stage-name { color: #fff; }
  /* Schede di sezione del portale (Obiettivi/Risultati, Supporto…): pillole sopra il titolo, senza la riga della sezione */
  .section-tabs-wrap { padding: 14px 16px 0; }
  .section-tabs-wrap .eyebrow { display: none; }
  .section-tabs { display: flex; gap: 6px; overflow-x: auto; border: 0; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .section-tabs::-webkit-scrollbar { display: none; }
  .section-tabs a { margin: 0; padding: 8px 14px; border: 0; border-radius: 999px; background: #e6eaf1; font-size: 14px; }
  .section-tabs a[aria-current="page"] { background: var(--text); color: #fff; }
  .section-tabs-wrap:not([hidden]) + .view { padding-top: 14px; }
  /* Consulente nella dashboard del cliente: foto e nome in alto, i due pulsanti affiancati sotto a tutta larghezza */
  .hero-card { display: grid !important; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px 14px; }
  .hero-card > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
  .hero-card-actions { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-card-actions .btn { width: 100%; justify-content: center; }
  /* Filtri a chip (guide, corsi, articoli): una riga che scorre, senza riquadro né titoli */
  .guides-layout { display: block !important; }
  .guides-filters.card { position: static; background: transparent; box-shadow: none; padding: 0; margin: 0 0 8px; min-width: 0; }
  .guides-filters .guide-progress { margin: 4px 0 6px; }
  .guides-filters h3 { display: none; }
  .gf-group { display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; margin: 0 -16px 8px; padding: 0 16px 2px; scrollbar-width: none; }
  .gf-group::-webkit-scrollbar { display: none; }
  .gf-group > * { flex: 0 0 auto; }
  /* Dati del bonifico: etichetta piccola sopra, valore e «Copia» sulla stessa riga */
  .pay-row { display: block !important; padding: 10px 0; }
  .pay-row dt { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
  .pay-row dd { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
  .pay-row .pay-value { min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--text); }
  .pay-row .pay-copy { flex: 0 0 auto; min-height: 36px; background: #eef1f6; }
  /* Impostazioni: categorie e schede interne come pillole che scorrono */
  .settings-nav { background: transparent; border: 0; padding: 2px 16px 4px !important; margin: 0 -16px 10px; gap: 6px !important; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-link-cat { padding: 8px 14px !important; border: 0 !important; border-radius: 999px !important; background: #e6eaf1 !important; color: var(--gray) !important; font-size: 14px; }
  .settings-link-cat .icon { width: 16px; height: 16px; }
  .settings-link-cat[aria-current="page"] { background: var(--text) !important; color: #fff !important; }
  .settings-tabs { border-bottom: 0; gap: 6px; margin: 8px -16px 14px; padding: 2px 16px 4px; -webkit-mask-image: none; mask-image: none; }
  .settings-tab { padding: 8px 14px; border: 0; margin: 0; border-radius: 999px; background: #e6eaf1; font-size: 14px; }
  .settings-tab[aria-selected="true"] { background: var(--text); color: #fff; }
  .tabs { -webkit-mask-image: none; mask-image: none; }
  /* Pulsanti a pillola */
  .btn { border-radius: 999px; padding-left: 18px; padding-right: 18px; font-size: 15px; }
  .btn-sm { border-radius: 999px; padding-left: 14px; padding-right: 14px; font-size: 14px; }
  .btn-primary { box-shadow: 0 6px 16px rgba(2, 63, 130, .22); }
  .btn:active { transform: scale(.97); }
  .icon-btn { border-radius: 50%; }

  /* Schede: angoli ampi, niente bordo, ombra leggera */
  .card { border: 0; border-radius: var(--m-radius); box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .04); padding: 16px; margin-bottom: 14px; }
  .card-head { margin-bottom: 10px; }
  .card-head h2, .card > h2:first-child, .card > h3:first-child { font-size: 17px; }
  .cols, .cols-3 { grid-template-columns: 1fr !important; gap: 0; }

  /* Numeri in carosello: si scorrono col pollice e si agganciano; il primo resta allineato al margine */
  .stats, .kpi-grid { display: flex !important; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
    margin-left: -16px; margin-right: -16px; padding: 2px 16px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .stats::-webkit-scrollbar, .kpi-grid::-webkit-scrollbar { display: none; }
  .stats > *, .kpi-grid > * { flex: 0 0 auto; width: min(44vw, 190px); scroll-snap-align: start; }
  .stat, .kpi-card { border: 0; border-radius: 16px; padding: 14px 14px 12px; box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .05); }
  .stat-value { font-size: 22px; letter-spacing: -.02em; }
  .stat-label { font-size: 12.5px; line-height: 1.3; }
  .stat-hint { font-size: 11.5px; }
  a.stat:hover { transform: none; }

  /* Schede di pagina e selettori: pillole che scorrono */
  .tabs { gap: 6px; border-bottom: 0; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button, .tabs a[role=tab] { border: 0; margin: 0; padding: 8px 14px; border-radius: 999px; background: #e6eaf1; color: var(--gray); font-size: 14px; }
  .tabs button[aria-selected=true], .tabs a[role=tab][aria-selected=true] { background: var(--text); color: #fff; }
  .segmented { border: 0; background: #e6eaf1; border-radius: 12px; padding: 3px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .segmented button { border-radius: 9px; padding: 7px 14px; font-size: 14px; white-space: nowrap; }
  .segmented button[aria-pressed=true] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(2, 30, 70, .14); }

  /* Campi riempiti (stile iOS): sfondo grigio chiaro, niente bordo finché non si tocca */
  .input, select.input, textarea.input, .field input, .field select, .field textarea { min-height: 46px; border-radius: 12px; border-color: transparent; background-color: #eef1f6; }
  .input:focus, .field input:focus, .field select:focus, .field textarea:focus { background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 120, 214, .15); }
  .card .input, .card .field input, .card .field select, .card .field textarea, .sheet .input, .modal .input { background-color: #f2f4f8; }
  .field > label, label.field > span:first-child, .form-stack label > span:first-child { font-size: 13px; font-weight: 600; color: var(--gray); }
  /* Ricerca: pillola con la lente */
  input[type=search].input, .toolbar input.input[placeholder^="Cerca"], .toolbar input.input[placeholder*="cerca" i] {
    border-radius: 999px; padding-left: 40px; background: #e6eaf1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px center / 18px no-repeat; }
  .toolbar { gap: 8px; }
  .toolbar > .input, .toolbar > input { flex: 1 1 100%; }
  .m-filter-btn { border-radius: 999px; }

  /* Etichette di stato più morbide */
  .badge { padding: 3px 10px; font-size: 12px; }

  /* Pipeline (kanban): colonne che si agganciano, una alla volta con l'anteprima della successiva */
  .kanban, .pipeline, .board { scroll-snap-type: x mandatory; scroll-padding: 0 16px; margin-left: -16px !important; margin-right: -16px !important;
    padding-left: 16px !important; padding-right: 16px !important; scrollbar-width: none; }
  .kanban > *, .pipeline > *, .board > * { scroll-snap-align: start; }
}

/* Elenchi (≤ 640 px): le tabelle diventano una lista raggruppata come nelle app. Una scheda sola con le righe separate da una
   linea sottile; in ogni riga il titolo, poi i dettagli in fila (etichetta piccola e valore), le azioni a destra e la freccia
   per le righe che si aprono. Sovrascrive le «schede a due colonne» qui sopra */
@media (max-width: 640px) {
  .table-wrap:has(> .table.is-cards) { background: var(--surface); border-radius: var(--m-radius); box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .04); overflow: hidden; }
  .table.is-cards > tbody > tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 0; padding: 14px 16px; border: 0; border-radius: 0;
    box-shadow: none; background: transparent; border-bottom: 1px solid var(--m-hair); }
  .table.is-cards > tbody > tr:last-child { border-bottom: 0; }
  .table.is-cards > tbody > tr > td { display: inline-flex; align-items: baseline; gap: 5px; padding: 0; font-size: 14px; color: var(--gray); max-width: 100%; }
  .table.is-cards > tbody > tr > td::before { display: inline; float: none; margin: 0; font: 600 12px var(--font-body, inherit); text-transform: none; letter-spacing: 0; color: var(--muted); white-space: nowrap; }
  .table.is-cards > tbody > tr > td:first-child { flex: 1 0 100%; display: block; font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
  .table.is-cards > tbody > tr > td:first-child small, .table.is-cards > tbody > tr > td:first-child .muted { display: block; font-weight: 400; font-size: 13.5px; }
  .table.is-cards > tbody > tr > td.num { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
  .table.is-cards > tbody > tr > td .badge { align-self: center; }
  /* Azioni: piccole, in fondo a destra, senza linea sopra */
  .table.is-cards > tbody > tr > td.row-actions, .table.is-cards > tbody > tr > td.crm-actions, .table.is-cards > tbody > tr > td.doc-actions,
  .table.is-cards > tbody > tr > td.num:last-child:has(button, a.btn) { flex: 1 0 100%; display: flex; justify-content: flex-end; gap: 4px; border: 0; margin: 2px 0 -6px; padding: 0; }
  .table.is-cards > tbody > tr > td.row-actions .icon-btn, .table.is-cards > tbody > tr > td.crm-actions .icon-btn { min-width: 38px; min-height: 38px; color: var(--muted); }
  .table.is-cards > tbody > tr[data-href] { padding-right: 36px; }
  .table.is-cards > tbody > tr[data-href]::after { top: 22px; margin-top: 0; }
  .table.is-cards > tbody > tr.is-overdue, .table.is-cards > tbody > tr.row-danger { border-left: 0; box-shadow: inset 3px 0 0 var(--red, #e34948); }
}

/* Menu completo sul telefono («Altro» della barra in basso): un foglio che sale dal basso con lo stile dello studio. In alto il logo e
   la chiusura; il profilo nel blu della dashboard; la ricerca; le sezioni in gruppi bianchi con il titolo «eyebrow», le icone nei
   toni del blu, la voce aperta evidenziata; in fondo Impostazioni, installazione dell'app ed Esci */
.sidebar-mhead { display: none; }
@media (max-width: 860px) {
  .sidebar { left: 0; right: 0; top: auto; bottom: 0; width: 100% !important; height: calc(100dvh - 10px - env(safe-area-inset-top, 0px)); max-height: none;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--bg); color: var(--text); border-radius: 24px 24px 0 0;
    transform: translateY(105%); transition: transform .32s cubic-bezier(.32, .72, 0, 1); overflow-y: auto; overscroll-behavior: contain; box-shadow: none; }
  .nav-open .sidebar { transform: none; box-shadow: 0 -10px 40px rgba(1, 26, 54, .25); }
  .nav-open .sidebar-scrim { background: rgba(1, 26, 54, .45); }
  /* Maniglia e intestazione in un solo blocco fisso dal bordo del foglio: scorrendo, le voci passano sotto senza spuntare sopra */
  .sidebar-mhead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 2; margin: 0 -16px 8px; padding: 20px 16px 12px;
    background: var(--bg); border-radius: 24px 24px 0 0; }
  .sidebar-mhead::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--border-strong); }
  .sidebar-mlogo { height: 34px; width: auto; }
  .sidebar-done { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); cursor: pointer; }
  .sidebar-done .icon { width: 20px; height: 20px; }
  .brand-row, .sidebar-client { display: none; }

  /* Ordine: profilo, ricerca, sezioni, account */
  .sidebar-user { order: 1; margin: 0 0 14px; padding: 0; border: 0; }
  .sidebar-search { order: 2; }
  .sidebar .nav { order: 3; flex: none; overflow: visible; gap: 0; margin: 0; padding: 0; }
  .sidebar-foot { order: 4; }

  /* Profilo: la scheda blu della dashboard, con l'anello ambra intorno alla foto */
  .user-chip { gap: 14px; padding: 16px; border-radius: 18px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(120% 140% at 100% 0%, rgba(42, 120, 214, .55), transparent 60%), linear-gradient(135deg, var(--blue), var(--blue-dark));
    box-shadow: 0 10px 24px rgba(2, 63, 130, .25); }
  /* Toccandola resta blu: sul telefono dopo il tocco vale lo stile «al passaggio del mouse» del computer, che la schiariva */
  .user-chip:hover, .user-chip:focus-visible, .user-chip.active { background: radial-gradient(120% 140% at 100% 0%, rgba(42, 120, 214, .55), transparent 60%), linear-gradient(135deg, var(--blue), var(--blue-dark)); color: #fff; }
  .user-chip:active { filter: brightness(1.08); }
  .user-chip strong { font: 700 18px var(--font-head); color: #fff; }
  .user-chip small { font-size: 13.5px; color: rgba(255, 255, 255, .75); opacity: 1; }
  .user-chip .avatar-img, .user-chip .avatar { width: 54px !important; height: 54px !important; font-size: 19px; box-shadow: 0 0 0 3px var(--amber) !important; }
  .user-chip::after, .nav a::after, .sidebar-foot-link:not(#logout-m)::after { content: ''; flex: none; width: 7px; height: 7px; margin-left: 8px;
    border-right: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); transform: rotate(-45deg); }
  .user-chip::after { margin-left: auto; border-color: rgba(255, 255, 255, .7); }

  .sidebar-search { height: 46px; margin: 0 0 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; color: var(--muted); font-size: 15px; box-shadow: var(--shadow-sm); }
  .sidebar-search .icon { color: var(--blue); }
  .sidebar-search:hover, .sidebar-search:focus-visible { background: #fff; color: var(--gray); border-color: var(--blue); }

  /* Sezioni: titolo «eyebrow» dello studio e gruppo bianco; i gruppi apribili del computer qui sono sempre aperti */
  .nav-section, .nav-group { margin: 0 0 20px !important; padding: 0 !important; border: 0 !important; }
  .nav-label, .nav-group-head { display: block; margin: 0 0 8px; padding: 0 6px; background: none; border: 0; pointer-events: none;
    font: 700 11px var(--font-head); letter-spacing: 1.6px; text-transform: uppercase; color: var(--blue); }
  .nav-group-head .icon, .nav-group-head .nav-caret, .nav-group-head .nav-badge-sum { display: none !important; }
  .nav-sub { display: flex !important; flex-direction: column; gap: 0; margin: 0; padding: 0; border: 0; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
  .nav-section:has(> a) { display: flex; flex-direction: column; }
  .nav-section > a { background: #fff; }
  .nav-section > a:first-of-type { border-radius: 18px 18px 0 0; }
  .nav-section > a:last-child { border-radius: 0 0 18px 18px; }
  .nav-section > a:only-of-type { border-radius: 18px; }
  .nav a, .nav-sub a { position: relative; gap: 14px; min-height: 54px; padding: 0 16px; border-radius: 0; color: var(--text); font: 600 15.5px var(--font-head); box-shadow: none; }
  .nav a + a::before { content: ''; position: absolute; top: 0; left: 64px; right: 16px; height: 1px; background: var(--border); }
  .nav a:hover { background: #fff; color: var(--text); }
  .nav a:active { background: var(--blue-lighter); }
  .nav a > span:first-of-type { flex: 1; min-width: 0; }
  .nav a .icon, .nav-sub a .icon { display: block; box-sizing: content-box; width: 18px; height: 18px; padding: 7px; border-radius: 11px; color: var(--blue); opacity: 1; background: var(--blue-light); flex: none; }
  /* Voce della pagina aperta: riga azzurra con l'icona piena e la barretta ambra */
  /* Barretta ambra diritta e centrata anche sulla prima e sull'ultima riga del gruppo (l'ombra interna seguiva l'angolo arrotondato) */
  .nav a.active { background: linear-gradient(var(--amber), var(--amber)) left center / 3px 56% no-repeat, var(--blue-lighter); color: var(--blue); box-shadow: none; }
  .nav a.active::after { border-color: var(--blue); }
  .nav a.active .icon { background: var(--blue); color: #fff; }
  .nav-badge { margin-left: 0; height: 22px; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--amber); color: #3b2604; font-size: 12px; }

  /* Account: gruppo bianco come le sezioni, «Esci» in rosso */
  .sidebar-foot { display: flex !important; flex-direction: column; gap: 0; margin: 0; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
  .sidebar-foot-link { position: relative; gap: 14px; height: 54px; padding: 0 16px; border: 0; border-radius: 0; background: #fff; color: var(--text); font: 600 15.5px var(--font-head); }
  .sidebar-foot-link > span { flex: 1; text-align: left; }
  .sidebar-foot-link + .sidebar-foot-link:not([hidden])::before { content: ''; position: absolute; top: 0; left: 64px; right: 16px; height: 1px; background: var(--border); }
  .sidebar-foot-link .icon { box-sizing: content-box; width: 18px; height: 18px; padding: 7px; border-radius: 11px; background: #eef0f3; color: var(--gray); }
  .sidebar-foot-link:hover { background: #fff; }
  .sidebar-foot-link:active { background: var(--blue-lighter); }
  #logout-m { color: #e34948; }
  #logout-m .icon { background: #fdecec; color: #e34948; }
  /* Con il menu aperto i pulsanti flottanti non ci finiscono sopra */
  .nav-open .aw, .nav-open .cw { display: none; }
}

/* Fogli (openSheet) sul telefono: la maniglia è una fascia fissa in cima e la X resta sempre a portata scorrendo (prima salivano con
   il contenuto, che finiva contro il bordo arrotondato e non si poteva più chiudere senza tornare in cima) */
@media (max-width: 860px) {
  .sheet { padding-top: 0; }
  .sheet::before { position: sticky; top: 0; z-index: 5; width: auto; height: 22px; margin: 0 -1px; border-radius: 20px 20px 0 0;
    background: linear-gradient(var(--border-strong), var(--border-strong)) center 9px / 38px 4px no-repeat, var(--surface); }
  .sheet > .sheet-close { position: sticky; top: 6px; float: right; z-index: 6; margin: -16px 6px -44px 0; width: 40px; height: 40px; min-width: 40px; min-height: 40px;
    border-radius: 50%; background: var(--surface); box-shadow: 0 1px 6px rgba(2, 30, 70, .16); }
}

/* «Indietro» sul telefono: pulsante a pillola nella barra in alto a sinistra con la freccia e il nome della pagina precedente (al posto
   del logo e del piccolo link sopra il titolo), sempre a portata anche scorrendo (app.js → compactTitle) */
.topbar-back { display: none; }
@media (max-width: 860px) {
  .view a.back { display: none; }
  .topbar-back { position: absolute; left: 12px; top: calc(env(safe-area-inset-top, 0px) + 10px); display: flex; align-items: center; gap: 2px; height: 40px;
    max-width: 38vw; padding: 0 14px 0 8px; border-radius: 999px; background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(2, 30, 70, .06), 0 2px 10px rgba(2, 30, 70, .08);
    font: 700 15px var(--font-head); text-decoration: none !important; -webkit-tap-highlight-color: transparent; transition: transform .1s, background .15s; }
  .topbar-back .icon { flex: none; width: 22px; height: 22px; stroke-width: 2.4; }
  .topbar-back span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar-back:active { transform: scale(.95); background: var(--blue-lighter); }
  .has-back .topbar-logo-link { opacity: 0; pointer-events: none; }
  .has-back .topbar-title { left: calc(38vw + 22px); right: 112px; justify-content: flex-start; }
}

/* Dashboard dello staff: i numeri economici non stanno nella home, si aprono da questo collegamento a Business */
.dash-numbers { display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: var(--text); text-decoration: none !important; }
.dash-numbers:hover { border-color: var(--blue); }
.dash-numbers > .icon:first-child { flex: none; box-sizing: content-box; width: 18px; height: 18px; padding: 8px; border-radius: 10px; background: var(--blue-light); color: var(--blue); }
.dash-numbers > .icon:last-child { flex: none; color: var(--muted); }
/* Sul telefono i quattro numeri del saluto stanno su una riga: numero grande e parola sotto, senza riquadri alti */
@media (max-width: 860px) {
  .dash-hero .focus-chips { display: grid !important; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .dash-hero .focus-chip { min-height: 0; padding: 10px 6px; border-radius: 14px; text-align: center; align-items: center; }
  .dash-hero .focus-chip strong { font-size: 22px; line-height: 1.1; }
  .dash-hero .focus-chip span { font-size: 11px; line-height: 1.25; }
}

/* Sezioni a fisarmonica sulle pagine lunghe del telefono (app.js → mobileCollapse): il titolo con la freccia, il resto si apre al tocco */
@media (max-width: 860px) {
  .m-collapse-head { position: relative; cursor: pointer; padding-right: 30px !important; -webkit-tap-highlight-color: transparent; }
  .m-collapse-head::after { content: ''; position: absolute; right: 6px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
    transform: rotate(45deg); transition: transform .18s; }
  .m-collapsed > .m-collapse-head::after { transform: rotate(-45deg); margin-top: -4px; }
  .m-collapsed > :not(.m-collapse-head) { display: none !important; }
  .m-collapsed > .m-collapse-head { margin-bottom: 0 !important; }
  section.section.m-collapsed { background: var(--surface); border-radius: var(--m-radius, 18px); padding: 14px 16px; margin-bottom: 10px; }
  section.section > .m-collapse-head { margin: 0; }
}

/* Elenchi a schede con copertina (guide, corsi, live, articoli) sul telefono: righe compatte con la miniatura a sinistra, titolo e
   durata; il riassunto e il pulsante «Leggi» si leggono aprendo la scheda */
@media (max-width: 640px) {
  .guide-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .guide-card.has-cover { display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 14px; row-gap: 4px; padding: 12px; border: 0; border-radius: 16px;
    box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .04); }
  .guide-card.has-cover:hover { transform: none; }
  .guide-card.has-cover .guide-card-cover { grid-row: 1 / 4; margin: 0; width: 88px; height: 88px; aspect-ratio: auto; border-radius: 12px; }
  .guide-card.has-cover h3 { font-size: 15.5px; }
  .guide-card.has-cover p, .guide-card.has-cover .guide-go, .guide-card.has-cover .guide-badges .badge-success { display: none; }
  .guide-card.has-cover .guide-badges { display: flex; flex-wrap: wrap; gap: 4px; }
  .guide-card.has-cover .guide-badges .badge { font-size: 11px; padding: 1px 8px; }
  .guide-card.has-cover .guide-foot { font-size: 12.5px; }
}
@media (max-width: 640px) {
  .content-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: start; gap: 12px; padding: 12px; }
  .content-card:hover { transform: none; }
  .content-card .content-cover { width: 88px; height: 88px; aspect-ratio: auto; border-radius: 12px; object-fit: cover; }
  .content-card .content-cover.placeholder { display: grid; place-items: center; }
  .content-card-body { padding: 0; gap: 4px; }
  .content-card h3 { font-size: 15.5px; }
  .content-card-body > p.clamp { display: none; }
}

/* Foto del profilo: anteprima, «Carica foto» e «Rimuovi» allineati sulla stessa riga */
.photo-pick { flex-wrap: wrap; }
.photo-pick [data-photo-remove] { margin: 0; padding: 0; align-self: center; }

/* Azioni in fondo a un foglio (anteprima del preventivo e del documento) sul telefono: barra piena fino al bordo, sopra lo spazio della
   barra home dell'iPhone, così il testo che scorre non si vede più sotto «Chiudi» */
@media (max-width: 860px) {
  .sheet .quote-preview-actions, .sheet .doc-preview + .actions { z-index: 4; bottom: calc(-1 * env(safe-area-inset-bottom, 0px) - 24px); margin: 0 -18px -24px;
    padding: 12px 18px calc(12px + 24px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); box-shadow: 0 -6px 18px rgba(2, 30, 70, .06); }
  .sheet .quote-preview-actions .btn, .sheet .doc-preview + .actions .btn { flex: 1; justify-content: center; }
}

/* Barra delle azioni degli editor (preventivo, documento, contenuto) sul telefono: pillola che galleggia sopra la barra in basso, come
   lei; prima era una fascia staccata e tra le due si vedeva il contenuto */
@media (max-width: 860px) {
  .page-head.sticky-head > .actions { left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(max(12px, calc(env(safe-area-inset-bottom, 0px) + 2px)) + 62px + 8px); padding: 8px 10px; border: 1px solid rgba(2, 30, 70, .08); border-radius: 26px;
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 10px 30px rgba(2, 30, 70, .16), 0 2px 6px rgba(2, 30, 70, .06); }
  .page-head.sticky-head > .actions .menu-list { bottom: calc(max(12px, calc(env(safe-area-inset-bottom, 0px) + 2px)) + 62px + 76px); }
}
/* Elenchi del telefono: una cella con più pezzi (badge, frecce, testi) va a capo invece di dividersi in colonne strette */
@media (max-width: 640px) {
  .table.is-cards > tbody > tr > td { flex-wrap: wrap; row-gap: 4px; }
}

/* Calendario: «In attesa della scelta dell'orario» come riga sottile (sul telefono senza i nomi), l'elenco aperto scorre dentro il
   riquadro; nell'Elenco il tasto per i giorni passati del mese */
.ap-pending > summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.ap-pending > summary::-webkit-details-marker { display: none; }
.ap-pending-caret { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s; flex: none; }
.ap-pending[open] .ap-pending-caret { transform: rotate(-135deg); }
.ap-pending-list { max-height: 260px; overflow-y: auto; }
.cal-past { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 12px; font-weight: 600; }
.cal-past .icon { width: 16px; height: 16px; }
@media (max-width: 860px) {
  .ap-pending { padding: 10px 14px !important; }
  .ap-pending > summary { font-size: 14.5px; }
  .ap-pending-names { display: none; }
}

/* Elenchi con righe che si aprono, sul telefono (app.js → cardTables, .is-compact): riga essenziale come nelle app social. A sinistra
   il titolo con la sotto-riga (nel CRM con l'avatar dell'iniziale), a destra lo stato e l'importo, poi la freccia; il resto (date,
   fonti, azioni) si apre toccando la riga */
.m-avatar { display: none; }
@media (max-width: 640px) {
  .table.is-compact > tbody > tr[data-href] { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 4px; padding: 12px 36px 12px 16px; }
  .table.is-compact > tbody > tr[data-href] > td:not(:first-child):not(.m-keep):not(.m-sub) { display: none !important; }
  .table.is-compact > tbody > tr[data-href] > td:first-child { grid-column: 1; grid-row: 1 / span 2; margin: 0; font-size: 16px; }
  .table.is-compact > tbody > tr[data-href] > td.m-keep { grid-column: 2; justify-self: end; display: block; text-align: right; font-size: 14px; }
  .table.is-compact > tbody > tr[data-href] > td.m-keep::before { display: none; }
  .table.is-compact > tbody > tr[data-href] > td.m-keep small, .table.is-compact > tbody > tr[data-href] > td.m-keep .crm-tags { display: none; }
  .table.is-compact > tbody > tr[data-href]::after { top: 50%; margin-top: -4px; }
  .table.is-compact > tbody > tr[data-href] > td:first-child small { font-size: 13.5px; }
  .table.is-compact td.crm-who { display: grid !important; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; align-items: center; }
  .table.is-compact td.crm-who > .m-avatar { display: grid; place-items: center; grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 50%;
    background: var(--blue-light); color: var(--blue); font: 700 15px var(--font-head); }
  .table.is-compact td.crm-who > :not(.m-avatar) { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 640px) {
  /* Sotto-riga presa dalla seconda colonna quando la prima è un codice */
  .table.is-compact > tbody > tr[data-href] > td:first-child:has(~ td.m-sub) { grid-row: 1; font-size: 13px; color: var(--muted); }
  .table.is-compact > tbody > tr[data-href] > td.m-sub { display: block !important; grid-column: 1; grid-row: 2; font-size: 15.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .table.is-compact > tbody > tr[data-href] > td.m-sub::before { display: none; }
  .table.is-compact > tbody > tr[data-href] > td.m-sub small, .table.is-compact > tbody > tr[data-href] > td.m-sub .block { display: none; }
}

/* Invito ad attivare le notifiche push nell'app installata */
.push-ask { text-align: center; }
.push-ask-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%; background: var(--blue-light); color: var(--blue); }
.push-ask-icon .icon { width: 30px; height: 30px; }
.push-ask .actions { justify-content: center; margin: 18px 0 10px; }
/* ==========================================================================================================================
   Computer (≥ 861 px): stesso linguaggio dell'app del telefono. Barra laterale chiara come il menu «Altro» (icone nei toni del
   blu, voce aperta in azzurro con la barretta ambra, sezioni «eyebrow» blu, contatori ambra), schede senza bordo con gli angoli
   ampi, pulsanti e schede a pillola, campi riempiti, ricerca a pillola, titoli grandi, tabelle in un riquadro arrotondato
   ========================================================================================================================== */
@media (min-width: 861px) {
  :root { --bg: #f2f4f8; --m-radius: 18px; --m-hair: rgba(2, 30, 70, .08); }
  body { background: var(--bg); }

  /* Barra laterale chiara */
  .sidebar { background: #fff; color: var(--text); border-right: 1px solid var(--m-hair); }
  .sidebar .brand-full { content: url('/img/logo-orizzontale.png'); }
  .sidebar-collapse { background: var(--bg); color: var(--gray); }
  .sidebar-collapse:hover, .sidebar-collapse:focus-visible { background: var(--blue-light); color: var(--blue); }
  .sidebar-client { background: var(--bg); color: var(--text); border-radius: 12px; }
  .nav-label, .nav-group-head { color: var(--blue); font: 700 10.5px var(--font-head); letter-spacing: 1.6px; text-transform: uppercase; }
  .nav a { color: var(--text); font-weight: 600; border-radius: 12px; padding: 6px 10px; gap: 12px; }
  .nav a .icon { box-sizing: content-box; width: 16px; height: 16px; padding: 6px; border-radius: 9px; background: var(--blue-light); color: var(--blue); opacity: 1; }
  .nav a:hover { background: var(--blue-lighter); color: var(--text); }
  .nav a.active { background: linear-gradient(var(--amber), var(--amber)) left center / 3px 56% no-repeat, var(--blue-lighter); color: var(--blue); box-shadow: none; }
  .nav a.active .icon { background: var(--blue); color: #fff; }
  .nav-badge { background: var(--amber); color: #3b2604; }
  .nav-badge-danger { background: var(--red, #e34948); color: #fff; }
  .sidebar-user { border-top: 1px solid var(--m-hair); }
  .user-chip { color: var(--text); border-radius: 12px; }
  .user-chip:hover { background: var(--blue-lighter); }
  .user-chip small { color: var(--gray); opacity: 1; }
  .sidebar-user #logout { color: var(--gray); }
  .sidebar-mini .brand-mark { background: var(--blue-light); }
  .sidebar-mini .nav-section + .nav-section, .sidebar-mini .nav-group + .nav-group, .sidebar-mini .nav-section + .nav-group, .sidebar-mini .nav-group + .nav-section { border-top-color: var(--m-hair); }
  .sidebar-mini .nav a { padding: 0; }
  .sidebar-mini .nav a.active, .sidebar-mini .nav a:hover { background: transparent; box-shadow: none; }
  .sidebar-mini .nav a:hover .icon { background: #d6e6f8; }

  /* Intestazione delle pagine: titolo grande, occhiello discreto */
  .page-head h1 { font-size: 30px; letter-spacing: -.02em; }
  .page-head .eyebrow { color: var(--muted); letter-spacing: 1.4px; }

  /* Schede, pulsanti, schede di pagina e selettori */
  .card { border: 0; border-radius: var(--m-radius); box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .04); }
  .btn { border-radius: 999px; }
  .btn-primary { box-shadow: 0 6px 16px rgba(2, 63, 130, .2); }
  .tabs { gap: 6px; border-bottom: 0; }
  .tabs button, .tabs a[role=tab], .section-tabs a, .settings-tab { margin: 0; padding: 8px 16px; border: 0; border-radius: 999px; background: #e6eaf1; color: var(--gray); }
  .tabs button[aria-selected=true], .tabs a[role=tab][aria-selected=true], .section-tabs a[aria-current="page"], .settings-tab[aria-selected="true"] { background: var(--text); color: #fff; }
  .settings-tabs { border-bottom: 0; gap: 6px; }
  /* Filtri a pillola (chip-row) con lo stesso aspetto delle schede di Impostazioni: grigio chiaro, la scelta in scuro */
  .chip-row { gap: 6px; }
  .chip-row .chip { border: 0; padding: 8px 16px; border-radius: 999px; background: #e6eaf1; color: var(--gray); font: 600 14px var(--font-head); }
  .chip-row .chip[aria-pressed=true] { background: var(--text); color: #fff; }
  .chip-row .chip[aria-pressed=true] .muted { color: rgba(255,255,255,.7); }
  .segmented { border: 0; background: #e6eaf1; border-radius: 12px; padding: 3px; }
  .segmented button { border-radius: 9px; padding: 7px 14px; }
  .segmented button[aria-pressed=true] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(2, 30, 70, .14); }

  /* Numeri e tabelle */
  .stat, .kpi-card { border: 0; border-radius: 16px; box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .05); }
  .table-wrap { border: 0; border-radius: var(--m-radius); box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .04); background: var(--surface); }
  .card .table-wrap { box-shadow: none; }

  /* Campi riempiti e ricerca a pillola */
  .input, select.input, textarea.input, .field input, .field select, .field textarea { border-radius: 12px; border-color: transparent; background-color: #eef1f6; }
  .input:focus, .field input:focus, .field select:focus, .field textarea:focus { background-color: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(42, 120, 214, .15); }
  input[type=search].input, .toolbar input.input[placeholder^="Cerca"] { border-radius: 999px; padding-left: 40px;
    background: #e6eaf1 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 14px center / 18px no-repeat; }
  .topbar .search-trigger { border: 0; border-radius: 999px; background: #fff; }
  .badge { padding: 3px 10px; }

  /* Livelli del CRM e indice delle Impostazioni come le altre schede */
  .crm-stage { border: 0; border-radius: 16px; box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .05); }
  .crm-stage:hover { box-shadow: 0 0 0 2px var(--blue-light), 0 4px 14px rgba(2, 30, 70, .06); }
  .crm-stage.active { background: var(--blue-lighter); box-shadow: 0 0 0 2px var(--blue) inset; }
  .settings-nav { border: 0; border-radius: var(--m-radius); box-shadow: 0 1px 2px rgba(2, 30, 70, .05), 0 4px 14px rgba(2, 30, 70, .04); gap: 4px; }
  .settings-link { border-radius: 12px; }
  .settings-link[aria-current=page] { background: linear-gradient(var(--amber), var(--amber)) left center / 3px 56% no-repeat, var(--blue-lighter); box-shadow: none; }
}

/* Preventivo leggibile: parti lunghe richiudibili (quote-read.js, data-qfold). Si apre al tocco; in stampa e nel PDF tutto aperto */
.qfold-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--blue-lighter, #f2f6fc);
  color: var(--blue); font: 700 13px var(--font-head); cursor: pointer; }
.qfold-btn:hover, .qfold-btn:focus-visible { background: var(--blue-light); }
.qfold-btn .icon { width: 15px; height: 15px; transition: transform .2s; }
.qfold-count { padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--gray); font-weight: 600; font-size: 12px; }
.qfold:not(.is-open) .qfold-body { display: none; }
.qfold:not(.is-open) .qfold-when-open, .qfold.is-open .qfold-when-closed, .qfold.is-open .qfold-count { display: none; }
.qfold.is-open > .qfold-btn .icon, .qfold.is-open .qfold-btn .icon { transform: rotate(180deg); }
.quote-read .qitem-body { margin-top: 10px; }
/* Introduzione lunga: prime righe sfumate */
.qfold-clamp:not(.is-open) .qfold-body { display: block; max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.qfold-clamp .qfold-btn { margin-top: 4px; }
/* Come si paga: corto, il resto si apre */
.quote-paynote .qfold-btn { margin-top: 10px; background: #fff; }
/* Condizioni: titolo e pulsante sulla stessa riga quando c'è spazio */
.quote-read .terms.qfold:not(.is-open) { padding-bottom: 16px; }
.quote-read .terms .qfold-btn { margin-top: 2px; background: #fff; }
.quote-read .terms .qfold-body { margin-top: 12px; }
@media print {
  .qfold .qfold-body, .qfold-clamp:not(.is-open) .qfold-body { display: block !important; max-height: none !important; overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; }
  .qfold-btn { display: none !important; }
}
/* Invito agli esempi: sul telefono testo sopra e pulsante sotto (prima il testo finiva in una colonna stretta) */
@container (max-width: 560px) { .quote-read .quote-demo { flex-wrap: wrap; } .quote-read .quote-demo > div { flex-basis: calc(100% - 60px); } .quote-read .quote-demo > .btn { margin-left: 54px; } }
@container (max-width: 640px) { .quote-read .qitem-head .qitem-price { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; } }

/* Comunicazioni → Notifiche push (views/push-campaign.js): modulo e anteprima affiancati, anteprima com'è sul telefono */
.pc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.pc-side { position: sticky; top: calc(var(--topbar-h, 64px) + 16px); }
.pc-phone { padding: 18px 14px; border-radius: 28px; background: linear-gradient(160deg, #1d3b63, #0b1d33); }
.pc-phone > .muted { color: #c9d6e6; margin: 12px 4px 0; }
.pc-notif { padding: 12px 14px; border-radius: 18px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); color: #111; }
.pc-notif-top { display: flex; align-items: center; gap: 6px; font-size: 12px; margin-bottom: 6px; }
.pc-notif-top img { border-radius: 5px; }
.pc-notif-title { display: block; font-size: 14.5px; line-height: 1.3; }
.pc-notif-body { margin: 3px 0 0; font-size: 13.5px; line-height: 1.4; color: #333; white-space: pre-line; }
.pc-notif-img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; margin-top: 10px; border-radius: 10px; }
.pc-notif-actions { display: flex; margin-top: 10px; border-top: 1px solid rgba(0, 0, 0, .08); padding-top: 8px; }
.pc-notif-actions span { font: 700 13px var(--font-head); color: var(--blue); text-transform: uppercase; letter-spacing: .4px; }
.pc-image { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-image img { width: 120px; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px; }
.pc-audience { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pc-audience legend { margin-bottom: 6px; }
.pc-audience .field-hint { flex-basis: 100%; }
.pc-clients { flex-basis: 100%; }
.pc-client-list { max-height: 220px; overflow: auto; margin-top: 8px; padding: 6px 10px; border-radius: 12px; background: var(--bg, #f5f7fb); display: grid; gap: 4px; }
.pc-count { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--blue-lighter, #f2f6fc); }
.pc-count .icon { width: 18px; height: 18px; color: var(--blue); flex: none; }
.pc-yes { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e3f5ec; color: var(--green); }
.pc-yes .icon { width: 12px; height: 12px; stroke-width: 2.6; }
@media (max-width: 1100px) { .pc-layout { grid-template-columns: 1fr; } .pc-side { position: static; } }
.pc-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: #e6eaf1; }
.pc-seg label { position: relative; cursor: pointer; }
.pc-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pc-seg span { display: block; padding: 7px 14px; border-radius: 9px; font: 600 13.5px var(--font-head); color: var(--gray); }
.pc-seg input:checked + span { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(2, 30, 70, .14); }
.pc-seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.pc-layout .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pc-devs { display: flex; flex-wrap: wrap; gap: 4px; }
.pc-dev { padding: 2px 9px; border-radius: 999px; font: 600 12px var(--font-head); background: #eef1f6; color: var(--gray); white-space: nowrap; }
.pc-dev-ios { background: #e8eefb; color: #2a5bb8; }
.pc-dev-android { background: #e3f5ec; color: #0e7a50; }
.pc-dev-desktop { background: #fdf1e3; color: #9a5b00; }

/* Editor visuale (rich-editor.js, modulo del warehouse): il testo formattato si vede mentre si scrive; il textarea con il markdown resta
   nascosto nel modulo. css/rich-editor.css del modulo si carica prima di questo file (index.html): queste regole lo sovrascrivono
   e tengono l'aspetto del gestionale (caratteri, sfondo su desktop), anche rispetto a .prose */
.rte .rte-source { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; border: 0 !important; opacity: 0; pointer-events: none; }
.rte { position: relative; }
.rte-area { padding: 10px 14px; font-size: 15px; line-height: 1.6; color: var(--text); outline: none; overflow-wrap: anywhere; cursor: text; max-height: 60vh; overflow-y: auto; }
.rte-area > :first-child { margin-top: 0; }
.rte-area > :last-child { margin-bottom: 0; }
.rte-area p { margin: 0 0 .7em; }
.rte-area h1, .rte-area h2, .rte-area h3, .rte-area h4, .rte-area h5, .rte-area h6 { margin: .9em 0 .35em; font: 700 16px/1.35 var(--font-head); color: var(--text); }
.rte-area ul, .rte-area ol { margin: 0 0 .7em; padding-left: 1.4em; }
.rte-area a { color: var(--blue); text-decoration: underline; }
.rte-area.is-empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; float: left; height: 0; }
.rte.is-invalid { border-color: var(--red, #e34948); }
.rte.is-disabled { background: #f4f6f9; }
.rte.is-disabled .rte-bar { display: none; }
.rte.is-disabled .rte-area { cursor: default; color: var(--gray); }
@media (min-width: 861px) { .rte { border: 0; background: #eef1f6; } .rte:focus-within { background: #fff; box-shadow: 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(42, 120, 214, .15); } .rte-bar { background: transparent; border-bottom: 1px solid rgba(2, 30, 70, .06); } }

/* Scorri a sinistra per eliminare (swipe-rows.js): la riga si sposta e scopre il pulsante rosso */
@media (max-width: 860px) {
  .table.is-compact > tbody > tr[data-href] { position: relative; transition: transform .2s ease; }
  .table.is-compact > tbody > tr[data-href].is-swiping { transition: none; }
  .table.is-compact > tbody > tr[data-href] > td.swipe-del.swipe-del:not(:first-child):not(.m-keep):not(.m-sub) { display: block !important; position: absolute; top: 0; bottom: 0; right: -92px; width: 92px; padding: 0; margin: 0; }
  .table.is-compact > tbody > tr[data-href] > td.swipe-del::before { display: none; }
  .swipe-del button { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; background: var(--red, #e34948); color: #fff; font: 700 12.5px var(--font-head); }
  .swipe-del .icon { width: 20px; height: 20px; }
  .table.is-compact { overflow: hidden; }
  .table-wrap:has(.table.is-compact) { overflow: hidden; }
}

/* Telefono: campi e editor a 16 px (sotto i 16 px Safari su iPhone ingrandisce la pagina al tocco del campo) */
@media (max-width: 860px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea, [contenteditable=true] { font-size: 16px !important; }
}
@media (max-width: 860px) {
  /* Chat con il consulente a tutto schermo, campo di scrittura sopra la barra home, niente pulsante sopra */
  .cw.open { top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; z-index: 400; align-items: stretch; gap: 0; transform: none !important; opacity: 1 !important; pointer-events: auto !important; }
  .cw.open .cw-launcher { display: none; }
  .cw.open .cw-panel { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; box-shadow: none; }
  .cw-head { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .cw-compose { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); }
  .cw-compose .btn { height: 44px; width: 44px; flex: none; }
  .cw-msg p { font-size: 15px; }
  body:has(.cw.open) { overflow: hidden; }
  body:has(.cw.open) .tabbar, body:has(.cw.open) .aw { display: none; }
}
@media (max-width: 600px) {
  /* Finestre con azioni a sinistra (es. task: AI ed Elimina): una riga sola, azioni come icone, Salva largo, Annulla nascosto (c'è la X) */
  .modal-foot:has(.foot-left-group) { flex-wrap: nowrap; gap: 6px; }
  .modal-foot:has(.foot-left-group) > .btn-ghost[data-close] { display: none; }
  .modal-foot .foot-left-group { gap: 6px; margin-right: 0; }
  .modal-foot .foot-left-group .btn { font-size: 0; gap: 0; min-width: 44px; min-height: 44px; padding: 0 12px; justify-content: center; }
  .modal-foot .foot-left-group .btn .icon { width: 20px; height: 20px; }
  .modal-foot:has(.foot-left-group) > button[type=submit] { flex: 1; }
}

/* Conversazione di una richiesta: messaggi come in una chat (i propri a destra in blu), risposta su una riga che si allunga */
.reply { align-items: flex-end; }
.reply .reply-input { min-height: 44px; max-height: 160px; resize: none; line-height: 1.4; border-radius: 22px; padding: 11px 16px; overflow-y: auto; }
.reply .reply-send { flex: none; }
.msg.mine { background: var(--blue); border-color: var(--blue); color: #fff; }
.msg.mine .msg-meta { color: rgba(255, 255, 255, .78); }
.msg.mine .msg-body a { color: #fff; }
@media (max-width: 860px) {
  .reply { position: sticky; bottom: calc(var(--tabbar-h, 72px) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 5; margin: 12px -6px 0; padding: 8px; background: var(--surface); border-radius: 26px; box-shadow: 0 6px 24px rgba(2, 30, 70, .12); }
  .reply .reply-send { width: 44px; height: 44px; padding: 0; border-radius: 50%; justify-content: center; }
  .reply .reply-send span { display: none; }
  .reply .reply-send .icon { width: 20px; height: 20px; }
  .msg { max-width: 86%; border-radius: 18px; }
  .msg.mine { border-bottom-right-radius: 6px; }
  .msg:not(.mine) { border-bottom-left-radius: 6px; }
}
@media (max-width: 860px) {
  .reply .reply-input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Nella conversazione il campo di risposta prende il posto dei pulsanti flottanti (assistente, consulente) */
  body:has(form.reply) .aw:not(.open), body:has(form.reply) .cw:not(.open) { display: none; }
}

/* Preventivo accettato (views/quote.js): riepilogo in cima, certificato e attività richiudibili; per lo studio il documento in sola
   lettura al posto dell'editor, che si apre da «Modifica il preventivo» (.is-editing) */
.acc-summary { display: flex; align-items: center; gap: 14px; border-left: 4px solid var(--ok); }
.acc-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.acc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-total { display: flex; flex-direction: column; align-items: flex-end; }
.acc-total strong { font-size: 1.25rem; color: var(--blue, #023f82); }
/* Copia cortesia del preventivo accettato (quote-courtesy.js): su una riga propria sotto il riepilogo */
.acc-summary:has(.acc-actions) { flex-wrap: wrap; }
.acc-actions { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-left: 54px; }
@media (max-width: 640px) { .acc-actions { padding-left: 0; } }
.cert-fold { margin: 0 0 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, #fff); }
.cert-fold > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
.cert-fold > summary::-webkit-details-marker { display: none; }
.cert-fold > summary::after { content: '›'; margin-left: auto; transform: rotate(90deg); transition: transform .15s; color: var(--muted); }
.cert-fold[open] > summary::after { transform: rotate(-90deg); }
.cert-fold > .card { margin: 0; border: 0; box-shadow: none; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); }
.acc-title { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.25; }
.qv-accepted:not(.is-editing) .qv-edit { display: none !important; }
.qv-accepted.is-editing .qv-read { display: none !important; }
.qv-doc { margin-top: 8px; }
@media (max-width: 640px) {
  .acc-summary { flex-wrap: wrap; }
  .acc-total { flex-direction: row; align-items: baseline; gap: 8px; width: 100%; padding-left: 54px; }
  .acc-title { font-size: 1.25rem; }
}
@media (max-width: 640px) {
  .cert-fold > summary { flex-wrap: nowrap; }
  .cert-fold > summary .muted { display: none; }
}
.cert-fold .certificate > .card-head { justify-content: flex-end; }
.cert-fold .certificate > .card-head h2 { display: none; }
@media print { body.print-cert .cert-fold .certificate > .card-head h2 { display: flex; } }

/* ==========================================================================================================================
   App mobile: intestazione e movimento.
   - Intestazione: logo allineato a sinistra (l'hamburger non c'è: il menu è in «Altro»), azioni a destra tutte rotonde e della
     stessa misura (44 px, il minimo per il tocco): campanella e chiamata bianche con il bordo sottile, «Nuovo» piena in blu.
   - Cambio di pagina con il verso (app.js → data-nav): un dettaglio entra da destra, tornando indietro da sinistra, tra le voci
     della barra in basso una dissolvenza; i blocchi della pagina arrivano uno dopo l'altro.
   - Pressione su pulsanti e icone, voce attiva della barra in basso che «salta», contatore delle notifiche che compare con un
     piccolo rimbalzo, ombra dell'intestazione che compare scorrendo.
   Tutto spento con «Riduci movimento» del sistema.
   ========================================================================================================================== */
@media (max-width: 860px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-left: 16px; padding-right: 14px; min-height: 60px; }
  .topbar .topbar-logo-link { grid-column: 1; margin-left: 0; }
  .topbar .topbar-logo { height: 30px; max-width: 56vw; }
  .topbar .topbar-right { grid-column: 2; gap: 8px; }
  .topbar .topbar-right .icon-btn.bell { width: 44px; height: 44px; border-radius: 50%; background: #fff; border: 1px solid var(--m-hair); box-shadow: 0 1px 2px rgba(2, 30, 70, .06); }
  .topbar .topbar-right .icon-btn.bell svg { width: 21px; height: 21px; }
  .topbar .topbar-right .btn-sm { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 4px 12px rgba(2, 63, 130, .28); }
  .topbar .topbar-right .btn-sm svg { width: 20px; height: 20px; }
  .bell-count { top: -3px; right: -3px; min-width: 19px; height: 19px; font-size: 10.5px; box-shadow: 0 0 0 2px #fff; }
  .scrolled .topbar { box-shadow: 0 6px 18px rgba(2, 30, 70, .06); }
  .topbar { transition: border-color .2s, box-shadow .25s; }

  /* Pressione */
  .btn, .icon-btn, .chip, .tabs [role=tab], .seg button { transition: transform .1s ease, background-color .15s, box-shadow .15s; }
  .btn:active:not(:disabled), .chip:active, .tabs [role=tab]:active, .seg button:active { transform: scale(.96); }
  .icon-btn:active { transform: scale(.9); }

  /* Cambio di pagina con il verso e blocchi che arrivano in cascata */
  .view.view-in { animation: none; }
  .view.view-in[data-nav=push] { animation: nav-push .3s cubic-bezier(.2, .8, .2, 1); }
  .view.view-in[data-nav=pop] { animation: nav-pop .3s cubic-bezier(.2, .8, .2, 1); }
  .view.view-in[data-nav=fade] { animation: nav-fade .22s ease-out; }
  .view.view-in > :nth-child(-n+6) { animation: block-in .38s cubic-bezier(.2, .8, .2, 1) backwards; }
  .view.view-in > :nth-child(2) { animation-delay: .04s; }
  .view.view-in > :nth-child(3) { animation-delay: .08s; }
  .view.view-in > :nth-child(4) { animation-delay: .12s; }
  .view.view-in > :nth-child(5) { animation-delay: .16s; }
  .view.view-in > :nth-child(6) { animation-delay: .2s; }

  /* Barra in basso: la voce attiva entra con un piccolo salto */
  .tabbar .active .tabbar-icon { animation: tab-pop .32s cubic-bezier(.3, 1.6, .5, 1); }
  /* Contatore delle notifiche */
  .bell-count:not([hidden]), .tabbar-badge { animation: badge-pop .35s cubic-bezier(.3, 1.6, .5, 1); }
}
@keyframes nav-push { from { opacity: .4; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes nav-pop { from { opacity: .4; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes block-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes tab-pop { 0% { transform: scale(.82); } 100% { transform: scale(1); } }
@keyframes badge-pop { 0% { transform: scale(.4); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .view.view-in, .view.view-in > *, .tabbar .active .tabbar-icon, .bell-count, .tabbar-badge { animation: none !important; }
  .btn:active, .icon-btn:active, .chip:active { transform: none; }
}

/* Impostazioni → Google Analytics del sito: esito della verifica della connessione */
.ga-verify { border-top: 1px solid var(--border); padding-top: 12px; }
.ga-check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.ga-check > .icon { flex: 0 0 auto; margin-top: 2px; }
.ga-check.is-ok > .icon { color: var(--ok); }
.ga-check.is-ko > .icon { color: var(--bad); }

/* Impostazioni → Eventi tracciati: le piattaforme collegate affiancate, poi gli eventi per piattaforma */
.te-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
.te-platform { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.te-platform .btn { align-self: flex-start; margin-top: 6px; }
.te-id code { font-size: 16px; }
.te-table td .icon { width: 16px; height: 16px; vertical-align: -3px; }

/* Sito web → Google Analytics: eventi chiave con nome leggibile, nome tecnico e origine sotto */
.ga-ev-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); }
.ga-ev-meta code { font-size: 11.5px; word-break: break-all; }
.ga-delta { font-weight: 600; }
.ga-delta.is-up { color: var(--ok); }
.ga-delta.is-down { color: var(--bad); }
.ga-hint { margin-top: 14px; }

/* ==========================================================================================================================
   Mockup di progetto (mockups.js, views/public-mockup.js): card del CRM, scelta dei file e pagina di sola visualizzazione per il lead
   con la cornice del mockup, i dispositivi, la filigrana, l'oscuramento quando la finestra perde il fuoco e il riquadro del consulente
   ========================================================================================================================== */
.mockup-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.mockup-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; border: 1.5px dashed var(--border); border-radius: var(--radius);
  text-align: center; cursor: pointer; background: #fafbfd; transition: border-color .15s, background .15s; }
.mockup-drop:hover, .mockup-drop:focus-within { border-color: var(--blue); background: var(--blue-light); }
.mockup-drop .icon { width: 26px; height: 26px; color: var(--blue); }
.mockup-drop small { color: var(--muted); font-size: 12px; }
.mockup-files { max-height: 220px; overflow: auto; margin-top: 6px; }
.mockup-pages { margin: 6px 0 2px; display: grid; gap: 4px; }
.mockup-pages li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; font-size: 12.5px; }
.mockup-page-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: #eef1f6; overflow: hidden; }
.mockup-page-bar > span { display: block; height: 100%; background: #2a78d6; border-radius: 2px; }
.mockup-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; justify-content: flex-end; }
@media (max-width: 640px) { .mockup-pick { grid-template-columns: 1fr; } .mockup-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .mockups-card .list-row.mockup-row > .list-main, .mockups-card .list-row.mockup-row > .list-meta { flex: none; min-height: 0; } .mockup-actions { justify-content: flex-start; margin-left: -8px; } }

body.mockup-page { background: #eef1f6; }
.mockup-err-logo { display: block; margin: 0 auto 24px; }
.mk { display: flex; flex-direction: column; height: 100dvh; -webkit-user-select: none; user-select: none; }
.mk textarea { -webkit-user-select: text; user-select: text; }
.mk-bar { display: flex; align-items: center; gap: 16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px; background: #fff; border-bottom: 1px solid var(--border); }
.mk-logo { height: 28px; width: auto; flex: none; }
.mk-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mk-title strong { font: 700 15px/1.25 var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-title small { color: var(--muted); font-size: 12px; }
.mk-devices { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #f1f3f7; }
.mk-dev { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--text); font: 600 13px var(--font-head); cursor: pointer; }
.mk-dev .icon { width: 16px; height: 16px; }
.mk-dev.is-on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(2, 30, 70, .12); }
.mk-stage { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 16px 16px 96px; overflow: auto; }
.mk-frame-wrap { position: relative; width: 100%; max-width: 100%; height: 100%; min-height: 420px; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(2, 30, 70, .12); transition: width .25s ease; }
.mk-frame-wrap.is-device { border: 10px solid #1d2433; border-radius: 28px; }
.mk-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
/* Filigrana: il nome di chi guarda ripetuto in diagonale, appena visibile, sopra il mockup ma senza bloccare i clic */
.mk-mark { position: absolute; inset: -20%; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 80px 60px;
  transform: rotate(-24deg); pointer-events: none; opacity: .07; overflow: hidden; }
.mk-mark span { font: 700 16px var(--font-head); color: #0b1b33; white-space: nowrap; }
.mk-shield { position: absolute; inset: 0; display: none; place-items: center; padding: 24px; text-align: center; background: rgba(238, 241, 246, .96);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.mk-shield p { display: flex; align-items: center; gap: 8px; font: 600 15px var(--font-head); color: var(--text); }
.mk.is-shielded .mk-shield { display: grid; }
.mk.is-shielded .mk-frame { filter: blur(24px); }
/* Riquadro del consulente in basso */
.mk-widget { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(560px, calc(100vw - 24px));
  background: #fff; border-radius: 22px; box-shadow: 0 12px 34px rgba(2, 30, 70, .2), 0 2px 6px rgba(2, 30, 70, .08); z-index: 30; overflow: hidden; }
.mk-widget-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--text); }
.mk-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.mk-avatar-ini { display: grid; place-items: center; background: var(--blue); color: #fff; font: 700 15px var(--font-head); }
.mk-widget-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mk-widget-who strong { font: 700 14px var(--font-head); }
.mk-widget-who small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-widget-cta { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--blue); color: #fff; font: 600 13px var(--font-head); white-space: nowrap; }
.mk-widget-cta .icon { width: 16px; height: 16px; }
.mk-badge { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e34948; color: #fff; font: 700 11px/18px var(--font-head); font-style: normal; text-align: center; }
.mk-widget.is-open .mk-widget-cta { background: #f1f3f7; color: var(--text); }
.mk-panel { border-top: 1px solid var(--border); padding: 10px 14px 12px; }
.mk-msgs { list-style: none; margin: 0 0 10px; padding: 0; max-height: min(42vh, 320px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.mk-msg { max-width: 85%; padding: 8px 12px; border-radius: 14px; background: #f1f3f7; }
.mk-msg.is-me { align-self: flex-end; background: var(--blue-light); }
.mk-msg p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.mk-msg-meta { font-size: 11.5px; color: var(--muted); }
.mk-form { display: flex; gap: 8px; align-items: flex-end; }
.mk-form textarea { flex: 1; resize: none; min-height: 44px; }
.mk-note { margin: 8px 0 0; }
@media (max-width: 700px) {
  .mk-bar { flex-wrap: wrap; gap: 8px 12px; padding-left: 12px; padding-right: 12px; }
  .mk-logo { height: 24px; }
  .mk-devices { order: 3; width: 100%; justify-content: center; }
  .mk-dev span { display: none; }
  .mk-stage { padding: 8px 8px 88px; }
  .mk-widget-cta span { display: none; }
}
@media print { body.mockup-page * { display: none !important; } }

/* ==========================================================================================================================
   Revisione dei progetti web (project-review.js, views/project-preview.js): percorso a fasi, piattaforme in costruzione,
   segnalazioni con screenshot e pagina di anteprima con il pannello a lato
   ========================================================================================================================== */
.web-phases { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.web-phase { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: #f6f8fb; }
.web-phase-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e3e8f0; color: var(--muted); font: 700 13px var(--font-head); }
.web-phase-dot .icon { width: 15px; height: 15px; }
.web-phase-body { display: flex; flex-direction: column; min-width: 0; }
.web-phase-body strong { font-size: 13.5px; line-height: 1.3; }
.web-phase-body small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.web-phase.is-done .web-phase-dot { background: #1baf7a; color: #fff; }
.web-phase.is-current .web-phase-dot, .web-phase.is-now .web-phase-dot { background: var(--blue); color: #fff; }
.web-phase.is-now { background: var(--blue-light); box-shadow: inset 0 0 0 1.5px var(--blue); }
.web-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.web-link-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: #fff; color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.web-link-card:hover { border-color: var(--blue); box-shadow: 0 4px 14px rgba(2, 63, 130, .1); }
.web-link-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-light); color: var(--blue); flex: none; }
.web-link-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.web-link-body small { color: var(--muted); font-size: 12.5px; }
.fb-row { align-items: flex-start; gap: 12px; }
.fb-thumb { flex: none; width: 64px; height: 44px; border-radius: 8px; overflow: hidden; background: #f1f3f7; display: grid; place-items: center; color: var(--muted); }
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fb-thumb-ico .icon { width: 18px; height: 18px; }
.fb-form { display: flex; flex-direction: column; gap: 10px; }
.fb-kinds { display: flex; gap: 4px; flex-wrap: wrap; }
.fb-kinds label { flex: 1; cursor: pointer; }
.fb-kinds input { position: absolute; opacity: 0; pointer-events: none; }
.fb-kinds span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 10px; border-radius: 999px; background: #f1f3f7; font: 600 13px var(--font-head); white-space: nowrap; }
.fb-kinds span .icon { width: 15px; height: 15px; }
.fb-kinds input:checked + span { background: var(--blue); color: #fff; }
.fb-kinds input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.fb-shot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-shot-preview { position: relative; display: inline-flex; }
.fb-shot-preview img { width: 96px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.fb-shot-preview .icon-btn { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); border-radius: 50%; }
.feedback-shot img { display: block; max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--border); margin: 6px 0 10px; }

.pv { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - var(--topbar-h, 64px) - 32px); min-height: 520px; }
.pv-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.pv-head .back { margin: 0; }
.pv-title { flex: 1; min-width: 160px; }
.pv-title h1 { font-size: 20px; line-height: 1.2; }
.pv-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv-devices button { display: inline-flex; align-items: center; gap: 6px; }
.pv-devices .icon { width: 15px; height: 15px; }
.pv-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; }
.pv.panel-closed .pv-body { grid-template-columns: minmax(0, 1fr); }
.pv.panel-closed .pv-panel { display: none; }
/* Pannello ridotto: resta una linguetta verticale sul bordo destro che lo riapre (sul telefono una barra sotto il sito) */
.pv.panel-mini .pv-body { grid-template-columns: minmax(0, 1fr) 46px; }
.pv.panel-mini .pv-panel { padding: 0; overflow: hidden; }
.pv.panel-mini .pv-panel > :not(.pv-panel-tab) { display: none; }
.pv-panel-tab { display: none; }
.pv.panel-mini .pv-panel-tab { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; height: 100%; padding: 14px 0; border: 0; background: none;
  color: var(--blue); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; border-radius: 14px; }
.pv.panel-mini .pv-panel-tab span { writing-mode: vertical-rl; }
.pv.panel-mini .pv-panel-tab:hover { background: var(--surface-2, #f4f7fb); }
.pv-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pv-panel-head .card-title-sm { margin: 0; }
.pv-panel-acts { display: inline-flex; gap: 2px; flex: none; }
.pv-stage { min-height: 0; display: flex; justify-content: center; background: #e9edf3; border-radius: 14px; padding: 10px; overflow: auto; }
.pv-frame-wrap { width: 100%; max-width: 100%; height: 100%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px rgba(2, 30, 70, .1); transition: width .25s ease; }
.pv-frame-wrap.is-device { border: 10px solid #1d2433; border-radius: 26px; }
.pv-frame { display: block; width: 100%; height: 100%; border: 0; }
.pv-external { align-self: center; max-width: 440px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px; }
.pv-external-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: #fff; color: var(--blue); }
.pv-panel { min-height: 0; overflow-y: auto; background: var(--surface); border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 12px; }
.pv-panel .fb-list .fb-thumb { width: 48px; height: 36px; }
@media (max-width: 900px) {
  .pv { height: auto; min-height: 0; }
  .pv-body { grid-template-columns: minmax(0, 1fr); }
  .pv-stage { height: 70dvh; padding: 6px; }
  .pv.panel-mini .pv-body { grid-template-columns: minmax(0, 1fr); }
  .pv.panel-mini .pv-panel-tab { flex-direction: row; justify-content: center; padding: 12px; }
  .pv.panel-mini .pv-panel-tab span { writing-mode: horizontal-tb; }
  .pv-devices span { display: none; }
  .pv-title h1 { font-size: 18px; }
}
.web-review .card-title-sm { margin-top: 16px; }

/* «Come lavoriamo» nella pagina del mockup (views/public-mockup.js, come-lavoriamo.js): menu a lato con voci apribili e screenshot */
.mk-main { flex: 1; min-height: 0; display: flex; }
.mk-tempi { flex: none; background: linear-gradient(90deg, #f3f8fe, #fff 60%); border-bottom: 1px solid var(--border); padding: 12px 18px; display: grid; gap: 10px; }
.mk-tempi-top { display: flex; align-items: center; gap: 18px; min-width: 0; }
.mk-tempi-intro { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: none; max-width: 300px; }
.mk-tempi-kicker { display: inline-flex; align-items: center; gap: 6px; font: 700 11px var(--font-head); letter-spacing: .8px; text-transform: uppercase; color: var(--blue); }
.mk-tempi-kicker .icon { width: 14px; height: 14px; }
.mk-tempi-intro strong { font: 700 17px/1.25 var(--font-head); color: var(--text, #102a43); }
.mk-tempi-steps { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 0; }
.mk-tempi-steps li { flex: 1; min-width: 0; position: relative; padding: 14px 6px 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.mk-tempi-steps li::before { content: ''; position: absolute; top: 4px; left: 0; right: 0; height: 3px; background: #cfe0f5; }
.mk-tempi-steps li::after { content: ''; position: absolute; top: 0; left: 6px; width: 11px; height: 11px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); box-sizing: border-box; }
.mk-tempi-steps li:first-child::before { left: 6px; }
.mk-tempi-steps li span { color: var(--muted); }
.mk-tempi-steps li b { font: 700 13px var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-tempi-steps li.is-end::after { background: var(--blue); }
.mk-tempi-steps li.is-end b { color: var(--blue); }
.mk-tempi-toggle { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transform: rotate(180deg); }
.mk-tempi-toggle .icon { width: 16px; height: 16px; }
.mk-tempi-more { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.mk-tempi-posti, .mk-tempi-tg { margin: 0; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); }
.mk-tempi-posti { font-weight: 600; }
.mk-tempi-posti.is-low { border-color: #f3c27a; background: #fff8ec; }
.mk-tempi-tg .icon { width: 15px; height: 15px; color: var(--blue); flex: none; }
.mk-tempi-tg small { color: var(--muted); }
.mk-dots { display: inline-flex; gap: 3px; }
.mk-dots i { width: 9px; height: 9px; border-radius: 50%; background: #1baf7a; }
.mk-dots i.is-taken { background: #cfd6e0; }
.mk-tempi-cta { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.mk-tempi-cta small { max-width: 320px; font-size: 11.5px; }
.mk-tempi.is-closed .mk-tempi-more, .mk-tempi.is-closed .mk-tempi-steps { display: none; }
.mk-tempi.is-closed .mk-tempi-top { justify-content: space-between; }
.mk-tempi.is-closed .mk-tempi-toggle { transform: none; }
.mk-tempi-sintesi { display: none; color: var(--muted); font-size: 12.5px; }
.mk-tempi.is-closed .mk-tempi-sintesi { display: block; }
.mk-tempi-posti, .mk-tempi-tg { font-size: 13px; padding: 5px 11px; }
.mk-tempi-cta small { max-width: 220px; }
@media (max-width: 900px) {
  .mk-tempi-top { flex-wrap: wrap; }
  .mk-tempi-intro { max-width: none; flex: 1; }
  .mk-tempi-steps { order: 3; flex-basis: 100%; }
  .mk-tempi-cta { margin-left: 0; }
}
@media (max-width: 700px) {
  .mk-tempi { padding: 10px 12px; }
  .mk-tempi-intro strong { font-size: 15px; }
  .mk-tempi-steps li { font-size: 11px; padding-right: 2px; }
  .mk-tempi-steps li b { font-size: 12px; white-space: normal; }
  .mk-tempi-posti, .mk-tempi-tg { border-radius: 12px; }
}
.mk-main .mk-stage { flex: 1; min-width: 0; }
.mk-guide-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff;
  color: var(--blue); font: 600 13px var(--font-head); cursor: pointer; white-space: nowrap; }
.mk-guide-btn .icon { width: 16px; height: 16px; }
.mk.guide-open .mk-guide-btn { background: var(--blue); color: #fff; border-color: var(--blue); }
.mk-guide { display: none; width: 360px; flex: none; flex-direction: column; background: #fff; border-right: 1px solid var(--border); overflow: hidden; }
.mk.guide-open .mk-guide { display: flex; }
.mk-guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 16px 16px 10px; }
.mk-guide-head strong { display: block; font: 700 16px var(--font-head); }
.mk-guide-head small { color: var(--muted); font-size: 12.5px; }
.mk-guide-list { list-style: none; margin: 0; padding: 0 10px 10px; overflow-y: auto; flex: 1; }
.mk-guide-item { border-radius: 12px; margin-bottom: 4px; }
.mk-guide-item.is-open { background: #f6f8fb; }
.mk-guide-q { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; text-align: left; font: 600 14px var(--font-head); color: var(--text); cursor: pointer; border-radius: 12px; }
.mk-guide-q:hover { background: #f1f3f7; }
.mk-guide-q > span:nth-child(2) { flex: 1; }
.mk-guide-q .icon { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.mk-guide-item.is-open .mk-guide-q .icon { transform: rotate(180deg); }
.mk-guide-n { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--blue-light); color: var(--blue); font: 700 12px var(--font-head); }
.mk-guide-item.is-open .mk-guide-n { background: var(--blue); color: #fff; }
.mk-guide-a { padding: 0 12px 12px 44px; font-size: 13.5px; line-height: 1.5; color: #3a4456; }
.mk-guide-a p { margin: 0 0 10px; }
.mk-guide-shot { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; cursor: zoom-in; box-shadow: 0 4px 14px rgba(2, 30, 70, .08); }
.mk-guide-shot img { display: block; width: 100%; height: auto; pointer-events: none; }
.mk-guide-points { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.mk-guide-points li { display: flex; align-items: flex-start; gap: 6px; }
.mk-guide-points .icon { width: 14px; height: 14px; color: #1baf7a; flex: none; margin-top: 2px; }
.mk-guide-foot { margin: 0; padding: 12px 16px calc(96px + env(safe-area-inset-bottom, 0px)); font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); }
.mk-zoom { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(11, 22, 40, .82); cursor: zoom-out; }
.mk-zoom[hidden] { display: none; }
.mk-zoom img { max-width: min(1400px, 100%); max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); pointer-events: none; }
.mk-zoom .icon-btn { position: absolute; top: 14px; right: 14px; background: #fff; border-radius: 50%; }
.mk-guide-seen { display: block; margin-top: 6px; }
.mk-guide-seen .icon { width: 13px; height: 13px; vertical-align: -2px; }
@media (max-width: 1099px) {
  /* Sotto i 1100 px il menu copre il mockup come un pannello e si chiude con la X */
  .mk-guide { position: fixed; left: 0; top: 0; bottom: 0; z-index: 40; width: min(400px, 100vw); box-shadow: 12px 0 40px rgba(2, 30, 70, .2); padding-top: env(safe-area-inset-top, 0px); }
}
@media (max-width: 700px) {
  .mk-guide-btn span { display: none; }
  .mk-guide-btn { width: 34px; padding: 0; justify-content: center; }
  .mk-guide { width: 100vw; }
}
/* Cambio dollaro/euro nelle impostazioni del catalogo del warehouse (warehouse-catalog.js) */
.wh-fx { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0; display: grid; gap: 8px; }
.wh-fx legend { padding: 0 6px; }
.wh-fx-now { margin: 0; }
.wh-fx-now .icon { width: 14px; height: 14px; color: #1baf7a; vertical-align: -2px; }

/* Progetto dal preventivo (quote-project.js): posti dei progetti web per mese, fasi e link da condividere */
.qp-form { display: grid; gap: 14px; }
.qp-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 0; min-width: 0; }
.qp-box legend { font-weight: 600; padding: 0 6px; }
/* Lista d'attesa (v1.16, js/waitlist-box.js e views/waitlist.js) */
.wl-box { display: grid; gap: 10px; }
.wl-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.wl-steps i { font-style: normal; font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2, rgba(0,0,0,.05)); }
.wl-steps i.done { background: rgba(27,175,122,.14); color: #138a5f; font-weight: 600; }
.wl-steps i.now { background: var(--primary, #1d3b6f); color: #fff; font-weight: 600; }
.wl-dots { flex-wrap: wrap; }
.wl-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.wl-dots i { width: 12px; height: 12px; border-radius: 3px; background: var(--primary, #1d3b6f); }
.wl-dots i.free { background: transparent; border: 2px dashed #eb6834; }
.wl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.wl-head p { margin: 0; max-width: 70ch; }
.wl-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 12px; margin-bottom: 16px; }
.wl-col { display: grid; gap: 8px; align-content: start; min-width: 0; }
.wl-col h3 { margin: 0; font-size: 1rem; }
.wl-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; display: grid; gap: 4px; font-size: .875rem; min-width: 0; overflow-wrap: anywhere; }
.wl-offer { margin: 0; }
/* Mockup a pagamento (v1.16, js/mockup-orders.js) */
.mo-box { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.mo-credit { background: var(--surface-2, rgba(42,120,214,.06)); border-radius: var(--radius); padding: 8px 10px; display: grid; gap: 2px; margin-top: 6px; max-width: 420px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.mo-credit .money, .money { font-variant-numeric: tabular-nums; font-weight: 600; }
.qp-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.qp-line { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.qp-line-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.qp-line p { margin: 0; overflow-wrap: anywhere; }
.qp-line-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.qp-line-act .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Progetti in cartelle per cliente (v1.15, views/projects.js) */
.pf-group { display: inline-flex; gap: 4px; }
.pf-list { display: grid; gap: 10px; }
.pf-folder { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, var(--bg)); min-width: 0; }
.pf-folder > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 14px; }
.pf-folder > summary::-webkit-details-marker { display: none; }
.pf-folder > summary .pf-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; flex: 1 1 180px; }
.pf-folder > summary .pf-facts { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .875rem; color: var(--muted); }
.pf-folder > summary .pf-lines { display: flex; flex-wrap: wrap; gap: 4px; }
.pf-folder > summary::before { content: '▸'; color: var(--muted); }
.pf-folder[open] > summary::before { content: '▾'; }
.pf-folder .pf-body { padding: 0 14px 14px; }
.pf-late { color: var(--danger, #e34948); font-weight: 600; }
.qp-slots { display: grid; gap: 6px; margin-bottom: 6px; }
.qp-slot { display: grid; grid-template-columns: minmax(110px, 1fr) auto minmax(64px, auto); align-items: center; gap: 12px; padding: 6px 10px; border-radius: 8px; }
.qp-slot.is-sel { background: #eaf2fc; outline: 1px solid #b9d3f2; }
.qp-slot.is-full strong { color: var(--bad, #c0392b); }
.qp-slot strong { font-size: 13px; text-align: right; }
.qp-dots { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.qp-dots i { width: 10px; height: 10px; border-radius: 50%; background: #dfe6f0; }
.qp-dots i.on { background: #2a78d6; }
.qp-steps { margin: 0 0 6px; padding-left: 20px; display: grid; gap: 4px; }
.qp-link + .qp-link { margin-top: 4px; }
.mockup-quotes a { font-weight: 500; }

/* Catalogo funzioni diviso per macro categoria (warehouse-catalog.js → righeRaggruppate) */
.table tr.wh-gruppo th { text-align: left; background: var(--surface-2, #f4f7fb); font-size: 13.5px; padding-top: 10px; padding-bottom: 10px; position: sticky; top: 0; z-index: 1; }
.table tr.wh-gruppo th .muted { font-weight: 400; margin-left: 6px; }

/* Accesso di prova alla piattaforma in costruzione (project-review.js → loginBoxHtml): utente e password con «Mostra» e «Copia» */
.web-link-wrap { display: grid; gap: 6px; }
.login-box { display: grid; gap: 4px; margin-top: 6px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface-2, #f7f9fc); }
.login-box strong .icon { width: 14px; height: 14px; vertical-align: -2px; }
.login-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.login-row > .muted { min-width: 64px; }
.login-row { flex-wrap: nowrap; }
.login-row code { flex: 1 1 auto; min-width: 0; font-size: 13px; padding: 2px 6px; border-radius: 6px; background: #fff; border: 1px solid var(--border); overflow-wrap: anywhere; }
.login-row .btn { flex: none; padding-inline: 8px; }
.pv-panel .login-box { margin: 0 0 12px; }
.qp-link + .qp-link { border-top: 1px solid var(--border); padding-top: 10px; }
.login-fields { margin-top: 4px; }
/* Materiali per il sito dei progetti web (project-materials.js): filtri, gruppi per pagina, invii con anteprime e riscontro dello studio */
.mat-card .card-head { gap: 12px; }
.mat-filter { flex-wrap: wrap; margin: 4px 0 6px; max-width: 100%; }
.mat-count { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--blue-light); color: var(--blue); font-size: 11.5px; text-align: center; }
.segmented button[aria-pressed=true] .mat-count { background: rgba(255, 255, 255, .25); color: #fff; }
.mat-group { margin-top: 14px; }
.mat-group > h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; }
.mat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mat-item { border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); display: grid; gap: 8px; }
.mat-item[data-status=in_lavorazione] { border-left-color: var(--amber); }
.mat-item[data-status=inserito] { border-left-color: var(--green); }
.mat-item[data-status=da_rivedere] { border-left-color: var(--red); }
.mat-head { display: flex; align-items: flex-start; gap: 10px; }
.mat-cat { flex: none; width: 34px; height: 34px; border-radius: 8px; background: var(--blue-light); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.mat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.mat-main small { font-size: 12px; }
.mat-note { margin: 0; white-space: pre-line; color: var(--gray); overflow-wrap: anywhere; }
/* Informazioni e testi per le pagine: il testo come lo scrive il cliente, i suggerimenti della pagina come chip */
.mat-content { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2, #f6f7f9); border-radius: 8px; padding: 10px 12px; max-height: 260px; overflow: auto; font-size: .92rem; }
.info-hints { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.info-hints .chip { cursor: pointer; }
.mat-thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
/* Video dei materiali: riquadro con la riproduzione (anteprima in video-preview.js) */
.mat-videos { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0; }
.mat-video { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left;
  min-width: 0; max-width: 100%; padding: 8px 12px 8px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface); color: inherit; cursor: pointer; }
.mat-video:hover, .mat-video:focus-visible { border-color: var(--blue); }
.mat-video-play { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 40px; border-radius: 6px; background: #12161f; color: #fff; }
.mat-video-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.mat-dl { font-size: 13px; }
/* Contenuti del progetto in cartelle (project-materials.js): cartelle apribili, griglia di card compatte, anteprime */
.mf-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.mf-toggle { display: inline-flex; gap: 4px; }
.mf-folders { display: grid; gap: 12px; }
.mf-folder { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; transition: border-color .15s, background .15s; }
.mf-folder.is-over { border-color: var(--blue); background: var(--blue-lighter, #f3f7fd); }
.mf-folder > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 14px; }
.mf-folder > summary::-webkit-details-marker { display: none; }
.mf-folder > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.mf-folder[open] > summary::before { transform: rotate(90deg); }
.mf-folder[open] > summary { border-bottom: 1px solid var(--border); }
.mf-folder-name { display: inline-flex; align-items: center; gap: 6px; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.mf-folder-tools { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.mf-empty { margin: 0; padding: 14px; }
.mf-grid { list-style: none; margin: 0; padding: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.mf-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-top: 3px solid var(--blue); border-radius: var(--radius); background: var(--surface); }
.mf-card[data-status=in_lavorazione] { border-top-color: var(--amber); }
.mf-card[data-status=inserito] { border-top-color: var(--green); }
.mf-card[data-status=da_rivedere] { border-top-color: var(--red); }
.mf-card[draggable=true] { cursor: grab; }
.mf-card.is-dragging { opacity: .5; }
.mf-card.is-focus { box-shadow: 0 0 0 3px var(--blue-light); }
.mf-card-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.mf-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mf-card-title strong, .mf-card-title small { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.mf-card-title small { -webkit-line-clamp: 1; font-size: 12px; }
.mf-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mf-medias { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.mf-medias.is-single { grid-template-columns: 1fr; }
.mf-media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: #12161f; border: 0; padding: 0; cursor: pointer; }
.mf-media img, .mf-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.mf-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; transition: transform .15s; }
.mf-media:hover .mf-play, .mf-media:focus-visible .mf-play { transform: scale(1.1); }
.mf-media-name { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 8px 6px; font-size: 12px; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mf-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.mf-card-foot > small { flex: 1 1 100%; }
.mf-tools { display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center; gap: 4px; }
.mf-tools .mf-comments { margin-right: auto; padding-left: 6px; padding-right: 6px; }
.mf-tools .mat-dl { font-size: 12px; gap: 5px; white-space: nowrap; }
.mf-tools .icon-btn { width: 32px; height: 32px; }
.mf-comments .badge { margin-left: 2px; }
/* Commenti e richieste di modifica (material-comments.js) */
.mc { display: grid; gap: 10px; min-width: 0; }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mc-head h3 { margin: 0; }
.mc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 380px; overflow-y: auto; }
.mc-item { padding: 8px 10px; border-radius: 8px; background: var(--bg); display: grid; gap: 4px; overflow-wrap: anywhere; }
.mc-item.is-change { border-left: 3px solid var(--amber); }
.mc-item.is-change.is-done { border-left-color: var(--green); opacity: .8; }
.mc-item p { margin: 0; white-space: pre-line; }
.mc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.mc-side { font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--blue-light); color: var(--blue); }
.mc-side-studio { background: var(--blue); color: #fff; }
.mc-side-partner { background: #efeaff; color: #4a3aa7; }
.mc-time { border: 0; background: var(--blue-light); color: var(--blue); border-radius: 6px; padding: 1px 6px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.mc-acts { display: flex; justify-content: flex-end; }
.mc-form { display: grid; gap: 8px; }
.mc-kind { flex-wrap: wrap; }
.mc-opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.mc-opts .check { margin-right: auto; font-size: 13px; }
.vp.has-comments { grid-template-columns: minmax(0, 1fr) 320px; grid-template-areas: "head head" "stage side" "foot side" "share side"; align-items: start; }
.vp.has-comments .vp-head { grid-area: head; }
.vp.has-comments .vp-stage { grid-area: stage; }
.vp.has-comments .vp-foot { grid-area: foot; }
.vp.has-comments .vp-share { grid-area: share; }
.vp-comments { grid-area: side; min-width: 0; border-left: 1px solid var(--border); padding-left: 14px; }
@media (max-width: 1000px) {
  .vp.has-comments { grid-template-columns: 1fr; grid-template-areas: "head" "stage" "foot" "share" "side"; }
  .vp-comments { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
}
@media (max-width: 640px) {
  .mf-grid { grid-template-columns: 1fr; padding: 10px; }
  .mf-folder-tools .btn span { display: none; }
}
/* Accessi alle piattaforme dei clienti (platform-access.js) */
.pa-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pa-item { padding: 12px 14px; border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: var(--radius); background: var(--surface); display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.pa-item[data-status=fatto] { border-left-color: var(--blue); }
.pa-item[data-status=confermata] { border-left-color: var(--green); }
.pa-item p { margin: 0; }
.pa-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.pa-warn { color: var(--red); font-size: 13px; }
.pa-steps summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--blue); }
.pa-steps ol { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.pa-done { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.pa-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pa-acts small { margin-left: auto; }
.pa-form { display: grid; gap: 12px; }
.pa-form h2 { margin: 0; }
.pa-platforms { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.pa-platform { align-items: flex-start; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; }
.pa-platform span { display: flex; flex-direction: column; }
.pa-platform.is-missing { opacity: .6; }
@media (max-width: 640px) { .pa-done { grid-template-columns: 1fr; } }
/* Guida passo passo degli accessi (views/access-guide.js) e anteprime dei passi nelle Impostazioni */
.pa-quick summary { cursor: pointer; color: var(--muted, #6b7385); margin: 4px 0; }
.ag { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.ag-head { display: flex; gap: 12px; align-items: center; }
.ag-head h1 { margin: 0; font-size: 1.45rem; }
.ag-head p { margin: 2px 0 0; }
.ag-dot { width: 14px; height: 40px; border-radius: 7px; background: var(--ag, #023F82); flex: none; }
.ag-card { display: flex; flex-direction: column; gap: 14px; }
.ag-progress { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ag-dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ag-dots button { width: 26px; height: 6px; border-radius: 3px; border: 0; padding: 0; background: var(--line, #e3e7ee); cursor: pointer; }
.ag-dots .is-past button { background: color-mix(in srgb, var(--primary, #023F82) 45%, transparent); }
.ag-dots .is-now button { background: var(--primary, #023F82); }
.ag-shot { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line, #e3e7ee); background: #f4f6fa; }
.ag-shot svg, .ag-img { display: block; width: 100%; height: auto; }
.ag-text { font-size: 1.05rem; line-height: 1.5; margin: 0; }
.ag-copy { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, #f4f6fa); }
.ag-copy code { font-size: 1rem; font-weight: 700; white-space: nowrap; flex: 1; }
.ag-copy code:only-of-type { min-width: 0; overflow-wrap: anywhere; }
.ag-nav { display: flex; justify-content: space-between; gap: 10px; }
.ag-final h2 { margin: 0 0 4px; }
.ag-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.ag-form .btn-lg { align-self: flex-start; }
.ag-state { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: #eaf6ef; color: #135c36; }
.ag-state.is-done { background: #eaf1fb; color: #0d3b75; }
.ag-state h2 { margin: 0 0 2px; font-size: 1.1rem; }
.ag-state p { margin: 0; }
.ag-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 10px; background: #fff8e6; }
.ag-help { text-align: center; }
.pa-guide { border-top: 1px solid var(--line, #e3e7ee); padding: 8px 0; }
.pa-guide summary { cursor: pointer; }
.pa-guide-steps { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 0; padding-left: 20px; }
.pa-guide-steps > li { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: start; }
.pa-thumb { border: 1px solid var(--line, #e3e7ee); border-radius: 8px; overflow: hidden; background: #f4f6fa; }
.pa-thumb svg, .pa-thumb img { display: block; width: 100%; height: auto; }
@media (max-width: 640px) {
  .ag-head h1 { font-size: 1.2rem; }
  .ag-nav .btn { flex: 1; }
  .ag-copy { display: grid; grid-template-columns: 1fr auto; }
  .ag-copy > span { grid-column: 1 / -1; }
  .pa-guide-steps > li { grid-template-columns: 1fr; }
}
/* Finestra di anteprima del video con i dispositivi */
.vp { display: grid; gap: 14px; }
.vp-head { display: flex; align-items: flex-start; gap: 10px 16px; flex-wrap: wrap; padding-right: 36px; }
.vp-title { flex: 1; min-width: 180px; }
.vp-title h2 { font-size: 18px; line-height: 1.25; margin: 0; word-break: break-word; }
.vp-stage { display: grid; place-items: center; padding: 18px; border-radius: 12px; background: radial-gradient(circle at 50% 30%, #2a3140, #10131a); min-height: 320px; overflow: hidden; }
.vp-frame { width: 100%; transition: width .25s ease, max-width .25s ease; }
.vp-screen { position: relative; overflow: hidden; background: #000; }
.vp-screen video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp-error { margin: 0; padding: 40px 16px; color: #fff; text-align: center; }
/* Computer: schermo 16:10 con la cornice e la base */
.vp-stage[data-device="desktop"] .vp-frame { max-width: 820px; padding: 12px 12px 0; border-radius: 14px 14px 4px 4px; background: #1d222c; box-shadow: 0 0 0 1px #3a4252; position: relative; }
.vp-stage[data-device="desktop"] .vp-frame::after { content: ''; display: block; height: 14px; margin: 0 -40px; border-radius: 0 0 14px 14px; background: linear-gradient(#c9ced8, #9aa1ae); }
.vp-stage[data-device="desktop"] .vp-screen { aspect-ratio: 16 / 10; }
/* Tablet e telefono: verticali, con i bordi arrotondati */
.vp-stage[data-device="tablet"] .vp-frame { max-width: 420px; padding: 18px; border-radius: 28px; background: #1d222c; box-shadow: 0 0 0 2px #3a4252; }
.vp-stage[data-device="tablet"] .vp-screen { aspect-ratio: 3 / 4; border-radius: 8px; }
.vp-stage[data-device="mobile"] .vp-frame { max-width: 270px; padding: 12px; border-radius: 40px; background: #1d222c; box-shadow: 0 0 0 2px #3a4252; }
.vp-stage[data-device="mobile"] .vp-screen { aspect-ratio: 9 / 19.5; border-radius: 30px; }
/* Video orizzontale su tablet e telefono: il dispositivo si gira */
.vp-stage[data-device="tablet"][data-orient="landscape"] .vp-frame { max-width: 600px; }
.vp-stage[data-device="tablet"][data-orient="landscape"] .vp-screen { aspect-ratio: 4 / 3; }
.vp-stage[data-device="mobile"][data-orient="landscape"] .vp-frame { max-width: 560px; }
.vp-stage[data-device="mobile"][data-orient="landscape"] .vp-screen { aspect-ratio: 19.5 / 9; }
.vp-stage[data-device="original"] .vp-frame { max-width: 900px; }
.vp-stage[data-device="original"] .vp-screen video { max-height: 70vh; }
.vp-devices button { display: inline-flex; align-items: center; gap: 6px; }
.vp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vp-share { padding: 14px; border: 1px solid var(--border); border-radius: 10px; }
.vp-share-form { display: grid; gap: 12px; }
.vp-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.vp-group { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.vp-group legend { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
@media (max-width: 640px) {
  .vp-stage { padding: 10px; min-height: 0; }
  .vp-devices span { display: none; }
  .vp-stage[data-device="desktop"] .vp-frame::after { margin: 0 -12px; }
}
.mat-thumb { display: block; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg); }
.mat-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mat-files { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mat-files a { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.mat-reply { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; }
.mat-reply > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.mat-reply p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.mat-reply.ok { background: var(--green-light); color: var(--green); }
.mat-reply.warn { background: var(--red-light); color: var(--red); }
.mat-reply.ok p, .mat-reply.warn p { color: var(--text); }
.mat-acts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.mat-steps { list-style: none; counter-reset: mat; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.mat-steps li { counter-increment: mat; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px 48px; position: relative; background: var(--blue-lighter); border-radius: var(--radius); }
.mat-steps li::before { content: counter(mat); position: absolute; left: 14px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; font: 700 13px/24px var(--font-head); text-align: center; }
.mat-steps span { color: var(--gray); font-size: 13px; }
.mat-form { display: grid; gap: 12px; }
.mat-form h2 { margin: 0; }
.mat-cats { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mat-cats legend { margin-bottom: 6px; }
.mat-cats label { cursor: pointer; }
.mat-cats input { position: absolute; opacity: 0; pointer-events: none; }
.mat-cats span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1.5px solid var(--border-strong); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--gray); }
.mat-cats input:checked + span { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.mat-cats input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.mat-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px; border: 2px dashed var(--border-strong); border-radius: var(--radius); text-align: center; cursor: pointer; color: var(--blue); }
.mat-drop.is-over, .mat-drop:hover { border-color: var(--blue); background: var(--blue-lighter); }
.mat-picked { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mat-picked li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--bg); border-radius: 6px; }
.mat-picked li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .mat-card .card-head { flex-direction: column; align-items: stretch; }
  .mat-acts { justify-content: flex-start; }
  .mat-filter button { padding: 6px 8px; }
}
/* «Tutto del progetto» (solo studio): demo, accessi di prova e file del cliente in tre colonne */
.kit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 16px; }
.kit-col { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; padding: 12px 14px; background: var(--blue-lighter); border-radius: var(--radius); }
.kit-col > h3 { margin: 0; display: flex; align-items: center; gap: 6px; }
.kit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.kit-list > li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface); border-radius: 8px; }
.kit-list > li.kit-login { flex-direction: column; align-items: stretch; }
.kit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.kit-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; }
.kit-col p { margin: 0; }
/* Scheda del progetto a sezioni (views/project.js): Panoramica con i dati principali in griglia */
.pj-tabs { margin-top: 4px; }
.pj-panel > * + * { margin-top: 16px; }
.pj-facts-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; margin: 0; }
.pj-facts-list > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pj-facts-list dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.pj-facts-list dd { margin: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; overflow-wrap: anywhere; }
.pj-facts-list dd .chip { display: inline-block; margin: 0 4px 4px 0; }
/* Servizi (views/services.js): gruppi per linea e fatturazione, schede dei servizi e finestra di modifica */
.svc-page .toolbar { flex-wrap: wrap; gap: 8px; }
.svc-page .toolbar .input[type=search] { flex: 1; min-width: 180px; }
.svc-group { margin-top: 18px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.svc-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; font: inherit; color: var(--text); }
.svc-card:hover, .svc-card:focus-visible { border-color: var(--blue); }
.svc-card.is-off { opacity: .65; }
.svc-card-ico { flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--blue-light); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.svc-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.svc-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.svc-card-incl { color: var(--gray); font-size: 12.5px; }
.svc-card-go { color: var(--muted); align-self: center; }
.svc-form { display: grid; gap: 16px; }
.svc-form h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.svc-sec { border-top: 1px solid var(--border); padding-top: 12px; display: grid; gap: 8px; }
.svc-sec h3 { margin: 0; font-size: 15px; }
.svc-sec p { margin: 0; }
.svc-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.svc-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; padding: 8px; background: var(--bg); border-radius: 8px; }
.svc-row-fields { flex: 1; min-width: 200px; display: grid; gap: 6px; }
.svc-row > .input:first-child { flex: 1; min-width: 180px; }
.svc-row-incl .input[type=number] { width: 80px; }
.svc-row-phase select { max-width: 220px; }
.svc-share { display: inline-flex; align-items: center; gap: 4px; }
.svc-share .input { width: 72px; }
.svc-row-tools { display: inline-flex; gap: 2px; margin-left: auto; }
.svc-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.svc-feats li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border-radius: 999px; background: var(--blue-light); color: var(--blue); font-size: 13px; }
.svc-pick { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.svc-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.svc-actions .text-danger { margin-right: auto; }
/* Preventivo in due parti (views/quote.js e quote-read.js): Servizi con Una tantum e Ricorrente, consigliato accanto alla voce */
.qe-services .card-head { gap: 12px; flex-wrap: wrap; }
.qe-part { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-top: 14px; background: var(--surface); }
.qe-part-rec { border-left: 4px solid var(--blue); background: var(--blue-lighter); }
.qe-part-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 16px; }
.qe-items .item-block { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 10px; }
.qe-items .item-block:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.qe-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.qe-cx button { padding: 4px 10px; font-size: 12px; text-transform: capitalize; }
.qe-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; }
.qe-hint.ok { color: var(--green); }
.qe-hint.warn { color: var(--amber-dark); }
.qe-hint.bad { color: var(--red); font-weight: 600; }
.qe-billing select { width: auto; }
.qe-incl { display: grid; gap: 6px; margin: 4px 0 8px; }
.qe-incl-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px 170px 34px; gap: 6px; align-items: center; }
.qe-recur { margin: 10px 0; align-items: end; }
.qe-recur .qe-recur-note { grid-column: 1 / -1; margin: 0; }
.qe-check { margin-top: 12px; }
.qe-check p { margin: 4px 0; }
.qe-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; margin-bottom: 12px; }
.qe-pick-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; color: var(--text); }
.qe-pick-item:hover, .qe-pick-item:focus-visible { border-color: var(--blue); background: var(--blue-lighter); }
.quote-part { margin-top: 18px; }
.quote-part-title { display: flex; align-items: center; gap: 8px; font-size: 18px; border-bottom: 2px solid var(--blue-light); padding-bottom: 6px; }
.qitem-incl { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; gap: 4px; }
.qitem-incl li { display: flex; gap: 6px; align-items: flex-start; }
.qitem-incl .icon { color: var(--green); flex: none; margin-top: 2px; }
.qitem-amount small { font-size: 12px; font-weight: 500; color: var(--muted); }
@media (max-width: 640px) {
  .qe-incl-row { grid-template-columns: minmax(0, 1fr) 70px; }
  .qe-incl-row select { grid-column: 1; }
  .qe-part { padding: 10px; }
}
.svc-lvl { display: inline-flex; flex-direction: column; gap: 2px; }
.svc-lvl small { font-size: 11px; color: var(--muted); }
.svc-lvl .input { width: 72px; }
.qe-pick-incl { color: var(--gray); font-size: 12px; }

/* Progetti Google Ads (ads-project.js): il mese in breve, numeri, percorso, setup, scheda della campagna */
.ads-brief { background: var(--blue-dark); color: #fff; border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ads-brief h2 { margin: 0; font-size: 20px; color: #fff; }
.ads-brief p { margin: 0; color: #dbe6f5; line-height: 1.55; }
.ads-brief strong { color: #fff; }
.ads-brief .eyebrow { color: #c2d3ea; }
.ads-brief .small { font-size: 13px; color: #c2d3ea; }
.ads-brief .btn { align-self: flex-start; }
.ads-brief .btn-light { background: #fff; color: var(--blue); border-color: #fff; }
.ads-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.ads-bar span { display: block; height: 100%; background: #8dbbf2; border-radius: inherit; }
.ads-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.ads-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ads-tile h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--gray); }
.ads-tile-v { margin: 0; font-size: 26px; font-weight: 800; color: var(--blue-dark); font-family: var(--font-head); }
.ads-tile-n { margin: 0; font-size: 13px; color: var(--gray); }
.ads-tile-n.ok { color: var(--green); font-weight: 600; }
.ads-tile-n.ko { color: var(--warn); font-weight: 600; }
.ads-cols { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
/* Competitività nell'asta (v1.17, solo studio) */
.ads-comp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 8px 0; }
.ads-comp-tile { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--line, #e3e6ec); border-radius: 8px; }
.ads-comp-tile strong { font-size: 15px; }
.ads-main { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ads-main > .card { margin: 0; }
.ads-aside { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ads-aside .card { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ads-aside .card p { margin: 0; }
.ads-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ads-step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 0 0 16px; position: relative; }
.ads-step::before { content: ''; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--border); }
.ads-step:last-child::before { display: none; }
.ads-step > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ads-step p { margin: 2px 0 0; color: var(--gray); }
.ads-step .btn { align-self: flex-start; margin-top: 6px; }
.ads-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: #fff; position: relative; z-index: 1; }
.ads-dot .icon { width: 14px; height: 14px; }
.ads-step.is-done .ads-dot { background: var(--green); border-color: var(--green); }
.ads-step.is-current .ads-dot { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-light); }
.ads-step.is-current strong { color: var(--blue); }
.ads-step.is-todo strong { color: var(--gray); }
.ads-setup .approval-done { margin: 0 0 12px; }
.ads-setup-form .field-full, .ads-plan-form .field-full { margin-top: 4px; }
.ads-facts { margin-top: 4px; }
.ads-plan-form fieldset { border: 0; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.ads-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) 36px; gap: 8px; align-items: center; }
.ads-proposed { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--amber-light); color: var(--amber-dark); font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.ads-ai-box { display: flex; flex-direction: column; gap: 8px; padding: 14px; margin: 0 0 14px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--blue-lighter); }
.ads-setup-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; flex: none; }
.ads-ai-box p { margin: 2px 0 0; }
.ads-google-box { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-top: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; }
.ads-google-box > div { flex: 1 1 280px; min-width: 0; }
.ads-google-box > .btn { flex: 0 0 auto; }
.ads-google-box p { margin: 2px 0 0; }
.ads-camp-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow: auto; }
.ads-camp-row { align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.ads-camp-row > span { display: flex; flex-direction: column; gap: 2px; }
.ads-camp-total { margin: 4px 0 0; font-weight: 600; }
.ads-budget-camp .ads-budget-val { margin: 4px 0; font-size: 16px; }
.ads-budget-camp .btn { align-self: flex-start; margin-top: 6px; }
.ads-setup-actions { align-items: center; justify-content: flex-end; }
.ads-setup-actions [data-autosave] { margin-right: auto; }
.ads-setup-changes { flex-basis: 100%; text-align: right; }
.ads-contact-types { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ads-questions { padding: 12px 14px; margin: 0 0 14px; border-radius: 12px; background: var(--amber-light); }
.ads-questions ul { margin: 6px 0; padding-left: 20px; }
.ads-questions p { margin: 0; }
.doc-after { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.doc-after .card { margin: 0; }
.doc-ack { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.doc-ack .approval-done { margin: 0; }
.doc-q-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.doc-q-list li { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .ads-brief { padding: 18px; }
  .ads-tile-v { font-size: 22px; }
  .ads-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ads-tile { padding: 12px; }
  .ads-row { grid-template-columns: minmax(0, 1fr) 36px; }
}

/* Utenze partner: badge nell'intestazione (desktop) e nel menu (mobile), logo nella scheda, pagina dei mockup del partner */
.partner-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--amber); color: #3b2600; font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.partner-badge-menu { display: none; margin-left: 6px; vertical-align: middle; }
@media (max-width: 900px) {
  .partner-badge-top { display: none; }
  .partner-badge-menu { display: inline-flex; }
}
.partner-logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.partner-logo-prev { max-height: 48px; max-width: 200px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; padding: 4px; background: #fff; }
.partner-brand-card { margin-bottom: 18px; }
.partner-brand-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--bg, #f7f8fa); }
.partner-brand-mark img { height: 48px; width: auto; min-width: 48px; max-width: 220px; object-fit: contain; display: block; }
.partner-brand-prev { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.partner-brand-prev img { max-height: 44px; max-width: 180px; object-fit: contain; }
.partner-mk-list { display: flex; flex-direction: column; gap: 16px; }
.partner-mk { margin: 0; }
.mk-partner { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mk-partner-logo { max-height: 36px; max-width: 180px; object-fit: contain; }
.mk-partner-name { font-size: 16px; }
.partner-mk-req { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.partner-mk-comments { margin-top: 8px; }
.partner-svc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.partner-svc { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.partner-svc header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.partner-svc h3 { margin: 0; font-size: 16px; }
.partner-svc p { margin: 0; }
.partner-prices { margin: 0; display: flex; flex-direction: column; }
.partner-prices > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: baseline; padding: 7px 0; border-top: 1px solid var(--border); }
.partner-prices dt { margin: 0; font-size: 14px; }
.partner-prices dd { margin: 0; text-align: right; font-size: 14px; white-space: nowrap; }
.partner-prices .pp-list { color: var(--muted); text-decoration: line-through; }
.partner-prices .pp-partner { color: var(--blue-dark); }
.partner-prices .pp-head { border-top: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.partner-prices .pp-head dt, .partner-prices .pp-head dd { font-size: 11px; text-decoration: none; }
/* Pacchetti di sviluppo per i partner (views/partner-services.js): funzioni incluse in evidenza, aggiungibili con la casella e totale */
.preset-card { grid-column: 1 / -1; }
.preset-desc p { margin: 0 0 6px; }
.preset-incl dt { font-weight: 600; }
.preset-incl dt svg { width: 15px; height: 15px; vertical-align: -2px; color: var(--green, #1baf7a); }
.preset-extra { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.preset-opt { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 6px 0; border-top: 1px solid var(--border); }
.preset-opt:first-of-type { border-top: 0; }
.preset-opt.is-off { opacity: .6; }
.preset-opt-price { white-space: nowrap; font-size: 14px; }
.preset-opt-price .pp-list, .preset-total .pp-list { color: var(--muted); text-decoration: line-through; }
.preset-opt-price .pp-partner, .preset-total .pp-partner { color: var(--blue-dark); }
.preset-total { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font-size: 15px; }
.preset-mods select { min-width: 150px; }
.preset-mods input { width: 110px; }
@media (max-width: 600px) { .preset-opt { grid-template-columns: auto minmax(0, 1fr); } .preset-opt-price { grid-column: 2; } }
.mk-avatar.mk-avatar-logo { object-fit: contain; background: #fff; border-radius: 10px; width: auto; max-width: 72px; padding: 2px; }
.mk-partner small { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* Stampa / PDF da qualsiasi larghezza (anche quando la pagina di stampa fa scattare il layout da telefono): niente animazioni d'ingresso,
   che in stampa ripartono da trasparente e lasciano le pagine bianche, e niente elementi fissi dell'app (barra in basso, pulsanti flottanti,
   avvisi, barre di azione fisse) */
/* Partner → Progetti (views/partner-projects.js) */
.pp-progress{display:block;max-width:240px;margin-top:6px}
.pp-phases .pp-current strong{color:var(--blue)}
.pp-comments{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:10px}
.pp-comments li{padding:10px 12px;border-radius:10px;background:var(--bg)}
.pp-comments li.pp-studio{background:var(--blue-lighter)}
.pp-comments li p{margin:4px 0 0}
.pp-comments li small{margin-left:6px}
/* Conferma prima delle funzioni AI (ai-confirm.js) */
.ai-confirm h2{display:flex;align-items:center;gap:8px}
.ai-confirm-what{font-weight:600;margin:8px 0 10px}
.ai-confirm-points{margin:0 0 14px;padding-left:18px;display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:.92rem}
.ai-confirm-points strong{color:var(--text)}
.ai-confirm-block{margin:0 0 12px}
.ai-confirm-block h3{font-size:.8rem;text-transform:uppercase;letter-spacing:.06em;color:var(--blue);margin:0 0 6px}
.ai-confirm-block ul{margin:0;padding-left:18px;display:flex;flex-direction:column;gap:4px;font-size:.92rem;color:var(--text)}
.ai-confirm-more summary{cursor:pointer;color:var(--blue);font-size:.85rem;margin:6px 0 0;font-weight:600}
.ai-confirm-more ul{margin-top:6px}

/* Schede stile Chrome (view-tabs.js): solo staff su desktop, sotto la barra in alto */
.vtabs { display: none; }
@media (min-width: 1024px) {
  .vtabs { display: flex; align-items: flex-end; gap: 2px; padding: 4px 36px 0; position: sticky; top: var(--topbar-h, 64px); z-index: 30; background: var(--bg);
    border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; max-width: 1320px; width: 100%; }
  .vtabs::-webkit-scrollbar { display: none; }
  .vtab { display: flex; align-items: center; gap: 4px; flex: 0 1 210px; min-width: 64px; height: 36px; padding: 0 6px 0 14px; border: 1px solid transparent; border-bottom: 0;
    border-radius: 10px 10px 0 0; color: var(--muted); font-size: .85rem; cursor: pointer; user-select: none; position: relative; margin-bottom: -1px; }
  .vtab:hover { background: var(--blue-lighter); color: var(--text); }
  .vtab.active { background: var(--surface); color: var(--text); font-weight: 600; border-color: var(--border); }
  .vtab.dragging { opacity: .5; }
  .vtab:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
  .vtab + .vtab:not(.active)::before { content: ''; position: absolute; left: -2px; top: 10px; bottom: 10px; width: 1px; background: var(--border); }
  .vtab.active + .vtab::before, .vtab:hover + .vtab::before { display: none; }
  .vtab-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .vtab-x { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: inherit; opacity: .55; cursor: pointer; padding: 0; }
  .vtab-x:hover { background: var(--border); opacity: 1; }
  .vtab-x .icon { width: 12px; height: 12px; }
  .vtab-new { flex: none; width: 30px; height: 30px; margin: 0 0 4px 4px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; padding: 0; }
  .vtab-new:hover:not(:disabled) { background: var(--blue-lighter); color: var(--text); }
  .vtab-new:disabled { opacity: .4; cursor: default; }
  .vtab-new .icon { width: 16px; height: 16px; }
}
/* Progetto Google Ads → Struttura e Annunci (ads-structure.js) */
.ads-camp-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.ads-subtabs { margin-bottom: 14px; }
.ads-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ads-sub-head h3 { margin: 0; font-size: 1rem; }
.ads-filter { display: inline-flex; align-items: center; gap: 6px; }
.ads-table td, .ads-table th { white-space: nowrap; }
.ads-table td:first-child { white-space: normal; min-width: 180px; }
.ads-match { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; color: var(--muted); }
.ads-qs { display: inline-block; min-width: 38px; padding: 1px 6px; border-radius: 999px; font-size: .8rem; font-weight: 600; text-align: center; }
.ads-qs-ok { background: var(--ok-bg); color: var(--ok); }
.ads-qs-mid { background: var(--warn-bg); color: var(--amber-dark); }
.ads-qs-low { background: var(--bad-bg); color: var(--bad); }
.ads-facts { margin: 14px 0; }
.ads-group-ads { margin-bottom: 20px; }
.ads-ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.ads-ad { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.ads-ad p { margin: 0; }
.ads-texts summary { cursor: pointer; color: var(--blue); }
.ads-texts ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 2px; font-size: .88rem; }
.ads-variant-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; margin-top: 14px; }
.ads-variant { display: flex; flex-direction: column; gap: 8px; }
.ads-variant .actions { margin-top: auto; justify-content: flex-end; }
/* Anteprima dell'annuncio come su Google */
.gad { font-family: Arial, Helvetica, sans-serif; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; color: #202124; }
.gad-top { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.3; }
.gad-top strong { display: block; font-size: 12px; font-weight: 700; color: #202124; }
.gad-fav { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; font-weight: 700; color: #5f6368; flex: none; }
.gad-url { color: #4d5156; }
.gad-title { color: #1a0dab; font-size: 18px; line-height: 1.3; margin: 6px 0 2px; }
.gad-desc { color: #4d5156; font-size: 14px; line-height: 1.45; }
@media (max-width: 640px) { .ads-variant-list, .ads-ad-grid { grid-template-columns: 1fr; } }
/* Creatività disegnate (frontend/js/meta-creative.js): editor e anteprime */
.mcr-colors { display: flex; gap: 12px; flex-wrap: wrap; }
.mcr-colors input[type=color] { width: 64px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.mcr-formats { display: flex; gap: 14px; flex-wrap: wrap; }
.mcr-previews { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.mcr-previews figure { margin: 0; width: 160px; }
.mcr-previews img { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; display: block; }
/* Inserzioni Meta Ads (frontend/js/meta-ads.js): anteprima come in Facebook e Instagram, feed e storie */
.mad-previews { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
/* Anteprime dei post social (social-project.js): Facebook, Instagram, LinkedIn */
.sp-prev { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: #050505; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; width: 300px; max-width: 100%; }
.sp-prev .mad-text { overflow-wrap: anywhere; white-space: pre-line; }
.sp-media { aspect-ratio: 1 / 1; background: #f0f2f5; display: grid; place-items: center; }
.sp-ig .sp-media { aspect-ratio: 4 / 5; }
.sp-media img, .sp-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sp-link { margin: 0 12px 8px; font-size: 12px; color: #385898; overflow-wrap: anywhere; }
.sp-icons { margin: 0; padding: 8px 12px; font-size: 12px; color: #65676b; border-top: 1px solid #eee; }
.sp-ig .sp-icons { border-top: 0; font-size: 16px; color: #262626; }
.sp-linkedin .mad-av { border-radius: 4px; }
.sp-nets { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.mad { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; color: #050505; background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.mad-feed { width: 300px; max-width: 100%; }
.mad-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; font-size: 13px; }
.mad-top small { display: block; color: #65676b; font-size: 12px; }
.mad-av { width: 28px; height: 28px; border-radius: 50%; background: #e4e6eb; display: inline-grid; place-items: center; font-weight: 700; color: #65676b; flex: none; }
.mad-text { margin: 0; padding: 0 12px 8px; font-size: 13px; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.mad-more { color: #65676b; font-weight: 600; }
.mad-media { aspect-ratio: 1 / 1; background: #f0f2f5; display: grid; place-items: center; }
.mad-media img, .mad-media video, .mad-story-media img, .mad-story-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mad-ph { color: #8a8d91; display: grid; place-items: center; width: 100%; height: 100%; min-height: 80px; font-size: 12px; text-align: center; padding: 8px; }
.mad-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: #f0f2f5; font-size: 13px; }
.mad-foot small { display: block; color: #65676b; font-size: 11px; }
.mad-cta, .mad-story-cta { background: #e4e6eb; border-radius: 6px; padding: 6px 10px; font-weight: 600; font-size: 12px; white-space: nowrap; }
.mad-story { width: 170px; aspect-ratio: 9 / 16; position: relative; background: #1c1e21; color: #fff; }
.mad-story-media { position: absolute; inset: 0; }
.mad-story-top { position: absolute; top: 8px; left: 8px; right: 8px; font-size: 11px; display: flex; align-items: center; gap: 6px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.mad-story-text { position: absolute; left: 10px; right: 10px; bottom: 48px; margin: 0; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.mad-story-cta { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: #fff; color: #050505; }
.mad-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.mad-asset { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.mad-asset img, .mad-asset video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 6px; background: #f0f2f5; }
.mad-asset figcaption { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.mad-frame { display: grid; grid-template-columns: 90px 1fr 70px; gap: 8px; align-items: center; }
.mad-frame img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; vertical-align: middle; }
@media (max-width: 640px) { .mad-feed { width: 100%; } .mad-frame { grid-template-columns: 1fr; } }
/* Efficacia dell'annuncio (frontend/js/ads-structure.js): barra a 4 livelli come in Google Ads, stima dello studio o valore di Google */
.ads-eff { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ads-eff-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ads-eff-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.ads-eff-bar span { height: 6px; border-radius: 3px; background: var(--border); }
.ads-eff-0 .ads-eff-bar span.on { background: var(--bad); }
.ads-eff-1 .ads-eff-bar span.on { background: var(--warn); }
.ads-eff-2 .ads-eff-bar span.on, .ads-eff-3 .ads-eff-bar span.on { background: var(--ok); }
.ads-eff-label { font-weight: 700; }
.ads-eff-0 .ads-eff-label { color: var(--bad); } .ads-eff-1 .ads-eff-label { color: var(--warn); } .ads-eff-2 .ads-eff-label, .ads-eff-3 .ads-eff-label { color: var(--ok); }
.ads-eff-tips { margin: 0; padding-left: 18px; font-size: .88rem; }
.ads-eff details summary { cursor: pointer; color: var(--blue); }
.ads-eff table { width: 100%; font-size: .85rem; }
.ads-perf { font-size: .75rem; border-radius: 4px; padding: 0 5px; margin-left: 4px; background: var(--border); }
.ads-perf-Migliore, .ads-perf-Buono { background: var(--ok-bg); color: var(--ok); }
.ads-perf-Basso { background: var(--bad-bg); color: var(--bad); }
.ads-cal table td, .ads-cal table th { text-align: center; }
.ads-cal td.diag { font-weight: 700; background: var(--ok-bg); }

@media print {
  .vtabs { display: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .view, .view > * { opacity: 1 !important; transform: none !important; }
  .tabbar, .cw, .aw, .demo-widget, .mk-widget, .ptr, .update-banner, .tour-layer, .sheet-backdrop, .modal-backdrop, .palette-backdrop,
  .page-head.sticky-head > .actions, #toasts, .sidebar-scrim { display: none !important; }
  html, body, .shell, .main-wrap, .view { height: auto !important; min-height: 0 !important; overflow: visible !important; }
  body { padding-bottom: 0 !important; }
}

/* AI Hub (views/ai-hub.js) */
.aih-kpis { margin-bottom: 16px; }
@media (min-width: 900px) { .aih-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.aih-rules ul { margin: 6px 0 0; padding-left: 18px; }
.aih-list { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
/* Uso dell'AI (v1.11, ai-usage.js): riquadro dell'AI Hub con grafico, tabelle e tetto giornaliero */
.aiu-panel { margin-top: 16px; }
.aiu-panel h3.card-title-sm { margin-top: 18px; }
.aiu-rates { margin: 8px 0 0; padding-left: 18px; }
@media (min-width: 900px) { .aiu-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.aiu-chart { margin-top: 14px; }
.aiu-chart svg { max-height: 280px; }
.aiu-chart .aiu-dot-0 { background: #2a78d6; }
.aiu-chart .aiu-dot-1 { background: #eb6834; }
.aiu-chart .aiu-dot-line { background: none; border-top: 2px dashed #eb6834; height: 0; border-radius: 0; vertical-align: 3px; }
.aiu-cap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.aiu-cap .input { width: 120px; }
.aiu-table td { vertical-align: top; }
.aih-card { display: flex; flex-direction: column; gap: 8px; }
.aih-off { opacity: .78; }
.aih-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.aih-head h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 6px; }
.aih-head p { margin: 2px 0 0; }
.aih-usage { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); margin: 0; }
.aih-details summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.aih-details[open] summary { margin-bottom: 8px; }
.aih-details > * + * { margin-top: 10px; }
.aih-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.aih-block h4 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.aih-block ul { margin: 0; padding-left: 18px; font-size: 14px; }
@media (max-width: 640px) { .aih-head { flex-direction: column; } }

/* Funzionalità sviluppate con Claude nel percorso del progetto (project-review.js, lato cliente) */
.dev-client { margin-top: 16px; }
.dev-client-phase { margin: 10px 0 4px; font: 600 12px var(--font-head); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.dev-client-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dev-client-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; background: #f6f8fb; }
.dev-client-item.is-fatta { background: #eefaf4; }
.dev-client-body { display: flex; flex-direction: column; min-width: 0; }
.dev-client-body small { color: var(--muted); font-size: 12.5px; }
.dev-client-side { display: flex; align-items: center; gap: 6px; flex: none; }
@media (max-width: 600px) { .dev-client-item { flex-direction: column; align-items: flex-start; } }

/* Sviluppo con Claude (dev-claude.js): sezione «Sviluppo» dei progetti web, solo per lo studio */
.dev-card .card-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-head-actions, .dev-plan-actions, .dev-feat-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dev-repo { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0 0 12px; }
.dev-repo > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.dev-plan-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f6f8fb; margin-bottom: 12px; }
.dev-blocked { border: 1px solid #f3c7c7; background: #fff6f6; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.dev-question { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dev-question p { margin: 4px 0; flex: 1; min-width: 200px; }
.dev-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dev-col { background: #f6f8fb; border-radius: 12px; padding: 10px; min-width: 0; }
.dev-feat { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.dev-feat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.dev-feat p { margin: 4px 0; }
.dev-feat-meta { color: var(--muted); }
.dev-feat-links { display: flex; gap: 12px; flex-wrap: wrap; }
.dev-feat-links a { display: inline-flex; align-items: center; gap: 4px; }
.dev-feat-note { background: #fff8e8; border-radius: 8px; padding: 6px 8px; }
.dev-feat details { margin-top: 6px; }
.dev-pkgs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dev-pkg { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: #f6f8fb; }
.dev-pkg-main { display: flex; flex-direction: column; min-width: 0; }
.dev-pkg-main small { color: var(--muted); font-size: 12px; }
.dev-pkg-side { display: flex; align-items: center; gap: 2px; flex: none; }
.dev-feat-actions { margin-top: 8px; }
.dev-bottom { margin: 12px 0; gap: 16px; }
.dev-forecast { padding: 10px 12px; border-radius: 12px; background: #eefaf4; }
.dev-forecast p { margin: 4px 0; }
.dev-forecast.is-late { background: #fff1f1; box-shadow: inset 0 0 0 1.5px #e34948; }
.dev-forecast.is-late b { color: #c0262d; }
.dev-cap { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 6px; font-size: 13px; }
.dev-cap dt { color: var(--muted); }
.dev-cap dd { margin: 0; }
.dev-runs td { vertical-align: top; }
.dev-days { display: flex; flex-wrap: wrap; gap: 4px 12px; border: 0; padding: 0; margin: 6px 0; }
.dev-token { display: block; word-break: break-all; padding: 10px; border-radius: 8px; background: #f1f3f7; }
.dev-form { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 1000px) { .dev-cols { grid-template-columns: 1fr; } }

/* Progetti SEO, GEO e AIO (seo-project.js): script di misura da copiare */
.seo-code { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #f1f3f7; font-size: 12px; word-break: break-all; }
.seo-measure .ads-google-box { width: 100%; }
.seo-site { overflow-wrap: anywhere; }

/* Progetti SEO: linee editoriali, piano e contenuti (seo-content-ui.js) */
.seo-lens { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: flex-end; margin: 6px 0 12px; }
.seo-lens > .field-label { flex-basis: 100%; }
.seo-len { display: flex; flex-direction: column; gap: 4px; }
.seo-len-row { display: inline-flex; align-items: center; gap: 6px; }
.seo-len-row .input { width: 90px; }
.seo-editor { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.seo-checks { list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.seo-checks .ok { color: #13795b; } .seo-checks .ko { color: #c0262d; font-weight: 600; } .seo-checks .warn { color: #9a6700; }
.seo-preview { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: #fff; overflow-wrap: anywhere; }
.seo-preview h2 { font-size: 20px; margin: 0 0 10px; }
.seo-serp { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; margin-bottom: 12px; border-radius: 8px; background: #f6f8fb; }
.seo-serp-t { color: #1a0dab; font-size: 16px; }
.seo-serp-d { color: #4d5156; font-size: 13px; }
.seo-faq dt { font-weight: 600; margin-top: 8px; }
.seo-faq dd { margin: 2px 0 0; }
.seo-events ul { margin: 6px 0 0; padding-left: 18px; }
.seo-plan .list-meta { display: flex; align-items: center; gap: 4px; }
.seo-plan .list-main small { display: block; }
@media (max-width: 900px) { .seo-editor { grid-template-columns: 1fr; } }
.seo-schedule { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 10px 12px; margin-bottom: 12px; border-radius: 12px; background: #f6f8fb; }
.seo-measure p, .seo-measure code { overflow-wrap: anywhere; }

/* Caso studio per i social (case-social.js) */
.cs-social { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.cs-social-preview { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.cs-social-canvas { width: 100%; max-width: 420px; height: auto; border-radius: 12px; box-shadow: 0 6px 20px rgba(1, 42, 86, .2); }
.cs-social-nav { display: flex; align-items: center; gap: 10px; }
.cs-social-nav [data-sl="prev"] .icon { transform: none; }
@media (max-width: 900px) { .cs-social { grid-template-columns: 1fr; } }

/* Staging (staging-ui.js): badge sempre visibile e pulsante «Pianifica rilascio» */
/* Versioni e novità: pagina del modulo sistema-versioni nelle Impostazioni (views/settings.js) */
.versions-page section + section, .versions-page [data-estensioni] > section { margin-top: 18px; }
.versions-page article + article { border-top: 1px solid var(--border, #e5e7eb); margin-top: 14px; padding-top: 14px; }
.staging-badge { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 9000; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; background: #e34948; color: #fff; font: 600 12px var(--font-head); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none; }
.staging-badge strong { letter-spacing: .08em; }
html.is-staging .topbar { box-shadow: inset 0 4px 0 #e34948; }
html.is-staging body::before { content: ''; position: fixed; inset: 0 0 auto 0; height: 4px; background: #e34948; z-index: 9001; }
.btn-update { background: #e34948; color: #fff; border: 0; }
.btn-update:hover { background: #c0262d; }
/* Sul telefono solo l'icona: il testo non sta nella barra (resta nel titolo e nell'etichetta del pulsante) */
@media (max-width: 720px) { .btn-update span { display: none; } .btn-update { padding: 0 10px; } }
/* Progetto Google Ads → Parole chiave (ads-keywords.js) */
.kw-bulk { flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.kw-bulk .input-sm { width: auto; min-width: 120px; }
.kw-table code { font-size: .85rem; white-space: nowrap; }
.kw-table .num { white-space: nowrap; }
.kw-table tr.kw-bad td { background: var(--red-lighter, #fdecec); }
.kw-spark { display: block; }
.kw-recent { margin: 8px 0; }
.kw-group { margin-top: 12px; }
.kw-group .ads-sub-head { align-items: flex-start; gap: 12px; }
.kw-gap { margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; }
.kw-gap summary { cursor: pointer; }

/* Area Partner → Clienti: tipo del mockup richiesto (views/partner-clients.js) */
.pm-kind { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pm-kind legend { width: 100%; margin-bottom: 4px; }
/* Mappa dei concorrenti: nota per lo studio sulle posizioni mancanti (strategy-view.js), mai in stampa */
.st-map-reading { margin: 8px 0 0; font-size: .92rem; }
.st-map-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
@media print { .st-map-note { display: none !important; } }
/* Indicatori chiave dei documenti (views/document.js → kpiCard): 2 colonne su desktop, 1 sul telefono, altezze uniformi, niente tagli */
.kpi-grid-doc { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
/* Sul telefono una colonna (non il carosello orizzontale delle altre griglie di numeri) */
@media (max-width: 720px) {
  .kpi-grid.kpi-grid-doc { display: grid !important; grid-template-columns: 1fr; overflow: visible; scroll-snap-type: none; }
  .kpi-grid.kpi-grid-doc > * { width: auto; flex: none; }
  .kpi-card .kpi-value { white-space: normal; }
}
.kpi-card { gap: 6px; min-width: 0; }
.kpi-card .kpi-value { white-space: nowrap; overflow-wrap: normal; line-height: 1.15; }
.kpi-card .kpi-missing { font-size: 18px; color: var(--muted); white-space: normal; }
.kpi-text { margin: 0; font-size: 15px; font-weight: 600; color: var(--blue); overflow-wrap: anywhere; }
.kpi-delta { align-self: flex-start; font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--gray-light, #eef1f5); color: var(--gray); }
.kpi-delta.is-good { background: #e3f5ec; color: #0b6b3e; }
.kpi-delta.is-bad { background: #fde8e7; color: #b42318; }
.kpi-prev { font-weight: 500; opacity: .8; }
.kpi-basis { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.kpi-goal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--blue-lighter, #eef4fb); font-size: 13px; }
.kpi-goal-label { font-weight: 700; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.kpi-card .kpi-note { margin: 0; font-size: 13px; color: var(--gray); overflow-wrap: anywhere; }
details.kpi-note summary { cursor: pointer; list-style: none; }
.kpi-more { color: var(--blue); font-weight: 600; }
.kpi-edit select.input { min-width: 0; }
@media print { .kpi-grid-doc { grid-template-columns: repeat(2, minmax(0, 1fr)); } details.kpi-note summary .kpi-more { display: none; } }
@media print { .staging-badge, html.is-staging body::before { display: none; } }
@media (max-width: 700px) { .staging-badge span { display: none; } .staging-badge { bottom: 84px; } }
/* Preventivi del partner: markup in percentuale o in euro (views/partner-quotes.js) */
.pq-mk { display: inline-flex; gap: 6px; align-items: center; }
.pq-mk .input-num { min-width: 70px; }
.pq-mk select.input-sm { width: auto; }

/* v1.11 — Registro delle violazioni e revisioni di sicurezza (views/violazioni.js, views/security-reviews.js) */
.vz-checks { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.vz-q { border: 0; padding: 0; margin: 0 0 .6rem; }
.vz-q legend { margin-bottom: .3rem; }
.vz-proposta { border-left: 3px solid var(--line, #ddd); padding: .4rem .8rem; margin: .6rem 0; }
.vz-list, .vz-cron { list-style: none; padding: 0; margin: .4rem 0; display: grid; gap: .35rem; }
.vz-cron { max-height: 22rem; overflow: auto; }
.vz-bozza { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; white-space: pre-wrap; }
.sr-inattivo { color: var(--danger, #c0392b); font-weight: 600; }

/* Agente di sicurezza (v1.11, views/security-agent.js): dati mandati all'AI */
.sa-pre { max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; background: var(--bg); border: 1px solid var(--border); padding: 12px; border-radius: var(--radius-sm); }

/* Mockup dei partner in cartelle per cliente (v1.13, scheda del CRM e Partner → Mockup): chiuse all'apertura, niente scorrimento
   orizzontale sul telefono */
.mk-folders { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mk-folder { min-width: 0; border: 1px solid var(--border, #e3e6ea); border-radius: 10px; padding: 0 14px; background: var(--surface, #fff); }
.mk-folder.card { padding: 0 16px; margin: 0; }
.mk-folder > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 12px 0; cursor: pointer; list-style: none; min-width: 0; }
.mk-folder > summary::-webkit-details-marker { display: none; }
.mk-folder > summary::after { content: '▸'; color: var(--muted, #6b7280); margin-left: auto; transition: transform .15s; }
.mk-folder[open] > summary::after { transform: rotate(90deg); }
.mk-folder[open] > summary { border-bottom: 1px solid var(--border, #e3e6ea); margin-bottom: 10px; }
.mk-folder[open] { padding-bottom: 12px; }
.mk-folder-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.mk-folder-meta { overflow-wrap: anywhere; }
.mk-folder .partner-mk { box-shadow: none; }
@media (max-width: 640px) {
  .mk-folder > summary { flex-direction: column; align-items: flex-start; }
  .mk-folder > summary::after { position: absolute; right: 14px; }
  .mk-folder { position: relative; }
  .mk-folder .partner-mk .card-head { flex-direction: column; align-items: stretch; }
  .mk-folder .partner-mk .actions { flex-wrap: wrap; }
  .mk-folder .mockup-row { flex-wrap: wrap; }
}
/* Richieste dalla cartella del cliente (v1.14): mockup e analisi con il cliente già scelto */
.mk-folder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.mk-folder-actions [aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.mk-quota { margin: 0 0 10px; }
/* Livelli dei partner (v1.14): blocco nella scheda Partner del CRM, Riepilogo del partner e impostazioni */
.ptier { margin: 10px 0 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ptier-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; }
.ptier-head > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ptier-chart { margin: 4px 0; }
.ptier-chart svg { width: 100%; max-width: 420px; height: 90px; display: block; }
.pr-level .gr-bar { margin: 6px 0; }
.ptier-settings .table .input { min-width: 56px; width: 100%; max-width: 130px; padding-left: 8px; padding-right: 8px; }
.ptier-settings .table td, .ptier-settings .table th { padding-left: 6px; padding-right: 6px; }
.ptier-settings td.num .input { text-align: right; }

/* Date del progetto delle linee di marketing (v1.16.1, project-dates.js): riga in cima a Panoramica e Setup, solo staff */
.pj-dates { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface, #fff); }
.pj-dates p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pj-dates .actions { margin: 0; }
