/* admin.css — palette scura sobria, superfici a scaglioni, accento unico (copia propria: niente import
 * cross-repo). 0.3.0 (05/11/2026): menu a sezioni, colonne della Whitelist, modali dei form.
 * Regole della pagina (P2): testi ≥ 13 px, bersagli ≥ 44 px, niente testo tagliato (le email lunghe vanno a
 * capo), niente che esce dallo schermo a 393 px. Lo controlla scripts/guardia-visiva.mjs. */

:root {
  /* Senza questo il browser disegna barre di scorrimento CHIARE su pagine scure:
     due strisce bianche in mezzo all'interfaccia. Si vede solo guardando una
     foto della pagina — nessun test lo intercetta (Regola 59). */
  color-scheme: dark;

  --bg-app: #0b0d10;
  --bg-elevated: #14171c;
  --bg-elevated-2: #1b1f27;
  --bg-input: #14171c;
  --bg-hover: #1e232c;

  --text: #e6e9ef;
  --text-muted: #a3acbd;
  --text-faint: #7d8697;

  --border: #242932;
  --border-strong: #333a47;

  --accent: #ff9f5a;
  --accent-strong: #ff8433;
  --accent-soft: rgba(255, 159, 90, 0.14);

  --ok: #5ad19a;
  --warn: #f0b429;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  /* Semaforo di Sviluppo (0.7.0): Sì verde (--ok), Boh GIALLO/ambra, No rosso (--danger). Il Boh era viola. */
  --boh: #f5b82e;
  --boh-testo: #ffd466;
  --boh-soft: rgba(245, 184, 46, 0.14);
  --boh-bordo: rgba(245, 184, 46, 0.55);

  --radius: 10px;
  --radius-sm: 6px;
  --gap: 16px;
  --maxw: 1320px;
  --bersaglio: 44px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t: 160ms ease;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }
h1 { font-size: 22px; margin: 0 0 4px; }
h1:focus { outline: none; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin: 0 0 6px; }

/* ---- Barra in alto ---- */
header.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  min-width: 0;
}
header.topbar .brand .dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.topbar-destra { display: flex; align-items: center; gap: 10px; flex: none; }

.hamburger {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  min-width: var(--bersaglio);
  min-height: var(--bersaglio);
  padding: 0 12px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.hamburger:hover { background: var(--bg-hover); }

/* Versione in esecuzione: dato di servizio, piccolo e tenue, sempre visibile (Regola 60). */
.versione {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-faint);
}

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 16px 80px;
}

