:root {
  --bg: #f2f5f6; --panel: #ffffff; --ink: #0f1d24; --muted: #62717c; --line: #e2e8eb; --line-strong: #c9d3d8;
  --brand: #0f7a6c; --brand-2: #14b8a6; --brand-ink: #ffffff; --accent: #ef7d2a;
  --good: #0f9d8a; --bad: #e5484d; --warn: #ef7d2a; --mid: #7a8a96;
  --c1: #0f9d8a; --c2: #ef7d2a; --c3: #94a3b0;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,29,36,.04), 0 4px 16px -8px rgba(15,29,36,.08);
  --shadow-lift: 0 2px 4px rgba(15,29,36,.06), 0 12px 28px -12px rgba(15,29,36,.18);
  --side: #0c1a20; --side-ink: #b9c8cd; --side-active: #ffffff;
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand-2) 35%, transparent);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1418; --panel: #111e23; --ink: #e6eef0; --muted: #8fa1a8; --line: #1f3038; --line-strong: #2d434c;
    --brand: #22c3ad; --brand-2: #2dd4bf; --brand-ink: #062320; --accent: #ff9a4a; --good: #2dd4bf; --bad: #ff6b6f; --warn: #ff9a4a; --mid: #93a4ae;
    --c1: #2dd4bf; --c2: #ff9a4a; --c3: #7f929b; --side: #081115; --shadow: none; --shadow-lift: 0 10px 30px -12px rgba(0,0,0,.6);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0; }
code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Layout */
.layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; gap: 8px; align-items: center; color: #fff; font-weight: 700; font-size: 16px; padding: 4px 10px 18px; }
.brand:hover { text-decoration: none; }
.logo { color: var(--accent); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; color: #fff; }
.brand-name b { color: #2fbfa5; font-weight: 800; }
.brand-logo { height: auto; max-width: 240px; display: block; }
.sidebar nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--side-ink); padding: 7px 10px; border-radius: 7px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.active { background: rgba(255,255,255,.1); color: var(--side-active); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #6d7891; margin: 18px 10px 6px; }
.pad { padding: 6px 10px; display: block; }
.pill { background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; border-radius: 10px; padding: 0 7px; }
.main { padding: 24px 32px 60px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.actions, .row { display: flex; gap: 8px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-bottom: 16px; }
.cols .grow { min-width: 0; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.chart-box { position: relative; height: 220px; }
.chart-box.tall { height: 300px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--bg); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { width: 100%; justify-content: center; }
.btn.xs { padding: 2px 8px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.loading::before { content: ''; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-align: left; }

/* Tabs / segmented */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--brand); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 3px; flex-wrap: wrap; }
.seg a { padding: 5px 11px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.seg a.active { background: var(--bg); color: var(--ink); font-weight: 600; }
.seg a:hover { text-decoration: none; color: var(--ink); }
.bulk { display: flex; gap: 12px; align-items: center; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .v small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi.accent { border-color: var(--accent); }
.delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }

/* Badges */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); border-color: transparent; }
.badge.err { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); border-color: transparent; }
.badge.warn { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); border-color: transparent; }
.badge.type { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); border-color: transparent; }
.tag { font-size: 10px; text-transform: uppercase; color: var(--muted); margin-left: 4px; letter-spacing: .05em; }
.issue { display: inline-block; font-size: 11px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); border-radius: 4px; padding: 1px 6px; margin: 1px 3px 1px 0; }
.quickwin { background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 4px; padding: 0 4px; }

