:root {
  --ud-rosa: #8b1e4b; --ud-rosa-chiaro: #fdf6f8; --ud-rosa-medio: #f3d9e3; --ud-testo: #2b2024;
  --ud-grigio: #6b5e63; --ud-bordo: #e7d7dd; --ud-bianco: #ffffff; --ud-verde: #1f7a4d; --ud-rosso: #b3261e;
  --ud-raggio: 16px; --ud-ombra: 0 4px 18px rgba(139, 30, 75, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--ud-rosa-chiaro); color: var(--ud-testo); -webkit-font-smoothing: antialiased;
  padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.ud-header { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: var(--ud-bianco);
  border-bottom: 1px solid var(--ud-bordo); position: sticky; top: 0; z-index: 5; }
.ud-brand { display: flex; align-items: center; gap: 10px; }
.ud-logo { width: 40px; height: 40px; border-radius: 12px; background: var(--ud-rosa); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; letter-spacing: .5px; }
.ud-title { font-weight: 700; font-size: 17px; }
.ud-sub { font-size: 12px; color: var(--ud-grigio); }
.ud-chip { border: 1px solid var(--ud-rosa); background: #fff; color: var(--ud-rosa); border-radius: 999px;
  padding: 7px 12px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ud-chip-ok { background: var(--ud-rosa); color: #fff; }
.ud-main { padding: 16px; max-width: 560px; margin: 0 auto; }
.ud-vista { display: none; }
.ud-vista.attiva { display: block; }
h2 { font-size: 20px; margin: 4px 0 6px; }
.ud-nota { color: var(--ud-grigio); font-size: 14px; line-height: 1.4; margin: 6px 0 12px; }
.ud-camera { position: relative; background: #111; border-radius: var(--ud-raggio); overflow: hidden; min-height: 220px;
  box-shadow: var(--ud-ombra); }
.ud-video { width: 100%; height: 300px; object-fit: cover; display: block; background: #111; }
/* il mirino corrisponde alla zona che il lettore guarda (94% x 70%), disegnato un po' piu' stretto */
.ud-mirino { position: absolute; left: 8%; right: 8%; top: 22%; bottom: 22%; 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; transition: border-color .2s; }
.ud-mirino::after { content: ''; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: rgba(230,40,90,.85); }
.ud-letto .ud-mirino { border-color: #2ecc71; }
.ud-camera-bottoni { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.ud-luce { background: rgba(0,0,0,.55); color: #fff; border: 1px solid rgba(255,255,255,.5);
  border-radius: 20px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.ud-luce.accesa { background: #f1c40f; color: #222; }
.ud-diag { font-size: 11px; color: var(--ud-grigio); text-align: center; min-height: 0; }
.ud-camera-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px; color: #fff; font-size: 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); text-align: center; pointer-events: none; }
.ud-manuale { display: flex; gap: 8px; margin: 12px 0; }
.ud-manuale input { flex: 1; min-width: 0; font-size: 16px; padding: 12px 14px; border: 1px solid var(--ud-bordo);
  border-radius: 12px; background: #fff; }
.ud-btn { background: var(--ud-rosa); color: #fff; border: 0; border-radius: 12px; padding: 12px 18px; font-size: 15px;
  font-weight: 700; cursor: pointer; }
.ud-btn:disabled { opacity: .6; }
.ud-btn-largo { width: 100%; margin-top: 10px; padding: 14px; font-size: 16px; }
.ud-link { background: none; border: 0; color: var(--ud-rosa); text-decoration: underline; font-size: 14px;
  padding: 12px; width: 100%; cursor: pointer; }
.ud-card { background: #fff; border-radius: var(--ud-raggio); padding: 18px; box-shadow: var(--ud-ombra); margin-top: 8px; }
.ud-card-no { border: 1px dashed var(--ud-rosso); }
.ud-nontrovato { color: var(--ud-rosso); font-weight: 700; font-size: 18px; }
.ud-foto { display: block; max-width: 100%; max-height: 260px; margin: 0 auto 12px; border-radius: 12px; object-fit: contain; }
.ud-nome { font-size: 20px; font-weight: 700; line-height: 1.25; }
.ud-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.ud-tag { background: var(--ud-rosa-medio); color: var(--ud-rosa); border-radius: 999px; padding: 5px 11px; font-size: 14px;
  font-weight: 600; }
.ud-tag small { font-weight: 400; color: var(--ud-grigio); }
.ud-prezzo { font-size: 38px; font-weight: 800; color: var(--ud-rosa); margin: 12px 0 6px; letter-spacing: -.5px; }
.ud-prezzo small { font-size: 13px; font-weight: 500; color: var(--ud-grigio); letter-spacing: 0; margin-left: 6px; }
.ud-descrizione { font-size: 15px; line-height: 1.5; color: #3d3237; margin: 10px 0; white-space: normal; }
.ud-codice { font-size: 12px; color: var(--ud-grigio); margin-bottom: 12px; }
.ud-lista { list-style: none; padding: 0; margin: 0; }
.ud-lettura { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 10px 12px;
  margin-bottom: 8px; box-shadow: var(--ud-ombra); }
.ud-lettura img { width: 52px; height: 52px; object-fit: contain; border-radius: 10px; background: var(--ud-rosa-chiaro); }
.ud-lettura-testo { flex: 1; min-width: 0; }
.ud-lettura-nome { font-weight: 600; font-size: 15px; }
.ud-lettura-var, .ud-lettura-quando { font-size: 12px; color: var(--ud-grigio); }
.ud-lettura-prezzo { font-weight: 800; color: var(--ud-rosa); white-space: nowrap; }
.ud-lettura-no .ud-lettura-nome { color: var(--ud-rosso); font-weight: 500; }
.ud-vuoto { color: var(--ud-grigio); padding: 20px; text-align: center; }
.ud-card-tessera { background: linear-gradient(135deg, #fff, var(--ud-rosa-medio)); border-radius: var(--ud-raggio);
  padding: 20px; box-shadow: var(--ud-ombra); text-align: center; }
.ud-tessera-nome { font-size: 22px; font-weight: 800; }
.ud-tessera-tel { color: var(--ud-grigio); margin-bottom: 14px; }
.ud-barcode { width: 100%; max-width: 360px; background: #fff; border-radius: 10px; padding: 8px; }
.ud-tessera-codice { font-family: ui-monospace, Menlo, monospace; letter-spacing: 2px; margin: 6px 0 12px; }
.ud-qr { width: 160px; height: 160px; background: #fff; border-radius: 10px; padding: 6px; }
.ud-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--ud-bordo);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.ud-nav button { flex: 1; background: none; border: 0; padding: 14px 4px 12px; font-size: 13px; color: var(--ud-grigio);
  font-weight: 600; border-top: 3px solid transparent; }
.ud-nav button.attiva { color: var(--ud-rosa); border-top-color: var(--ud-rosa); }
.ud-sheet { position: fixed; inset: 0; background: rgba(43, 32, 36, .55); z-index: 20; display: flex; align-items: flex-end;
  justify-content: center; }
.ud-sheet[hidden] { display: none; }
.ud-sheet-card { background: #fff; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px 18px
  calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
.ud-sheet-card label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 0; }
.ud-sheet-card input[type=text], .ud-sheet-card input[type=tel], .ud-sheet-card input[type=email] { display: block; width: 100%;
  font-size: 16px; padding: 12px 14px; border: 1px solid var(--ud-bordo); border-radius: 12px; margin-top: 4px; }
.ud-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; line-height: 1.4; }
.ud-check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; }
.ud-check a { color: var(--ud-rosa); }
.ud-obbl { color: var(--ud-rosso); }
.ud-fac { color: var(--ud-grigio); font-weight: 400; font-size: 12px; }
.ud-errore { background: #fdecea; color: var(--ud-rosso); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.ud-privacy body, body.ud-privacy { padding-bottom: 24px; }
.ud-testo { background: #fff; border-radius: var(--ud-raggio); padding: 18px; line-height: 1.55; font-size: 15px; }
.ud-testo h2 { font-size: 20px; } .ud-testo h3 { font-size: 16px; margin: 18px 0 6px; color: var(--ud-rosa); }
