/* CondoDesk — stile mobile-first. Nessuna dipendenza esterna. */

:root {
  color-scheme: light;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --surface-3: #ebf0ee;
  --border: #e0e7e4;
  --border-strong: #c9d3cf;
  --text: #13201d;
  --text-2: #4b5c58;
  --text-3: #7a8985;
  --accent: #0f766e;
  --accent-hover: #0c655e;
  --accent-soft: #e1f2ee;
  --accent-text: #0b5c55;
  --on-accent: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --warning: #a15c07;
  --warning-soft: #fdf3e1;
  --success: #157f3c;
  --success-soft: #e5f4ea;
  --info: #1d4ed8;
  --info-soft: #e8eefd;
  --violet: #6d3fd1;
  --violet-soft: #f0eafc;
  --neutral: #5b6865;
  --neutral-soft: #edf0ef;
  --focus: #0f766e66;
  --shadow-sm: 0 1px 2px rgba(15, 32, 28, .06);
  --shadow: 0 1px 2px rgba(15, 32, 28, .05), 0 6px 20px rgba(15, 32, 28, .06);
  --shadow-lg: 0 18px 50px rgba(15, 32, 28, .22);
  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --top-h: 58px;
  --bottom-h: 64px;
  --side-w: 268px;
}

/* Tema scuro: data-theme è impostato da js/theme-boot.js (scelta dell'utente o impostazione del dispositivo). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1112;
  --surface: #121a1b;
  --surface-2: #162021;
  --surface-3: #1e2a2b;
  --border: #233032;
  --border-strong: #33423f;
  --text: #e5eeec;
  --text-2: #a3b3af;
  --text-3: #72837f;
  --accent: #2fb5a5;
  --accent-hover: #3cc6b5;
  --accent-soft: #10302c;
  --accent-text: #64d7c8;
  --on-accent: #03201c;
  --danger: #f2837a;
  --danger-soft: #3a1714;
  --warning: #f1b44c;
  --warning-soft: #33260c;
  --success: #5bd38a;
  --success-soft: #0f2b1b;
  --info: #86a8ff;
  --info-soft: #152140;
  --violet: #bba1ff;
  --violet-soft: #241b3e;
  --neutral: #a3b0ad;
  --neutral-soft: #1f2a2b;
  --focus: #2fb5a588;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .3);
  --shadow-lg: 0 18px 60px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; font-weight: 700; }
h2 { font-size: 1.08rem; font-weight: 650; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }

/* ---------- Boot ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--text-2); }
.boot img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }
.noscript { padding: 24px; text-align: center; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.sidenav { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 6px;
  min-height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-title {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
  background: none; border: 0; padding: 6px 4px; border-radius: 10px; text-align: left;
}
.topbar-title .tt-text { min-width: 0; display: grid; }
.topbar-title strong { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title small { font-size: .75rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .ic { color: var(--text-3); }
.topbar-actions { display: flex; align-items: center; gap: 2px; }
.space-badge {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem;
  background: var(--accent-soft); color: var(--accent-text);
}
.main { flex: 1; min-width: 0; }
.bottomnav {
  position: sticky; bottom: 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
}
.bn-item {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px;
  min-height: var(--bottom-h); padding: 6px 2px;
  color: var(--text-3); font-size: .7rem; font-weight: 600; background: none; border: 0;
  text-decoration: none !important;
}
.bn-item .ic { width: 23px; height: 23px; }
.bn-label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bn-item.active { color: var(--accent-text); }
.bn-item.active .bn-icon { background: var(--accent-soft); }
.bn-icon { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; transition: background .2s; }
.bn-badge, .nav-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700;
  display: inline-grid; place-items: center; line-height: 1;
}
.bn-badge { position: absolute; top: 6px; left: calc(50% + 8px); }

.icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: 12px; border: 0; background: none; color: var(--text-2);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn .dot { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid var(--bg); }
.icon-btn.spinning .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: var(--violet-soft); color: var(--violet);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }

@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: var(--side-w) 1fr; grid-template-rows: auto 1fr; }
  .sidenav {
    display: flex; flex-direction: column; gap: 12px;
    grid-row: 1 / span 2; position: sticky; top: 0; height: 100dvh; overflow-y: auto;
    padding: 18px 14px; background: var(--surface); border-right: 1px solid var(--border);
  }
  .topbar { grid-column: 2; background: color-mix(in srgb, var(--bg) 88%, transparent); }
  .topbar .topbar-title { pointer-events: none; }
  .topbar .topbar-title > .ic, .topbar .space-badge, .topbar .tb-mobile { display: none; }
  .main { grid-column: 2; }
  .bottomnav { display: none; }
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; font-weight: 750; font-size: 1.1rem; letter-spacing: -.02em; color: var(--text); text-decoration: none !important; }
.brand svg { width: 32px; height: 32px; }
.space-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: left;
}
.space-switch:hover { border-color: var(--border-strong); }
.space-switch .ss-text { flex: 1; min-width: 0; display: grid; }
.space-switch strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.space-switch small { font-size: .74rem; color: var(--text-3); }
.space-switch > .ic { color: var(--text-3); }
.nav-list { display: grid; gap: 2px; }
.nav-section { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 12px 10px 4px; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 10px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 560; font-size: .92rem; text-decoration: none !important;
}
.nav-link:hover { background: var(--surface-3); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-link .nav-badge { margin-left: auto; }
.sidenav-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--text); text-decoration: none !important; }
.user-chip:hover { background: var(--surface-3); }
.user-chip .uc-text { min-width: 0; display: grid; }
.user-chip strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip small { font-size: .74rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Page ---------- */
.page { width: 100%; max-width: 1120px; margin: 0 auto; padding: 18px 16px 32px; display: grid; gap: 18px; animation: fadeIn .18s ease-out; }
.page-narrow { max-width: 760px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
@media (min-width: 720px) { .page { padding: 26px 28px 48px; gap: 22px; } }
.page-head { display: grid; gap: 8px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head-text { min-width: 0; display: grid; gap: 4px; }
.page-sub { color: var(--text-2); font-size: .92rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; width: max-content; color: var(--text-2); font-size: .88rem; font-weight: 600; margin-left: -4px; padding: 2px 4px; border-radius: 8px; }
.back-link:hover { color: var(--text); text-decoration: none; background: var(--surface-3); }
@media (max-width: 719px) { .page-actions-desktop { display: none !important; } }

.section { display: grid; gap: 10px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head a { font-size: .86rem; font-weight: 600; }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); align-items: start; }
}
.stack { display: grid; gap: 10px; }
.stack-lg { display: grid; gap: 18px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.spacer { flex: 1; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: .84rem; }
.tiny { font-size: .76rem; }
.strong { font-weight: 650; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- Cards & lists ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 16px; }
@media (min-width: 720px) { .card-pad { padding: 20px; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 1rem; }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-link:active { transform: scale(.995); }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 60px;
  color: inherit; text-decoration: none !important; border-top: 1px solid var(--border); background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0;
}
.list-row:first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); }
.lr-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent-text); }
.lr-icon.tone-info { background: var(--info-soft); color: var(--info); }
.lr-icon.tone-warning { background: var(--warning-soft); color: var(--warning); }
.lr-icon.tone-danger { background: var(--danger-soft); color: var(--danger); }
.lr-icon.tone-violet { background: var(--violet-soft); color: var(--violet); }
.lr-icon.tone-neutral { background: var(--neutral-soft); color: var(--neutral); }
.lr-icon.tone-success { background: var(--success-soft); color: var(--success); }
.lr-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lr-title { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-title-wrap { font-weight: 620; }
.lr-sub { font-size: .84rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); margin-top: 2px; }
.lr-end { display: flex; align-items: center; gap: 6px; flex: none; color: var(--text-3); }
.lr-chevron { color: var(--text-3); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: .92rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: 99px; font-size: .74rem; font-weight: 650; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral);
}
.chip .ic { width: 13px; height: 13px; stroke-width: 2.2; }
.chip-info { background: var(--info-soft); color: var(--info); }
.chip-violet { background: var(--violet-soft); color: var(--violet); }
.chip-warning { background: var(--warning-soft); color: var(--warning); }
.chip-accent { background: var(--accent-soft); color: var(--accent-text); }
.chip-success { background: var(--success-soft); color: var(--success); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.chip-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-2); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 650; color: var(--text-2); }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.prio-bassa::before { background: var(--success); }
.prio-media::before { background: var(--info); }
.prio-alta::before { background: var(--warning); }
.prio-urgente { color: var(--danger); }
.prio-urgente::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 650; font-size: .92rem; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .84rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 50px; font-size: 1rem; border-radius: 14px; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--on-accent) transparent var(--on-accent) transparent; animation: spin .7s linear infinite;
}
.btn-secondary.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--text-2) transparent var(--text-2) transparent; }
.link-btn { background: none; border: 0; padding: 4px; color: var(--accent-text); font-weight: 600; font-size: .88rem; }
.link-btn:hover { text-decoration: underline; }
.fab {
  position: fixed; right: 16px; bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px); z-index: 25;
  display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px 0 16px;
  border-radius: 18px; border: 0; background: var(--accent); color: var(--on-accent);
  font-weight: 700; box-shadow: var(--shadow-lg); text-decoration: none !important;
}
.fab .ic { width: 22px; height: 22px; stroke-width: 2.2; }
@media (min-width: 1024px) { .fab { display: none; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: .86rem; font-weight: 620; color: var(--text); }
.field .req { color: var(--danger); }
.field-hint { font-size: .8rem; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 16px; /* evita lo zoom su iOS */
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8985' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
@media (min-width: 720px) { .input, .select, .textarea { font-size: .95rem; } }
.form-row { display: grid; gap: 14px; }
@media (min-width: 600px) { .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; cursor: pointer; padding: 4px 0; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check small { display: block; color: var(--text-3); font-size: .8rem; }
.check-group { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.choice-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: .88rem; font-weight: 560; cursor: pointer;
}
.choice input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: .88rem; }
.file-drop {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border-strong); background: var(--surface-2); cursor: pointer; color: var(--text-2);
}
.file-drop:hover { border-color: var(--accent); color: var(--accent-text); }
.file-drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-drop strong { color: var(--text); display: block; font-size: .92rem; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.6); color: #fff; }
.thumb button .ic { width: 16px; height: 16px; }
.file-list { display: grid; gap: 6px; }
.file-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: .86rem; }
.file-pill .ellipsis { flex: 1; min-width: 0; }