/* Site cards */
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.site-card { color: var(--ink); display: flex; flex-direction: column; gap: 14px; transition: border-color .15s; }
.site-card:hover { border-color: var(--brand); text-decoration: none; }
.site-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.mini-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-kpis div { display: flex; flex-direction: column; }
.mini-kpis .k { font-size: 11px; color: var(--muted); }
.mini-kpis .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.site-card-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.score { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.score.s0 { background: var(--bad); } .score.s1 { background: var(--accent); } .score.s2 { background: var(--warn); } .score.s3, .score.s4 { background: var(--good); }
.score.big { width: 72px; height: 72px; font-size: 24px; line-height: 1; flex-direction: column; display: flex; justify-content: center; align-items: center; }
.score.big small { font-size: 10px; opacity: .8; font-weight: 500; }
.analysis { display: flex; gap: 16px; align-items: flex-start; }
.analysis p { margin: 0; }
.checks { display: flex; gap: 14px; list-style: none; padding: 0; margin: 14px 0; font-size: 13px; }
.checks li::before { margin-right: 4px; font-weight: 700; }
.checks .ok::before { content: '✓'; color: var(--good); }
.checks .ko::before { content: '✗'; color: var(--bad); }

/* Proposals */
.proposals { display: flex; flex-direction: column; gap: 12px; }
.proposal { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.proposal.prio-alta { border-left-color: var(--bad); }
.proposal.prio-media { border-left-color: var(--accent); }
.proposal.prio-bassa { border-left-color: var(--c3); }
.proposal.st-done { opacity: .9; }
.proposal.flash-ok { outline: 2px solid var(--good); }
.proposal.flash-err { outline: 2px solid var(--bad); }
.proposal header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proposal header h3 { flex: 1; min-width: 200px; }
.proposal .meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.proposal .rationale { margin: 0; color: var(--ink); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.diff .k, .brief .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.diff .old { background: color-mix(in srgb, var(--bad) 7%, transparent); padding: 8px 10px; border-radius: 6px; }
.diff .new { background: color-mix(in srgb, var(--good) 9%, transparent); padding: 8px 10px; border-radius: 6px; }
.counter { font-style: normal; float: right; text-transform: none; }
.counter.over { color: var(--bad); font-weight: 700; }
.img-link img { max-width: 100%; max-height: 120px; border-radius: 6px; border: 1px solid var(--line); }
.brief p { margin: 0; }
.steps { margin: 0; padding-left: 20px; }
.result { margin: 0; font-size: 12px; color: var(--good); }
.result.err { color: var(--bad); }
.proposal footer { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .pos { font-weight: 700; font-size: 14px; }
.table.compact td, .table.compact th { padding: 5px 6px; }
.table tr.inactive td { opacity: .5; }
.table tr.early td { color: var(--muted); }
.row-actions { white-space: nowrap; text-align: right; }
canvas.spark { display: block; }
.table.kw td:first-child { min-width: 190px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 7px; padding: 7px 10px; width: 100%; }
input[type=checkbox] { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent); border-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: start; }
.hint { font-weight: 400; color: var(--muted); font-size: 11px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
legend { font-weight: 600; padding: 0 6px; }
.settings .card { margin-bottom: 16px; }
.stack { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
details.danger summary { cursor: pointer; color: var(--bad); font-size: 13px; }
details.danger .form { margin-top: 10px; }

/* Alerts, toasts, log, dialogs */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: color-mix(in srgb, var(--good) 10%, var(--panel)); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.alert.err { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.alert.warn { background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: 420px; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 13px; animation: in .2s ease; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes in { from { transform: translateY(8px); opacity: 0; } }
.log { list-style: none; padding: 0; margin: 0; font-size: 13px; max-height: 260px; overflow-y: auto; }
.log.tall { max-height: 420px; }
.log li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.log li.error { color: var(--bad); }
.log li.warn { color: var(--warn); }
dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 18px; width: min(720px, 94vw); }
dialog::backdrop { background: rgba(10,14,22,.5); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.empty { text-align: center; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 48px 24px; }
.empty.small { padding: 24px; }

/* Auth */
body.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: min(380px, 100%); box-shadow: 0 10px 30px rgba(16,24,40,.08); }
.auth-card.wide { width: min(640px, 100%); }
.brand-big { font-size: 20px; font-weight: 700; margin-bottom: 6px; display: flex; gap: 8px; }
.req { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.req .ok { color: var(--good); } .req .ko { color: var(--bad); font-weight: 700; }

/* Responsive */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .main { padding: 16px; }
  .grid2, .diff { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Lingua */
.side-lang { display: flex; gap: 4px; padding: 18px 10px 0; }
.side-lang a, .lang-switch a { font-size: 11px; font-weight: 600; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; color: #8e99b0; border: 1px solid rgba(255,255,255,.12); }
.side-lang a.active { color: #fff; background: rgba(255,255,255,.12); }
.side-lang a:hover, .lang-switch a:hover { text-decoration: none; color: #fff; }
.lang-switch { float: right; display: flex; gap: 4px; }
.lang-switch a { color: var(--muted); border-color: var(--line); }
.lang-switch a.active { color: var(--ink); background: var(--bg); }
.pill.warn { background: var(--warn); }

/* Sicurezza */
.card.highlight { border-color: var(--accent); margin-bottom: 16px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.codes code { font-size: 14px; padding: 6px 10px; text-align: center; }
.totp-setup { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; }
#qrcode { background: #fff; padding: 10px; border-radius: 8px; border: 1px solid var(--line); min-width: 200px; min-height: 200px; }
code.secret { font-size: 15px; letter-spacing: .08em; display: inline-block; padding: 6px 10px; }
.note { background: var(--bg); border-left: 3px solid var(--line-strong); padding: 10px 12px; border-radius: 0 6px 6px 0; font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* Anteprima contenuti */
.preview { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.preview-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.summary-line { margin: 0; font-weight: 500; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-grid .k { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 4px; }
.pv-frame { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pv-frame.single { height: 520px; }
.added-n { color: var(--good); } .removed-n { color: var(--bad); }
details.changes summary, details.edit-html summary { cursor: pointer; font-size: 13px; color: var(--brand); }
details.changes p { margin: 6px 0; padding: 6px 10px; border-radius: 6px; font-size: 13px; }
details.changes .ins { background: color-mix(in srgb, var(--good) 12%, transparent); border-left: 3px solid var(--good); }
details.changes .del { background: color-mix(in srgb, var(--bad) 10%, transparent); border-left: 3px solid var(--bad); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 50%, transparent); }
textarea.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; margin-top: 8px; }
:target.proposal { outline: 2px solid var(--brand); }

/* Report e impostazioni */
.share { display: flex; gap: 6px; margin-bottom: 10px; }
.share input { font-size: 12px; }
.logo-preview { max-height: 48px; max-width: 200px; display: block; margin-bottom: 6px; background: #fff; padding: 4px; border-radius: 6px; border: 1px solid var(--line); }
input[type=color] { height: 38px; padding: 3px; }
.form h3 { margin: 8px 0 0; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 860px) { .pv-grid { grid-template-columns: 1fr; } }

/* FAQ */
.qlist { margin: 4px 0 8px; padding-left: 18px; }
.qlist li { margin: 2px 0; }
.faq-editor { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.faq-item.needs-fill { border-left-color: var(--warn); background: color-mix(in srgb, var(--warn) 6%, var(--panel)); }
.faq-q { font-weight: 600; }
.faq-item-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.faq-item-foot .wc.over { color: var(--warn); font-weight: 600; }
.del-soft { background: var(--bg); border-left: 3px solid var(--line-strong); }
.bulkbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; padding: 8px 10px; background: var(--bg); border-radius: 8px; }
.bulkbar select { width: auto; max-width: 380px; }
.qtable td:nth-child(2) { min-width: 260px; }
.alert.small { padding: 7px 10px; font-size: 13px; margin-bottom: 8px; }

/* Campo Application Password: testo mascherato, così il browser non lo riempie con la password di accesso */
input.masked{-webkit-text-security:disc;text-security:disc;font-family:inherit}

/* Scansioni: autorità, backlink e confronto */
.kpi .v.sm { font-size: 17px; }
.kpi-action { justify-content: center; align-items: flex-start; gap: 6px; }
.scan-compare { margin-bottom: 16px; }
.scan-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.scan-metrics { margin-bottom: 10px; }
.scan-metrics a { font-size: 12px; padding: 4px 9px; }
.cmp-form { margin-bottom: 6px; }
.cmp-form select { margin-left: 6px; padding: 3px 6px; font: inherit; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--panel); color: var(--ink); }
.table.cmp td:first-child { white-space: nowrap; }
@media (max-width: 1100px) { .scan-grid { grid-template-columns: 1fr; } }

/* Autopost */
.site-switch { width: auto; max-width: 240px; }
.ap-cols { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; align-items: start; }
.ap-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ap-cats { padding: 14px 10px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.ap-cats h2 { padding: 0 8px; }
.ap-cats ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ap-cats li { padding: 6px 8px; border-radius: 7px; display: flex; flex-direction: column; gap: 1px; }
.ap-cats li a { color: var(--ink); display: flex; justify-content: space-between; gap: 6px; align-items: center; font-weight: 500; }
.ap-cats li a:hover { text-decoration: none; }
.ap-cats li:hover { background: var(--bg); }
.ap-cats li.active { background: color-mix(in srgb, var(--brand) 9%, transparent); }
.ap-cats li.off a { color: var(--muted); }
.ap-counts { display: flex; gap: 4px; flex-shrink: 0; }
.ap-topic-actions { align-items: center; }
.grow-sp { flex: 1; }
details.ap-add { margin-top: 12px; }
details.ap-add summary { cursor: pointer; color: var(--brand); font-size: 13px; }
details.ap-add .form { margin-top: 10px; }
.ap-kw td { vertical-align: top; }
.ap-kw td:nth-child(2) { min-width: 220px; }
.ap-kw .issue { margin-top: 3px; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.ap-edit { gap: 10px; }
.ap-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ap-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.ap-img { display: flex; flex-direction: column; gap: 4px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.ap-img img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 5px; background: var(--line); }
.ap-img-ph { aspect-ratio: 3 / 2; display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 5px; padding: 6px; }
.ap-img.missing .ap-img-ph { color: var(--bad); }
.ap-img details summary { cursor: pointer; color: var(--brand); }
.ap-img textarea { margin: 4px 0; font-size: 12px; }
.ap-checks { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.ap-checks h4 { margin: 0 0 6px; font-size: 13px; }
.seo-checks { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 16px; font-size: 12.5px; }
.seo-checks li { break-inside: avoid; padding: 2px 0 2px 18px; position: relative; }
.seo-checks li::before { position: absolute; left: 0; font-weight: 700; }
.seo-checks li.ok::before { content: '✓'; color: var(--good); }
.seo-checks li.ko::before { content: '✗'; color: var(--bad); }
.ap-preview-wrap summary { cursor: pointer; font-size: 13px; color: var(--brand); margin-bottom: 6px; }
.ap-article { background: #fff; color: #1d2330; border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; max-height: 640px; overflow-y: auto; font: 15px/1.65 Georgia, serif; }
.ap-article h1, .ap-article h2, .ap-article h3, .ap-article h4 { font-family: Inter, Arial, sans-serif; line-height: 1.25; color: #14171f; }
.ap-article h1 { font-size: 24px; margin: 8px 0 12px; }
.ap-article h2 { font-size: 19px; margin: 22px 0 8px; }
.ap-article h3 { font-size: 16px; margin: 16px 0 6px; }
.ap-article a { color: #0f7a6c; text-decoration: underline; }
.ap-article figure { margin: 14px 0; }
.ap-article img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.ap-article figcaption { font: 12px/1.4 Inter, Arial, sans-serif; color: #6a7282; margin-top: 4px; }
.ap-article table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ap-article td, .ap-article th { border: 1px solid #dde1e7; padding: 6px 8px; text-align: left; }
.ap-article blockquote { border-left: 3px solid #cfd3da; margin: 12px 0; padding: 2px 14px; color: #3d4452; }
.ap-post.st-published { border-left-color: var(--good); }
.ap-post.st-ready { border-left-color: var(--accent); }
.ap-post.st-failed { border-left-color: var(--bad); }
.ap-post header .score { width: 36px; height: 36px; font-size: 13px; }
.ap-settings .grid2 { margin-top: 6px; }
.span2 { grid-column: 1 / -1; }
.row.nowrap { flex-wrap: nowrap; align-items: center; gap: 8px; font-weight: 400; }
input.w-num { width: 80px; }
select.w-auto { width: auto; }
label.check.big { font-size: 15px; margin-bottom: 4px; }
code.block { display: block; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 1100px) { .ap-cols, .ap-grid { grid-template-columns: 1fr; } .ap-cats { position: static; max-height: none; } .seo-checks { columns: 1; } }

/* Velocità e visualizzazione: cornici dei dispositivi */
.speed-pick select { width: auto; max-width: 460px; }
.dev-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, .8fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.dev-card { display: flex; flex-direction: column; gap: 12px; }
.frame { position: relative; background: #1b2130; margin: 0 auto 10px; box-shadow: 0 6px 18px rgba(16, 24, 40, .18); }
.frame .screen { width: 100%; height: 100%; overflow-y: auto; background: #fff; border-radius: 3px; scrollbar-width: thin; }
.frame .screen img { width: 100%; display: block; }
.frame .noshot { height: 100%; display: grid; place-items: center; padding: 12px; text-align: center; color: #6a7282; font-size: 12px; background: #f1f3f6; }
.frame-desktop { width: 100%; aspect-ratio: 16 / 10; padding: 10px 10px 14px; border-radius: 10px; }
.frame-desktop::after { content: ''; position: absolute; left: 50%; bottom: -18px; width: 22%; height: 10px; transform: translateX(-50%); background: #2a3142; border-radius: 0 0 8px 8px; }
.frame-tablet { width: min(100%, 300px); aspect-ratio: 3 / 4; padding: 16px 12px; border-radius: 22px; }
.frame-mobile { width: min(100%, 210px); aspect-ratio: 9 / 19; padding: 12px 7px; border-radius: 28px; }
.frame-mobile::before { content: ''; position: absolute; top: 4px; left: 50%; width: 34%; height: 5px; transform: translateX(-50%); background: #2a3142; border-radius: 4px; }
.dev-scores { display: flex; gap: 18px; justify-content: center; }
.dev-score { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.table.metrics td { font-size: 12.5px; }
.m-good { color: var(--good); font-weight: 600; } .m-avg { color: var(--warn); font-weight: 600; } .m-poor { color: var(--bad); font-weight: 600; }
.seo-checks.one { columns: 1; }
.warn-text { color: var(--warn); }
@media (max-width: 1200px) { .dev-grid { grid-template-columns: 1fr 1fr; } .dev-desktop { grid-column: 1 / -1; } }
@media (max-width: 760px) { .dev-grid { grid-template-columns: 1fr; } }

[hidden] { display: none !important; }
.type-switch { margin-bottom: 4px; gap: 4px; }
.type-switch label { flex-direction: row !important; align-items: center; gap: 6px !important; padding: 5px 11px; border-radius: 6px; font-weight: 500; cursor: pointer; }
.type-switch label:has(input:checked) { background: var(--bg); }
.grid2.tight { grid-template-columns: 1fr 110px; gap: 8px; }
input[type=radio] { width: auto; }
.type-switch label { white-space: nowrap; }

/* robots.txt e sitemap */
.cols.even { grid-template-columns: 1fr 1fr; }
.diff.files pre.file-view, pre.file-view { max-height: 320px; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: 12px/1.45 'JetBrains Mono', ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; margin: 0; }
textarea.file-edit { min-height: 260px; }
.file-issues { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.file-issues li { padding-left: 20px; position: relative; }
.file-issues li::before { position: absolute; left: 0; font-weight: 700; }
.file-issues li.err::before { content: '✗'; color: var(--bad); }
.file-issues li.warn::before { content: '!'; color: var(--warn); left: 4px; }
details.ftp-optional > summary { cursor: pointer; list-style: none; }
details.ftp-optional > summary h3 { display: inline; }
details.ftp-optional > summary::before { content: '▸ '; color: var(--muted); }
details.ftp-optional[open] > summary::before { content: '▾ '; }
@media (max-width: 1100px) { .cols.even { grid-template-columns: 1fr; } }

/* Aiuto contestuale «?» */
.help-line { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.help-q { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 17px; height: 17px; padding: 0; margin: 0 0 0 4px;
  border: 0; border-radius: 50%; background: #f5c518; color: #3a2c00; font: 700 11px/1 Inter, system-ui, sans-serif; cursor: pointer; vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(120,90,0,.25); }
.help-line .help-q { margin-left: 0; }
.help-q:hover { background: #ffd43b; }
.help-q:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.help-q.static { cursor: default; width: 22px; height: 22px; font-size: 13px; margin: 0; }
.help-dialog { width: min(560px, 94vw); padding: 0; }
.help-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.help-head strong { flex: 1; font-size: 15px; }
.help-x { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.help-x:hover { color: var(--ink); }
.help-body { padding: 14px 18px 18px; font-size: 14px; line-height: 1.6; }
.help-body ol, .help-body ul { margin: 6px 0; padding-left: 20px; }
.help-body li { margin: 4px 0; }
.help-body a { word-break: break-word; }

/* Punteggio SEO complessivo */
.seo-score .card-head h2 { display: inline-flex; align-items: center; }
.score-grid { display: grid; grid-template-columns: 170px minmax(240px, 1fr) minmax(260px, 1.2fr); gap: 24px; align-items: center; }
.score-main { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.score-ring { --p: 0; --c: var(--muted); width: 128px; height: 128px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--line) 0); }
.score-ring > span { width: 104px; height: 104px; border-radius: 50%; background: var(--panel); display: flex; align-items: baseline; justify-content: center; padding-top: 30px; }
.score-ring b { font-size: 38px; line-height: 1; letter-spacing: -.02em; }
.score-ring small { color: var(--muted); font-size: 13px; margin-left: 2px; }
.score-ring.g-good { --c: var(--good); } .score-ring.g-mid { --c: var(--warn); } .score-ring.g-bad { --c: var(--bad); }
.score-delta { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.score-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.score-parts li { display: grid; grid-template-columns: 150px 1fr 30px; gap: 10px; align-items: center; font-size: 13px; }
.score-parts .sp-label small { font-size: 11px; }
.score-parts .sp-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.score-parts .sp-bar i { display: block; height: 100%; border-radius: 4px; background: var(--muted); }
.score-parts li.g-good .sp-bar i { background: var(--good); } .score-parts li.g-mid .sp-bar i { background: var(--warn); } .score-parts li.g-bad .sp-bar i { background: var(--bad); }
.score-parts .sp-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.score-parts .sp-miss { grid-column: 2 / 4; }
.score-trend .chart-box { height: 200px; }
@media (max-width: 1100px) { .score-grid { grid-template-columns: 1fr; } .score-parts li { grid-template-columns: 130px 1fr 30px; } }
.site-score { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.site-score.g-good { color: var(--good); } .site-score.g-mid { color: var(--warn); } .site-score.g-bad { color: var(--bad); }
.score-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; }

/* Concorrenti e difficoltà delle keyword */
.kd { display: inline-block; min-width: 28px; padding: 1px 6px; border-radius: 10px; text-align: center; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; color: #fff; }
.kd.kd-1 { background: #16865a; } .kd.kd-2 { background: #5aa469; } .kd.kd-3 { background: #c9a227; color: #2b2200; } .kd.kd-4 { background: #e0611a; } .kd.kd-5 { background: #c8322b; }
.comp-actions { margin-top: 14px; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.comp-add { gap: 8px; align-items: flex-end; }
.comp-add label { min-width: 240px; }
.comp-filters { justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.comp-filters select { width: auto; }
.comp-who span { display: inline-block; margin-right: 8px; white-space: nowrap; }
.bulkbar select { width: auto; }
.form.comp-add { display: flex; flex-direction: row; flex-wrap: wrap; }
.comp-kw td:nth-child(4) { white-space: nowrap; }
.help-q.sm { width: 15px; height: 15px; font-size: 10px; margin-left: 5px; text-transform: none; letter-spacing: 0; }
th .help-q { vertical-align: -2px; }
.score-parts .help-q.sm, .kpi .k .help-q.sm { margin-right: 4px; }
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: -6px 0 10px; }
.ap-head p { margin: 0; }
.tabs.sub { border-bottom: 0; gap: 4px; margin-bottom: 16px; }
.tabs.sub a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; border-bottom-width: 1px; font-size: 13px; }
.tabs.sub a.active { background: var(--panel); border-color: var(--brand); color: var(--brand); }
.btn.ghost.danger { background: none; border-color: transparent; color: var(--bad); }
.btn.ghost.danger:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* Elimina sito dalla panoramica */
.site-card-wrap { display: flex; flex-direction: column; }
.site-card-wrap .site-card { flex: 1; }
.site-card-wrap .site-del { align-self: flex-end; margin-top: 4px; opacity: .7; }
.site-card-wrap:hover .site-del, .site-card-wrap .site-del:focus { opacity: 1; }

/* Editor del testo Autopost */
.rte { display: flex; flex-direction: column; gap: 6px; }
.rte-label { font-weight: 600; font-size: 13px; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 4px; position: sticky; top: 0; z-index: 2; background: var(--card, #fff); padding: 4px 0; }
.rte-bar button { border: 1px solid var(--line); background: var(--bg, #f6f7f9); border-radius: 6px; padding: 3px 9px; font-size: 13px; cursor: pointer; min-width: 32px; color: var(--ink); }
.rte-bar button:hover { border-color: var(--brand); }
.rte-body { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; min-height: 320px; max-height: 70vh; overflow: auto; background: #fff; outline: none; }
.rte-body:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

.ap-prompt-label { display: block; margin: 4px 0 2px; }


/* =====================================================================
   Active SEO — interfaccia 2026: tipografia, pulsanti, punteggi turchese/grigio, mobile
   ===================================================================== */
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-weight: 700; letter-spacing: -.005em; }
::selection { background: color-mix(in srgb, var(--brand-2) 30%, transparent); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

/* Pulsanti: pieni, morbidi, con risposta al tocco */
.btn { min-height: 38px; padding: 8px 16px; border-radius: 11px; font-weight: 600; letter-spacing: -.005em; border: 1px solid var(--line-strong);
  background: var(--panel); transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease, color .15s ease; }
.btn:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line-strong)); background: color-mix(in srgb, var(--brand) 5%, var(--panel)); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:focus-visible { box-shadow: var(--ring); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 88%, #fff) 0%, var(--brand) 100%); border-color: transparent; color: var(--brand-ink);
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn.primary:hover { filter: none; background: var(--brand); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 10px 22px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.btn.danger { background: var(--bad); border-color: transparent; color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 88%, #000); }
.btn.ghost.danger { background: none; color: var(--bad); }
.btn.xs { min-height: 28px; padding: 3px 10px; border-radius: 8px; font-size: 12px; }
.btn:disabled { opacity: .5; transform: none; }

/* Campi */
input, select, textarea { border-radius: 10px; transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: var(--ring); outline: none; }

/* Card e KPI */
.card, .kpi { border-radius: var(--radius); box-shadow: var(--shadow); border-color: var(--line); }
.kpi { padding: 14px 16px; gap: 4px; }
.kpi .k { font-size: 12px; font-weight: 500; }
.kpi .v { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.kpi.accent { border-color: color-mix(in srgb, var(--brand-2) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 7%, var(--panel)), var(--panel) 70%); }
.site-card { transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease; }
.site-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.mini-kpis .v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }

/* Etichette in minuscolo, non tutto maiuscolo */
.nav-label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: #6f858d; }
.table th { text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--muted); }
.tag { text-transform: none; letter-spacing: 0; font-size: 11px; }
.diff .k, .brief .k, .pv-grid .k { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; }
.form h3 { text-transform: none; letter-spacing: -.005em; font-size: 14px; font-weight: 700; color: var(--ink); margin-top: 14px; }

/* Schede: indicatore turchese più evidente */
.tabs { gap: 4px; border-bottom-color: var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; border-radius: 10px 10px 0 0; border-bottom-width: 3px; transition: color .15s ease, background-color .15s ease; }
.tabs a:hover { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand-2); font-weight: 700; }
.seg { border-radius: 12px; }
.seg a { border-radius: 9px; transition: background-color .15s ease, color .15s ease; }
.seg a.active { background: color-mix(in srgb, var(--brand) 10%, var(--panel)); color: var(--brand); }

/* Barra laterale */
.sidebar nav a { border-radius: 10px; padding: 8px 12px; transition: background-color .15s ease, color .15s ease; }
.sidebar nav a.active { background: color-mix(in srgb, var(--brand-2) 18%, transparent); color: #fff; box-shadow: inset 3px 0 0 var(--brand-2); }
.pill { background: var(--accent); }

/* Badge e avvisi: niente marrone */
.badge { border-radius: 999px; padding: 3px 9px; }
.badge.warn { background: color-mix(in srgb, var(--accent) 14%, transparent); color: color-mix(in srgb, var(--accent) 85%, #000); }
.issue { background: color-mix(in srgb, var(--accent) 12%, transparent); color: color-mix(in srgb, var(--accent) 85%, #000); }
.alert { border-radius: 12px; }
.alert.warn { background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.toast { border-radius: 12px; box-shadow: var(--shadow-lift); }
dialog { border-radius: 18px; box-shadow: var(--shadow-lift); }
dialog[open] { animation: dlg-in .18s ease; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* Scala dei punteggi: dal corallo all'arancio della freccia, grigio neutro, poi turchese e verde acqua del logo */
.score.s0 { background: var(--bad); } .score.s1 { background: var(--accent); } .score.s2 { background: var(--mid); }
.score.s3 { background: var(--brand-2); } .score.s4 { background: var(--brand); }
.score { box-shadow: 0 4px 12px -6px currentColor; }
.score-ring.g-mid, .score-parts li.g-mid { --c: var(--mid); }
.score-ring.g-good { --c: var(--brand-2); }
.score-parts li.g-mid .sp-bar i { background: var(--mid); }
.score-parts li.g-good .sp-bar i { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.score-parts li.g-bad .sp-bar i { background: linear-gradient(90deg, var(--bad), var(--accent)); }
.score-parts .sp-bar { height: 10px; border-radius: 999px; }
.score-parts .sp-bar i { border-radius: 999px; transform-origin: left; animation: bar-grow .9s cubic-bezier(.2,.8,.2,1) both; }
.site-score.g-mid { color: var(--mid); } .site-score.g-good { color: var(--brand); }
.m-avg { color: var(--mid); } .warn-text, .log li.warn { color: color-mix(in srgb, var(--accent) 85%, #000); }
.kd.kd-1 { background: var(--brand); } .kd.kd-2 { background: var(--brand-2); } .kd.kd-3 { background: var(--mid); color: #fff; } .kd.kd-4 { background: var(--accent); } .kd.kd-5 { background: var(--bad); }
.pill.warn { background: var(--accent); }
.faq-item.needs-fill { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.faq-item-foot .wc.over { color: var(--accent); }
.file-issues li.warn::before { color: var(--accent); }

/* Anello del punteggio: si riempie all'apertura della pagina */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }
.score-ring { width: 136px; height: 136px; background: conic-gradient(var(--c) calc(var(--p) * 1%), color-mix(in srgb, var(--line) 80%, transparent) 0);
  animation: ring-fill 1.1s cubic-bezier(.2,.8,.2,1) both; }
.score-ring > span { width: 110px; height: 110px; padding-top: 32px; box-shadow: 0 0 0 1px var(--line) inset; }
.score-ring b { font-size: 40px; font-weight: 800; letter-spacing: -.04em; }
@keyframes ring-fill { from { --p: 0; } }
@keyframes bar-grow { from { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- Mobile */
.topbar { display: none; }
.side-backdrop { display: none; }
@media (max-width: 860px) {
  body { font-size: 15px; }
  .layout { display: block; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; gap: 10px; padding: 10px 14px; background: var(--side); color: #fff;
    box-shadow: 0 4px 16px -8px rgba(0,0,0,.5); }
  .topbar .brand { padding: 0; }
  .topbar .menu-btn { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
    color: #fff; display: grid; place-items: center; cursor: pointer; }
  .topbar .menu-btn span, .topbar .menu-btn span::before, .topbar .menu-btn span::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s ease, background-color .2s ease; }
  .topbar .menu-btn span::before, .topbar .menu-btn span::after { content: ''; position: absolute; left: 0; }
  .topbar .menu-btn span::before { top: -6px; } .topbar .menu-btn span::after { top: 6px; }
  body.nav-open .topbar .menu-btn span { background: transparent; }
  body.nav-open .topbar .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
  body.nav-open .topbar .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }
  .sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); height: 100dvh; transform: translateX(-102%);
    transition: transform .25s cubic-bezier(.2,.8,.2,1); box-shadow: 12px 0 40px -20px rgba(0,0,0,.6); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(5,12,15,.45); backdrop-filter: blur(2px); }
  body.nav-open { overflow: hidden; }
  .sidebar nav a { padding: 11px 12px; }
  .main { padding: 16px 14px 80px; }
  h1 { font-size: 22px; }
  .page-head { gap: 12px; }
  .page-head > .actions, .page-head > .row { width: 100%; }
  .page-head > .actions .btn, .page-head > .row .btn { flex: 1 1 auto; justify-content: center; }
  .btn { min-height: 42px; }
  .btn.xs { min-height: 34px; }
  input, select, textarea { font-size: 16px; } /* evita lo zoom automatico su iPhone */
  .tabs { margin-left: -14px; margin-right: -14px; padding: 0 14px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 24px), transparent); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 22px; }
  .site-grid { grid-template-columns: 1fr; }
  .cols, .cols.even, .grid2, .diff, .ap-grid, .ap-cols, .pv-grid, .scan-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .score-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .score-parts li { grid-template-columns: 112px 1fr 28px; }
  .card { padding: 14px; }
  .toolbar { align-items: stretch; }
  .seg { overflow-x: auto; flex-wrap: nowrap; }
  .seg a { white-space: nowrap; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; padding: 16px; }
  dialog[open] { animation: sheet-in .22s cubic-bezier(.2,.8,.2,1); }
  .speed-pick select, .comp-filters select, .bulkbar select { width: 100%; max-width: 100%; }
  .speed-pick > * { min-width: 0; max-width: 100%; }
  #toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .auth-card { padding: 24px 20px; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

/* ================================================================ Account, piani e assistente «Aiuto» */
.auth-title { font-size: 20px; margin: 4px 0 2px; }
.auth-alt { text-align: center; margin-top: 14px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 3px; flex: none; }
.acct-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acct-bar form { margin: 0; }
.alert.trial { background: color-mix(in srgb, var(--brand-2) 12%, var(--panel)); border-color: color-mix(in srgb, var(--brand-2) 35%, transparent); color: var(--ink); }
.bar { height: 8px; border-radius: 8px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand-2); border-radius: 8px; }
.bar span.full { background: var(--accent); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; margin-top: 10px; }
.plan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.plan-card h3 { margin: 0; }
.plan-card .price { font-size: 19px; font-weight: 800; color: var(--brand); line-height: 1.25; }
.plan-group { margin: 22px 0 0; font-size: 15px; }
.plan-target { display: block; max-width: 520px; }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; flex: 1; }
.table-wrap { overflow-x: auto; }

.hb-fab { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 10px;
  border: 0; border-radius: 999px; background: var(--brand); color: #fff; font: 600 14px var(--font); cursor: pointer; box-shadow: var(--shadow-lift); transition: transform .15s ease, background .15s; }
.hb-fab:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--brand) 85%, #000); }
.hb-fab .hb-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-weight: 800; }
.hb-fab.open { display: none; }
.hb-panel { position: fixed; right: 18px; bottom: 18px; z-index: 95; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 36px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lift); display: flex; flex-direction: column; overflow: hidden; animation: in .18s ease; }
.hb-panel[hidden] { display: none; }
.hb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 14px 14px 10px; border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--panel)), var(--panel)); }
.hb-head strong { display: block; }
.hb-sub { font-size: 12px; color: var(--muted); }
.hb-tools { display: flex; gap: 4px; }
.hb-tools button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font: 500 12px var(--font); padding: 4px 8px; border-radius: 8px; }
.hb-tools button:hover { background: var(--bg); color: var(--ink); }
.hb-close { font-size: 20px !important; line-height: 1; }
.hb-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.hb-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.hb-msg p { margin: 0 0 6px; } .hb-msg p:last-child { margin: 0; }
.hb-msg ol, .hb-msg ul { margin: 4px 0 6px; padding-left: 20px; }
.hb-msg code { font-size: 12px; background: color-mix(in srgb, var(--ink) 8%, transparent); padding: 1px 4px; border-radius: 4px; }
.hb-msg.assistant { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.hb-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.hb-msg.user code { background: rgba(255,255,255,.2); }
.hb-msg.error { align-self: stretch; max-width: none; background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.hb-msg.wait { color: var(--muted); font-style: italic; }
.hb-tag { display: inline-block; font-size: 11px; opacity: .8; margin-bottom: 2px; }
.hb-form { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hb-form textarea { width: 100%; resize: none; min-height: 44px; }
.hb-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hb-shot { font-size: 12px; font-weight: 400; display: flex; gap: 6px; align-items: center; color: var(--muted); }
.hb-shot input { width: auto; }
.hb-note { margin: 0; font-size: 11px; color: var(--muted); }
.hb-ask { margin-left: 10px; border: 1px solid rgba(255,255,255,.6); background: transparent; color: inherit; border-radius: 8px; padding: 2px 8px; font: 600 12px var(--font); cursor: pointer; }
body:has(.hb-fab) #toasts { bottom: 74px; }
@media (max-width: 760px) {
  .hb-fab { right: 12px; bottom: 12px; }
  .hb-panel { right: 0; bottom: 0; width: 100vw; height: 88vh; border-radius: 18px 18px 0 0; }
  body:has(.hb-fab) #toasts { bottom: 66px; }
}
.ap-img { position: relative; }
.ap-img-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(15,29,36,.72); color: #fff;
  font: 700 16px/1 var(--font); cursor: pointer; display: grid; place-items: center; opacity: .85; transition: background .15s, opacity .15s; z-index: 1; }
.ap-img-del:hover, .ap-img-del:focus-visible { background: var(--bad); opacity: 1; }
.connect-box { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; background: color-mix(in srgb, var(--brand-2) 4%, var(--panel)); }
.connect-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.connect-list li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0; }
.connect-list .muted { overflow-wrap: anywhere; }
code.copy { cursor: pointer; background: var(--bg); border: 1px dashed var(--line-strong); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
code.copy:hover { border-color: var(--brand); color: var(--brand); }
.steps li { margin-bottom: 4px; }
.wp-steps { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.wp-steps ol, .connect-wp ol { margin: 6px 0 0; padding-left: 20px; }
.wp-steps li, .connect-wp li { margin-bottom: 4px; }
.connect-wp { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.plan-card .plan-for { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.4; }

/* ---- lavoro in corso: lente che scorre sulle righe di una pagina ---- */
.work-banner { display: flex; align-items: center; gap: 12px; }
.work-anim { position: relative; display: inline-block; width: 34px; height: 30px; flex: none; border-radius: 4px; background:
  linear-gradient(currentColor, currentColor) 5px 7px / 22px 2px no-repeat,
  linear-gradient(currentColor, currentColor) 5px 13px / 17px 2px no-repeat,
  linear-gradient(currentColor, currentColor) 5px 19px / 20px 2px no-repeat,
  linear-gradient(currentColor, currentColor) 5px 25px / 12px 2px no-repeat;
  color: color-mix(in srgb, currentColor 35%, transparent); }
.work-anim::before { content: ''; position: absolute; top: 2px; left: 0; width: 13px; height: 13px; border: 2.5px solid var(--brand, #157a6e);
  border-radius: 50%; background: color-mix(in srgb, var(--brand, #157a6e) 12%, transparent); animation: work-lens 2.4s ease-in-out infinite; }
.work-anim::after { content: ''; position: absolute; top: 15px; left: 13px; width: 7px; height: 2.5px; background: var(--brand, #157a6e);
  border-radius: 2px; transform: rotate(45deg); transform-origin: left center; animation: work-lens 2.4s ease-in-out infinite; }
.work-anim.sm { width: 22px; height: 18px; vertical-align: -4px; margin-right: 6px; background-size: 14px 2px, 11px 2px, 13px 2px, 8px 2px;
  background-position: 3px 4px, 3px 8px, 3px 12px, 3px 16px; color: color-mix(in srgb, currentColor 45%, transparent); }
.work-anim.sm::before { width: 8px; height: 8px; border-width: 2px; top: 1px; }
.work-anim.sm::after { top: 9px; left: 8px; width: 5px; height: 2px; }
@keyframes work-lens { 0% { translate: 0 0; } 25% { translate: 14px 6px; } 50% { translate: 6px 12px; } 75% { translate: 16px 2px; } 100% { translate: 0 0; } }
.work-anim.sm::before, .work-anim.sm::after { animation-name: work-lens-sm; }
@keyframes work-lens-sm { 0% { translate: 0 0; } 25% { translate: 9px 4px; } 50% { translate: 4px 7px; } 75% { translate: 10px 1px; } 100% { translate: 0 0; } }
.busy-time { font-variant-numeric: tabular-nums; opacity: .8; }
.elapsed { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .work-anim::before, .work-anim::after { animation: none; } }
.btn.loading:has(.work-anim)::before { display: none; }
.btn .work-anim::before { border-color: currentColor; background: color-mix(in srgb, currentColor 18%, transparent); }
.btn .work-anim::after { background: currentColor; }
.work-banner .work-anim { transform: scale(1.25); margin: 0 4px; color: color-mix(in srgb, var(--ink, #1d2a33) 30%, transparent); }
.ap-req-links { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 4px; margin: 10px 0; }
.ap-req-links legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.ap-req-links .grid2 { margin-bottom: 6px; }

/* Finestra di conferma (avviso modifiche ravvicinate) */
.confirm-dialog { width: min(560px, 94vw); }
.confirm-body p { margin: 0 0 10px; line-height: 1.55; }
.confirm-body p:last-child { color: var(--muted); }
.confirm-skip { display: flex; gap: 8px; align-items: center; margin: 6px 0 14px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
