:root {
  --bg: #f3f5fb; --surface: #ffffff; --surface-2: #f7f8fd; --text: #101828; --muted: #667085; --line: #e4e7f0;
  --brand: #4f46e5; --brand-2: #06b6d4; --brand-soft: #eef0ff; --on-brand: #fff;
  --ok: #12b76a; --danger: #d92d20; --danger-soft: #fef3f2; --warn: #f79009;
  --c-fuel: #06b6d4; --c-insurance: #4f46e5; --c-tires: #f79009; --c-maint: #12b76a; --c-other: #a855f7;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.12);
  --radius: 18px; --nav-h: 68px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f1a; --surface: #131a2a; --surface-2: #182036; --text: #eef1f8; --muted: #9aa5bd; --line: #243049;
    --brand: #818cf8; --brand-soft: #1b2145; --on-brand: #0b0f1a; --danger-soft: #3a1714; --danger: #f97066;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -14px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; letter-spacing: -.01em; }
h3 { font-size: .95rem; }
button { font: inherit; color: inherit; cursor: pointer; }
.ico { display: inline-flex; width: 22px; height: 22px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.main { padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -16px rgba(16,24,40,.25); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; color: var(--muted); font-size: .7rem; font-weight: 600; }
.bottom-nav button.active { color: var(--brand); }
.bottom-nav button.active .ico { background: var(--brand-soft); border-radius: 12px; width: 44px; height: 28px; padding: 3px 12px; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 264px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 16px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
  .topbar, .bottom-nav { display: none; }
  .main { padding: 32px 36px 56px; width: 100%; }
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.brand small { display: block; font-size: .68rem; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -3px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 600; text-align: left; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); }
.nav-label { margin: 14px 12px 4px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sidebar .grow { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: .85rem; overflow: hidden; }
.user-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Componenti ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card > h2 + * { margin-top: 12px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 150px; }
.page-head .btn { flex: none; }
.page-head p { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.grid { display: grid; gap: 12px; }
.grid.kpis { grid-template-columns: repeat(2, 1fr); }
.grid.two { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid.kpis { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .grid.two { grid-template-columns: 1fr 1.4fr; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: .78rem; font-weight: 600; }
.kpi .v { font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .u { font-size: .8rem; font-weight: 600; color: var(--muted); margin-left: 3px; }
.hero { position: relative; overflow: hidden; border: 0; color: #fff; background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #06b6d4 130%); box-shadow: 0 18px 40px -18px rgba(79,70,229,.7); padding: 22px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero .l { opacity: .85; font-size: .85rem; font-weight: 600; }
.hero .big { font-size: clamp(2.2rem, 8vw, 3.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.hero .pills { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.pill { background: rgba(255,255,255,.18); border-radius: 999px; padding: 5px 12px; font-size: .85rem; font-weight: 600; }
.badge { display: inline-block; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); vertical-align: middle; }
.badge.warn { background: #fff4e0; color: #b45309; } .badge.red { background: var(--danger-soft); color: var(--danger); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; transition: transform .05s, background .15s; }
.btn:hover { background: var(--surface-2); } .btn:active { transform: scale(.98); }
.btn.primary { background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px var(--brand); }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0b0f1a; background: var(--brand); } }
.btn.danger { color: var(--danger); } .btn.small { min-height: 36px; padding: 0 12px; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.icon-btn:hover { background: var(--danger-soft); color: var(--danger); }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea { width: 100%; min-height: 46px; font: inherit; font-size: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); appearance: none; -webkit-appearance: none; }
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
input:focus, select:focus, .btn:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; border-color: var(--brand); }
input.filled { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 8%, var(--surface-2)); }
.form { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .form.wide { grid-template-columns: repeat(3, 1fr); } }
.form .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.error { color: var(--danger); font-size: .9rem; min-height: 1.2em; }
.hint { color: var(--muted); font-size: .82rem; }
.scan-box { display: flex; align-items: center; gap: 14px; padding: 14px; border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: 16px; background: var(--brand-soft); flex-wrap: wrap; }
.scan-box .thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.scan-box .txt { flex: 1; min-width: 180px; }
.scan-box input[type=file] { display: none; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Elenco voci ---------- */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .badge-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--tone, var(--brand)); background: color-mix(in srgb, var(--tone, var(--brand)) 14%, transparent); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 650; overflow-wrap: anywhere; }
.item .s { color: var(--muted); font-size: .84rem; }
.item .amt { font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.photo-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); cursor: zoom-in; }
.empty { text-align: center; color: var(--muted); padding: 28px 8px; }
.empty .ico { width: 40px; height: 40px; margin-bottom: 6px; opacity: .6; }

/* ---------- Grafici ---------- */
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.donut { width: 190px; height: 190px; position: relative; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut .center b { font-size: 1.25rem; letter-spacing: -.02em; } .donut .center span { font-size: .72rem; color: var(--muted); }
.legend { list-style: none; margin: 0; padding: 0; width: 100%; }
.legend li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: .92rem; }
.legend .dot { width: 11px; height: 11px; border-radius: 4px; flex: none; }
.legend .amt { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--muted); width: 3.2em; text-align: right; font-size: .82rem; }
.chart-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.chart-scroll svg { display: block; height: auto; }
.chart-scroll text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; }
.bar-row .track { grid-column: 1 / -1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.months { width: 100%; border-collapse: collapse; font-size: .88rem; }
.months th { text-align: right; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; }
.months td { text-align: right; padding: 8px 4px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.months th:first-child, .months td:first-child { text-align: left; }
@media (max-width: 520px) { .months .opt { display: none; } }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; }
.auth-hero { padding: 36px 24px 28px; color: #fff; background: linear-gradient(145deg, #4338ca 0%, #7c3aed 60%, #0891b2 130%); display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.auth-hero .brand-mark { background: rgba(255,255,255,.2); }
.auth-hero ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; }
.auth-hero li { display: flex; gap: 10px; align-items: flex-start; opacity: .95; }
.auth-hero li .ico { width: 20px; height: 20px; margin-top: 2px; }
.auth-panel { display: grid; place-items: center; padding: 24px 16px 40px; }
.auth-card { width: 100%; max-width: 400px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.auth-panel, .auth-hero { min-width: 0; }
.auth-hero p { overflow-wrap: anywhere; }
.auth-card .form { grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } .auth-hero { padding: 64px; } .auth-panel { padding: 48px; } }

/* ---------- Dialog / sheet / toast ---------- */
dialog { border: 0; border-radius: 20px; background: var(--surface); color: var(--text); width: min(92vw, 560px); padding: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(8,12,24,.55); backdrop-filter: blur(3px); }
dialog img { max-width: 100%; border-radius: 12px; display: block; }
dialog.sheet { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 8px 12px calc(16px + env(safe-area-inset-bottom)); }
dialog.sheet .nav-item { padding: 14px 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 600; font-size: .9rem; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
.copybox { font: 600 1.2rem ui-monospace, monospace; letter-spacing: .05em; padding: 14px; text-align: center; background: var(--surface-2); border-radius: 12px; user-select: all; margin: 12px 0; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition: none !important; } }

/* ---------- Aggiunte: layout, controlli, report, consigli ---------- */
.content-col { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.grid.cols { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chart-note { margin: 8px 0 4px; }
.seg { display: inline-flex; max-width: 100%; padding: 4px; gap: 2px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-weight: 650; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.seg.sub-seg { margin: 4px 0 2px; } .seg.mode-seg { display: flex; }
.seg.mode-seg button { flex: 1; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.chip.on { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; margin: 0; font-size: .95rem; color: var(--text); font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.switch .track-sw { flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; transition: background .15s; margin-top: 1px; }
.switch .track-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track-sw { background: var(--brand); }
.switch input:checked + .track-sw::after { transform: translateX(18px); }
.switch input:focus-visible + .track-sw { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
.switch small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.opt-row { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.opt-row:first-child { border-top: 0; }
@media (min-width: 700px) { .opt-row { grid-template-columns: 1.4fr 1fr 1fr; align-items: center; } }
.sale-box { padding-top: 6px; border-top: 1px dashed var(--line); }
.kv-list { display: flex; flex-direction: column; margin-top: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.kv:last-child { border-bottom: 0; } .kv.strong { font-size: 1.02rem; } .kv b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv small { display: block; color: var(--muted); font-size: .76rem; }
.tip-btn { color: #b45309; border-color: color-mix(in srgb, #f79009 45%, var(--line)); background: color-mix(in srgb, #f79009 10%, var(--surface)); }
.tip-btn .ico { color: #f79009; }
@media (max-width: 520px) { .tip-btn .tip-label { display: none; } .tip-btn { width: 44px; padding: 0; } }
@media (prefers-color-scheme: dark) { .tip-btn { color: #fdb022; } }
.tip-hero { display: flex; gap: 14px; align-items: center; }
.tip-hero .brand-mark { width: 52px; height: 52px; flex: none; }
.tip-list { margin: 10px 0 0; padding-left: 1.2rem; display: grid; gap: 8px; }
.tips-grid .tip-card { text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; color: inherit; font: inherit; }
.tips-grid .tip-card:hover { border-color: var(--brand); }
.legend.inline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.legend.inline li { padding: 2px 0; font-size: .82rem; color: var(--muted); }
.item .track { height: 6px; margin-top: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; max-width: 320px; }
.item .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-tires), var(--brand)); border-radius: 99px; }
.amt.due { font-size: .85rem; color: var(--muted); } .amt.due.soon { color: var(--danger); }
.table-scroll { overflow-x: auto; }
.months tr.tot td { font-weight: 700; border-top: 2px solid var(--line); }
.months.detail td, .months.detail th { text-align: left; } .months.detail td:last-child, .months.detail th:last-child { text-align: right; }
.report-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
details summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.page-head h2 { font-size: 1.15rem; }
a.btn { text-decoration: none; color: inherit; }
.chart-scroll text.avg-label { font-size: 10.5px; }
.stack > .card.hidden { display: none; }

/* ---------- Stampa del report ---------- */
@media print {
  body { background: #fff; color: #000; }
  .no-print, .sidebar, .topbar, .bottom-nav, .toast { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; } .report { color: #000; }
  .kpi { box-shadow: none; } .grid.kpis { grid-template-columns: repeat(4, 1fr); }
  table { page-break-inside: auto; } tr { page-break-inside: avoid; }
}

/* ---------- Documenti, condivisione, flotta ---------- */
.file-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: .82rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.file-chip .ico { width: 16px; height: 16px; color: var(--danger); }
.file-chip:hover { border-color: var(--brand); }
.icon-btn.plain:hover { background: var(--brand-soft); color: var(--brand); }
.linklike { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-size: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: .85rem; font-weight: 500; color: var(--muted); }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.invite-card { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-soft), var(--surface)); }
select.mini { width: auto; min-height: 38px; padding: 6px 34px 6px 10px; font-size: .85rem; }
.fleet-row { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: inherit; }
.fleet-row:hover { background: var(--surface-2); }
.fleet-row .due-line { display: flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 600; }
.fleet-row .due-line .ico { width: 14px; height: 14px; }
button.chip:disabled { opacity: .5; cursor: not-allowed; }
.scan-box .row { flex: 1 1 100%; flex-wrap: wrap; }

.item { flex-wrap: wrap; } .item .body { min-width: 140px; } .item .s { overflow-wrap: anywhere; }

/* ---------- Piani, avvisi ---------- */
.banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 14px; background: #fff4e0; border: 1px solid #f9c97a; color: #7a4a05; font-size: .92rem; }
.banner .grow { flex: 1; min-width: 200px; } .banner .ico { color: #f79009; }
@media (prefers-color-scheme: dark) { .banner { background: #2f2410; border-color: #6b4b12; color: #fdd68a; } }
button.linkbadge { border: 0; cursor: pointer; font: inherit; font-size: .7rem; font-weight: 700; }
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 12px; }
.plan-card.current { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 35%, transparent), var(--shadow); }
.plan-card.featured { border-color: var(--brand); }
.plan-price { font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; }
.plan-card .ribbon { position: absolute; top: -11px; right: 16px; background: var(--brand); color: var(--on-brand); font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.plan-card .btn { margin-top: auto; }
.feat { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: .92rem; }
.feat li { display: flex; gap: 8px; align-items: flex-start; }
.feat .ico { width: 18px; height: 18px; margin-top: 2px; }
.feat li.yes .ico { color: var(--ok); } .feat li.no { color: var(--muted); } .feat li.no .ico { color: var(--muted); }
.meters { display: grid; gap: 14px; margin-top: 12px; }
@media (min-width: 700px) { .meters { grid-template-columns: 1fr 1fr; } }
.meter-top { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; margin-bottom: 4px; }
.meter .track { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter .track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.meter .track i.warnbar { background: var(--warn); } .meter .track i.full { background: var(--danger); }
dialog.upgrade { max-width: min(92vw, 480px); }

/* ---------- Statistiche, confronto, pagina pubblica ---------- */
.insights-cta { width: 100%; justify-content: flex-start; text-align: left; gap: 14px; padding: 14px 16px; height: auto; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-soft); color: var(--text); }
.insights-cta .ico { width: 26px; height: 26px; color: var(--brand); }
.insights-cta small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.check.consent { align-items: flex-start; font-size: .84rem; line-height: 1.35; }
.check.consent input { margin-top: 2px; flex: none; }
.check.consent small { display: block; color: var(--muted); margin-top: 3px; }
details.tech { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; }
details.tech summary { font-size: .92rem; }
.two-col-info { display: grid; gap: 14px; margin: 14px 0 6px; font-size: .92rem; }
@media (min-width: 700px) { .two-col-info { grid-template-columns: 1fr 1fr; } }
.cmp-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.cmp-head .good { color: var(--ok); } .cmp-head .bad { color: var(--danger); }
.cmp { position: relative; height: 14px; margin: 18px 6px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.cmp .band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--muted) 28%, transparent); border-radius: 99px; }
.cmp .mark { position: absolute; top: -5px; width: 4px; height: 22px; border-radius: 3px; transform: translateX(-50%); }
.cmp .mark.median { background: var(--muted); } .cmp .mark.me { background: var(--brand); width: 6px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.cmp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--muted); }
.cmp-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.band-dot { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.public-page { min-height: 100vh; min-height: 100dvh; }
.public-top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.wrap-pub { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.public-top .wrap-pub { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
/* le caselle da spuntare devono sembrare caselle, anche con lo stile generale dei campi */
.check input[type=checkbox] { -webkit-appearance: checkbox; appearance: auto; width: 20px; height: 20px; min-height: 0; padding: 0; border-radius: 4px; flex: none; accent-color: var(--brand); }

/* ---------- Assistente AI ---------- */
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #7c3aed); box-shadow: 0 12px 28px -8px rgba(79,70,229,.7); }
.fab .ico { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 32px; } }
.btn.rec { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 20%, transparent); } }
.item.proposal .s { white-space: normal; }
.checklist { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; font-size: .9rem; }
