@font-face {
  font-family: "InterVar";
  src: url("vendor/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.09);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.04), 0 8px 24px -12px rgba(11, 11, 11, 0.12);
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  --accent-soft: #e4eefb;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-7: #4a3aa7;
  --series-1-b: #185db0;
  --series-2-b: #db470b;
  --series-3-b: #0e845a;
  --series-7-b: #332584;
  --series-1-c: #1e24d8;
  --series-2-c: #be890a;
  --series-3-c: #1197a0;
  --series-7-c: #732fa8;
  --band: rgba(42, 120, 214, 0.14);
  --good: #0ca30c;
  --good-ink: #006300;
  --bad: #d03b3b;
  --bad-ink: #b42828;
  --warn: #fab219;
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 68px;
  --font: "InterVar", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #242422;
    --ink: #ffffff;
    --ink-2: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --accent: #3987e5;
    --accent-soft: #1b2a3d;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-7: #9085e9;
    --series-1-b: #1373e7;
    --series-2-b: #c34918;
    --series-3-b: #0e855c;
    --series-7-b: #6453e9;
    --series-1-c: #272ded;
    --series-2-c: #b18316;
    --series-3-c: #11929c;
    --series-7-c: #a353e9;
    --band: rgba(57, 135, 229, 0.2);
    --good-ink: #0ca30c;
    --bad-ink: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #242422;
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --axis: #383835;
  --border: rgba(255, 255, 255, 0.09);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --accent: #3987e5;
  --accent-soft: #1b2a3d;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-7: #9085e9;
  --series-1-b: #1373e7;
  --series-2-b: #c34918;
  --series-3-b: #0e855c;
  --series-7-b: #6453e9;
  --series-1-c: #272ded;
  --series-2-c: #b18316;
  --series-3-c: #11929c;
  --series-7-c: #a353e9;
  --band: rgba(57, 135, 229, 0.2);
  --good-ink: #0ca30c;
  --bad-ink: #e66767;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.num, table td.r, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  display: none;
  width: 240px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; font-weight: 700; letter-spacing: -0.01em; font-size: 17px; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: 0; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); text-decoration: none; font-weight: 550;
  border: 0; background: none; cursor: pointer; text-align: left; width: 100%;
}
.nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.sidebar .spacer { flex: 1; }

main { flex: 1; min-width: 0; padding: 20px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); }
.container { max-width: 1180px; margin: 0 auto; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  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: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--border);
}
.bottom-nav .nav-link {
  flex-direction: column; justify-content: center; gap: 3px;
  font-size: 11px; padding: 6px 2px; border-radius: 0; text-align: center;
}
.bottom-nav .nav-link.active { background: none; }
.bottom-nav .nav-link svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  main { padding: 32px 36px 48px; }
}

/* ---------- Header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
@media (min-width: 900px) { .page-head h1 { font-size: 30px; } }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.span-2 { grid-column: 1 / -1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  min-width: 0;
}
.card h2 { font-size: 16px; margin: 0 0 2px; letter-spacing: -0.01em; font-weight: 700; }
.card h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.card-head .sub { margin: 2px 0 0; }

.kpi { padding: 14px 16px; }
.kpi .label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .foot { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
@media (min-width: 700px) { .kpi .value { font-size: 24px; } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }

.hero { padding: 22px; }
.hero .value { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
@media (min-width: 700px) { .hero .value { font-size: 42px; } }

.delta { font-weight: 650; white-space: nowrap; }
.delta.up { color: var(--good-ink); }
.delta.down { color: var(--bad-ink); }
.delta.flat { color: var(--muted); }

/* split bar disponibili / vincolati */
.split { margin-top: 6px; }
.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface); }
.split-bar > div { height: 100%; min-width: 4px; }
.split-bar > div:first-child { border-radius: 999px 4px 4px 999px; }
.split-bar > div:last-child { border-radius: 4px 999px 999px 4px; }
.split-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.split-legend .item .t { font-size: 12.5px; color: var(--ink-2); display: flex; gap: 6px; align-items: center; font-weight: 550; }
.split-legend .item .v { font-size: 18px; font-weight: 750; letter-spacing: -0.01em; }
.split-legend .item .p { font-size: 13px; color: var(--muted); }

