/* Cittadino Preoccupato - foglio di stile unico (mobile first) */
:root {
  --brand: #0f4c81; --brand-dark: #0b3a63; --brand-soft: #e6eef7;
  --accent: #f2a900; --accent-dark: #d99500;
  --ink: #1c2733; --muted: #5b6b7c; --line: #dfe5ec; --bg: #f3f5f8; --card: #fff;
  --ok: #15803d; --ok-bg: #e7f6ec; --warn: #a15c07; --warn-bg: #fff4dd; --err: #b91c1c; --err-bg: #fdeaea; --info-bg: #e6eef7;
  --radius: 16px; --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(15, 35, 60, .04), 0 10px 28px -10px rgba(15, 35, 60, .16);
  --shadow-lift: 0 4px 10px rgba(15, 35, 60, .06), 0 18px 38px -12px rgba(15, 35, 60, .22);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.32rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container.narrow, .narrow { max-width: 560px; }
.container.narrow.prose-page, .prose-page { max-width: 760px; }
main { display: block; padding-bottom: 40px; min-height: 60vh; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.hp { position: absolute; left: -5000px; height: 0; overflow: hidden; }
.inline { display: inline; margin: 0; }
.inline-copy { display: flex; gap: 6px; }
.inline-copy input { flex: 1 1 auto; min-width: 0; }
.text-err { color: var(--err); }
.stack > * + * { margin-top: 16px; }
.grow { flex: 1 1 220px; }

/* ---- barra superiore ---- */
.topbar { background: #082d58; color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.1); }
.topbar-in { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; }
.topbar-row1 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; min-height: 60px; flex: 1 1 100%; gap: 6px 12px; }
.brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 1.15rem; letter-spacing: .1px; min-width: 0; flex: 0 1 auto; }
.brand b { font-weight: 800; } .brand span { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.brand:hover { color: #fff; }
.logo-mark { flex: none; }
.area-tag { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; background: rgba(255,255,255,.18); padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.nav-toggle { display: inline-flex; background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; font-size: 1.3rem; border-radius: 8px; width: 42px; height: 40px; align-items: center; justify-content: center; cursor: pointer; }
.langsw { display: flex; align-items: center; margin-left: 4px; flex: none; }
.langsw select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-color: rgba(255,255,255,.14);
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 13px) center, calc(100% - 8px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 8px;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em; font-family: inherit;
  padding: 6px 24px 6px 9px; min-height: 40px; cursor: pointer;
}
.langsw select:hover { background-color: rgba(255,255,255,.22); }
.langsw select:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.langsw select option { color: #1c2733; background: #fff; }
.mainnav { display: none; flex-basis: 100%; flex-direction: column; gap: 2px; padding: 8px 0 14px; }
.mainnav.open { display: flex; }
.mainnav a, .linklike { color: #fff; text-decoration: none; padding: 9px 10px; border-radius: 8px; font-size: .95rem; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.mainnav a:hover, .linklike:hover { background: rgba(255,255,255,.14); color: #fff; }
.mainnav a.active { background: rgba(255,255,255,.2); font-weight: 600; }
.mainnav a.btn-accent { background: var(--accent); color: var(--ink); margin-top: 6px; text-align: center; font-weight: 700; }
.mainnav a.btn-accent:hover { background: var(--accent-dark); color: var(--ink); }
.usermenu { display: flex; flex-direction: column; border-top: 1px solid rgba(255,255,255,.2); margin-top: 8px; padding-top: 8px; }
.pill { background: var(--accent); color: var(--ink); border-radius: 99px; padding: 0 7px; font-size: .75rem; font-weight: 700; }
.subbar { background: var(--brand-soft); border-bottom: 1px solid var(--line); padding: 8px 0; font-size: .9rem; }
.subbar-demo { background: var(--warn-bg); color: #6d3f05; border-bottom: 1px solid #f0d59a; font-weight: 600; }
.badge-demo { background: var(--warn-bg); color: #6d3f05; border: 1px solid #f0d59a; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .mainnav { display: flex; flex-direction: row; flex-basis: auto; align-items: center; padding: 0; flex-wrap: wrap; gap: 2px; }
  .mainnav a.btn-accent { margin: 0 0 0 8px; }
  .usermenu { flex-direction: row; align-items: center; border: 0; margin: 0 0 0 8px; padding: 0; gap: 2px; }
}

/* ---- backend (admin/comune): barra superiore slim + menù laterale ---- */
.area-admin .topbar, .area-comune .topbar { background: linear-gradient(180deg, #0d3b67 0%, #082d58 100%); }
.area-admin .area-tag, .area-comune .area-tag { background: rgba(242,169,0,.16); color: #ffd98a; border: 1px solid rgba(242,169,0,.38); font-weight: 700; }

.app-shell { display: block; }
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 86%; max-width: 300px;
  display: flex; flex-direction: column; gap: 2px; padding: 14px 10px 20px; margin: 0;
  background: linear-gradient(180deg, #0d3b67 0%, #082d58 100%); color: #fff;
  transform: translateX(-100%); transition: transform .2s ease; z-index: 60;
  box-shadow: 2px 0 16px rgba(0,0,0,.3); overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }
.sidebar-backdrop { display: none; }
.sidebar.open + .sidebar-backdrop {
  display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 55;
}
.sidebar a, .sidebar .linklike {
  display: flex; align-items: center; gap: 10px; width: 100%; color: #fff; text-decoration: none;
  padding: 10px 12px; border-radius: 8px; font-size: .95rem; font-weight: 500;
  background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left;
  transition: background .15s ease, opacity .15s ease;
}
.sidebar a:hover, .sidebar .linklike:hover { background: rgba(255,255,255,.14); }
.sidebar a.active { background: rgba(255,255,255,.18); font-weight: 700; border-left: 3px solid var(--accent); padding-left: 9px; }
.sidebar .nav-ico { flex: none; opacity: .8; }
.sidebar a:hover .nav-ico, .sidebar a.active .nav-ico, .sidebar .linklike:hover .nav-ico { opacity: 1; }
.sidebar .nav-sep { display: block; height: 1px; width: auto; background: rgba(255,255,255,.14); margin: 8px 10px; border: 0; }
.sidebar .usermenu { display: flex; flex-direction: column; gap: 2px; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.18); }
.sidebar .usermenu .linklike { background: rgba(255,255,255,.07); }
.sidebar .usermenu .linklike:hover { background: rgba(255,255,255,.16); }
.sidebar .pill { margin-left: auto; }

@media (min-width: 900px) {
  /* il guscio dell'app occupa tutta l'altezza della finestra: la sidebar resta sempre visibile
     (compreso "Esci" in fondo) e solo la colonna di contenuto scorre, indipendentemente da quanto è lunga la pagina */
  .area-admin, .area-comune { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
  .area-admin .topbar, .area-comune .topbar { position: static; flex: none; }
  .area-admin .app-shell, .area-comune .app-shell { flex: 1 1 auto; min-height: 0; }
  .area-admin .footer, .area-comune .footer { flex: none; }
  .app-shell { display: flex; align-items: stretch; }
  .sidebar {
    position: static; transform: none; width: 236px; max-width: none; flex: none;
    box-shadow: none; z-index: auto; overflow-y: auto;
  }
  .sidebar-backdrop { display: none !important; }
  .app-col { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
}

/* ---- flash / alert ---- */
.flashwrap:empty { display: none; } .flashwrap { padding-top: 16px; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); margin: 0 0 14px; border: 1px solid transparent; font-size: .95rem; }
.alert-ok { background: var(--ok-bg); color: #0b4d26; border-color: #b7e2c6; }
.alert-err { background: var(--err-bg); color: #7f1414; border-color: #f3c0c0; }
.alert-warn { background: var(--warn-bg); color: #6d3f05; border-color: #f0d59a; }
.alert-info { background: var(--info-bg); color: #0b3a63; border-color: #c4d8ec; }
.alert .linklike { color: inherit; text-decoration: underline; padding: 0; }

/* ---- card / bottoni ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 0 0 18px; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 44px; transition: background .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: #f1f4f8; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.06); } .btn-accent:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--brand); color: var(--brand); } .btn-outline:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); color: #fff; } .btn-ghost:hover { background: rgba(255,255,255,.22); color: #fff; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; } .btn-danger:hover { background: #991b1b; color: #fff; }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: .875rem; border-radius: 9px; }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-block { display: flex; width: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .btn-primary:hover, .btn-accent:hover, .btn-outline:hover { transform: translateY(-1px); }
}
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 22px 0 14px; }
.page-head h1, .page-head h2 { margin: 0; }
.container > h1:first-child { margin-top: 22px; }
.crumbs { margin: 18px 0 8px; font-size: .9rem; }

/* ---- form ---- */
.field { margin: 0 0 16px; }
label { display: block; font-weight: 600; font-size: .92rem; margin: 0 0 5px; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], input[type=number], input[type=date], input[type=url], select, textarea, input:not([type]) {
  width: 100%; padding: 10px 12px; border: 1px solid #c5cfda; border-radius: var(--radius-sm); font: inherit; color: inherit; background: #fff; min-height: 44px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid rgba(15, 76, 129, .35); outline-offset: 1px; border-color: var(--brand); }
input:disabled { background: #eef1f5; color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); margin-top: 5px; }
.field-err { color: var(--err); font-size: .875rem; margin-top: 5px; font-weight: 500; }
.field.check label, label.check-inline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.field.check input, label.check-inline input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; flex: none; }
label.check-inline { align-items: center; margin: 0 10px 16px 0; }
.grid-2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.filters-form { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; margin-bottom: 8px; }
.filters-form .field { margin-bottom: 12px; } .filters-form .btn { margin-bottom: 12px; }

/* ---- badge / stati ---- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: #e9edf2; color: #334155; }
.st-inviata { background: #dbeafe; color: #1e40af; } .st-in_carico { background: #ede9fe; color: #5b21b6; }
.st-in_lavorazione { background: #fef3c7; color: #92400e; } .st-risolta { background: #dcfce7; color: #166534; }
.st-respinta { background: #fee2e2; color: #991b1b; } .st-archiviata { background: #e5e7eb; color: #374151; }
.st-interna { background: #fef9c3; color: #713f12; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }

/* ---- statistiche ---- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 20px; }
@media (min-width: 800px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.stat-v { font-size: 1.9rem; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat-l { font-size: .9rem; color: var(--ink); font-weight: 600; margin-top: 4px; }
.stat-s { font-size: .8rem; color: var(--muted); }

/* ---- hero home ---- */
.hero { position: relative; background: linear-gradient(150deg, var(--brand-dark) 0%, var(--brand) 55%, #1d78bc 100%); color: #fff; padding: 44px 0 56px; }
.hero h1 { font-size: 2rem; margin: 0 0 .5em; } .hero h1 span { color: var(--accent); }
.hero .lead { font-size: 1.1rem; opacity: .95; max-width: 640px; }
.hero-in { display: grid; gap: 28px; position: relative; z-index: 1; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.hero-stats { display: grid; gap: 12px; grid-template-columns: 1fr; }
.hero-stats .stat { background: rgba(255,255,255,.12); box-shadow: none; border: 1px solid rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(2px); }
.hero-stats .stat-v, .hero-stats .stat-l, .hero-stats .stat-s { color: #fff; }
.hero-small { padding: 34px 0; } .hero-small h1 { font-size: 1.7rem; }
.hero + .container { padding-top: 28px; }
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 44px; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0,30 C240,58 480,2 720,18 C960,34 1200,54 1440,26 L1440,60 L0,60 Z' fill='%23f3f5f8'/%3E%3C/svg%3E");
  background-size: 100% 100%; background-repeat: no-repeat;
}
@media (min-width: 900px) { .hero { padding: 64px 0 76px; } .hero h1 { font-size: 2.6rem; } .hero-in { grid-template-columns: 1.4fr 1fr; align-items: center; } .hero-stats { grid-template-columns: 1fr; } .hero::after { height: 64px; } }
.section { padding: 44px 0 20px; } .section.alt { background: #fff; padding-bottom: 36px; }
.steps { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 20px; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; }
.step-n { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--ink); font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
@media (prefers-reduced-motion: no-preference) { .step-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); } }

/* ---- vademecum emergenze: intestazioni di sezione con icona e card illustrate ---- */
.sec-head { display: flex; align-items: center; gap: 12px; margin: 30px 0 10px; }
.sec-head h2 { margin: 0; }
.sec-ico { width: 42px; height: 42px; border-radius: 50%; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; flex: none; font-size: 1.35rem; line-height: 1; }
.sec-ico.warn { background: var(--warn-bg); }
h1 .sec-ico { width: 36px; height: 36px; font-size: 1.15rem; vertical-align: -8px; margin-right: 2px; }
.emg-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 16px 0 24px; }
@media (min-width: 700px) { .emg-grid { grid-template-columns: repeat(2, 1fr); } }
.emg-card { background: #fff; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.emg-card .emg-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 10px; }
.emg-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.emg-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.band { background: var(--brand); color: #fff; padding: 36px 0; margin-top: 28px; }
.band h2 { color: #fff; } .band p { opacity: .95; margin: 0; }
.band-in { display: grid; gap: 16px; align-items: center; }
@media (min-width: 800px) { .band-in { grid-template-columns: 1fr auto; } }
.two-col { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .two-col { grid-template-columns: 1fr 1fr; } .two-col.wide-left { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-plain a { text-decoration: none; color: var(--ink); }
.checks { list-style: none; padding: 0; margin: 0 0 1em; }
.checks li { padding: 8px 0 8px 30px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 8px; width: 22px; height: 22px; background: var(--ok-bg); color: var(--ok); border-radius: 50%; text-align: center; font-weight: 800; font-size: .85rem; line-height: 22px; }

/* ---- mappe ---- */
.map { height: 320px; border-radius: var(--radius); border: 1px solid var(--line); background: #dde6ee; z-index: 1; }
.map-home { height: 420px; margin-bottom: 8px; } .map-form { height: 360px; }
.pop b { display: block; margin-bottom: 2px; }
.coords { font-size: .9rem; margin: 6px 0 12px; }
.comune-box { position: relative; }
.comune-view { padding: 10px 12px; border: 1px dashed #c5cfda; border-radius: 10px; margin-bottom: 8px; background: #f8fafc; color: var(--muted); }
.comune-view.ok { border-style: solid; border-color: #b7e2c6; background: var(--ok-bg); color: #0b4d26; font-weight: 700; }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; background: #fff; border: 1px solid #c5cfda; border-radius: 10px; margin: 2px 0 0; padding: 4px; list-style: none; box-shadow: var(--shadow); max-height: 260px; overflow: auto; }
.suggest[hidden] { display: none; }
.suggest li { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.suggest li:hover, .suggest li:focus { background: var(--brand-soft); outline: 0; } .suggest li.empty { color: var(--muted); cursor: default; }

/* ---- form segnalazione ---- */
.report-grid { display: grid; gap: 0 20px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .report-grid { grid-template-columns: 1fr 1fr; align-items: start; } .report-grid > .card:first-child { grid-row: span 2; } }
.step { display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: .9rem; margin-right: 6px; }
.chips { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; } .chip input { position: absolute; opacity: 0; }
.chip span { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid #c5cfda; border-radius: 99px; font-weight: 500; font-size: .9rem; cursor: pointer; background: #fff; }
.chip i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid rgba(15,76,129,.4); outline-offset: 2px; }
.vicine { background: var(--warn-bg); border: 1px solid #f0d59a; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.vicine h3 { margin: 0 0 4px; font-size: 1rem; }
.vicine-list { list-style: none; margin: 8px 0 0; padding: 0; } .vicine-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid #f0d59a; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 2px; } .thumb img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }

/* ---- elenchi segnalazioni ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tab { padding: 7px 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .9rem; }
.tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cards-list { display: grid; gap: 12px; }
.rep-card { display: flex; gap: 14px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; text-decoration: none; color: inherit; transition: box-shadow .18s, transform .18s; }
.rep-card:hover { box-shadow: var(--shadow-lift); }
.rep-thumb { flex: none; width: 84px; height: 84px; border-radius: 10px; background: var(--brand-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.rep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rep-body { flex: 1; min-width: 0; } .rep-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 2px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0; }
.pager a, .pager b { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; font-size: .9rem; }
.pager b { background: var(--brand); color: #fff; border-color: var(--brand); }
.comuni-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.comune-card { display: flex; flex-direction: column; gap: 2px; background: #fff; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.comune-card:hover { border-color: var(--brand); box-shadow: var(--shadow); } .comune-card .badge { align-self: flex-start; margin-top: 4px; }

.ba-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ba-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; color: var(--ink); transition: box-shadow .18s, transform .18s; }
.ba-card:hover { box-shadow: var(--shadow-lift); }
@media (prefers-reduced-motion: no-preference) {
  .rep-card:hover, .ba-card:hover, .comune-card:hover { transform: translateY(-2px); }
}
.ba-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.ba-imgs img, .ba-ph { width: 100%; height: 120px; object-fit: cover; display: block; }
.ba-ph { background: var(--brand-soft); }
.ba-body { padding: 10px 12px; }

/* ---- bacheca avvisi ---- */
.avviso-card { margin-bottom: 14px; }
.avviso-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.avviso-card h3 { margin: 0 0 6px; }
.avviso-testo { white-space: pre-wrap; margin: 0; }

/* ---- dettaglio segnalazione ---- */
.detail-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .detail-grid { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; } .detail-head h1 { margin: 0; font-size: 1.5rem; }
.meta { color: var(--muted); font-size: .9rem; margin: 6px 0 14px; }
.prose p { margin-bottom: .9em; }
.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 12px 0 20px; }
.gallery img { width: 100%; height: 130px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.dl { display: grid; grid-template-columns: 34% 1fr; gap: 8px 10px; margin: 14px 0; font-size: .92rem; } .dl dt { color: var(--muted); } .dl dd { margin: 0; word-break: break-word; }
.owner-actions { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; display: grid; gap: 14px; }
.success-card { border-left: 5px solid var(--ok); }
.timeline { list-style: none; margin: 0 0 8px; padding: 0; }
.timeline li { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); margin-top: 5px; z-index: 1; }
.tl-stato { background: var(--accent); } .tl-nota_interna { background: #ca8a04; } .tl-risposta_cittadino { background: #64748b; }
.tl-assegnata_esterno { background: #7c3aed; } .tl-foto_ripristino { background: #16a34a; }
.tl-text { background: #f6f8fb; border-radius: 8px; padding: 8px 12px; margin-top: 4px; }
.danger-zone { border: 1px solid #f3c0c0; }

/* ---- tabelle backend ---- */
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: #f7f9fb; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover { background: #fafbfd; }
.table a { font-weight: 600; text-decoration: none; }
.table .actions { white-space: nowrap; text-align: right; }
.table td.row-actions { flex-wrap: nowrap; white-space: nowrap; }
.bars { display: grid; gap: 8px; } .bar-row { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; font-size: .9rem; }
.bar-track { background: #eef2f6; border-radius: 99px; height: 10px; overflow: hidden; margin-top: 3px; } .bar-fill { height: 100%; background: var(--brand); border-radius: 99px; }
.tabs-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 14px; font-size: .93rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.progress { height: 14px; background: #e5eaf0; border-radius: 99px; overflow: hidden; } .progress > i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.upload-progress-box { margin-top: 12px; } .upload-progress-box .upload-progress { margin-bottom: 4px; } .upload-progress > i { background: var(--accent); }
pre.log { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 10px; overflow: auto; font-size: .82rem; max-height: 300px; }
code { background: #eef2f6; padding: 1px 6px; border-radius: 5px; font-size: .9em; }

/* ---- footer ---- */
.footer { background: #0e2238; color: #cbd5e1; padding: 28px 0; font-size: .9rem; }
.footer a { color: #fff; } .footer .muted { color: #94a3b8; }
.footer-in { display: grid; gap: 14px; }
@media (min-width: 800px) { .footer-in { grid-template-columns: 1.2fr 1fr 1.4fr; align-items: start; } }
@media print { .topbar, .footer, .btn, .btn-112, .nav-toggle, .sidebar, .sidebar-backdrop { display: none !important; } body { background: #fff; } .card { box-shadow: none; border: 1px solid #ccc; } }

/* backend: sottotitoli nelle schede e checkbox in linea */
.card h3 { margin-top: 1.4rem; }
.card > h3:first-child { margin-top: 0; }
label.check-inline span { flex: 1; }

.detail-grid > *, .two-col > * { min-width: 0; }
.table-wrap { max-width: 100%; }
.tl-body { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.area-tag { white-space: nowrap; }

[hidden] { display: none !important; }

/* ---- webapp (PWA) ---- */
.logo-mark { display: block; height: 38px; width: auto; }
.pwa-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--brand-soft); border-bottom: 1px solid var(--line); padding: 8px 16px; font-size: .9rem; }
.pwa-bar .pwa-txt { flex: 1 1 220px; }
.pwa-bar .pwa-x { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 8px; }
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  body { -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
}

/* ---- schede (log) ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--brand-dark); }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
label.check { display: inline-flex; align-items: center; gap: 8px; margin: 0 12px 12px 0; font-weight: 400; cursor: pointer; }

/* ---- logo dei Comuni ---- */
.logo-comune { display: inline-block; width: auto; max-width: 160px; object-fit: contain; vertical-align: middle; background: #fff; border-radius: 6px; padding: 2px; }
.logo-monogramma { display: inline-block; flex: none; text-align: center; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; vertical-align: middle; }
.subbar-in { display: flex; align-items: center; gap: 10px; }
.logo-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.title-logo { display: flex; align-items: center; gap: 14px; }

/* Conformita': avviso emergenze, moderazione, note legali */
.emergenza { border-left: 5px solid var(--err); display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.emergenza-txt { flex: 1 1 260px; }
.btn-112 { display: inline-flex; align-items: center; gap: 10px; background: var(--err); color: #fff; border: 2px solid var(--err); border-radius: 10px; padding: 8px 16px; min-height: 46px; font-weight: 700; text-decoration: none; line-height: 1.15; }
.btn-112:hover { background: #991b1b; border-color: #991b1b; color: #fff; text-decoration: none; }
.btn-112:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px var(--err); }
.btn-112 .ico-112 { flex: none; }
.btn-112 .ico-112-img { flex: none; width: 28px; height: 28px; object-fit: contain; }
.btn-112 .t112 b { font-size: 1.3rem; letter-spacing: .02em; }
.btn-112 .t112-sub { display: block; font-size: .78rem; font-weight: 500; opacity: .95; }
.btn-112-sm { min-height: 40px; padding: 4px 10px; gap: 6px; margin-left: auto; }
.btn-112-sm .t112 b { font-size: 1.05rem; }
.emergenza-wrap { max-width: 760px; margin: 26px auto 0; }
.mod-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 0 0 12px; background: #fff; }
.mod-item h3 { margin-bottom: .3em; }
.mod-item .flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.mod-item .flags span { background: var(--warn-bg); color: var(--warn); border-radius: 99px; padding: 1px 9px; font-size: .78rem; font-weight: 600; }
.mod-hide { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-top: 8px; }
.mod-hide input[type=text], .mod-hide textarea { flex: 1 1 240px; }
.hint-legal { font-size: .85rem; color: var(--muted); margin-top: 4px; }
.data-export { border: 1px dashed var(--line); border-radius: 10px; padding: 14px; }
@media (max-width: 420px) { .topbar-in { gap: 4px 8px; } .brand { font-size: .9rem; gap: 6px; } .btn-112-sm { padding: 4px 8px; gap: 5px; } .btn-112-sm .ico-112 { width: 18px; height: 18px; } .area-tag { margin-left: 2px; padding: 2px 6px; letter-spacing: .04em; } }