/* ---------- Toolbar / filters ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1 1 100%; }
@media (min-width: 720px) { .search { flex: 1 1 220px; } }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 40px; }
.toolbar .select { width: auto; min-width: 0; flex: 1 1 140px; }
@media (min-width: 720px) { .toolbar .select { min-width: 160px; flex: 0 1 auto; } }
.segmented { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-3); overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented a, .segmented button {
  flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 10px; border: 0; background: none;
  color: var(--text-2); font-weight: 620; font-size: .86rem; white-space: nowrap; text-decoration: none !important;
}
.segmented .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.lang-switch { display: inline-flex; flex: none; padding: 3px; }
.lang-switch button { min-height: 30px; padding: 0 10px; font-size: .78rem; }
.seg-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--border); font-size: .72rem; display: inline-grid; place-items: center; }
.segmented .active .seg-count { background: var(--accent-soft); color: var(--accent-text); }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: none; min-height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2); font-size: .84rem; font-weight: 600;
}
.filter-chip.active { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------- Stats & quick actions ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.stat { display: grid; gap: 8px; padding: 14px; color: inherit; text-decoration: none !important; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.stat-value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.stat-label { font-size: .82rem; color: var(--text-2); font-weight: 560; }
.tone-info .stat-icon { background: var(--info-soft); color: var(--info); }
.tone-warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.tone-violet .stat-icon { background: var(--violet-soft); color: var(--violet); }
.tone-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px;
  color: var(--text); font-weight: 680; text-decoration: none !important; min-height: 112px;
}
.quick .q-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.quick .q-icon .ic { width: 24px; height: 24px; }
.quick small { display: block; font-weight: 500; color: var(--text-2); font-size: .8rem; margin-top: 2px; }
.quick.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.quick.primary .q-icon { background: color-mix(in srgb, var(--on-accent) 18%, transparent); color: var(--on-accent); }
.quick.primary small { color: color-mix(in srgb, var(--on-accent) 80%, transparent); }

.hero {
  display: grid; gap: 6px; padding: 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 70%, #1d4ed8) 100%);
  color: #fff;
}
.hero h1 { font-size: 1.5rem; }
.hero p { opacity: .88; font-size: .92rem; }
[data-theme="dark"] .hero { background: linear-gradient(135deg, #0f5e57 0%, #1a3f7a 100%); }

/* ---------- Notices ---------- */
.notice { display: grid; gap: 8px; padding: 16px; }
.notice-important { border-left: 4px solid var(--warning); }
.notice-head { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; }
.notice-head h3 { font-size: 1rem; }
.notice-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--text-3); }
.notice-text { color: var(--text-2); white-space: pre-wrap; word-break: break-word; font-size: .93rem; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; max-width: 100%;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .84rem; font-weight: 560;
}
.attachment span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment:hover { border-color: var(--accent); color: var(--accent-text); }
.date-badge {
  flex: none; width: 52px; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--border); background: var(--surface);
}
.date-badge .db-m { display: block; background: var(--accent); color: var(--on-accent); font-size: .66rem; font-weight: 750; text-transform: uppercase; padding: 2px 0; letter-spacing: .05em; }
.date-badge .db-d { display: block; font-size: 1.2rem; font-weight: 750; padding: 3px 0 4px; }