section.card, .card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
}
section.card h2 { margin: 0 0 4px; font-size: 16px; }
.sub {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- Controlli: ogni bersaglio almeno 44 px ---- */
input, select, textarea, button { font-family: inherit; font-size: 15px; }

button.btn {
  background: var(--accent);
  color: #1a1006;
  border: none;
  border-radius: var(--radius-sm);
  min-height: var(--bersaglio);
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: filter var(--t);
  max-width: 100%;
  white-space: normal;
  text-align: center;
  overflow-wrap: anywhere;
}
button.btn:hover { filter: brightness(1.08); }
button.btn.secondary {
  background: var(--bg-elevated-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
button.btn.danger { background: var(--danger); color: #200; }
button.btn.piccolo {
  background: var(--bg-elevated-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  min-width: var(--bersaglio);
}
button.btn.piccolo.pericolo { color: var(--danger); border-color: rgba(255, 107, 107, 0.45); }
button.btn.piena { width: 100%; }
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-width: 0;
}
.campo input, .campo select, .campo textarea {
  min-height: var(--bersaglio);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  width: 100%;
  font-size: 16px; /* 16 px: Safari su iPhone non zooma il campo */
}
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--accent); }
.facoltativo { color: var(--text-faint); font-size: 13px; }
.campo textarea { resize: vertical; line-height: 1.4; }
.campo input:disabled, .campo textarea:disabled, .campo select:disabled { opacity: 0.6; cursor: not-allowed; }
.campi-due { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .campi-due { grid-template-columns: 1fr 1fr; } }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  margin: 2px 4px 2px 0;
  overflow-wrap: anywhere;
}
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.tenue { background: var(--bg-elevated-2); color: var(--text-muted); font-weight: 500; }
.badge.ruolo { background: rgba(90, 209, 154, 0.14); color: var(--ok); }

.msg {
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.msg.ok { background: rgba(90,209,154,0.12); color: var(--ok); }
.msg.err { background: var(--danger-soft); color: var(--danger); }
.nota { font-size: 13px; color: var(--text-muted); margin: 4px 0 8px; overflow-wrap: anywhere; }
.nota.collegato { color: var(--ok); }
.nota.attesa, .nota.attenzione { color: var(--warn); }
.vuoto { color: var(--text-faint); font-size: 14px; list-style: none; padding: 8px 0; }
.caricamento { color: var(--text-muted); font-size: 14px; list-style: none; padding: 12px 0; margin: 0; }
.hidden { display: none !important; }

/* ---- Sezioni ---- */
.vista-testa {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.vista-testa > div { min-width: 0; flex: 1 1 320px; }
.vista-testa .sub { margin-bottom: 0; }

/* ---- Colonne della Whitelist: 4 su desktop, 2 su tablet, fisarmonica su telefono ---- */
.colonne { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 760px) { .colonne { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .colonne { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.colonna {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.colonna > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.colonna > summary::-webkit-details-marker { display: none; }
.colonna > summary::after { content: '▾'; color: var(--text-faint); font-size: 14px; flex: none; }
.colonna:not([open]) > summary { border-bottom: none; }
.colonna:not([open]) > summary::after { content: '▸'; }
.colonna-titolo { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; min-width: 0; }
.conta { color: var(--text-muted); font-size: 13px; white-space: nowrap; margin-left: auto; }
.colonna-corpo { padding: 10px 14px 14px; }
.colonna-corpo > .btn { margin: 6px 0 10px; }

.elenco, .schede, .registro, .elenco-semplice { list-style: none; margin: 0; padding: 0; }
.voce, .scheda {
  border-top: 1px solid var(--border);
  padding: 10px 0;
  min-width: 0;
}
.voce:first-child { border-top: none; }
.voce-nome { font-weight: 600; overflow-wrap: anywhere; }
.voce-desc { color: var(--text-muted); font-size: 14px; overflow-wrap: anywhere; }
.voce-email { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.piu { color: var(--text-faint); font-family: var(--font); }
.azioni { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge-riga { margin-top: 6px; }

/* ---- Schede fuori da ogni colonna (ex «Persone») ---- */
#altre-schede { margin-top: 28px; }
.brand-sotto { font-weight: 400; color: var(--text-muted); font-size: 14px; margin-left: 4px; }
.nome-link { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 600; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; overflow-wrap: anywhere; }
.nome-link:hover, .nome-link:focus-visible { color: var(--accent, inherit); }
.schede { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 760px) { .schede { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .schede { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.scheda {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

/* ---- Registro ---- */
.riga-registro {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.riga-registro .quando { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.riga-registro .frase { overflow-wrap: anywhere; }
.riga-registro .chi { font-weight: 600; color: var(--accent); }


/* ---- Menu (hamburger) ---- */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 20;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 88vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
  z-index: 21;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.drawer-testa { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer-testa h2 { margin: 0; }
.voce-menu {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.voce-menu:hover { background: var(--bg-hover); }
.voce-menu.attiva { background: var(--accent-soft); color: var(--accent); border-color: rgba(255, 159, 90, 0.35); }
.voce-menu.esci { margin-top: auto; color: var(--text-muted); font-weight: 500; }
.menu-sezioni { display: flex; flex-direction: column; gap: 6px; }

/* ---- Modali ---- */
.modale {
  position: fixed; z-index: 21;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(720px, 94vw); max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.55);
}
/* Informativa: volutamente NON chiudibile a vuoto (niente "X", niente click fuori). */
.modale h2 { margin: 0 0 10px; font-size: 18px; overflow-wrap: anywhere; }
.modale iframe {
  flex: 1 1 auto; min-height: 320px;
  width: 100%; margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-app);
}
.modale-form { width: min(620px, 94vw); overflow-y: auto; display: block; }
.modale-azioni { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.riga-bottoni { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 8px; }
.programma-fisso { margin: 0 0 12px; }

.programmi { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; margin: 0 0 12px; min-width: 0; }
.programmi legend { color: var(--text-muted); font-size: 14px; padding: 0 4px; }
.caselle { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
@media (min-width: 560px) { .caselle { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.casella {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--bersaglio);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  min-width: 0;
}
.casella span { overflow-wrap: anywhere; }
.casella:hover { background: var(--bg-hover); }
.casella input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); margin: 0; }
.casella.spenta { opacity: 0.55; cursor: not-allowed; }

.blocco { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.cerca { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.risultati { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.risultato {
  width: 100%; min-height: var(--bersaglio); text-align: left; cursor: pointer;
  background: var(--bg-elevated-2); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 15px; overflow-wrap: anywhere;
}
.risultato:hover { background: var(--bg-hover); }
.risultato .nota { display: block; margin: 2px 0 0; }
.scelta { margin-bottom: 8px; }
.campo input[readonly] { opacity: 0.75; }
.blocco.pericolo h3 { color: var(--danger); }
.riga-email { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; min-width: 0; }
.elenco-semplice li { overflow-wrap: anywhere; }
.aggiungi-email { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 10px; margin-top: 8px; }
@media (min-width: 560px) { .aggiungi-email { grid-template-columns: minmax(0, 1fr) 140px; } .aggiungi-email .riga-bottoni { grid-column: 1 / -1; } }

#login-gate {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}
#login-gate p { color: var(--text-muted); }

/* Su telefono «chi sono» ed «Esci» stanno nel menu: la barra resta su una riga. */
@media (max-width: 759px) {
  .solo-largo { display: none !important; }
  header.topbar .brand { font-size: 15px; }
  main { padding: 14px 12px 64px; }
  .modale { padding: 16px; }
}

/* ───────────────────────────────────────────────────────────────────────────
 * SVILUPPO (0.5.0) — la bacheca Dante ↔ Guz. Stesso linguaggio del resto della pagina (superfici scure, accento arancio);
 * gli stati hanno un colore ciascuno. Misure come tutto il resto: testi ≥ 13 px, bersagli ≥ 44 px, niente fuori a 393 px.
 * ─────────────────────────────────────────────────────────────────────────── */
.sv-riepilogo { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.sv-riepilogo b { color: var(--text); font-weight: 600; margin-right: 4px; }
.sv-sezione { margin-bottom: 22px; }
.sv-sezione > h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; font-size: 18px; }
.sv-gruppi { display: grid; gap: 18px; }
.sv-gruppo { display: grid; gap: 8px; min-width: 0; }
.sv-gruppo > h3 { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 14px; letter-spacing: 0.02em; color: var(--text-muted); }
.sv-lista { display: grid; gap: 8px; }

.sv-carta { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.sv-carta.sv-chiusa { background: var(--bg-app); }
.sv-carta-testa {
  all: unset; box-sizing: border-box; width: 100%; min-height: var(--bersaglio); cursor: pointer;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border-radius: var(--radius);
}
.sv-carta-testa:hover { background: var(--bg-hover); }
.sv-carta-testa:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sv-num { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.sv-titolo { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.sv-chevron { color: var(--text-faint); font-size: 14px; }
.sv-meta { grid-column: 2 / -1; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.sv-pill { justify-self: end; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; }
.sv-st-proposta { color: var(--text); background: var(--bg-elevated-2); } /* neutro: il giallo ora è solo del Boh */
.sv-st-dubbio { color: var(--boh-testo); background: var(--boh-soft); }
.sv-st-accettata { color: #7fb8f5; background: rgba(127, 184, 245, 0.14); }
.sv-st-fatta { color: var(--ok); background: rgba(90, 209, 154, 0.12); }
.sv-st-rifiutata { color: var(--danger); background: var(--danger-soft); }
.sv-st-ritirata { color: var(--text-muted); background: var(--bg-elevated-2); }
@media (max-width: 520px) {
  .sv-carta-testa { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sv-pill { grid-column: 1 / -1; justify-self: start; grid-row: 3; }
  .sv-meta { grid-column: 1 / -1; }
}

.sv-vetrina { padding: 0 14px 14px; display: grid; gap: 12px; min-width: 0; }
.sv-breve { margin: 0; max-width: 68ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-media { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sv-copertina, .sv-miniatura {
  all: unset; box-sizing: border-box; cursor: zoom-in; overflow: hidden; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-elevated-2);
}
.sv-copertina { width: 220px; max-width: 100%; aspect-ratio: 16 / 10; }
.sv-miniatura { width: 132px; height: 92px; }
.sv-copertina:focus-visible, .sv-miniatura:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sv-copertina img, .sv-miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; font-size: 13px; }
a.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--bersaglio); padding: 10px 16px;
  background: var(--accent); color: #1a1006; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; overflow-wrap: anywhere;
}
.sv-prova { font-size: 15px; }
.sv-verdetto { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sv-aspetta { margin: 0; color: var(--text-muted); font-size: 14px; }
button.btn.sv-si { background: var(--ok); color: #06210f; border: 1px solid var(--ok); }
button.btn.sv-no { background: var(--danger); color: #2a0505; border: 1px solid var(--danger); }
button.btn.sv-boh { background: var(--boh); color: #1f1500; border: 1px solid var(--boh); }
button.btn.sv-si.accesa, button.btn.sv-no.accesa, button.btn.sv-boh.accesa { cursor: default; box-shadow: 0 0 0 3px var(--bg-app), 0 0 0 5px currentColor; filter: none; }
.sv-boh-box { border: 1px solid var(--boh-bordo); background: var(--boh-soft); border-radius: var(--radius-sm); padding: 10px 12px; display: grid; gap: 6px; }
.sv-boh-box p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-boh-box .sv-etichetta { color: var(--boh-testo); }
.sv-motivo { border: 1px solid rgba(255, 107, 107, 0.5); background: var(--danger-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.sv-motivo .sv-etichetta { color: var(--danger); }
.sv-motivo p { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.sv-giudizio { display: grid; gap: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px; }
.sv-giudizio-no { border-color: rgba(255, 107, 107, 0.5); }
.sv-giudizio-boh { border-color: var(--boh-bordo); }
.sv-area, .sv-giudizio textarea {
  width: 100%; min-height: var(--bersaglio); background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 10px; font-size: 16px; resize: vertical; line-height: 1.4;
}
.sv-area:focus { outline: none; border-color: var(--accent); }
.sv-mono { font-family: var(--font-mono); font-size: 14px; }
.sv-etichetta { font-size: 13px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-muted); }
.sv-errore { color: var(--danger); font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.sv-errore:empty { display: none; }
.aiuto { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.sv-registratore { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.sv-registratore:empty { display: none; }
audio { max-width: 100%; height: var(--bersaglio); }
.sv-rec { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); display: inline-block; }
.sv-tag-boh { font-size: 13px; font-weight: 600; color: var(--boh-testo); border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; margin-left: 8px; }

.sv-corpo { border-top: 1px solid var(--border); padding: 14px; display: grid; gap: 16px; min-width: 0; }
.sv-blocco { display: grid; gap: 4px; min-width: 0; }
.sv-blocco p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.sv-galleria { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 520px) { .sv-galleria { grid-template-columns: minmax(0, 1fr); } }
.sv-miniature { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-prompt {
  margin: 0; font-family: var(--font-mono); font-size: 13px; background: var(--bg-app); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto;
}
.sv-copia-ripiego { font-family: var(--font-mono); font-size: 13px; min-height: 90px; }
.sv-note { display: grid; gap: 8px; }
.sv-nota { border-left: 2px solid var(--border-strong); padding: 2px 0 2px 10px; min-width: 0; }
.sv-nota .sv-chi { font-size: 13px; color: var(--text-muted); }
.sv-nota p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-nota-nuova { display: grid; gap: 8px; }
.sv-storia { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.sv-storia li { overflow-wrap: anywhere; }

/* modulo nuova richiesta: due riquadri per le immagini */
.sv-zone { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
@media (max-width: 560px) { .sv-zone { grid-template-columns: minmax(0, 1fr); } }
.sv-zona { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 10px; background: var(--bg-app); min-width: 0; }
.sv-zona.attiva { border-color: var(--accent); border-style: solid; }
.sv-zona.sopra { background: var(--accent-soft); }
.sv-zona-testa { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-scegli {
  display: inline-flex; align-items: center; min-height: var(--bersaglio); padding: 0 12px; cursor: pointer;
  background: var(--bg-elevated-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 14px;
}
.sv-anteprime { display: flex; flex-wrap: wrap; gap: 8px; }
.sv-anteprime:empty { display: none; }
.sv-anteprima { position: relative; width: 120px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-strong); background: var(--bg-elevated-2); }
.sv-anteprima img { width: 100%; height: 100%; object-fit: cover; display: block; font-size: 13px; }
.sv-anteprima button {
  position: absolute; top: 0; right: 0; width: var(--bersaglio); height: var(--bersaglio); border: 0; background: rgba(0, 0, 0, 0.6);
  color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
}

/* immagine ingrandita e demo a tutto schermo */
.sv-lightbox {
  position: fixed; inset: 0; z-index: 30; background: rgba(5, 7, 10, 0.88); display: grid; place-items: center;
  padding: 64px 16px 16px;
}
.sv-lightbox img { max-width: 100%; max-height: 82vh; border-radius: var(--radius-sm); background: #fff; }
.sv-lightbox > button { position: absolute; top: 12px; right: 12px; }
.sv-demo { position: fixed; inset: 0; z-index: 30; background: var(--bg-app); display: flex; flex-direction: column; }
.sv-demo-barra {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; min-height: 60px;
  background: var(--bg-elevated); border-bottom: 1px solid var(--border); font-weight: 700;
}
.sv-demo-corpo { flex: 1 1 auto; min-height: 0; }
.sv-demo-corpo iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }

.sv-avviso-vocale { flex-basis: 100%; }
#sv-avviso-immagini { margin: 0 0 8px; }

/* ---- 0.7.0: il semaforo (Sì verde · Boh giallo · No rosso), il filtro, gli allegati del Boh ---- */
.sv-verdetto { display: grid; gap: 10px; }
.sv-semaforo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .sv-semaforo { grid-template-columns: minmax(0, 1fr); } }
.sv-luce { display: grid; gap: 4px; align-content: start; min-width: 0; }
.sv-luce > button { width: 100%; }
.sv-luce-aiuto { margin: 0; font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }
.sv-verdetto-altre, .sv-verdetto > .btn { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sv-verdetto:not(:has(.sv-semaforo)) { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sv-aspetta-no { color: var(--text); font-weight: 600; flex-basis: 100%; }

.sv-filtro { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sv-filtro-voce {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--bersaglio); padding: 0 14px; cursor: pointer;
  background: var(--bg-elevated); color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; font-size: 15px; font-weight: 600;
}
.sv-filtro-voce:hover { background: var(--bg-hover); }
.sv-filtro-voce:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sv-filtro-voce.attiva { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.sv-filtro-n { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.sv-filtro-voce.attiva .sv-filtro-n { color: inherit; }
.sv-punto { width: 10px; height: 10px; border-radius: 50%; background: var(--text-faint); display: inline-block; }
.sv-f-accettata .sv-punto { background: var(--ok); }
.sv-f-dubbio .sv-punto { background: var(--boh); }
.sv-f-rifiutata .sv-punto { background: var(--danger); }
.sv-f-tutte .sv-punto, .sv-f-fatta .sv-punto { display: none; }

.sv-zona-boh { background: var(--bg-app); }
.sv-allegati-scelti, .sv-allegati { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.sv-allegati-scelti:empty { display: none; }
.sv-allegato-scelto, .sv-allegati li { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.sv-allegato-scelto img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); }
.sv-pdf { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-elevated-2); font-size: 13px; font-weight: 700; }
.sv-allegato-nome { min-width: 0; overflow-wrap: anywhere; font-size: 14px; flex: 1 1 120px; }
.sv-pdf-scarica { overflow-wrap: anywhere; text-align: left; }

/* Voci «Da attivare» del menu (0.7.0): segnaposto, non cliccabili, non raggiungibili con Tab. */
.menu-gruppo-titolo { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--border-strong); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: var(--text-muted); }
.menu-bloccate { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.voce-bloccata { display: flex; flex-direction: column; justify-content: center; gap: 1px; cursor: not-allowed; color: var(--text-muted); font-weight: 500; background: transparent; }
.voce-bloccata:hover { background: transparent; }
.voce-bloccata-nome { font-size: 16px; font-weight: 600; }
.voce-bloccata-nota { font-size: 13px; color: var(--text-muted); }

/* ---- 0.7.0: Passi dopo il Sì ---- */
.sv-passi { border: 2px solid var(--ok); background: rgba(90, 209, 154, 0.08); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; min-width: 0; }
.sv-passi-testa { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.sv-passi-testa h3 { margin: 0; font-size: 18px; }
.sv-passi-badge { font-size: 13px; font-weight: 600; color: var(--text); border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 10px; }
.sv-passi-anteprima { border: 1px dashed var(--border-strong); background: var(--bg-app); opacity: 0.85; }
.sv-passi-anteprima .sv-passo, .sv-passi-anteprima .sv-passi-testa h3 { color: var(--text-muted); }
.sv-passi-sola { border-color: var(--border-strong); background: var(--bg-app); }
.sv-avanzamento { display: flex; align-items: center; gap: 10px; }
.sv-barra { flex: 1 1 auto; height: 10px; background: var(--bg-elevated-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border-strong); }
.sv-barra span { display: block; height: 100%; background: var(--ok); }
.sv-avanzamento-testo { font-family: var(--font-mono); font-size: 14px; font-weight: 600; white-space: nowrap; }
.sv-passi-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sv-passo { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 10px; min-width: 0; }
.sv-passo.fatto { opacity: 0.8; border-color: rgba(90, 209, 154, 0.5); }
.sv-passo-testa { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sv-passo-testa h4 { margin: 0; font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
.sv-passo.fatto .sv-passo-testa h4 { text-decoration: line-through; text-decoration-thickness: 1px; }
.sv-passo-n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #06210f; font-weight: 700; font-size: 14px; }
.sv-passi-anteprima .sv-passo-n { background: var(--bg-elevated-2); color: var(--text-muted); }
.sv-passo-istruzione { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 68ch; }
.sv-passo-link { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
a.btn.sv-apri { min-height: 52px; padding: 12px 22px; font-size: 17px; background: var(--ok); color: #06210f; }
.sv-sito { font-family: var(--font-mono); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.sv-valori { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sv-valori li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--bg-app); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 6px 6px 10px; min-width: 0; }
.sv-valore-testo { min-width: 0; overflow-wrap: anywhere; flex: 1 1 160px; }
.sv-valore-etichetta { color: var(--text-muted); font-size: 14px; }
.sv-valore { font-family: var(--font-mono); font-size: 14px; }
.sv-fatto { justify-self: start; }
.sv-fatto-da { margin: 0; }
.sv-tutto-fatto { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; border: 2px solid var(--ok); border-radius: var(--radius-sm); padding: 12px; background: rgba(90, 209, 154, 0.14); }
.sv-tutto-fatto p { margin: 0; font-weight: 700; }

.sv-passi-editor { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 10px; margin: 0 0 12px; min-width: 0; }
.sv-passi-editor legend { font-weight: 600; padding: 0 6px; }
.sv-passi-editor .aiuto { margin: 0; }
#sv-passi-lista { display: grid; gap: 10px; }
.sv-passo-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; display: grid; gap: 8px; background: var(--bg-app); min-width: 0; }
.sv-passo-editor-testa { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.sv-valori-blocco, .sv-valori-editor { display: grid; gap: 6px; }
.sv-valore-riga { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: 6px; align-items: center; }
@media (max-width: 560px) { .sv-valore-riga { grid-template-columns: minmax(0, 1fr); } }
.sv-valore-riga input, .sv-passo-editor input[type=text], .sv-passo-editor textarea {
  width: 100%; min-height: var(--bersaglio); background: var(--bg-input); border: 1px solid var(--border-strong); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 10px; font-size: 16px;
}
.sv-sito-anteprima { margin: 0; font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; }
.sv-badge-cambiato { flex: none; font-size: 13px; font-weight: 700; color: var(--boh-testo); background: var(--boh-soft); border: 1px solid var(--boh-bordo); border-radius: 999px; padding: 1px 10px; }
