/* ===========================================
   RICORDATI PWA — Stylesheet
   Struttura standard Ciegi (topbar, menu, badge, footer legale,
   bottom-nav mobile). Colore app: blu #2c7be5.
   Semaforo scadenze: rosso / ambra / verde.
   =========================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --app: #2c7be5;
  --app-dark: #1a5bb8;
  --app-chiaro: #e6f0fd;
  --blu: #1a5bb8;
  --verde: #16a34a;
  --verde-btn: #28a745;
  --ambra: #f59e0b;
  --rosso: #dc2626;
  --rosso-btn: #dc3545;
  --grigio: #6c757d;
  --bg: #f3f6fa;
  --bg-card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e2e7ef;
  --shadow: 0 2px 6px rgba(0,0,0,0.08);
  --radius: 10px;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--blu); outline-offset: 2px; }
.hidden { display: none !important; }

/* ===== TOPBAR (standard Ciegi) ===== */
.topbar {
  background: var(--app);
  color: #fff;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar h1 { font-size: 20px; font-weight: 700; margin: 0; white-space: nowrap; }
.topbar .sub { font-size: 13px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand-link { display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand-link:hover .brand-logo { opacity: 0.92; }

/* Pallino protezione dati CSG: tondo CSS, mai emoji */
.storage-dot {
  display: inline-block; flex-shrink: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: #9ca3af; border: 1px solid rgba(0,0,0,.25);
  cursor: pointer;
}

.drive-area { display: inline-flex; align-items: center; margin-left: auto; gap: 0; }
.drive-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 14px;
  background: rgba(255,255,255,0.92); color: #555;
  border: 1px solid #d4d8e0;
  font-size: 12px; font-weight: 600; cursor: pointer;
  max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.drive-badge:hover { background: #fff; }
.drive-badge.synced  { color: #0d7a4a; border-color: #0d7a4a; }
.drive-badge.syncing { color: #c47100; border-color: #e6a830; }
.drive-badge.error   { color: #c4351c; border-color: #c4351c; }
.drive-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; flex-shrink: 0; }
.drive-badge.synced .drive-dot  { background: #16a34a; }
.drive-badge.syncing .drive-dot { background: #f59e0b; animation: drivePulse .8s infinite; }
.drive-badge.error .drive-dot   { background: #dc2626; }
@keyframes drivePulse { 50% { opacity: .3; } }
.drive-label { overflow: hidden; text-overflow: ellipsis; }

.btn-quick-sync {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-left: 6px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: 1px solid #d4d8e0;
  font-size: 14px; cursor: pointer; flex-shrink: 0;
}
.btn-quick-sync.spin { animation: spinRot 1s linear infinite; }
@keyframes spinRot { to { transform: rotate(360deg); } }

.lingua-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 26px; margin-left: 8px; padding: 0;
  border-radius: 5px; background: rgba(255,255,255,0.92);
  border: 1px solid #d4d8e0; cursor: pointer; flex-shrink: 0; overflow: hidden;
}
.lingua-badge:hover { background: #fff; }
.lingua-menu {
  position: absolute; z-index: 99999; background: #fff; border: 1px solid #ccc;
  border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 4px; min-width: 150px;
}
.lingua-voce {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 0; background: transparent; border-radius: 6px;
  font-size: 14px; color: #222; cursor: pointer; text-align: left;
}
.lingua-voce:hover { background: #f3f3f3; }
.lingua-voce.attiva { background: var(--app-chiaro); font-weight: 600; }

/* ===== MENU A TENDINA (standard Ciegi) ===== */
.menu-wrap { position: relative; margin-left: 10px; }
.btn-menu {
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.4);
  color: #fff; padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-menu:hover, .btn-menu[aria-expanded="true"] { background: rgba(255,255,255,0.3); }
.menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 300px; max-width: 90vw;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.20); padding: 6px; z-index: 999;
  color: var(--text);
}
.menu-section { padding: 4px 0; }
.menu-section + .menu-section { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 6px; }
.menu-section-title { font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 6px 12px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; background: transparent; border: none; color: var(--text);
  font-size: 14px; text-align: left; cursor: pointer; border-radius: 6px;
}
.menu-item:hover { background: #eef3fa; }
.menu-item .menu-ic { flex-shrink: 0; font-size: 16px; width: 20px; text-align: center; }
.menu-item .menu-lbl { flex: 1; font-weight: 500; }
.menu-item .menu-summary {
  flex-shrink: 0; font-size: 11px; color: var(--text-muted); font-weight: 600;
  background: #f1f4f9; padding: 2px 8px; border-radius: 10px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== CONTENUTO ===== */
.container { max-width: 760px; margin: 0 auto; padding: 18px 16px 24px; }
.view-tit { font-size: 15px; font-weight: 700; color: var(--app-dark); margin: 22px 0 8px; }

/* Semaforo: una sola striscia a tre lampade */
.semaforo {
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.sem-cella {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 16px 12px; border: 0; background: transparent; text-align: left;
  color: var(--text); cursor: default; position: relative;
}
.sem-cella + .sem-cella { border-left: 1px solid var(--border); }
button.sem-cella { cursor: pointer; font: inherit; }
button.sem-cella:hover { background: #f7f9fd; }
.sem-cella::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: var(--lampada);
}
.sem-rosso { --lampada: var(--rosso); }
.sem-ambra { --lampada: var(--ambra); }
.sem-verde { --lampada: var(--verde); }
.sem-num { font-size: 34px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sem-rosso .sem-num { color: var(--rosso); }
.sem-ambra .sem-num { color: #b86e00; }
.sem-verde .sem-num { color: var(--verde); }
.sem-num.zero { color: #b8c1cf; }
.sem-lbl { font-size: 13px; font-weight: 700; }
.sem-det { font-size: 11px; color: var(--text-muted); }

.azioni { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 14px; }
.azione {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-radius: var(--radius); cursor: pointer; text-align: left; font-size: 16px;
}
.azione .az-ic { font-size: 24px; line-height: 1; }
.azione .az-tit { display: block; font-weight: 700; }
.azione .az-sub { display: block; font-size: 12px; opacity: .85; font-weight: 500; }
.azione-primaria { background: var(--app); color: #fff; border: 0; box-shadow: 0 3px 10px rgba(44,123,229,.3); }
.azione-primaria:active { background: var(--app-dark); }
.azione-secondaria { background: var(--bg-card); color: var(--app-dark); border: 1px solid #c9d7ea; }

.avviso-vuoto {
  margin-top: 14px; padding: 12px 14px; border-radius: 8px;
  background: var(--app-chiaro); color: var(--app-dark); font-size: 13px;
}

.lista-unita { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.riga-unita {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 16px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text);
}
.riga-unita + .riga-unita { border-top: 1px solid var(--border); }
.riga-unita:hover { background: #f7f9fd; }
.ru-ic { font-size: 22px; width: 28px; text-align: center; }
.ru-nome { flex: 1; font-weight: 600; }
.ru-conta { font-size: 13px; color: var(--text-muted); }
.ru-freccia { color: #9aa4b4; font-size: 18px; }
.link-azione { display: inline-block; margin-top: 8px; background: none; border: 0; color: var(--app); font-weight: 600; cursor: pointer; font-size: 14px; padding: 4px 0; }

/* ===== BOTTONI ===== */
.btn { padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; }
.btn-primario { background: var(--app); color: #fff; }
.btn-verde { background: var(--verde-btn); color: #fff; }
.btn-rosso { background: var(--rosso-btn); color: #fff; }
.btn-grigio { background: var(--grigio); color: #fff; }
.btn-bordo { background: none; color: inherit; border: 1px solid rgba(0,0,0,.25); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-icona { border: 0; background: none; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.btn-icona:hover { background: #eef1f6; }

/* ===== MODALI ===== */
.modal {
  position: fixed; inset: 0; z-index: 2000; background: rgba(12,24,48,.55);
  display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px;
  overflow-y: auto;
}
.modal-content {
  background: var(--bg-card); border-radius: 12px; width: 100%; max-width: 560px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 17px; color: var(--app-dark); }
.modal-head .close { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: #777; padding: 0 4px; }
.modal-body { padding: 16px 18px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }

.imp-sez { padding: 12px 0; }
.imp-sez + .imp-sez { border-top: 1px solid var(--border); }
.imp-tit { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.imp-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.imp-riga { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-stato { font-size: 13px; margin-bottom: 8px; }
.lingue-scelta { display: flex; gap: 8px; flex-wrap: wrap; }
.lingua-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px;
}
.lingua-btn.attiva { border-color: var(--app); background: var(--app-chiaro); font-weight: 700; }
.num-input { width: 70px; padding: 6px 8px; border: 1px solid #c9d2df; border-radius: 6px; font-size: 15px; text-align: center; }

.campo { margin-bottom: 12px; }
.campo label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.campo input[type=text], .campo select {
  width: 100%; padding: 9px 10px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 15px; background: #fff;
}
.tipi-scelta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tipo-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer; font-size: 12px;
}
.tipo-btn .tipo-ic { font-size: 22px; }
.tipo-btn.attiva { border-color: var(--app); background: var(--app-chiaro); font-weight: 700; }

.riga-gest {
  display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--border);
}
.riga-gest .rg-nome { flex: 1; font-weight: 600; }
.riga-gest .rg-conta { font-size: 12px; color: var(--text-muted); }

.help-content h4 { margin: 14px 0 4px; font-size: 14px; color: var(--app-dark); }
.help-content h4:first-child { margin-top: 0; }
.help-content p { margin: 4px 0 8px; line-height: 1.55; font-size: 14px; }
.help-brand-bottom {
  display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border); font-size: 12px; color: #555;
}
.help-brand-logo-bottom { width: 80px; height: auto; }

/* ===== CARICO (v0.2) ===== */
.mic-box { display: flex; align-items: center; gap: 14px; padding: 4px 0 12px; }
.mic-btn {
  flex-shrink: 0; width: 72px; height: 72px; border-radius: 50%;
  border: 0; background: var(--app); color: #fff; font-size: 30px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(44,123,229,.35);
}
.mic-btn.ascolto { background: var(--rosso); box-shadow: 0 0 0 0 rgba(220,38,38,.55); animation: micPulse 1.4s infinite; }
.mic-btn.conferma { background: var(--verde); }
@keyframes micPulse { 70% { box-shadow: 0 0 0 16px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.mic-testi { flex: 1; min-width: 0; }
.mic-stato { font-size: 14px; font-weight: 600; color: var(--app-dark); }
.mic-live {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #fff7ed;
  border: 1px dashed #f5b35c; font-size: 15px; min-height: 38px; color: #7c3d00;
}
.car-testo-riga { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.car-testo-riga textarea {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid #c9d2df; border-radius: 8px;
  font: inherit; font-size: 15px; resize: vertical;
}
.schede { display: flex; flex-direction: column; gap: 10px; }
.scheda { border: 1px solid #cfe1dd; border-left: 4px solid var(--app); border-radius: 10px; padding: 10px; background: #fbfdfd; }
.sch-riga { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sch-riga:last-child { margin-bottom: 0; }
.sch-nome { flex: 1; min-width: 140px; padding: 8px 10px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 16px; font-weight: 600; }
.sch-lbl { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.sch-scad, #ge-scad { padding: 7px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 15px; }
.sch-unita { flex: 1; min-width: 130px; padding: 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; background: #fff; }
.sch-ubi { flex: 1; min-width: 110px; padding: 8px 10px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; }
.sch-testo { font-size: 11px; color: var(--text-muted); font-style: italic; }
.qta { display: inline-flex; align-items: center; border: 1px solid #c9d2df; border-radius: 8px; overflow: hidden; }
.qta-btn { width: 32px; height: 36px; border: 0; background: #eef3fa; font-size: 18px; cursor: pointer; }
.sch-qta { width: 44px; height: 36px; border: 0; text-align: center; font-size: 15px; -moz-appearance: textfield; }
.sch-qta::-webkit-inner-spin-button, .sch-qta::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip {
  padding: 5px 10px; border-radius: 14px; border: 1px solid #c9d7ea; background: #fff;
  font-size: 12px; font-weight: 600; color: var(--app-dark); cursor: pointer;
}
.chip:hover { background: var(--app-chiaro); }
.rel { font-size: 12px; font-weight: 700; }
.rel.st-scaduto { color: var(--rosso); }
.rel.st-inscadenza { color: #b86e00; }
.rel.st-ok { color: var(--verde); }
.rel.st-nd { color: var(--text-muted); }

/* Piede del carico: "Salva tutto" sempre visibile in fondo */
.car-piede {
  position: sticky; bottom: 0; z-index: 2; margin: 14px -18px -16px; padding: 10px 18px 12px;
  background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 12px rgba(0,0,0,.06);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.btn-grande { width: 100%; padding: 13px 16px; font-size: 17px; border-radius: 10px; }
.car-piede-riga { display: flex; gap: 8px; justify-content: space-between; margin-top: 8px; }
.car-piede-riga .btn { flex: 1; }

/* ===== ELENCO (v0.2) ===== */
.chip-stato b { margin-left: 2px; }
.chip-stato.attivo { background: var(--app); color: #fff; border-color: var(--app); }
.chip-stato.st-scaduto.attivo { background: var(--rosso); border-color: var(--rosso); }
.chip-stato.st-inscadenza.attivo { background: #d88a06; border-color: #d88a06; }
.chip-stato.st-ok.attivo { background: var(--verde); border-color: var(--verde); }
.el-filtri { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.el-filtri input, .el-filtri select { flex: 1; min-width: 140px; padding: 8px 10px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 15px; background: #fff; }
.el-lista { display: flex; flex-direction: column; gap: 8px; }
.riga-gia { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-left: 5px solid #b8c1cf; border-radius: 10px; background: #fff; padding: 6px 8px; }
.riga-gia.st-scaduto { border-left-color: var(--rosso); }
.riga-gia.st-inscadenza { border-left-color: var(--ambra); }
.riga-gia.st-ok { border-left-color: var(--verde); }
.rg-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--text); font: inherit; }
.rg-corpo .rg-nome { font-weight: 700; font-size: 15px; }
.rg-qta { color: var(--app); font-weight: 800; }
.rg-scad { font-size: 13px; color: var(--text-muted); }
.rg-dove { font-size: 12px; color: var(--text-muted); }
.rg-azioni { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.btn-pic { padding: 5px 9px; font-size: 12px; white-space: nowrap; }
.riga-gest .rg-nome { flex: 1; font-weight: 600; display: flex; flex-direction: column; }
.rg-info { font-size: 12px; font-weight: 400; color: var(--text-muted); }

/* ===== PROCEDURE GUIDATE (v0.3) ===== */
.wiz { font-size: 16px; }
.wiz-passi { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.wiz-passi span { width: 34px; height: 5px; border-radius: 3px; background: #d9e4e2; }
.wiz-passi span.fatto { background: var(--app); }
.wiz-icona { font-size: 40px; text-align: center; margin-bottom: 6px; }
.wiz-tit { font-size: 20px; color: var(--app-dark); margin-bottom: 8px; line-height: 1.3; }
.wiz-txt { font-size: 16px; line-height: 1.5; margin-bottom: 12px; }
.wiz-sub { font-size: 13px; font-weight: 700; color: var(--text-muted); margin: 12px 0 6px; }
.wiz-nota { font-size: 13px; color: var(--text-muted); margin: 10px 0; line-height: 1.45; }
.wiz-opz { font-size: 15px; line-height: 1.5; margin: 12px 0 8px; }
.wiz .campo label { font-size: 15px; margin-bottom: 6px; }
.wiz .campo input { font-size: 17px; padding: 11px 12px; }
.wiz-riga { display: flex; gap: 8px; margin-bottom: 10px; }
.wiz-riga input { flex: 1; min-width: 0; padding: 11px 12px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 16px; }
.wiz-check { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; margin: 4px 0 10px; cursor: pointer; line-height: 1.4; }
.wiz-check input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; }
.wiz-azioni { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.wiz-azioni .btn-grande { flex: 1; }
.wiz-azioni-3 .btn { flex: 1; min-width: 110px; }
a.btn { display: inline-block; text-align: center; text-decoration: none; }
.btn-link { background: none; border: 0; color: var(--app); font-weight: 600; font-size: 15px; cursor: pointer; padding: 6px 0; text-decoration: underline; }
.wiz-err { background: #fee2e2; color: #7f1d1d; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin: 8px 0; }
.wiz-occ { background: var(--app-chiaro); color: var(--app-dark); border-radius: 8px; padding: 9px 12px; font-size: 14px; margin: 8px 0; }
.wiz-qr { width: 200px; max-width: 70%; margin: 6px auto 4px; }
.wiz-qr svg { width: 100%; height: auto; display: block; }
.wiz-membri { margin-bottom: 6px; }
.chi-nomi { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 6px; }
.chi-nome { padding: 16px 10px; font-size: 17px; font-weight: 700; border-radius: 10px; border: 2px solid var(--app); background: #fff; color: var(--app-dark); cursor: pointer; }
.chi-nome:active { background: var(--app-chiaro); }
.arc-attivo { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--app-chiaro); margin-bottom: 8px; }
.arc-attivo .arc-ic { font-size: 22px; }
.arc-attivo b { display: block; }

/* ===== SCANSIONE ED ETICHETTE (v0.4) ===== */
.btn-scan { width: 100%; margin: 0 0 12px; padding: 11px 14px; font-size: 15px; }
.scan-box { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #111; border-radius: 12px; overflow: hidden; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-mirino {
  position: absolute; left: 18%; right: 18%; top: 18%; bottom: 18%;
  border: 3px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none;
}
.scan-stato { margin: 10px 0; font-size: 14px; color: var(--app-dark); font-weight: 600; }
.scan-stato.scan-errore { color: #7f1d1d; background: #fee2e2; padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.sch-et { margin-top: 2px; }
.chip-et { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 14px;
  background: var(--app-chiaro); color: var(--app-dark); font-weight: 700; font-size: 13px; font-family: "Courier New", monospace; }
.chip-ean { display: inline-block; padding: 4px 10px; border-radius: 14px; background: #f1f4f9; font-size: 12px; color: var(--text-muted); font-family: "Courier New", monospace; }
.pv-cod { font-family: "Courier New", monospace; font-weight: 700; color: var(--app); margin-bottom: 6px; }
.pv-nome { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; margin-bottom: 6px; }
.pv-scad { font-size: 16px; margin-bottom: 8px; }
.pv-scad .rel { font-size: 16px; }
.pv-info { font-size: 14px; color: var(--text-muted); margin-bottom: 4px; }
.pv-mov { list-style: none; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.et-modi { margin-bottom: 4px; }
#car-stampa { margin-top: 12px; }

/* ===== VANI (v0.5) ===== */
.vani-cont { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-weight: 600; }
.vani-n { display: inline-block; min-width: 40px; text-align: center; font-size: 16px; font-weight: 700; }
.vani-sub { font-size: 12px; font-weight: 700; color: var(--text-muted); margin: 10px 0 6px; }
.chip-toggle.attivo { background: var(--app); color: #fff; border-color: var(--app); }
.vani-nuovo { margin-top: 8px; }

.sch-etn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--app-dark); }
.sch-etn .qta-btn { width: 30px; height: 30px; border: 1px solid #c9d2df; border-radius: 8px; background: #fff; }
.sch-etn-n { min-width: 18px; text-align: center; }
.chip-conf { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; padding: 3px 4px 3px 10px; border-radius: 14px;
  background: #fff4e0; color: #7a4a00; font-weight: 700; font-size: 13px; }
.rg-conf { font-size: 12px; font-weight: 600; color: #7a4a00; }

/* ===== GUIDA (v0.5.3) ===== */
.g-sez { border: 1px solid #dfe5ee; border-radius: 10px; margin-bottom: 8px; background: #fff; }
.g-sez > summary { cursor: pointer; padding: 12px 14px; font-weight: 700; color: var(--app-dark); list-style: none; }
.g-sez > summary::-webkit-details-marker { display: none; }
.g-sez > summary::after { content: '▸'; float: right; transition: transform .15s; }
.g-sez[open] > summary::after { transform: rotate(90deg); }
.g-sez[open] > summary { border-bottom: 1px solid #eef2f8; }
.g-cont { padding: 8px 14px 12px; font-size: 14px; line-height: 1.5; }
.g-cont ul { padding-left: 18px; margin: 6px 0; }
.g-cont li { margin: 4px 0; }
.g-tab { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
.g-tab th, .g-tab td { border: 1px solid #dfe5ee; padding: 6px 8px; text-align: left; vertical-align: top; }
.g-tab th { background: var(--app-chiaro); }
.g-r { color: #c0392b; font-weight: 700; } .g-g { color: #b7791f; font-weight: 700; } .g-v { color: #1e8449; font-weight: 700; }
.g-stampa { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.g-fig { margin: 14px 0 18px; }
.g-fig img { display: block; width: 100%; max-width: 340px; margin: 0 auto 8px; border: 1px solid #dfe5ee; border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.08); background: #f3f6fa; min-height: 120px; }
.g-leg { margin: 0; padding-left: 26px; font-size: 13.5px; line-height: 1.45; }
.g-leg li { margin: 3px 0; }
.g-leg li::marker { color: #e8590c; font-weight: 800; }
.g-albero, .g-albero ul { list-style: none; margin: 0; padding: 0; }
.g-albero { font-size: 13.5px; line-height: 1.5; }
.g-albero ul { margin: 2px 0 4px 10px; padding-left: 10px; border-left: 2px solid #dfe5ee; }
.g-albero li { margin: 3px 0; }

/* ===== FINESTRE TRASCINABILI SU PC (v0.5.5) ===== */
.pc-trascina .modal-head, .pc-trascina .csg-tit { cursor: grab; user-select: none; }
.pc-trascina .modal-head .close { cursor: pointer; }
body.trascinando, body.trascinando * { cursor: grabbing !important; user-select: none !important; }

/* ===== DETTATURA VOCALE IA (v0.6.0) ===== */
.mic-btn.ascolto { box-shadow: 0 0 0 calc(4px + var(--liv, 0) * 22px) rgba(220, 53, 69, .22); transition: box-shadow .08s linear; }
.mic-btn.trascrivo { background: #6c757d; animation: cc-pulsa 1s ease-in-out infinite; }
.mic-btn.errore { background: #b7791f; }
@keyframes cc-pulsa { 50% { opacity: .55; } }
.ia-punti, .ia-passi { margin: 8px 0 12px 20px; font-size: 14px; line-height: 1.55; }
.ia-passi li { margin: 4px 0; }
#ia-chiave { flex: 1; font-family: "Courier New", monospace; }

/* ===== VALORE DELLA MERCE (v0.7.0) ===== */
.sch-val { gap: 6px; align-items: center; flex-wrap: wrap; font-weight: 700; color: var(--app-dark); }
.sch-prezzo { width: 90px; padding: 7px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 15px; text-align: right; }
.seg { display: inline-flex; border: 1px solid #c9d2df; border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.seg button.on { background: var(--app); color: #fff; }
.sch-val-alt { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.rg-val { margin-left: 8px; font-weight: 700; color: var(--app-dark); }
.home-valore { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #eef3fb; font-size: 14px; font-weight: 600; color: var(--app-dark); }
.home-valore .hv-buttato { color: #b3261e; }

/* ===== STAMPE ED ESPORTAZIONI (v0.7.1) ===== */
.modal-largo { max-width: 980px; width: 96vw; }
.rp-scelta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.rp-opz { border: 1px solid #dfe5ee; border-radius: 10px; margin: 8px 0 10px; background: #fafbfd; }
.rp-opz > summary { cursor: pointer; padding: 10px 12px; font-weight: 700; color: var(--app-dark); }
.rp-griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px 12px; padding: 4px 12px 12px; }
.rp-griglia label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.rp-griglia select, .rp-griglia input { padding: 6px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; background: #fff; }
.rp-ord { display: flex; gap: 4px; } .rp-ord select { flex: 1; min-width: 0; }
.rp-anteprima { overflow-x: auto; border: 1px solid #dfe5ee; border-radius: 10px; max-height: 55vh; overflow-y: auto; }
.rp-tab { border-collapse: collapse; width: 100%; font-size: 13px; }
.rp-tab th, .rp-tab td { padding: 6px 8px; border-bottom: 1px solid #eef2f8; text-align: left; white-space: nowrap; }
.rp-tab th { position: sticky; top: 0; background: var(--app-chiaro); cursor: pointer; user-select: none; z-index: 1; }
.rp-tab .n { text-align: right; }
.rp-g td { background: var(--app); color: #fff; font-weight: 700; }
.rp-g1 td { background: #d9ebe7; color: var(--app-dark); }
.rp-sub td { background: #f4f7f6; font-weight: 700; text-align: right; }
.rp-tot td { background: var(--app-dark); color: #fff; font-weight: 800; text-align: right; }
.rp-tab .st-scaduto { color: #c0392b; font-weight: 700; } .rp-tab .st-inscadenza { color: #b7791f; font-weight: 700; } .rp-tab .st-ok { color: #1e8449; }
.rp-azioni { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid #eef2f8; flex-wrap: wrap; }
.rp-azioni .btn { flex: 1; min-width: 120px; }

/* ===== NOTIFICHE (v0.8.0) ===== */
.not-griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.not-griglia label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.not-griglia select { padding: 6px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; background: #fff; }
.not-tipi .wiz-check { align-items: flex-start; margin: 6px 0; font-size: 13px; line-height: 1.4; }

/* ===== DISCONNETTI DRIVE (v0.8.1) ===== */
.modal-piccolo { max-width: 400px; }
.drv-off-ic { font-size: 40px; text-align: center; margin: 4px 0 6px; }
.drv-off-txt { text-align: center; font-size: 15px; line-height: 1.5; color: var(--text); margin: 0 0 6px; }
.drv-off-acc { text-align: center; font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }
#modal-drive-off .wiz-azioni { justify-content: center; }
#modal-drive-off .wiz-azioni .btn { flex: 1; }

/* ===== PROCEDURA CHIAVE (v0.8.2) ===== */
.ia-foto { display: block; width: 100%; height: auto; border: 1px solid #d5dddb; border-radius: 12px; margin: 10px 0 6px; background: #fff; }
.ia-gratis { background: #e8f6ec; border: 2px solid #2e9d4f; border-radius: 14px; padding: 12px 14px; font-weight: 600; line-height: 1.65; margin: 10px 0; }
.ia-gratis-tit { font-size: 19px; font-weight: 800; color: #1e7a3a; margin-bottom: 2px; }
.ia-attenzione { background: #fdecea; border: 2px solid #e51e1e; border-radius: 12px; padding: 10px 12px; font-weight: 700; color: #a3160f; margin: 8px 0; line-height: 1.45; }
.ia-didascalia { font-weight: 700; font-size: 15px; margin: 4px 0 10px; }
.ia-lettere { list-style: lower-alpha; } .ia-lettere li::marker { color: #e51e1e; font-weight: 800; }
.ia-se { border: 1px solid #dfe5ee; border-radius: 10px; padding: 4px 12px; margin: 8px 0; background: #fafbfd; }
.ia-se > summary { cursor: pointer; font-weight: 700; color: var(--app-dark); padding: 8px 0; }
.ia-incolla-zona { margin: 10px 0 4px; }
#ia-chiave { width: 100%; box-sizing: border-box; padding: 18px 12px; font-size: 16px; border: 3px dashed #e51e1e; border-radius: 12px; font-family: "Courier New", monospace; background: #fffafa; }
#ia-chiave:focus { outline: none; border-style: solid; }
.ia-bolla { display: inline-block; margin-top: 8px; background: #333; color: #fff; border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 700; }
.ia-esito { margin: 10px 0; font-weight: 700; min-height: 1.2em; line-height: 1.45; }
.ia-esito.no { color: #b3261e; background: #fdecea; padding: 10px 12px; border-radius: 10px; }
.ia-esito.attesa { color: var(--app-dark); }

.ia-scorciatoia { text-align: center; margin-top: 4px; }
.ia-scorciatoia .btn-link { color: var(--app-dark); font-weight: 700; font-size: 14px; padding: 8px; }

/* ===== SCARICA CON RICERCA (v0.8.5) ===== */
.sc-scan { width: 100%; margin-bottom: 10px; }
.sc-cerca-box { position: relative; margin-bottom: 8px; }
#sc-cerca { width: 100%; box-sizing: border-box; padding: 13px 40px 13px 14px; font-size: 16px; border: 2px solid #c9d2df; border-radius: 12px; }
#sc-cerca:focus { outline: none; border-color: var(--app); }
.sc-cerca-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 22px; color: var(--text-muted); cursor: pointer; padding: 6px 10px; }
.sc-tit { font-size: 13px; font-weight: 800; color: var(--text-muted); margin: 14px 2px 6px; text-transform: uppercase; letter-spacing: .03em; }
.sc-riga { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 6px 0; background: #fff; border: 1px solid #e3e8f0; border-left: 5px solid #2e9d4f; border-radius: 12px; }
.sc-riga.st-scaduto { border-left-color: #c0392b; } .sc-riga.st-inscadenza { border-left-color: #e0992e; }
.sc-info { flex: 1; min-width: 0; }
.sc-nome { font-weight: 800; font-size: 15px; } .sc-conf, .sc-q { font-weight: 700; color: var(--text-muted); font-size: 13px; }
.sc-det { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.sc-btn { display: flex; flex-direction: column; gap: 6px; } .sc-btn .btn { padding: 7px 12px; font-size: 13px; min-width: 92px; }
.sc-undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: #1f2a3d; color: #fff; font-weight: 700; font-size: 14px; }
.sc-undo .btn { background: #fff; color: #1f2a3d; padding: 6px 14px; }

/* ===== VOCE NELLO SCARICO (v0.8.6) ===== */
.sc-riga-cerca { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sc-riga-cerca .sc-cerca-box { flex: 1; margin-bottom: 0; }
.mic-btn.sc-mic { width: 52px; height: 52px; min-width: 52px; font-size: 24px; }
.mic-btn.mic-esempi { width: 84px; height: 84px; font-size: 13px; font-weight: 700; line-height: 1.15; padding: 6px; white-space: normal; hyphens: auto; overflow-wrap: anywhere; }
.sc-mic-stato { background: #eef3fb; color: var(--app-dark); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }

/* ===== SCARICA: risultati in finestra, data a destra (v0.8.7) ===== */
.sc-cerca-btn { white-space: nowrap; padding: 12px 14px; }
.sc-data { text-align: right; min-width: 82px; line-height: 1.25; }
.sc-data b { display: block; font-size: 14px; color: #1e8449; }
.sc-data small { display: block; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.sc-data.st-scaduto b { color: #c0392b; } .sc-data.st-inscadenza b { color: #b7791f; }
.sc-suggerimento { background: #f4f7fb; border: 1px dashed #c9d2df; border-radius: 12px; padding: 14px; font-size: 14px; color: var(--text-muted); text-align: center; margin-top: 6px; }
@media (max-width: 420px) { .sc-cerca-btn span { display: none; } }

.sc-rapidi { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; }
.sc-rapidi .chip { white-space: nowrap; flex: 0 0 auto; }

/* ===== I TUOI ARCHIVI SU DRIVE (v0.9.1) ===== */
#arc-miei .riga-gest .rg-nome { display: flex; flex-direction: column; }
.arc-doppio { background: #fff4e0; border: 1px solid #f0c27a; border-radius: 10px; padding: 8px 10px; margin: 6px 0; font-size: 13.5px; font-weight: 700; color: #8a5a00; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.arc-riga-doppio { border-left: 4px solid #f0c27a; padding-left: 8px; }
.arc-in-uso { font-size: 12px; font-weight: 800; color: var(--app); background: #e6effb; border-radius: 8px; padding: 4px 8px; }
.rg-info.err { color: #b3261e; }

.g-sub { font-size: 15px; margin: 18px 0 6px; color: var(--app-dark); }

/* ===== INSEGNA ALL'APP (v0.9.5) ===== */
.voc-form { background: #f4f7fb; border-radius: 12px; padding: 10px 12px; margin: 6px 0 4px; }
.voc-lbl { display: block; font-size: 12.5px; font-weight: 800; color: var(--text-muted); margin: 6px 0 3px; }
.voc-form input, #voc-prova { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 15px; border: 1px solid #c9d2df; border-radius: 10px; }
.voc-err { color: #b3261e; font-weight: 700; font-size: 13px; min-height: 1em; margin-top: 4px; }
.voc-riga .voc-da { font-family: "Courier New", monospace; background: #eef3f1; border-radius: 6px; padding: 1px 6px; }
.voc-riga .rg-nome { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.voc-riga .voc-regola { display: block; line-height: 1.5; }
.voc-riga .voc-da { display: inline; }
.voc-dopo { font-size: 13.5px; margin: 8px 0 4px; color: var(--app-dark); }
.voc-tab { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.voc-tab th, .voc-tab td { text-align: left; padding: 5px 6px; border-bottom: 1px solid #e3e8f0; }
.voc-tab th { font-size: 12px; color: var(--text-muted); }
.voc-prova-vuota { font-size: 13.5px; color: var(--text-muted); margin-top: 6px; }
.voc-base { margin-top: 10px; } .voc-base summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--app-dark); }
.voc-proposta { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 5000;
  width: min(520px, calc(100% - 20px)); background: #1f2a3d; color: #fff; border-radius: 14px; padding: 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.3); font-size: 14.5px; }
.voc-proposta b { color: #8ff0c2; }
.voc-proposta-btn { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.voc-proposta-btn .btn-bordo { background: transparent; color: #fff; border-color: #6b7f7b; }

/* ===== INSEGNA ALL'APP: gruppi e scelta dall'archivio (v0.9.6) ===== */
.voc-form-tit { font-weight: 800; color: var(--app-dark); margin-bottom: 2px; }
.voc-gruppo { border-top: 1px solid #e3e8f0; padding: 10px 0; }
.voc-gr-testa { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voc-gr-nome { font-weight: 800; font-size: 15px; }
.voc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.voc-chip { font-family: "Courier New", monospace; font-size: 14px; font-weight: 700; background: #e6effb; color: var(--app-dark); border: 1px solid #bfe0d6; border-radius: 9px; padding: 4px 9px; cursor: pointer; }
.voc-chip.auto { background: #f4efff; border-color: #d7c9f5; color: #4b3a8a; }
.voc-chip.att { background: #fff4e0; border-color: #f0c27a; color: #8a5a00; }
.voc-legenda { margin-top: 4px; font-size: 12px; }
.voc-bers { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #c9d2df; border-radius: 10px; padding: 9px 12px; background: #fff; }
.voc-scelta #voc-cerca { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 15px; border: 1px solid #c9d2df; border-radius: 10px; }
.voc-scelta-lista { max-height: 230px; overflow-y: auto; border: 1px solid #e3e8f0; border-radius: 10px; margin-top: 4px; background: #fff; }
.voc-cand { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eef1f6; background: none; padding: 9px 12px; font-size: 14.5px; cursor: pointer; }
.voc-cand.sel { background: #e6effb; font-weight: 800; }
.voc-cand-t { font-size: 11.5px; color: var(--text-muted); margin-left: 4px; }
.voc-nuovo { color: var(--app-dark); font-weight: 700; }
.voc-elimina { color: #b3261e; }

/* ===== PAROLE DELL'APP: finestra dedicata (v0.9.7) ===== */
.voc-riassunto { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f4f7fb; border-radius: 10px; padding: 8px 12px; margin-top: 6px; font-weight: 700; }
.voc-barra { display: flex; gap: 8px; margin: 6px 0; }
.voc-barra #voc-filtro { flex: 1; min-width: 0; padding: 9px 12px; font-size: 15px; border: 1px solid #c9d2df; border-radius: 10px; }
.voc-barra select { padding: 8px; border: 1px solid #c9d2df; border-radius: 10px; font-size: 14px; background: #fff; }
.voc-pul-btn { margin: 2px 0 6px; }
.voc-gruppo .voc-gr-testa { width: 100%; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; }
.voc-gr-n { background: #e6effb; color: var(--app-dark); font-weight: 800; font-size: 12.5px; border-radius: 10px; padding: 2px 9px; }
.voc-gruppo.aperto { background: #fafbfd; }
.voc-chip-agg { background: #fff; border-style: dashed; font-family: inherit; }
.voc-pulizia { background: #fff8ec; border: 1px solid #f0d7a4; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.voc-pul-riga { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #f3e6c9; font-size: 14.5px; }
.voc-pul-riga .voc-da { font-family: "Courier New", monospace; font-weight: 700; }

.voc-suggerimento { background: #f4f7fb; border: 1px dashed #c9d2df; border-radius: 12px; padding: 14px; font-size: 14px; color: var(--text-muted); text-align: center; margin-top: 6px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: #1f2937; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 14px; z-index: 99990; box-shadow: 0 6px 20px rgba(0,0,0,.25);
  max-width: 90vw; text-align: center;
}

/* ===== CSG dialog ===== */
.csg-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 99999; display: flex; align-items: center; justify-content: center; }
.csg-box { background: #fff; color: var(--text); box-shadow: 0 8px 30px rgba(0,0,0,.25); border-radius: 12px; padding: 16px; max-width: 420px; width: 92%; max-height: 80vh; overflow-y: auto; font-size: 13px; }
.csg-tit { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.csg-sub { margin: 10px 0 4px; font-weight: 700; }
.csg-list { border-top: 1px solid rgba(0,0,0,.12); }
.csg-riga { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid rgba(0,0,0,.08); }
.csg-riga-txt { flex: 1; }
.csg-kb { opacity: .6; font-size: 11px; }
.csg-vuoto { padding: 8px; opacity: .7; }
.tast-passi { padding-left: 20px; margin: 8px 0; }
.tast-passi li { margin: 6px 0; }
.tast-nota { font-size: 13px; opacity: .8; }
.tast-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 10px 0; }
.link-esempi { background: none; border: 0; padding: 4px 0; color: var(--primario, #2c7be5); font-weight: 600; font-size: 14px; text-decoration: underline; cursor: pointer; }
.esempi { margin-top: 12px; }
.es-tit { font-weight: 700; font-size: 15px; margin: 6px 0; }
.es-gruppo { border: 1px solid rgba(0,0,0,.1); border-radius: 10px; padding: 6px 10px; margin: 6px 0; background: rgba(44,123,229,.03); }
.es-gruppo summary { font-weight: 600; cursor: pointer; padding: 4px 0; }
.es-lista { list-style: none; padding: 0; margin: 4px 0; }
.es-lista li { padding: 6px 0; border-top: 1px dashed rgba(0,0,0,.1); }
.es-lista li:first-child { border-top: 0; }
.es-frase { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: rgba(0,0,0,.05); border-radius: 6px; padding: 3px 6px; word-break: break-word; }
.es-capisce { display: block; font-size: 13px; opacity: .8; margin-top: 3px; }
.es-nota { font-size: 12px; opacity: .75; margin: 4px 0 2px; }
.es-consigli { font-size: 13px; padding-left: 18px; margin: 8px 0; }
.es-consigli li { margin: 4px 0; }
.csg-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0 2px; }
.csg-pag { font-size: 12px; opacity: .7; white-space: nowrap; }
.csg-nav button { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(0,0,0,.18); background: #fff; color: var(--text); font-size: 13px; cursor: pointer; }
.csg-nav button:disabled { opacity: .35; cursor: default; }
.csg-btns { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.csg-diag { font-size: 10px; opacity: .7; margin-top: 8px; }

/* ===== FOOTER (standard Ciegi) ===== */
.foot { text-align: center; font-size: 12px; color: var(--text-muted); padding: 18px 12px 0; }
.cs-legal-footer {
  font-family: 'Segoe UI', Arial, sans-serif; font-size: 12px; color: #666; text-align: center;
  padding: 24px 10px 18px; margin-top: 24px;
  border-top: 2px solid rgba(44,123,229,.15);
  background: linear-gradient(180deg, rgba(248,250,250,0) 0%, rgba(248,250,250,0.6) 100%);
}
.cs-legal-footer .cs-logo { display: block; margin: 0 auto 12px; width: 110px; height: auto; }
.cs-legal-footer a { color: #1e3a5f; text-decoration: none; margin: 0 4px; white-space: nowrap; font-weight: 500; }
.cs-legal-footer a:hover { color: #2c7be5; text-decoration: underline; }
.cs-legal-footer .cs-sep { color: #bbb; margin: 0 2px; }
.cs-legal-footer .cs-row { margin-top: 6px; }

/* ===== Banner aggiornamento ===== */
.upd-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 99999;
  background: #1e3a5f; color: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  font-size: 14px; box-shadow: 0 -2px 10px rgba(0,0,0,.3);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.upd-banner .upd-ora { background: var(--verde-btn); color: #fff; border: 0; padding: 7px 16px; border-radius: 6px; font-weight: 600; cursor: pointer; }
.upd-banner .upd-dopo { background: transparent; color: #bcd; border: 1px solid #456; padding: 7px 12px; border-radius: 6px; cursor: pointer; }

/* ===== Bottom nav mobile (standard Ciegi) ===== */
.bottom-nav { display: none; }
@media (max-width: 600px) {
  body { padding-bottom: 64px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .topbar h1 { font-size: 17px; }
  .topbar .sub { display: none; }
  .brand-logo { height: 22px; }
  .topbar .menu-wrap .btn-menu { display: none; }
  .drive-badge { max-width: 110px; padding: 4px 8px; }
  .cs-legal-footer { margin-bottom: 8px; }
  body:has(.modal:not(.hidden)) .bottom-nav { display: none !important; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.10); z-index: 1000;
  }
  .bottom-nav .nav-item {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    padding: 8px 0 7px; min-width: 0; background: transparent; border: 0;
    color: #64748b; cursor: pointer; position: relative;
  }
  .bottom-nav .nav-item:active { background: #f1f5f9; }
  .bottom-nav .nav-ic { font-size: 21px; line-height: 1; }
  .bottom-nav .nav-lbl { font-size: 11px; font-weight: 600; line-height: 1; }
  .bottom-nav .nav-item.nav-primary { color: var(--app); }
  .bottom-nav .nav-dot {
    position: absolute; top: 6px; left: 50%; margin-left: 7px;
    width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; border: 1px solid #fff;
  }
  .bottom-nav .nav-item.synced  .nav-dot { background: #16a34a; }
  .bottom-nav .nav-item.syncing .nav-dot { background: #f59e0b; }
  .bottom-nav .nav-item.error   .nav-dot { background: #dc2626; }
  .menu-dropdown {
    position: fixed; top: auto; bottom: 72px; left: 8px; right: 8px;
    min-width: 0; max-width: none; max-height: calc(100vh - 140px); overflow-y: auto;
  }
  .toast { bottom: 84px; }
  .sem-num { font-size: 28px; }
  .sem-cella { padding: 12px 10px 10px; }
  .azioni { grid-template-columns: 1fr 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-content { border-radius: 14px 14px 0 0; max-height: 92vh; overflow-y: auto; }
}

/* ===== Finestre «alte»: subito sotto i pulsanti Carica/Scarica (v0.8.8) ===== */
/* (dopo la regola dei telefoni, così vince anche sotto i 600 px) */
.modal.modal-alto { align-items: flex-start; padding: var(--alto-top, 140px) 10px 10px; overflow: hidden; }
.modal.modal-alto .modal-content {
  border-radius: 16px; display: flex; flex-direction: column; overflow: hidden;
  max-height: calc(100vh - var(--alto-top, 140px) - 10px); max-height: calc(100dvh - var(--alto-top, 140px) - 10px);
}
.modal.modal-alto .modal-body { overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal.modal-alto .modal-head, .modal.modal-alto .sc-undo { flex: 0 0 auto; }
.modal.modal-alto-pieno .modal-content { height: calc(100vh - var(--alto-top, 140px) - 10px); height: calc(100dvh - var(--alto-top, 140px) - 10px); }

/* Telefoni stretti: badge Drive compatto (pallino + nuvola), il dettaglio è in bottom-nav e Impostazioni */
@media (max-width: 420px) {
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 16px; }
  .drive-badge { padding: 4px 7px; gap: 4px; }
  .drive-badge::before { content: "☁"; font-size: 13px; }
  .drive-label { display: none; }
  .lingua-badge { margin-left: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .drive-badge.syncing .drive-dot, .btn-quick-sync.spin, .mic-btn.ascolto { animation: none; }
}

@media print {
  .topbar, .bottom-nav, .cs-legal-footer, .foot, .azioni { display: none !important; }
}

/* ===== 📍 RIPONI / SPOSTA (v0.9.23) ===== */
.home-riporre {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding: 12px 16px;
  border: 2px solid #f0b54a; border-radius: var(--radius); background: #fff8e8; color: var(--text);
  text-align: left; cursor: pointer; box-shadow: var(--shadow); font: inherit;
}
.home-riporre:hover { background: #fff2d4; }
.hr-ic { font-size: 26px; }
.hr-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-muted); }
.hr-txt b { font-size: 16px; color: #8a5300; }
.car-dopo {
  display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 10px; padding: 10px 12px; cursor: pointer;
  border: 1px dashed #c9d2df; border-radius: 10px; font-size: 14px; line-height: 1.4; color: var(--text-muted);
}
.car-dopo b { color: var(--app-dark); }
.car-dopo input { width: 22px; height: 22px; margin-top: 0; flex-shrink: 0; }
.car-dopo.on { border: 2px solid #f0b54a; background: #fff8e8; color: var(--text); }
.sch-dopo { font-size: 14px; font-weight: 600; color: #8a5300; background: #fff8e8; border-radius: 8px; padding: 8px 10px; }
.pv-riporre { color: #8a5300; font-weight: 700; }
.rip-tabs { display: flex; width: 100%; margin-bottom: 10px; }
.rip-tabs button { flex: 1; padding: 10px 8px; font-size: 14px; }
.rip-guida { font-size: 15px; font-weight: 600; color: var(--app-dark); margin: 4px 0 6px; }
.rip-cerca { width: 100%; padding: 11px 12px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 16px; margin-bottom: 4px; }
.rip-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.rip-riga {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 2px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); font: inherit;
}
.rip-riga.sel { border-color: var(--verde); background: #ecf9f0; }
.rip-check {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 2px solid #c9d2df;
  display: flex; align-items: center; justify-content: center; color: transparent; font-weight: 800; font-size: 16px;
}
.rip-riga.sel .rip-check { background: var(--verde); border-color: var(--verde); color: #fff; }
.rip-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rip-nome { font-weight: 700; font-size: 15px; }
.rip-info { font-size: 12px; color: var(--text-muted); }
.rip-centro { text-align: center; }
.rip-cosa { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.rip-unita { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.rip-u {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px; cursor: pointer;
  border: 2px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); font: inherit;
}
.rip-u.on { border-color: var(--app); background: var(--app-chiaro); }
.rip-u-ic { font-size: 30px; }
.rip-u-nome { font-weight: 700; font-size: 15px; text-align: center; }
.rip-u-ab { font-size: 11px; color: #8a5300; font-weight: 600; }
.rip-vani .chip { font-size: 14px; padding: 8px 12px; border-radius: 18px; }

/* ===== ELENCO: posto toccabile + ⋯ Altro (v0.9.24) ===== */
.riga-gia .rg-corpo { cursor: default; padding: 0; gap: 0; }
.rg-tit { display: flex; flex-direction: column; gap: 2px; text-align: left; background: none; border: 0; padding: 4px; cursor: pointer; color: var(--text); font: inherit; }
.rg-tit .rg-nome { font-weight: 700; font-size: 15px; }
.rg-dist { font-size: 12px; font-weight: 600; color: var(--app-dark); }
.rg-posto {
  align-self: flex-start; max-width: 100%; margin: 2px 0 2px 2px; padding: 4px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid #c9d7ea; background: #f4faf9; color: var(--app-dark); font: inherit; font-size: 12px; font-weight: 600; text-align: left;
}
.rg-posto:hover { background: var(--app-chiaro); }
.rg-posto-rip { border-color: #f0b54a; background: #fff8e8; color: #8a5300; }
.rg-posto-fr { color: #9aa4b4; }
.btn-grigio-chiaro { background: #eef1f6; color: var(--text); font-size: 16px; font-weight: 800; letter-spacing: 1px; line-height: 1; }
.az-testa { border: 1px solid var(--border); border-left: 5px solid #b8c1cf; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.az-testa.st-scaduto { border-left-color: var(--rosso); }
.az-testa.st-inscadenza { border-left-color: var(--ambra); }
.az-testa.st-ok { border-left-color: var(--verde); }
.az-nome { font-weight: 700; font-size: 17px; margin-bottom: 2px; }
.az-info { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.az-dom { font-size: 15px; margin-bottom: 10px; }
.az-lista { display: flex; flex-direction: column; gap: 8px; }
.az-sub { display: block; font-size: 12px; font-weight: 400; opacity: .9; margin-top: 2px; }

/* ===== ETICHETTE DEI POSTI + SCANSIONE IN RIPONI (v0.9.25) ===== */
#modal-posti { z-index: 2050; }            /* sopra «Riponi», da cui si apre */
#modal-scan { z-index: 2100; }             /* la fotocamera sta sempre sopra a tutto */
.rip-posto { border: 2px solid var(--app); background: var(--app-chiaro); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.rip-posto-dove { font-weight: 800; font-size: 16px; color: var(--app-dark); }
.rip-posto-az { display: flex; gap: 16px; flex-wrap: wrap; }
.rip-posto-az .link-azione { margin-top: 4px; }
.rip-fatti { font-size: 13px; color: var(--verde); font-weight: 600; margin-top: 4px; }
.rip-et { display: block; margin: 10px auto 0; }
.pst-unita { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.pst-u { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 4px 0 8px; cursor: pointer; font: inherit; color: var(--text); text-align: left; font-size: 15px; }
.pst-u small { color: var(--text-muted); font-weight: 400; }
.pst-u.on .rip-check { background: var(--verde); border-color: var(--verde); color: #fff; }
.pst-unita .chip { font-size: 13px; padding: 7px 11px; border-radius: 16px; }

/* ===== IMPOSTAZIONI A GRUPPI + TEAM (v0.9.26) ===== */
.imp-indice { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.imp-voce { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 14px; border: 0; background: #fff; cursor: pointer; text-align: left; font: inherit; color: var(--text); }
.imp-voce + .imp-voce { border-top: 1px solid var(--border); }
.imp-voce:hover { background: #f7f9fd; }
.imp-voce-ic { font-size: 24px; width: 32px; text-align: center; flex-shrink: 0; }
.imp-voce-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.imp-voce-txt b { font-size: 16px; color: var(--app-dark); }
.imp-voce-txt small { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-indietro { background: none; border: 0; font-size: 28px; line-height: 1; padding: 0 10px 2px 0; cursor: pointer; color: var(--app-dark); }
.car-dopo-squadra { margin: -4px 0 10px; }
.sch-proposto { font-size: 12px; font-weight: 600; color: #8a5300; margin: 2px 0 2px; }
#modal-impostazioni .modal-head h3 { flex: 1; }

/* ===== FOGLI DEI POSTI (v0.9.27) ===== */
.pst-fmt { margin: 4px 0 6px; }
.pst-fmt .wiz-check { margin-bottom: 8px; }
.pst-fmt small { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ===== LETTORE BLUETOOTH (v0.9.28) ===== */
.lt-prova { width: 100%; padding: 11px 12px; border: 2px dashed #c9d2df; border-radius: 8px; font-size: 15px; margin: 6px 0; }
.lt-prova:focus { border-color: var(--app); outline: none; background: var(--app-chiaro); }
.lt-ok { color: var(--verde); font-weight: 600; }
.lt-no { color: #8a5300; font-weight: 600; margin-top: 4px; }

/* ===== v0.9.29 ===== */
.rip-solo { font-size: 13px; font-weight: 600; color: #8a5300; background: #fff8e8; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.rip-solo .link-azione { margin: 0 0 0 8px; padding: 0; font-size: 13px; }

/* ===== LETTORE ATTIVO (v0.9.31) ===== */
.solo-lettore { display: none; }
body.con-lettore .solo-lettore { display: inline; }
body.con-lettore .senza-lettore { display: none; }
.btn-sub { display: block; font-size: 12px; font-weight: 500; opacity: .75; margin-top: 2px; }
.lettore-badge { border: 1px solid rgba(255,255,255,.6); background: rgba(255,255,255,.92); border-radius: 14px; font-size: 15px; line-height: 1; padding: 4px 7px; cursor: pointer; margin-right: 4px; }
.lettore-badge.hidden { display: none; }

/* ===== ATTESA DEL POSTO CON IL LETTORE (v0.9.34) ===== */
.rip-attesa { text-align: center; background: #fff; border: 3px dashed var(--app); border-radius: 18px; padding: 22px 14px 18px; margin: 10px 0 12px; }
.rip-pistola { font-size: 54px; line-height: 1; animation: ripPulsa 1.6s ease-in-out infinite; }
.rip-attesa h2 { font-size: 26px; color: var(--app-dark); margin: 8px 0 4px; }
.rip-attesa p { font-size: 15px; color: var(--text-muted); margin: 0; }
@keyframes ripPulsa { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.12); opacity: .75; } }
.rip-attesa-az { display: flex; gap: 8px; margin: 0 0 8px; }
.rip-attesa-az .btn { flex: 1; }
#rip-metti.rip-sugg { width: 100%; margin-bottom: 10px; }

/* ===== 🛒 SCORTA MINIMA (v0.9.36) ===== */
.home-scorta { border-color: #e2797f; background: #fff1f1; }
.home-scorta:hover { background: #ffe5e6; }
.home-scorta .hr-txt b { color: #a8262e; }
.riga-gest.pr-sotto { border-left: 4px solid var(--rosso); }

/* ===== SECONDO RIEPILOGO (v0.9.38) ===== */
.not-ora2 { margin: 0 0 10px; }
.not-ora2 label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--text-muted); max-width: 220px; }
.not-ora2 select { padding: 6px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; background: #fff; }

/* =====================================================
   RICORDATI v0.1 — scadenze e ricorrenze
   ===================================================== */
.ri-lista { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ri-riga { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--border);
  background: #fff; text-align: left; font: inherit; color: var(--text); cursor: pointer; border-left: 5px solid var(--verde); }
.ri-riga:last-child { border-bottom: 0; }
.ri-riga.st-scaduta { border-left-color: var(--rosso); background: #fff7f7; }
.ri-riga.st-arrivo { border-left-color: var(--ambra); background: #fffbf0; }
.ri-riga.st-chiusa { border-left-color: #b8c1cf; opacity: .8; }
.ri-ic { font-size: 22px; width: 28px; text-align: center; flex-shrink: 0; }
.ri-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ri-tit { font-weight: 700; overflow-wrap: anywhere; }
.ri-sub { font-size: 12.5px; color: var(--text-muted); }
.ri-rel { font-weight: 700; }
.st-scaduta .ri-rel { color: var(--rosso); }
.st-arrivo .ri-rel { color: #b86e00; }
.ri-fatto { flex-shrink: 0; border: 2px solid var(--verde); background: #fff; color: var(--verde); border-radius: 20px; padding: 6px 10px;
  font-weight: 800; font-size: 13px; cursor: pointer; white-space: nowrap; }
.ri-fatto:hover { background: var(--verde); color: #fff; }
.ri-vuota { padding: 14px; color: var(--text-muted); font-size: 14px; text-align: center; }
.ri-mese { font-size: 12px; font-weight: 800; color: var(--app-dark); text-transform: uppercase; letter-spacing: .04em; margin: 14px 2px 6px; }
.ri-mese:first-child { margin-top: 4px; }

.ri-detta { display: flex; gap: 10px; align-items: flex-start; }
.ri-detta textarea { flex: 1; min-width: 0; padding: 10px; border: 2px solid var(--app); border-radius: 10px; font-size: 16px; font-family: inherit; resize: vertical; background: #fff; }
.ri-detta .ri-compila { align-self: stretch; min-width: 92px; padding: 0 12px; }
/* v0.4.3: verifica mentre scrivi — sfondo tenue verde (frase completa) o rosso (manca qualcosa) */
.ri-detta textarea { transition: background-color .2s; }
.ri-detta textarea.ri-ok { background: #effaf2; border-color: #4caf6e; }
.ri-detta textarea.ri-ko { background: #fdf0f0; border-color: #e08a8a; }
.ri-detta-sotto { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-top: 4px; min-height: 4px; }
.ri-verifica { font-size: 12.5px; line-height: 1.4; }
.ri-verifica.ok { color: #23753f; }
.ri-verifica.ko { color: #b3261e; }
.ri-detta-sotto .link-azione { margin-left: auto; white-space: nowrap; }
#ed-mic.ascolto { color: var(--rosso); font-weight: 700; }
.ri-compila.da-fare { box-shadow: 0 0 0 3px rgba(76,175,110,.35); }
.ri-capito { margin-top: 6px; font-size: 13px; background: var(--app-chiaro); color: var(--app-dark); border-radius: 8px; padding: 7px 10px; line-height: 1.5; }
.ri-capito b { font-weight: 700; }
.ri-proposte { margin: 4px 0 6px; }
.ri-proposte .chip { cursor: pointer; }
.ri-form { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.ri-form .campo input[type=date], .ri-form .campo textarea, .ri-rm-data input[type=date], #ed-fine-data {
  padding: 8px 10px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff; }
.ri-form .campo textarea { width: 100%; }
.ri-form .campo input[type=date] { width: 100%; max-width: 220px; }
#ed-fine { width: auto; min-width: 160px; flex: 1; }
.ri-pers { margin-top: 8px; }
.ri-pers select { width: auto !important; flex: 1; }
.ri-proposta { display: inline-block; margin-top: 4px; font-size: 12px; color: #8a5300; background: #fff4e0; border-radius: 6px; padding: 2px 8px; }
.ri-form .wiz-check { font-size: 14px; margin: 2px 0 8px; }
.ri-form .wiz-check small { color: var(--text-muted); font-size: 12px; }
.campo.manca input { border-color: var(--rosso) !important; box-shadow: 0 0 0 3px rgba(220,38,38,.15); }

.ri-scheda-data { font-size: 22px; font-weight: 800; margin: 2px 0; }
.ri-scheda-rel { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.ri-scheda-rel.st-scaduta { color: var(--rosso); } .ri-scheda-rel.st-arrivo { color: #b86e00; } .ri-scheda-rel.st-avanti { color: var(--verde); }
.ri-det { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; margin: 10px 0; }
.ri-det dt { color: var(--text-muted); }
.ri-det dd { font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.ri-azioni { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.ri-azioni .btn { padding: 12px 10px; font-size: 15px; }
.btn-arancio { background: #fd7e14; color: #fff; }
.ri-storico { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.ri-storico h4 { font-size: 13px; color: var(--app-dark); margin-bottom: 6px; }
.ri-storico li { list-style: none; font-size: 13px; padding: 4px 0; border-bottom: 1px dashed var(--border); }
.ri-storico li:last-child { border-bottom: 0; }
.ri-rimanda { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0 12px; }
.ri-rimanda .btn { padding: 11px 8px; }
.ri-rm-data { gap: 8px; }
.ri-icone { grid-template-columns: repeat(6, 1fr); }
.ri-icone .tipo-btn { font-size: 22px; padding: 6px 2px; }
.ri-undo { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 99991; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box;
  background: #1f2937; color: #fff; padding: 8px 8px 8px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: 14px; }
.ri-undo span { flex: 1; min-width: 0; }
.ri-undo .btn-bordo { color: #fff; border-color: rgba(255,255,255,.5); white-space: nowrap; }
.el-filtri #el-cat { flex: 0 1 180px; }
#modal-scheda { z-index: 2005; }
#modal-edit, #modal-rimanda, #modal-cat-edit { z-index: 2010; }
.ri-form .wiz-check input[type=radio], .ri-form .wiz-check input[type=checkbox] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; }
/* v0.1.1 — più scadenze insieme con «poi» */
.ri-multi { margin-top: 6px; }
.ri-multi-tit { font-weight: 800; color: var(--app-dark); margin: 4px 0 8px; }
.ri-mcard { display: flex; gap: 10px; align-items: flex-start; padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); border-left: 4px solid var(--app); border-radius: 10px; background: #fff; }
.ri-mcard.manca { border-left-color: var(--rosso); background: #fff7f7; }
.ri-mnum { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--app); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.ri-mcard.manca .ri-mnum { background: var(--rosso); }
.ri-mcorpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ri-mcorpo input[type=text] { width: 100%; padding: 7px 9px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 15px; font-weight: 700; font-family: inherit; }
.ri-mriga { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ri-mriga input[type=date] { padding: 6px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; font-family: inherit; }
.ri-mmanca { color: #b3261e; font-weight: 700; font-size: 13px; }
.ri-msub { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.not-tipi select { display: block; margin: -2px 0 10px 26px; padding: 6px 8px; border: 1px solid #c9d2df; border-radius: 8px; font-size: 14px; background: #fff; }

/* v0.3.3 — compleanno dedotto, correzioni a voce */
.ri-dedotto { color: #c25e00; font-weight: 700; }
.ri-corr { color: #1e7e34; font-weight: 700; }
.ri-avviso { margin: 4px 0 8px; padding: 6px 10px; border-radius: 8px; background: #fff4e5; color: #8a4b00; font-size: 13px; line-height: 1.4; }
.ri-mcard.lampo { animation: ri-lampo 1.6s ease-out 1; }
@keyframes ri-lampo { 0%, 35% { background: #e6f4ea; box-shadow: 0 0 0 3px #28a74555; } 100% { background: #fff; box-shadow: none; } }

/* v0.3.4 — ❓ nella finestra «Nuova scadenza»: la guida si apre sopra */
.head-btns { display: flex; align-items: center; gap: 6px; }
.aiuto-btn { border: 0; background: var(--app-chiaro); border-radius: 50%; width: 30px; height: 30px; font-size: 15px; line-height: 30px; padding: 0; cursor: pointer; }
.aiuto-btn:hover { filter: brightness(.95); }
#modal-guida { z-index: 2020; }
#modal-guida .modal-head { position: sticky; top: 0; background: var(--bg-card); z-index: 3; border-radius: inherit; }
#guida-corpo h4 { scroll-margin-top: 64px; }

/* v0.3.5 — Elenco sul telefono alto come «Nuova scadenza» (non più schiacciato in fondo quando le scadenze sono poche) */
@media (max-width: 600px) {
  #modal-elenco .modal-content { height: 92vh; height: 92dvh; display: flex; flex-direction: column; overflow: hidden; }
  #modal-elenco .modal-head { flex: 0 0 auto; }
  #modal-elenco .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
}

/* v0.4.0 — Stampe, statistiche ed Excel: sul telefono alta come «Nuova scadenza» */
@media (max-width: 600px) {
  #modal-report .modal-content { height: 92vh; height: 92dvh; display: flex; flex-direction: column; overflow: hidden; }
  #modal-report .modal-head, #modal-report .rp-azioni { flex: 0 0 auto; }
  #modal-report .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
  #modal-report .rp-anteprima { max-height: none; }
}
.rp-sub td.n, .rp-tot td.n { text-align: right; }
.rp-sub td:first-child, .rp-tot td:first-child { text-align: left; }