/* ---------- Timeline & stepper ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.tl-item { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.tl-dot .ic { width: 16px; height: 16px; }
.tl-stato .tl-dot { background: var(--accent-soft); color: var(--accent-text); }
.tl-internal .tl-dot { background: var(--warning-soft); color: var(--warning); }
.tl-content { min-width: 0; display: grid; gap: 4px; padding-top: 5px; }
.tl-head { font-size: .9rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tl-text { font-size: .92rem; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.tl-internal .tl-text { background: var(--warning-soft); padding: 8px 10px; border-radius: 10px; color: var(--text); }
.tl-meta { font-size: .76rem; color: var(--text-3); }
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.step { display: grid; gap: 6px; justify-items: center; text-align: center; font-size: .68rem; font-weight: 600; color: var(--text-3); }
.step-bar { width: 100%; height: 6px; border-radius: 99px; background: var(--surface-3); }
.step.done .step-bar { background: var(--accent); }
.step.current { color: var(--accent-text); }
.step.current .step-bar { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 520px) { .step span { display: none; } .step.current span { display: block; white-space: nowrap; } }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photo-tile {
  display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .84rem; text-align: left;
}
.photo-tile:hover { border-color: var(--accent); }
.photo-tile span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer { display: grid; gap: 10px; padding: 14px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Banners, empty, skeleton ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; background: var(--info-soft); color: var(--text); }
.banner > .ic { color: var(--info); margin-top: 1px; }
.banner-warning { background: var(--warning-soft); }
.banner-warning > .ic { color: var(--warning); }
.banner-success { background: var(--success-soft); }
.banner-success > .ic { color: var(--success); }
.banner-danger { background: var(--danger-soft); }
.banner-danger > .ic { color: var(--danger); }
.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 36px 20px; color: var(--text-2); }
.empty > .ic { width: 44px; height: 44px; stroke-width: 1.4; color: var(--text-3); margin-bottom: 4px; }
.empty h3 { color: var(--text); }
.empty p { max-width: 420px; font-size: .9rem; }
.empty .btn { margin-top: 8px; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-title { height: 30px; width: 46%; }
.sk-line { height: 14px; width: 70%; }
.sk-card { height: 92px; }

/* ---------- Dialog / bottom sheet ---------- */
dialog.dialog { padding: 0; margin: 0; border: 0; background: transparent; width: 100%; height: 100%; max-width: 100%; max-height: 100%; color: var(--text); }
dialog.dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
dialog.dialog::backdrop { background: rgba(8, 16, 14, .5); backdrop-filter: blur(2px); }
.dialog-panel {
  width: 100%; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg);
  padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .22s cubic-bezier(.2, .8, .2, 1);
}
.dialog-panel::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 8px auto 0; }
.dialog-panel:focus { outline: none; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 12px 10px 20px; background: var(--surface); }
.dialog-head h2 { font-size: 1.1rem; }
.dialog-body { padding: 4px 20px 20px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; position: sticky; bottom: 0; background: var(--surface); padding-bottom: 4px; }
.dialog-actions .btn { flex: 1; }
.dialog-text { color: var(--text-2); margin-bottom: 16px; }
@media (min-width: 720px) {
  dialog.dialog[open] { align-items: center; }
  .dialog-panel { width: min(560px, calc(100vw - 48px)); border-radius: 20px; max-height: 88dvh; animation: pop .18s ease-out; }
  .dialog-wide .dialog-panel { width: min(760px, calc(100vw - 48px)); }
  .dialog-panel::before { display: none; }
  .dialog-head { padding: 16px 14px 8px 24px; }
  .dialog-body { padding: 6px 24px 24px; }
  .dialog-actions .btn { flex: 0 0 auto; }
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.sheet-menu { display: grid; gap: 2px; margin: 0 -8px; }
.sheet-menu a, .sheet-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px;
  border: 0; background: none; color: var(--text); font-weight: 560; text-align: left; text-decoration: none !important;
}
.sheet-menu a:hover, .sheet-menu button:hover { background: var(--surface-3); }
.sheet-menu .current { background: var(--accent-soft); color: var(--accent-text); }
.sheet-menu .sm-text { flex: 1; min-width: 0; display: grid; }
.sheet-menu small { color: var(--text-3); font-size: .78rem; font-weight: 500; }
.sheet-menu .danger { color: var(--danger); }
.sheet-sep { height: 1px; background: var(--border); margin: 6px 4px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 1000; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 12px); display: grid; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
@media (min-width: 1024px) { .toasts { bottom: 24px; } }
.toast {
  display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 14px; pointer-events: auto;
  background: #16211f; color: #f1f6f5; box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 550;
  opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-success .ic { color: #5bd38a; }
.toast-error { background: #4a1511; }
.toast-error .ic { color: #ff9b91; }
[data-theme="dark"] .toast { background: #e9f1ef; color: #10201c; }
[data-theme="dark"] .toast-success .ic { color: #157f3c; }
[data-theme="dark"] .toast-error { background: #ffe4e1; }
[data-theme="dark"] .toast-error .ic { color: #b42318; }
.theme-switch .ic { width: 16px; height: 16px; }

/* ---------- Auth ---------- */
.auth { min-height: 100dvh; display: grid; align-content: center; gap: 22px; padding: calc(24px + env(safe-area-inset-top)) 16px 32px; max-width: 1040px; margin: 0 auto; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 56px; padding: 40px; } }
.auth-hero { display: grid; gap: 14px; }
.auth-logo svg { width: 56px; height: 56px; }
.auth-hero h1 { font-size: 2.1rem; letter-spacing: -.03em; }
.auth-hero > p { color: var(--text-2); font-size: 1.04rem; max-width: 460px; }
.auth-points { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: .93rem; }
.auth-points .ic { color: var(--accent-text); }
@media (max-width: 899px) { .auth-points { display: none; } .auth-hero h1 { font-size: 1.7rem; } }
.auth-card { padding: 22px; display: grid; gap: 14px; }
@media (min-width: 720px) { .auth-card { padding: 30px; } }
.provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 50px;
  border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); font-weight: 650; font-size: .98rem;
}
.provider-btn:hover:not(:disabled) { background: var(--surface-2); border-color: var(--text-3); }
.provider-btn:disabled { opacity: .5; cursor: not-allowed; }
.provider-btn svg { width: 20px; height: 20px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: .8rem; font-weight: 600; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-users { display: grid; gap: 8px; }
.demo-user { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); text-align: left; }
.demo-user:hover { border-color: var(--accent); }
.demo-user .du-text { flex: 1; min-width: 0; display: grid; }
.demo-user small { color: var(--text-3); font-size: .8rem; }
.demo-user > .ic { color: var(--text-3); }

.condo-card { display: grid; gap: 12px; padding: 16px; }
.condo-card-head { display: flex; gap: 12px; align-items: center; }
.condo-card .cc-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 750; }
.condo-card .cc-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--text-2); }
.condo-card .cc-stats span { display: inline-flex; gap: 5px; align-items: center; }
.condo-card .cc-stats .ic { width: 15px; height: 15px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.table th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; border-top: 0; background: var(--surface-2); }

.menu-pop { position: relative; }
.progress-steps { display: grid; gap: 8px; font-size: .9rem; color: var(--text-2); }
.progress-steps .ic { color: var(--accent-text); }

/* Abbonamento */
.eyebrow { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
.plan-usage { display: grid; gap: 6px; }
.plan-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.plan-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.plan-usage.over .plan-bar span { background: var(--warning); }
.plans { align-items: stretch; }
.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-card.featured { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.plan-card.current { box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-head h3 { font-size: 1.1rem; }
.plan-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-price strong { font-size: 2rem; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.plan-price span { color: var(--text-2); font-size: .88rem; }
.plan-feats { list-style: none; padding: 0; margin: 2px 0; display: grid; gap: 7px; font-size: .9rem; }
.plan-feats li { display: flex; gap: 8px; align-items: flex-start; }
.plan-feats .ic { width: 17px; height: 17px; color: var(--success); flex: none; margin-top: 2px; }
.qty-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.qty-ctl { display: flex; align-items: center; gap: 4px; }
.qty-ctl .icon-btn { width: 36px; height: 36px; font-size: 1.2rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); }
.qty-ctl .icon-btn:disabled { opacity: .4; }
.qty-ctl output { min-width: 34px; text-align: center; font-weight: 700; font-size: 1.05rem; }
.plan-total { font-weight: 650; }
.plan-hint { color: var(--accent-text); }
.plan-card .spacer { flex: 1; }
.plan-card > .btn { margin-top: auto; }
.plan-notes p { display: flex; gap: 8px; align-items: flex-start; }
.plan-notes .ic { flex: none; margin-top: 2px; }
.plan-banner-wrap { padding-bottom: 0 !important; margin-bottom: -14px; }
.plan-banner .btn { flex: none; }
.seg-sm { padding: 3px; }
.seg-sm button { min-height: 32px; font-size: .84rem; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* Notifiche push */
.push-card { display: flex; gap: 12px; align-items: flex-start; }
.push-card .lr-icon { flex: none; }
.push-card .pc-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.push-card .pc-close { flex: none; margin: -6px -6px 0 0; }
.ios-steps { display: grid; gap: 12px; margin: 4px 0 8px; padding: 0; list-style: none; counter-reset: s; }
.ios-steps li { display: flex; gap: 12px; align-items: center; counter-increment: s; }
.ios-steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: .85rem; }
.ios-steps .ic { flex: none; color: var(--accent-text); }

/* Rate */
.text-danger { color: var(--danger) !important; }
.select-sm { min-height: 34px; padding-top: 4px; padding-bottom: 4px; font-size: .86rem; width: auto; }
.year-pick .select { width: auto; min-width: 96px; }
.rate-stats .stat-value { font-size: 1.35rem; }
.rate-stats .tone-success .stat-value { color: var(--success); }
.rate-stats .tone-warning .stat-value { color: var(--warning); }
.rate-row { align-items: center; }
.rate-check { display: grid; place-items: center; width: 40px; height: 40px; flex: none; cursor: pointer; }
.rate-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.rate-main { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.rate-main:hover .lr-title { text-decoration: underline; }
.rate-bar { position: relative; display: block; height: 6px; border-radius: 99px; background: var(--surface-3); margin: 6px 0 2px; max-width: 360px; }
.rate-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.rate-bar > i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--text-2); border-radius: 2px; }
.rate-end { display: grid; justify-items: end; gap: 6px; flex: none; }
.rate-missing { color: var(--danger); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-credit { color: var(--info); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-actions { position: sticky; bottom: calc(var(--bottom-h, 0px) + 10px); z-index: 5; box-shadow: var(--shadow); }
@media (min-width: 900px) { .rate-actions { bottom: 14px; } }
.mov-row { align-items: flex-start; }
.mov-row.uscita { opacity: .78; }
.mov-row.ignorato { opacity: .6; }
.mov-desc { font-size: .82rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.mov-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mov-amount.in { color: var(--success); }
.mov-amount.out { color: var(--text-2); }
.mov-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
@media (max-width: 719px) {
  .mov-row { flex-wrap: wrap; }
  .mov-row .lr-main { flex: 1 1 calc(100% - 140px); }
  .mov-actions { flex-basis: 100%; }
}
.mov-detail { display: grid; gap: 4px; background: var(--surface-2); box-shadow: none; overflow-wrap: anywhere; }
.unit-split { max-height: 300px; }
.split-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.split-row .check { flex: 1; min-width: 0; }
.split-amount { width: 120px; flex: none; text-align: right; min-height: 36px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; }
.scad-row { display: flex; gap: 8px; align-items: center; }
.scad-row input[type=date] { flex: 1; min-width: 0; max-width: 220px; }
.pct-input { display: flex; align-items: center; gap: 6px; }
.pct-input input { width: 96px; text-align: right; }
.quote-table td, .quote-table th { vertical-align: middle; }
.quote-input { width: 130px; margin-left: auto; text-align: right; min-height: 36px; }
.rate-sum th { width: 60%; text-transform: none; letter-spacing: 0; font-size: .86rem; background: none; border-top: 1px solid var(--border); }
.mail-preview { display: grid; gap: 6px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.mail-body { white-space: pre-wrap; font-size: .88rem; color: var(--text-2); max-height: 260px; overflow-y: auto; }

/* Termini di servizio */
.legal-brand { gap: 10px; color: var(--text); text-decoration: none !important; font-size: 1.05rem; }
.legal-brand svg { width: 32px; height: 32px; }
.legal-text { display: grid; gap: 18px; line-height: 1.6; }
.legal-text h2 { font-size: 1.02rem; margin-bottom: 6px; }
.legal-text p { color: var(--text-2); font-size: .93rem; }
.legal-text p + p { margin-top: 8px; }
.terms-check { box-shadow: none; background: var(--surface-2); }
.terms-check a { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