/* charts */
.chart-box { position: relative; width: 100%; height: 260px; }
.chart-box.tall { height: 320px; }
.chart-box.short { height: 200px; }
@media (min-width: 900px) { .chart-box { height: 290px; } .chart-box.tall { height: 360px; } }
/* Barre finte per le anteprime Premium (numeri di esempio, non dati veri dell'utente) */
.fake-bars { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding-top: 10px; }
.fake-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.fake-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 0 0; background: var(--accent); opacity: .55; }
.fake-bar-col span { font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; }
.legend i.dash { height: 0; border-top: 3px dashed; background: none !important; width: 16px; }
.legend i.band { opacity: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 10px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th.r, td.r { text-align: right; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
tfoot td { font-weight: 700; border-top: 1px solid var(--axis); border-bottom: 0; }

/* ---------- Forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  text-decoration: none; min-height: 42px; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad-ink); }
.btn.ghost { background: none; border-color: transparent; }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: 13px; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }
.icon-btn { width: 36px; height: 36px; padding: 0; min-height: 0; border-radius: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label, .field .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.pw-wrap { position: relative; display: flex; }
.pw-wrap .input { padding-right: 42px; }
.pw-eye { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 38px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--muted); border-radius: 9px; cursor: pointer; }
.pw-eye:hover, .pw-eye:focus-visible { color: var(--ink); background: var(--surface-3, rgba(0,0,0,.06)); }
.pw-eye svg { width: 20px; height: 20px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2);
  outline: none; min-height: 42px; transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-euro { position: relative; }
.input-euro .input { padding-right: 32px; text-align: right; font-variant-numeric: tabular-nums; }
.input-euro::after { content: "€"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-pct .input { padding-right: 32px; text-align: right; }
.input-pct { position: relative; }
.input-pct::after { content: "%"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (min-width: 700px) { .form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.big-input .input { font-size: 26px; font-weight: 750; min-height: 58px; letter-spacing: -0.02em; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 10px 0 0; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 11px; padding: 3px; gap: 2px; border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; font-size: 14px; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--axis); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* expense rows */
.rows { display: flex; flex-direction: column; gap: 8px; }
.row-line { display: grid; grid-template-columns: minmax(0, 1fr) 118px 36px; gap: 8px; align-items: center; }
.row-line.acc { grid-template-columns: minmax(0, 1fr) 128px 36px; }
.row-total { display: flex; justify-content: space-between; padding: 10px 2px 0; font-weight: 700; border-top: 1px solid var(--grid); margin-top: 6px; }

/* list items */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--grid); }
.list-item:last-child { border-bottom: 0; }
.list-item .main { min-width: 0; }
.list-item .main .t { font-weight: 600; }
.list-item .main .s { font-size: 12.5px; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.disp { background: color-mix(in srgb, var(--series-1) 14%, transparent); color: var(--series-1); }
.pill.vinc { background: color-mix(in srgb, var(--series-2) 16%, transparent); color: var(--series-2); }

.note { font-size: 13px; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.note strong { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.stack > * + * { margin-top: 14px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; font-size: 14px; }
.kv .k { color: var(--ink-2); }
.kv .v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.kv .sep { grid-column: 1 / -1; border-top: 1px solid var(--grid); margin: 2px 0; }
.kv .strong { font-weight: 800; color: var(--ink); }

.empty { text-align: center; padding: 42px 20px; }
.empty .ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h2 { margin: 0 0 6px; }
.empty p { color: var(--ink-2); margin: 0 auto 16px; max-width: 420px; }

/* ---------- Dialog ---------- */
dialog {
  border: 0; padding: 0; background: var(--surface); color: var(--ink);
  border-radius: 22px; width: min(640px, calc(100vw - 20px)); max-height: calc(100dvh - 24px);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.45);
}
dialog::backdrop { background: rgba(10, 10, 10, 0.45); backdrop-filter: blur(3px); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg-head { padding: 18px 20px 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--grid); }
.dlg-head h2 { margin: 0; font-size: 18px; }
.dlg-err { margin: 12px 20px 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad-ink); font-weight: 650; font-size: 14px; }
.dlg-err:empty, .dlg-err[hidden] { display: none; }
.dlg-body { padding: 16px 20px; overflow-y: auto; }
.dlg-foot { padding: 12px 20px 18px; border-top: 1px solid var(--grid); display: flex; gap: 8px; justify-content: space-between; flex-wrap: wrap; }
@media (max-width: 600px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 22px 22px 0 0; max-height: 92dvh; }
  .dlg { max-height: 92dvh; }
  .dlg-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
.group-title { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; margin: 16px 0 8px; }
.group-title:first-child { margin-top: 0; }
.live-total { position: sticky; bottom: -16px; background: var(--surface); padding: 12px 0 2px; border-top: 1px solid var(--grid); margin-top: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.live-total div { font-size: 12px; color: var(--muted); }
.live-total b { display: block; font-size: 15px; color: var(--ink); }

.toast { position: fixed; left: 50%; transform: translateX(-50%) translateY(20px); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .25s; z-index: 100; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 30; border-radius: 16px; box-shadow: 0 10px 24px -8px rgba(42,120,214,.6); min-height: 52px; padding: 0 18px; }
@media (min-width: 900px) { .fab { display: none; } }
.desktop-only { display: none; }
@media (min-width: 900px) { .desktop-only { display: inline-flex; } }

details.box { border: 1px solid var(--border); border-radius: 14px; padding: 0 14px; background: var(--surface); }
details.box > summary { cursor: pointer; padding: 12px 0; font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::after { content: "+"; font-size: 20px; color: var(--muted); font-weight: 400; }
details.box[open] > summary::after { content: "−"; }
details.box > div { padding-bottom: 14px; }

.method ol { padding-left: 18px; margin: 8px 0 0; }
.method li { margin-bottom: 6px; color: var(--ink-2); font-size: 13.5px; }
.range-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

.only-mob { display: flex; }
.only-desk { display: none; }
@media (min-width: 700px) { .only-mob { display: none; } .only-desk { display: block; } }
.list-item.clickable { cursor: pointer; }
.list-item .s { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.live-total small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
@media (max-width: 600px) {
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
  .live-total b { font-size: 14px; }
}

/* ---------- v2: blocco, assistente, fisco, modulo mese ---------- */
#appRoot { transition: filter .35s ease; }
#appRoot.blurred { filter: blur(18px) saturate(.9); pointer-events: none; user-select: none; }
.lock { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--page) 35%, transparent); }
.lock[hidden] { display: none; }
.lock-card { width: min(360px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); padding: 26px 22px 20px; text-align: center; }
.lock-logo { width: 52px; height: 52px; border-radius: 14px; }
.lock-card h2 { margin: 12px 0 4px; font-size: 19px; letter-spacing: -0.01em; }
.lock-sub { margin: 0; color: var(--ink-2); font-size: 14px; min-height: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 20px 0 18px; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--axis); transition: all .15s; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.pin-dots.shake { animation: shake .4s; }
.pin-dots.shake i { border-color: var(--bad); }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { height: 58px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); font-size: 22px; font-weight: 600; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.keypad button:active { background: var(--accent-soft); transform: scale(.97); }
.keypad .kp-ghost { background: none; border-color: transparent; font-size: 15px; color: var(--ink-2); }
.keypad .kp-ghost[data-key="del"] { font-size: 22px; }
.linkbtn { margin-top: 14px; background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 13.5px; }
.head-lock { display: inline-flex; }
@media (min-width: 900px) { .head-lock { display: none; } }
.page-head .actions { align-items: center; }

.ai-card { background: linear-gradient(160deg, color-mix(in srgb, var(--series-7) 7%, var(--surface)), var(--surface) 55%); }
.ai-card h2 { display: flex; align-items: center; gap: 8px; }
.ai-card h2 svg, .card h2 svg { width: 19px; height: 19px; color: var(--series-7); flex-shrink: 0; }
.insights { margin: 4px 0 0; padding-left: 18px; }
.insights li { margin-bottom: 8px; color: var(--ink-2); font-size: 14px; }
.checks { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.check { font-size: 12.5px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); }
.check.ok { color: var(--good-ink); }
.check.ko { color: var(--bad-ink); }

.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.ex-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 110px 36px; gap: 8px; align-items: center; }
@media (max-width: 600px) { .ex-row { grid-template-columns: minmax(0, 1fr) 104px 36px; } .ex-row [data-exk="cat"] { grid-column: 1 / 2; grid-row: 2; } .ex-row { row-gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--grid); } }
.acc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.acc-row.archived .input { opacity: .55; }
@media (max-width: 600px) { .acc-row { grid-template-columns: minmax(0, 1fr) auto; } .acc-row select { grid-column: 1 / 2; grid-row: 2; } .acc-row { padding-bottom: 8px; border-bottom: 1px solid var(--grid); } }
.opt-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.opt-head .sub { margin: 2px 0 0; }
.opt-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.opt-ico svg { width: 20px; height: 20px; }
.steps { padding-left: 18px; margin: 0 0 12px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.add-acc > summary { font-size: 14px; }
details.box > summary { gap: 8px; }
.bottom-nav { grid-template-columns: repeat(5, 1fr); }
.bottom-nav .nav-link { font-size: 10.5px; }
.bottom-nav .nav-link svg { width: 21px; height: 21px; }
@media (max-width: 899px) {
  .page-head { position: relative; padding-right: 44px; }
  .page-head .head-lock { position: absolute; top: 0; right: 0; }
}

/* ================= Dividi Spesa ================= */
:root { --accent: #13815f; --accent-soft: #e0f2ea; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-8: #e34948; --gray-cat: #9a988f;--series-4-b: #b57b00; --series-5-b: #e84381; --series-6-b: #004b00; --series-8-b: #dc1817; --gray-cat-b: #888369; --series-4-c: #879600; --series-5-c: #ea5952; --series-6-c: #007933; --series-8-c: #dc6b17; --gray-cat-c: #89916f; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) { --accent: #1baf7a; --accent-soft: #143328; --accent-ink: #06140e; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-8: #e66767; --gray-cat: #75736c;--series-4-b: #a56d00; --series-5-b: #d82a69; --series-6-b: #005f00; --series-8-b: #e94040; --gray-cat-b: #6a6553; --series-4-c: #859100; --series-5-c: #dc4940; --series-6-c: #007933; --series-8-c: #dd6b19; --gray-cat-c: #73785f; } }
:root[data-theme="dark"] { --accent: #1baf7a; --accent-soft: #143328; --accent-ink: #06140e; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-8: #e66767; --gray-cat: #75736c;--series-4-b: #a56d00; --series-5-b: #d82a69; --series-6-b: #005f00; --series-8-b: #e94040; --gray-cat-b: #6a6553; --series-4-c: #859100; --series-5-c: #dc4940; --series-6-c: #007933; --series-8-c: #dd6b19; --gray-cat-c: #73785f; }
.bottom-nav { grid-template-columns: repeat(5, 1fr); }
.bottom-nav .nav-link { font-size: 11px; }
.fab { box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }

/* calendario */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { font-size: 20px; margin: 0; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-day { position: relative; min-height: 58px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); padding: 5px 4px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 3px; font: inherit; color: inherit; }
.cal-day:hover { border-color: var(--axis); }
.cal-day.out { opacity: .35; }
.cal-day.today .n { background: var(--ink); color: var(--surface); }
.cal-day.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--surface); }
.cal-day .n { font-size: 12px; font-weight: 700; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal-day .amt { font-size: 10.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.cal-day .dots { display: flex; gap: 2px; flex-wrap: wrap; }
.cal-day .dots i { width: 6px; height: 6px; border-radius: 50%; }
@media (min-width: 700px) { .cal-day { min-height: 76px; padding: 7px; } .cal-day .amt { font-size: 12px; } }

.all-exp-list { max-height: 440px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.exp-day-sep { position: sticky; top: 0; background: var(--surface); z-index: 1; padding: 7px 0 5px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--axis); }
.exp-day-sep:first-child { margin-top: 0; }
.exp-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); cursor: pointer; }
.exp-item:last-child { border-bottom: 0; }
.exp-item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.exp-item .ic svg { width: 20px; height: 20px; }
.exp-item .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-item .s { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-item .a { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.exp-item .a small { display: block; font-weight: 500; font-size: 11.5px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.chip svg { width: 16px; height: 16px; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; }
.chip.on .sw { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.split-prev { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14px; color: var(--ink); }
.split-prev b { font-variant-numeric: tabular-nums; }

.settle { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; background: var(--accent-soft); }
.settle .big { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.settle .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }
.settle .ico svg { width: 22px; height: 22px; }
.settle.even { background: var(--surface-2); }
.settle.even .ico { background: var(--muted); }

.member-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.member-row:last-child { border-bottom: 0; }
.member-row .dot { width: 12px; height: 12px; }
.member-row .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.member-row .b { font-size: 12.5px; text-align: right; min-width: 88px; }

.fx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--grid); }
.fx-row:last-child { border-bottom: 0; }
.fx-row .t { font-weight: 650; }
.fx-row .s { font-size: 12.5px; color: var(--muted); }
.fx-row.pending .t::after { content: "da confermare"; margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--series-4); }
.fx-row.removed { opacity: .5; }
.fx-row.removed .t { text-decoration: line-through; }
.fx-actions { display: flex; gap: 6px; align-items: center; }

.wizard { max-width: 560px; margin: 0 auto; }
.wiz-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.wiz-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--grid); }
.wiz-steps i.on { background: var(--accent); }
.wiz-card h1 { font-size: 26px; letter-spacing: -0.02em; margin: 6px 0 6px; }
.wiz-card p.lead { color: var(--ink-2); margin: 0 0 18px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; font-size: 24px; font-weight: 600; }
.stepper .n { font-size: 40px; font-weight: 800; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.choice { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; width: 100%; color: inherit; font: inherit; }
.choice:hover { border-color: var(--accent); }
.choice .ci { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.choice .ci svg { width: 22px; height: 22px; }
.choice b { display: block; font-size: 15.5px; margin-bottom: 2px; }
.choice span { font-size: 13.5px; color: var(--ink-2); }

.sync-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.sync-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sync-pill.ok i { background: var(--good); }
.sync-pill.wait i { background: var(--warn); }
.sync-pill.err i { background: var(--bad); }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; background: var(--surface-2); border-radius: 12px; padding: 12px; border: 1px dashed var(--axis); user-select: all; }
.pie-legend { display: flex; flex-direction: column; gap: 8px; }
.pie-legend .row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 14px; }
.pie-legend .row i { width: 12px; height: 12px; border-radius: 3px; }
.pie-legend .row .v { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.pie-legend .row .p { color: var(--muted); font-size: 12.5px; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.forecast-card .value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.head-sync { display: inline-flex; }
@media (max-width: 899px) { .page-head { position: relative; } }
.page-head { padding-right: 0 !important; }
.only-mob-inline { display: inline-flex; }
@media (min-width: 900px) { .only-mob-inline { display: none; } }
body.wiz .sidebar, body.wiz .bottom-nav { display: none !important; }
body.wiz main { padding-bottom: 40px; }
body.wiz .wizard { padding-top: 12px; }
@media (min-width: 900px) { body.wiz .wizard { padding-top: 48px; } }
.cal-head h1 { font-size: 22px; }
@media (min-width: 900px) { .cal-head h1 { font-size: 28px; } }
@supports (padding: env(safe-area-inset-top)) { main { padding-top: max(20px, env(safe-area-inset-top)); } }

.exp-item .edit-hint svg { width: 13px; height: 13px; color: var(--muted); vertical-align: -1px; margin-left: 2px; }
.exp-item:active { background: var(--surface-2); }

.about { margin: 0 0 14px; border-left: 4px solid var(--accent); }
.about h2 { margin: 0 0 8px; font-size: 20px; }
.about p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.55; }
.about p:last-child { margin-bottom: 0; }
.about-pledge { background: var(--accent-soft, rgba(19,129,95,.1)); border-radius: 10px; padding: 10px 12px; color: var(--ink) !important; }

.credits { max-width: 880px; margin: 28px auto 0; padding: 16px 4px 0; border-top: 1px solid var(--line, rgba(128,128,128,.25)); text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.credits p { margin: 0 0 4px; }
.credits a { color: inherit; text-decoration: underline; }

#installBar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h, 64px) + 12px + env(safe-area-inset-bottom)); z-index: 40; display: flex; gap: 12px; align-items: center; background: var(--surface, #fff); color: var(--ink); border: 1px solid var(--line, rgba(128,128,128,.3)); border-radius: 16px; padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.22); max-width: 560px; margin: 0 auto; }
#installBar img { border-radius: 10px; flex: none; }
#installBar .ib-t { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13.5px; line-height: 1.4; }
#installBar .ib-t span { color: var(--ink-2, var(--muted)); }
#installBar .ib-a { display: grid; gap: 6px; flex: none; }
#installBar .ib-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
#installBar .ib-step { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
#installBar .ib-arrow { color: var(--muted); font-size: 13px; }
body.wiz #installBar { bottom: 12px; }
@media (min-width: 900px) { #installBar { bottom: 16px; left: auto; right: 16px; margin: 0; } }

/* Account */
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex: none; }
.avatar.big { width: 52px; height: 52px; font-size: 21px; }
.avatar-btn { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border-radius: 50%; text-decoration: none; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 0 12px; border-radius: 12px; border: 1px solid var(--line, rgba(128,128,128,.25)); text-decoration: none; color: inherit; }
.user-chip:hover, .user-chip.active { background: var(--accent-soft, rgba(19,129,95,.1)); }
.user-chip b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.danger-zone { border-color: var(--bad-ink, #b3261e); }
.danger-zone > h2 { color: var(--bad-ink, #b3261e); }
.avatar.light { background: var(--accent-soft); color: var(--accent); border: 2px solid var(--accent); width: 38px; height: 38px; }
.profile-link { align-items: center; gap: 8px; padding: 3px 12px 3px 3px; min-height: 44px; border-radius: 999px; border: 1px solid var(--line, rgba(128,128,128,.3)); background: var(--surface, transparent); text-decoration: none; color: var(--ink); font-weight: 650; font-size: 13.5px; }
.profile-link:hover, .profile-link:focus-visible { border-color: var(--accent); }
.profile-label { white-space: nowrap; }
.user-chip .chev { margin-left: auto; color: var(--muted); font-size: 20px; line-height: 1; }
#appVer { white-space: nowrap; opacity: .85; }

/* v2.8: il tasto Spesa sparisce quando si arriva al piè di pagina */
.fab { transition: opacity .18s ease, transform .18s ease; }
.fab.fab-off { opacity: 0; transform: translateY(12px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .fab { transition: none; } }

/* v2.9: corona Premium, tasti "Passa a Premium", stato attivo */
.av-wrap { position: relative; display: inline-flex; flex: none; }
.crown { position: absolute; top: -12px; left: 50%; width: 20px; height: 20px; transform: translateX(-50%) rotate(-8deg); z-index: 2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); pointer-events: none; }
.avatar.big + .crown, .av-wrap:has(.avatar.big) .crown { width: 26px; height: 26px; top: -16px; }
.profile-link { display: inline-flex; }
.profile-wrap { flex-direction: column; align-items: stretch; gap: 6px; }
.premium-link { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 6px 22px 6px 16px; border-radius: 999px; background: linear-gradient(135deg, #ffd95a 0%, #f5b800 55%, #e09b00 100%); color: #3b2600; border: 1px solid #c98a00; font-weight: 750; font-size: 13.5px; text-decoration: none; white-space: nowrap; box-shadow: 0 1px 2px rgba(120,80,0,.25); }
.premium-link:hover, .premium-link:focus-visible { filter: brightness(1.06); }
.premium-link .crown { position: absolute; top: -11px; right: -6px; left: auto; width: 22px; height: 22px; transform: rotate(12deg); }
.premium-side { display: flex; width: 100%; margin: 0 0 14px; border-radius: 12px; }
.prem-ok { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft, rgba(19,129,95,.1)); border: 1px solid var(--accent); margin-bottom: 12px; }
.prem-ok .crown { position: static; transform: none; width: 30px; height: 30px; flex: none; filter: none; }
.prem-ok p { margin: 4px 0 0; font-size: 13.5px; }
.prem-more { margin-top: 4px; }
.prem-more summary { cursor: pointer; font-weight: 650; font-size: 14px; min-height: 40px; display: flex; align-items: center; }

/* v2.9: avviso di scadenza */
.exp-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px; background: var(--accent-soft, rgba(19,129,95,.1)); border: 1px solid var(--accent); }
.exp-banner p { margin: 0; flex: 1; min-width: 200px; font-size: 14px; }
.exp-banner .premium-link { flex: none; }
.prem-more summary.btn { list-style: none; width: 100%; justify-content: center; text-align: center; }
.prem-more summary.btn::-webkit-details-marker { display: none; }
.card { scroll-margin-top: 12px; }

/* v2.11: lucchetti Premium e tabella dei piani */
.lock-ico { width: 14px; height: 14px; flex: none; }
.lock-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 9px 2px 7px; border-radius: 999px; background: linear-gradient(135deg, #ffd95a, #f5b800); color: #3b2600; border: 1px solid #c98a00; font-size: 11.5px; font-weight: 750; line-height: 1.5; vertical-align: middle; white-space: nowrap; }
.lock-badge .lock-ico { width: 12px; height: 12px; }
h1 .lock-badge, h2 .lock-badge { font-size: 12px; }
.nav-ico { position: relative; display: inline-flex; }
.lock-mini { position: absolute; top: -5px; right: -9px; display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: #f5b800; color: #3b2600; border: 1px solid #c98a00; }
.nav-link .lock-mini .lock-ico, .bottom-nav .nav-link .lock-mini .lock-ico { width: 9px; height: 9px; }
.sidebar .nav-link .lock-badge { margin-left: auto; font-size: 10.5px; padding: 1px 7px 1px 5px; }
.sidebar .nav-link .lock-badge .lock-ico { width: 11px; height: 11px; }
.btn .lock-ico { width: 16px; height: 16px; }

.plan-table { margin-top: 18px; border: 1px solid var(--line, rgba(128,128,128,.25)); border-radius: 14px; overflow: hidden; }
.pt-row { display: grid; grid-template-columns: minmax(0, 1fr) 86px 108px; align-items: center; }
.pt-row + .pt-row { border-top: 1px solid var(--line, rgba(128,128,128,.2)); }
.pt-l { padding: 11px 12px; font-size: 14px; overflow-wrap: anywhere; }
.pt-c { padding: 11px 6px; text-align: center; font-size: 14px; font-weight: 650; display: flex; align-items: center; justify-content: center; align-self: stretch; }
.pt-p { background: rgba(245, 184, 0, .13); border-left: 1px solid rgba(201, 138, 0, .35); }
.pt-head .pt-c { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; padding-top: 14px; padding-bottom: 12px; }
.pt-head .pt-p { position: relative; color: #8a5a00; }
.pt-head .pt-p .crown { position: static; transform: none; width: 18px; height: 18px; margin-right: 4px; filter: none; }
.pt-yes { color: var(--accent); font-size: 18px; font-weight: 800; }
.pt-no { color: var(--muted); display: inline-flex; opacity: .75; }
.pt-no .lock-ico { width: 15px; height: 15px; }
.pt-foot .pt-l { padding-top: 14px; padding-bottom: 14px; }
.pt-foot .pt-c { padding: 14px 6px; }
.pt-foot .premium-link { padding: 6px 20px 6px 10px; min-height: 40px; font-size: 12.5px; white-space: normal; text-align: center; line-height: 1.2; }
.pt-foot .premium-link .crown { top: -12px; right: -5px; }
@media (min-width: 560px) { .pt-row { grid-template-columns: minmax(0, 1fr) 100px 150px; } .pt-foot .premium-link { font-size: 13.5px; } }

/* v2.13: pagina di benvenuto (landing) */
.returning #landing { display: none; }
/* Chi torna non vede la landing: finché l'app non ha finito di avviarsi, mostra questo invece di una pagina vuota (sopra il footer). render() lo sovrascrive appena pronto. */
.boot-loader { display: none; }
.returning .boot-loader { display: flex; align-items: center; justify-content: center; min-height: min(60vh, 420px); }
.boot-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--grid); border-top-color: var(--accent); animation: boot-spin 0.8s linear infinite; }
@keyframes boot-spin { to { transform: rotate(360deg); } }
.wiz-card h2.wiz-title { font-size: 26px; letter-spacing: -0.02em; margin: 6px 0 6px; }
.landing { max-width: 1040px; margin: 0 auto; padding-bottom: 8px; }
.lp-hero { display: grid; gap: 22px; align-items: center; padding: 8px 0 8px; }
.lp-eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 750; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.lp-hero h1 { margin: 0 0 12px; font-size: clamp(28px, 7.4vw, 46px); line-height: 1.08; letter-spacing: -0.025em; }
.lp-lead { margin: 0 0 18px; font-size: clamp(16px, 4.2vw, 19px); line-height: 1.5; color: var(--ink-2); }
.lp-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.lp-btn { min-height: 48px; padding: 0 22px; font-size: 16px; justify-content: center; flex: 1 1 200px; }
.lp-note { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.lp-chips { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lp-chips li { padding: 6px 12px; border-radius: 999px; background: var(--accent-soft, rgba(19,129,95,.1)); color: var(--accent); font-size: 13px; font-weight: 650; }
.lp-hero-img img { display: block; width: 100%; height: auto; border-radius: 20px; box-shadow: 0 14px 40px rgba(0,0,0,.18); background: var(--surface-2, #eee); }
.lp-sec { margin: 40px 0 0; }
.lp-sec h2, .lp-final h2 { margin: 0 0 16px; font-size: clamp(22px, 5.5vw, 30px); line-height: 1.15; letter-spacing: -0.02em; }
.lp-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lp-steps li { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line, rgba(128,128,128,.22)); }
.lp-steps p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.lp-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink, #fff); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.lp-grid { display: grid; gap: 12px; }
.lp-card { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line, rgba(128,128,128,.22)); }
.lp-card h3 { margin: 0 0 6px; font-size: 17px; }
.lp-card p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.lp-plans { display: grid; gap: 12px; }
.lp-plan { padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line, rgba(128,128,128,.22)); }
.lp-plan-pro { border-color: #c98a00; background: linear-gradient(180deg, rgba(245,184,0,.14), var(--surface) 70%); }
.lp-plan h3 { margin: 0; font-size: 18px; }
.lp-price { margin: 6px 0 10px; font-size: 24px; font-weight: 800; }
.lp-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.lp-or { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 4px; }
.lp-plan ul { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.lp-faq { display: grid; gap: 8px; }
.lp-faq details { border-radius: 14px; background: var(--surface); border: 1px solid var(--line, rgba(128,128,128,.22)); padding: 0 16px; }
.lp-faq summary { cursor: pointer; padding: 15px 0; font-weight: 650; font-size: 16px; min-height: 48px; display: flex; align-items: center; }
.lp-faq details[open] summary { color: var(--accent); }
.lp-faq p { margin: 0 0 15px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.lp-final { margin: 40px 0 28px; padding: 28px 20px; text-align: center; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #0a63ff 0%, #08a6d8 55%, #2fd08a 100%); }
.lp-final h2 { color: #fff; margin-bottom: 8px; }
.lp-final p { margin: 0 0 16px; opacity: .95; }
.lp-final .btn { background: #fff; color: #0b3d6b; border-color: #fff; max-width: 320px; width: 100%; flex: none; }
@media (min-width: 760px) {
  .lp-hero { grid-template-columns: 1.05fr 1fr; gap: 36px; padding-top: 24px; }
  .lp-btn { flex: 0 0 auto; }
  .lp-steps { grid-template-columns: repeat(3, 1fr); }
  .lp-steps li { flex-direction: column; }
  .lp-grid { grid-template-columns: repeat(3, 1fr); }
  .lp-plans { grid-template-columns: 1fr 1fr; }
  .lp-faq { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Assegni e contributi, valute */
.exp-item .a.pos { color: var(--good-ink); }
.neg { color: var(--bad-ink); font-weight: 650; }
.inc-grid { display: grid; gap: 8px; margin-top: 10px; }
.inc-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) minmax(120px, 150px); gap: 10px; align-items: center; font-weight: 600; }
.inc-row .input-euro .input { min-height: 44px; }
.input-euro[data-sym] .input { padding-right: 52px; }
.input-euro[data-sym]::after { content: attr(data-sym); font-size: 13px; font-weight: 650; }
.cur-lock { justify-self: start; }
.cur-lock .lock-ico { width: 14px; height: 14px; }
.cur-box { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); display: grid; gap: 8px; }
.cur-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 650; }
.cur-line .input { width: 120px; min-height: 44px; text-align: right; }
.cur-conv { font-size: 14px; }
@media (max-width: 420px) { .inc-row { grid-template-columns: 10px minmax(0, 1fr) 118px; } }

/* v2.16: anteprime grafiche in landing */
.lp-shots { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 4px 2px 14px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.lp-shots::-webkit-scrollbar { display: none; }
.lp-shot { margin: 0; flex: 0 0 72%; max-width: 300px; scroll-snap-align: center; display: flex; flex-direction: column; gap: 12px; }
.lp-phone { border-radius: 30px; border: 7px solid #1c1c1e; background: #1c1c1e; box-shadow: 0 14px 34px rgba(0,0,0,.22); overflow: hidden; }
.lp-phone img { display: block; width: 100%; height: auto; border-radius: 22px; background: var(--surface-2, #eee); }
.lp-shot figcaption { display: grid; gap: 4px; text-align: center; padding: 0 4px; }
.lp-shot figcaption b { font-size: 16px; line-height: 1.25; }
.lp-shot figcaption span { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.lp-shots-note { margin: 2px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }
@media (min-width: 760px) {
  .lp-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; overflow: visible; margin: 0; padding: 4px 0 8px; }
  .lp-shot { flex: none; max-width: none; padding: 0 8px; }
}

/* v2.17: scheda Assegni e contributi accanto a "Chi deve a chi" (PC) e subito prima (mobile) */
.inc-title { display: flex; align-items: center; gap: 10px; }
.inc-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--series-2) 16%, transparent); color: var(--series-2); }
.inc-ic svg { width: 22px; height: 22px; }
@media (min-width: 700px) {
  #calCard { order: 1; } #dayCard { order: 2; } #settleCard { order: 3; } #incCard { order: 4; align-self: start; } #fixCard { order: 5; }
}

/* v2.18: scheda amministratore (codici Premium) */
.adm-form { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .adm-form { grid-template-columns: 2fr 1fr 2fr; align-items: end; } }
.adm-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line, rgba(128,128,128,.2)); }
.adm-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; letter-spacing: .04em; overflow-wrap: anywhere; }
.adm-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.adm-st { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.adm-st.free { background: rgba(19,129,95,.14); color: var(--accent); }
.adm-st.wait { background: rgba(245,184,0,.2); color: #8a5a00; }
.adm-st.used { background: rgba(128,128,128,.16); color: var(--muted); }

/* Lingue */
html.i18n-wait #view,html.i18n-wait .sidebar,html.i18n-wait .bottom-nav,html.i18n-wait .credits{visibility:hidden}
.lp-top{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-wrap:wrap;margin:0 0 14px}
.lp-top-l{font-size:13px;color:var(--muted)}
.lp-langs{display:flex;flex-wrap:wrap;gap:6px}

/* Invito a partire e notifiche */
.start-card{border:1.5px solid color-mix(in srgb,var(--accent) 45%,transparent);background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 7%,var(--surface)),var(--surface));margin-bottom:16px}
.start-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.start-head h2{margin:0 0 4px;font-size:19px}
.start-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.start-steps{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:8px}
.start-steps li{display:flex;align-items:center;gap:10px;font-size:14px}
.start-steps .st-t{flex:1;min-width:0}
.start-steps .st-ic{flex:0 0 22px;height:22px;border-radius:50%;border:2px solid var(--axis);display:grid;place-items:center}
.start-steps li.done .st-ic{background:var(--good);border-color:var(--good);color:#fff}
.start-steps li.done .st-ic svg{width:14px;height:14px}
.start-steps li.done .st-t{color:var(--muted);text-decoration:line-through}
.push-ask{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:16px;padding:14px 16px}
.push-ic{flex:0 0 40px;height:40px;border-radius:12px;background:var(--accent-soft);color:var(--accent);display:grid;place-items:center}
.push-ic svg{width:22px;height:22px}
.push-btns{display:flex;gap:8px;margin-left:auto}
@media (max-width:520px){.push-btns{width:100%;margin-left:0}.push-btns .btn{flex:1}}
.push-opts{display:grid;gap:10px;margin-top:14px}
@keyframes fabPulse{0%,100%{box-shadow:0 10px 24px -8px color-mix(in srgb,var(--accent) 70%,transparent),0 0 0 0 color-mix(in srgb,var(--accent) 45%,transparent)}60%{box-shadow:0 10px 24px -8px color-mix(in srgb,var(--accent) 70%,transparent),0 0 0 14px transparent}}
body.no-exp .fab{animation:fabPulse 2.2s ease-out infinite}
@media (prefers-reduced-motion:reduce){body.no-exp .fab{animation:none}}

@media (min-width: 1100px) { .lp-shots { grid-template-columns: repeat(4, 1fr); gap: 20px; } }
/* Perché sceglierla: schede con icona */
.lp-card { position: relative; display: flex; flex-direction: column; gap: 4px; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.lp-card::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--accent)); opacity: .85; }
.lp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lp-ic { --c: var(--accent); width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.lp-ic svg { width: 24px; height: 24px; }
.lp-grid > .lp-card:nth-child(6n+1) { --c: var(--series-1); }
.lp-grid > .lp-card:nth-child(6n+2) { --c: var(--series-3); }
.lp-grid > .lp-card:nth-child(6n+3) { --c: var(--series-2); }
.lp-grid > .lp-card:nth-child(6n+4) { --c: var(--series-7); }
.lp-grid > .lp-card:nth-child(6n+5) { --c: var(--series-6); }
.lp-grid > .lp-card:nth-child(6n) { --c: var(--series-8); }
.lp-grid > .lp-card .lp-ic { --c: inherit; }
@media (prefers-reduced-motion: reduce) { .lp-card { transition: none; } .lp-card:hover { transform: none; } }
.btn.wrap{white-space:normal;max-width:100%;height:auto;min-height:44px;text-align:center;line-height:1.25;padding-top:8px;padding-bottom:8px}

/* Statistiche: banner di scelta e cruscotto amministratore */
.consent{position:fixed;left:12px;right:12px;bottom:calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));z-index:90;max-width:720px;margin:0 auto;max-height:calc(100vh - var(--nav-h) - 28px);overflow:auto}
.consent[hidden]{display:none}
.consent-in{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;background:var(--surface);color:var(--ink);border:1px solid var(--axis);border-radius:16px;box-shadow:var(--shadow);padding:14px 16px}
.consent-tx{flex:1 1 240px;min-width:0}
.consent-tx p{margin:4px 0 0;font-size:14px;line-height:1.45}
.consent-btns{display:flex;gap:8px;width:100%}
.consent-btns .btn{flex:1}
@media (min-width:900px){.consent{left:auto;right:20px;bottom:20px;max-width:560px;margin:0}}
.st-kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin:12px 0}
.st-tile{background:var(--surface-2);border-radius:12px;padding:10px 12px;display:flex;flex-direction:column;gap:2px;min-width:0}
.st-tile b{font-size:22px;line-height:1.1}
.st-tile span{font-size:13px;color:var(--ink-2)}
.st-tile small{font-size:11px;color:var(--muted)}
.st-h{margin:18px 0 8px;font-size:15px}
.st-nav{display:flex;align-items:center;justify-content:center;gap:14px;margin:6px 0}
.st-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:4px}
.st-cal>span:not(.st-c){font-size:11px;color:var(--muted);text-align:center}
.st-c{position:relative;min-height:48px;border-radius:8px;background:var(--surface-2);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px}
.st-c.off{background:transparent}
.st-c.today{outline:2px solid var(--accent)}
.st-c i{position:absolute;top:2px;left:4px;font-size:10px;color:var(--muted);font-style:normal}
.st-c b{font-size:15px}
.st-c em{font-size:10px;color:var(--good-ink);font-style:normal;line-height:1}
.st-year{display:flex;align-items:stretch;gap:6px;height:170px}
.st-col{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:2px}
.st-bw{flex:1;width:100%;display:flex;align-items:flex-end}
.st-bw i{display:block;width:100%;background:var(--accent);border-radius:4px 4px 0 0;min-height:2px}
.st-col b{font-size:11px;min-height:14px}
.st-col span{font-size:10px;color:var(--muted)}
.st-col em{font-size:10px;color:var(--good-ink);font-style:normal;min-height:12px}
.st-30{gap:2px}.st-30 .st-col span{font-size:9px}
.st-bars{display:grid;gap:8px}
.st-bar{display:grid;grid-template-columns:minmax(90px,30%) 1fr auto;gap:8px;align-items:center;font-size:13px}
.st-bt{background:var(--surface-2);border-radius:6px;height:10px;overflow:hidden}
.st-bt i{display:block;height:100%;background:var(--accent)}
.st-bv{color:var(--ink-2);font-size:12px;white-space:nowrap}
@media (max-width:520px){.st-bar{grid-template-columns:1fr auto}.st-bar .st-bt{grid-column:1/-1;order:3}}

.st-delta{font-size:11px;font-weight:600;margin-top:2px}
.st-delta.up{color:var(--good-ink)}
.st-delta.down{color:var(--bad-ink)}
.st-delta.flat{color:var(--muted);font-weight:400}
.st-custom{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
.st-custom label{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--ink-2)}
.st-custom input[type="date"]{font:inherit;color:var(--ink);background:var(--surface-2);border:1px solid var(--axis);border-radius:8px;padding:5px 8px}
.st-members{grid-template-columns:repeat(2,1fr)}
.st-big{background:var(--accent-soft)}
.st-big b{font-size:28px}
@media (min-width:700px){.st-members{grid-template-columns:repeat(4,1fr)}}

.st-ch{display:grid;grid-template-columns:1.3fr repeat(4,1fr);gap:6px;padding:7px 4px;border-bottom:1px solid var(--axis);font-size:13px;text-align:right}
.st-ch span:first-child{text-align:left}
.st-chh{font-size:11px;color:var(--muted);font-weight:600}

/* Risparmi personali: su PC è una pagina a parte (menu a sinistra), su telefono sta sotto "Conti e risparmi" */
.pill.vinc svg.lock-ico { width: 12px; height: 12px; vertical-align: -1px; }
.mine-in { width: 88px; text-align: right; min-height: 36px; padding: 4px 8px; }
@media (max-width: 600px) { .mine-in { width: 74px; padding: 4px 6px; font-size: 14px; } td.mine-m { white-space: nowrap; } td.mine-m .pill { display: none; } }

/* ----- Paywall, anteprime sfocate, limite spese ----- */
.pw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pw-list li { display: flex; gap: 10px; align-items: flex-start; }
.pw-list svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; color: var(--accent); }
.pw .dlg-foot { justify-content: flex-end; }
.pw-card { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; border: 1px solid var(--accent); }
.pw-card.span-2 { grid-column: 1 / -1; }
.pw-card .ico { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft, rgba(26,127,90,.12)); color: var(--accent); }
.pw-card .ico svg { width: 22px; height: 22px; }
.pw-card h2 { margin: 0 0 4px; font-size: 17px; }
.pw-card p { margin: 0 0 12px; }
.limit-note { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }

/* Card di anteprima Premium per chi non ha sbloccato: due etichette fisse negli angoli, così è impossibile scambiarle per
   la vista completa, anche a colpo d'occhio. Dentro, solo i primi due elementi sono dati reali: il resto non è scritto nel
   DOM (niente da "smascherare" con gli strumenti per sviluppatori), solo un blocco con lucchetto e bottone di sblocco. */
.fake-card { position: relative; overflow: hidden; }
.fake-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.fake-tag { position: absolute; top: 0; z-index: 1; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 750; letter-spacing: 0.02em; text-transform: uppercase; padding: 4px 9px; line-height: 1.4; }
.fake-tag.ex { left: 0; border-radius: var(--radius) 0 10px 0; background: var(--surface-2); color: var(--ink-2); }
.fake-tag.prem { right: 0; border-radius: 0 var(--radius) 0 10px; background: linear-gradient(135deg, #ffd95a, #f5b800); color: #3b2600; }
.fake-tag.prem .crown { width: 12px; height: 12px; }
.fake-card > h2, .fake-card > .card-head { margin-top: 20px; }
/* Blocco di chiusura del teaser: stesso posto degli elementi reali mostrati sopra, ma senza alcun dato dentro. */
.teaser-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; color: var(--muted); border-top: 1px dashed var(--grid); margin-top: 4px; cursor: pointer; }
.teaser-more .lock-ico { width: 14px; height: 14px; vertical-align: -2px; }
.pie-legend .row.teaser-more { border-top: 1px dashed var(--grid); }
tr.teaser-more td { text-align: left; color: var(--muted); padding-top: 12px; }
tr.teaser-more .lock-ico { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.fake-bar-col.teaser-more { cursor: pointer; }
.fake-bar.locked { background: var(--surface-2); opacity: 1; display: grid; place-items: center; height: 60%; min-height: 48px; }
.fake-bar.locked .lock-ico { width: 16px; height: 16px; color: var(--muted); }
.kpi.locked .value { color: var(--muted); display: flex; align-items: center; }
.kpi.locked .lock-ico { width: 18px; height: 18px; }
.locked-value { color: var(--muted); display: flex; align-items: center; }
.locked-value .lock-ico { width: 22px; height: 22px; }
.pt-group { padding: 14px 4px 6px; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); border-top: 1px solid var(--line, rgba(128,128,128,.2)); }
.pt-group:first-of-type { border-top: 0; }
.good { color: var(--good-ink); font-weight: 650; }
.bad { color: var(--bad-ink); font-weight: 650; }
@media (max-width: 899px) { .bottom-nav { grid-template-columns: repeat(5, 1fr); } .bottom-nav .nav-link { font-size: 10.5px; padding-left: 2px; padding-right: 2px; } }
.month-end { display: flex; gap: 14px; align-items: flex-start; margin: 14px 0 0; }
.month-end .ico { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.month-end .ico svg { width: 22px; height: 22px; }
.month-end p { margin: 4px 0 6px; }
.fam-links .actions { gap: 8px; flex-wrap: wrap; }
.month-end { margin-bottom: 14px; }
.lp-promise-lead { margin: -4px 0 16px; font-size: 16px; color: var(--ink-2); max-width: 62ch; }
.lp-plan-tag { margin: 2px 0 10px; font-size: 13.5px; font-weight: 650; color: var(--accent); }
.lp-plan ul .lp-grp { list-style: none; margin: 10px 0 0 -20px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.lp-plan ul .lp-grp:first-child { margin-top: 0; }

/* spese personali extra */
.mx-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.mx-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line, #e5e2da); border-radius: 12px; }
.mx-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.mx-r { display: flex; align-items: center; gap: 4px; flex: none; }

/* percorso (breadcrumb) nelle schermate collegate */
.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; font-size: 14px; color: var(--muted, #6b6b66); }
.crumb a { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; text-decoration: none; padding: 6px 10px 6px 4px; border-radius: 8px; min-height: 36px; }
.crumb a:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.crumb a svg { width: 16px; height: 16px; }
.crumb [aria-current] { color: var(--ink); }

/* invito a importare lo storico */
.hist-cta { display: grid; gap: 8px; justify-items: start; padding: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 6%, transparent); margin-top: 12px; }
.hist-cta b { font-size: 15px; }
.card.hist-cta { padding: 16px; }
.limit-note.soft { background: transparent; border: 1px dashed var(--line, #d8d4c8); color: inherit; }

/* sezioni gemelle della pagina Previsioni */
.fc-sec { margin: 0 0 12px; }
.fc-sec h2 { margin: 0; font-size: 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.fc-sec .sub { margin: 4px 0 0; }

/* spese: colonne separate su schermi larghi, riga unica con dettaglio su telefono */
.c-d { display: none; }
.s-m { display: block; font-weight: 400; white-space: normal; max-width: 118px; margin-left: auto; line-height: 1.3; }
@media (min-width: 700px) { .c-d { display: table-cell; } .s-m { display: none; } }

/* ===== Riorganizzazione: Spese famiglia / Spese mie / Analisi / Previsioni ===== */
.sec-tag { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 2px 0 6px; }
.sec-tag .pill { text-transform: none; letter-spacing: 0; font-size: 11px; }
.mine-intro p { color: var(--ink-2); }
.hist-cta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: var(--surface-2); }
.hist-cta .actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.btn.wrap { white-space: normal; text-align: center; height: auto; min-height: 40px; }
.seg-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; margin: 4px 0 14px; }
.seg-tabs a, .seg-tabs button { border: 0; background: transparent; color: var(--ink-2); font: inherit; font-weight: 650; font-size: 14px; padding: 10px 8px; border-radius: 10px; text-align: center; cursor: pointer; text-decoration: none; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg-tabs .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sec-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.tour-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 45; background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -12px rgba(0,0,0,.25); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.tour-bar .t-row { display: flex; align-items: center; gap: 10px; }
.tour-bar .t-txt { flex: 1; min-width: 0; font-size: 14px; }
.tour-bar .t-txt b { display: block; font-size: 12px; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.tour-bar .t-dots { display: flex; gap: 5px; }
.tour-bar .t-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--border); }
.tour-bar .t-dots i.on { background: var(--accent); }
.tour-bar .t-skip { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; padding: 6px 0; cursor: pointer; align-self: center; }
@media (min-width: 900px) { .tour-bar { left: 240px; bottom: 0; max-width: 760px; margin: 0 auto; right: 0; border: 1px solid var(--border); border-radius: 16px 16px 0 0; } }
.pf-cards { display: grid; gap: 12px; }
.pf-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: var(--surface); }
.pf-card h3 { margin: 0 0 8px; font-size: 16px; }
.pf-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 14px; }
.pf-row:first-of-type { border-top: 0; }
.pf-row span:first-child { color: var(--ink-2); min-width: 0; }
.pf-row b { white-space: nowrap; }
.calc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 15px; }
.calc-row:first-child { border-top: 0; }
.calc-row > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.calc-row small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.calc-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-row.total { border-top: 2px solid var(--ink); font-size: 17px; margin-top: 4px; }
.calc-row.good b { color: var(--good-ink); } .calc-row.bad b { color: var(--bad-ink); }
.dlg.quick .fld-adv { display: none; }
body.tour-on #view { padding-bottom: 190px; }
body.tour-on .fab { bottom: calc(var(--nav-h) + 170px + env(safe-area-inset-bottom)); }
.seg-tabs svg { width: 18px; height: 18px; flex-shrink: 0; }
.sec-label svg, .sec-tag svg { width: 16px; height: 16px; flex-shrink: 0; }
.sec-label .crown { width: 18px; height: 18px; }
.sec-label .crown { position: static; transform: none; filter: none; }

/* Landing: selettore lingua con bandierine, in alto a destra */
.lp-top{justify-content:flex-end;margin:0 0 10px}
.lp-langs{flex-wrap:nowrap;gap:6px;justify-content:flex-end}
.lp-langs button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:36px;min-height:36px;padding:0;border-radius:10px;border:2px solid transparent;background:transparent;opacity:.75}
.lp-langs button svg{width:28px;height:20px;border-radius:3px;box-shadow:0 0 0 1px rgba(0,0,0,.18)}
.lp-langs button.on{background:transparent;border-color:var(--accent);opacity:1}
.lp-langs button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* video embed (landing + popup) */
.lp-video-wrap { display: flex; justify-content: center; margin: 32px 0; }
.video-embed { aspect-ratio: 9/16; width: 100%; max-width: 360px; border: 0; border-radius: 16px; display: block; }
.help-video { margin: 12px 0 16px; display: flex; justify-content: center; }
.help-video .video-embed { max-width: 100%; border-radius: 12px; }

.help-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line, rgba(128,128,128,.3)); background: var(--surface); color: var(--ink-2); font-weight: 750; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.help-btn:hover, .help-btn:focus-visible { border-color: var(--accent); color: var(--accent); }

.help-dlg { position: relative; border: 0; border-radius: 20px; padding: 20px; max-width: min(380px, 94vw); width: 100%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.help-dlg::backdrop { background: rgba(0,0,0,.5); }
.help-dlg h2 { margin: 4px 36px 14px 0; font-size: 18px; line-height: 1.3; }
.dlg-close:hover { background: var(--accent-soft); color: var(--accent); }
.help-tour { margin-top: 14px; text-align: center; }
.help-tour .btn { width: 100%; justify-content: center; }
.help-tour p { margin: 8px 0 0; }
/* icona "?" sempre in alto a destra dell'intestazione (su schermi stretti, dove i controlli andrebbero a capo) */
@media (max-width: 899px) {
  .page-head { position: relative; }
  .page-head > div:first-child { padding-right: 46px; }
  .page-head .help-btn { position: absolute; top: 0; right: 0; }
}

/* Totale ben visibile sopra i risultati di una ricerca (famiglia e personale), solo Premium */
.search-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; margin: 0 0 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.search-total span { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.search-total b { font-size: 19px; font-weight: 800; color: var(--accent); }
.search-total.locked { background: var(--surface-2); border-color: var(--border); }
.search-total.locked span { display: flex; align-items: center; gap: 6px; }
.search-total:empty { display: none; margin: 0; padding: 0; border: 0; }

/* Budget bar: gradiente verde > giallo > arancio > rosso, ancorato alla barra intera */
.bud-bar-wrap { padding: 6px 0 2px; --bud-c: #16a34a; }
.bud-mid { --bud-c: #ca8a04; } .bud-high { --bud-c: #ea580c; } .bud-over { --bud-c: #dc2626; }
.bud-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.bud-pct { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--bud-c); }
.bud-msg { font-size: 13px; font-weight: 600; color: var(--bud-c); text-align: right; }
.bud-bar-track { position: relative; height: 20px; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, #22c55e, #a3e635 28%, #facc15 55%, #fb923c 78%, #ef4444); box-shadow: inset 0 1px 3px rgba(0,0,0,.18); }
.bud-bar-track::before { content: ""; position: absolute; inset: 0; z-index: 0; background: color-mix(in srgb, var(--surface, #fff) 82%, transparent); }
.bud-bar-fill { position: relative; z-index: 1; height: 100%; min-width: 20px; border-radius: 999px; background-image: linear-gradient(90deg, #22c55e, #a3e635 28%, #facc15 55%, #fb923c 78%, #ef4444); background-repeat: no-repeat; box-shadow: 0 0 12px color-mix(in srgb, var(--bud-c) 55%, transparent); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bud-bar-fill::after { content: ""; position: absolute; left: 6px; right: 6px; top: 3px; height: 6px; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); }
.bud-over .bud-bar-fill { animation: budPulse 1.8s ease-in-out infinite; }
@keyframes budPulse { 50% { box-shadow: 0 0 18px rgba(239,68,68,.85); } }
@media (prefers-reduced-motion: reduce) { .bud-over .bud-bar-fill { animation: none; } .bud-bar-fill { transition: none; } }
.bud-bar-labels { display: flex; justify-content: space-between; margin-top: 8px; }
.bud-teaser { cursor: pointer; }
.bud-teaser .actions { justify-content: flex-start; }
.bud-over-txt { color: var(--bad-ink); }
/* Netto disponibile: toggles */
.mine-net-cfg { background: var(--surface-2, #f5f2ec); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.mine-net-cfg-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 2px; }
