/* Font self-hostati (subset latin, copre l'italiano) — nessun fornitore esterno.
   Lato (titoli) statico 400/700/900 · Roboto (corpo) variable font 100–900. */
@font-face{font-family:"Lato";font-style:normal;font-weight:400;font-display:swap;src:url("/vendor/fonts/lato-400.woff2") format("woff2");}
@font-face{font-family:"Lato";font-style:normal;font-weight:700;font-display:swap;src:url("/vendor/fonts/lato-700.woff2") format("woff2");}
@font-face{font-family:"Lato";font-style:normal;font-weight:900;font-display:swap;src:url("/vendor/fonts/lato-900.woff2") format("woff2");}
@font-face{font-family:"Roboto";font-style:normal;font-weight:100 900;font-display:swap;src:url("/vendor/fonts/roboto.woff2") format("woff2");}

:root{
  --blue:#2789bb; --blue-dark:#123e60; --navy:#0d1f2c; --green:#4db43f;
  --ink:#2b3138; --muted:#5a6b76; --muted2:#8a9aa6;
  --bg:#f4f7f9; --card:#ffffff; --line:#e6edf2; --line2:#d4dee6;
  --head:"Lato",system-ui,sans-serif; --body:"Roboto",system-ui,sans-serif;
  --radius:14px; --shadow:0 6px 20px rgba(13,31,44,.10);
}
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
/* schermate scure (home/fiche/login…): body scuro così sotto la view non affiora il bianco.
   Inoltre blocco lo scroll di PAGINA (solo la lista interna scrolla): su iOS evita che la
   barra dinamica di Safari si ritragga/espanda lasciando un gap in fondo al primo caricamento. */
html.theme-dark, body.theme-dark{ height:100%; overflow:hidden; overscroll-behavior:none; }
body.theme-dark{ background:var(--d2-bg); }
body{
  font-family:var(--body); font-weight:300; color:var(--ink); background:var(--bg);
  -webkit-font-smoothing:antialiased; line-height:1.55;
}
input,select,button{font-family:inherit}


.screen{ min-height:100dvh; display:flex; flex-direction:column; }
.screen[hidden]{ display:none; }

/* ---------- LOGIN ---------- */
.screen-login{
  background:radial-gradient(120% 90% at 50% -10%, #163651 0%, var(--navy) 55%);
  color:#fff; align-items:center; justify-content:center; padding:24px 20px calc(24px + env(safe-area-inset-bottom));
}
.login-card{ width:100%; max-width:360px; }
.login-card .logo{ width:210px; max-width:64%; display:block; margin:0 auto 10px; }
.login-sub{ text-align:center; color:#a9c2d1; font-size:14px; margin-bottom:26px; }
.login-foot{ margin-top:28px; color:#6b8394; font-size:12px; }

.field{ display:block; margin-bottom:14px; }
.field > span{ display:block; font-size:12.5px; font-weight:500; color:#c7d5df; margin-bottom:6px; letter-spacing:.02em; }
.screen-login .field > span{ color:#c7d5df; }
.field em{ font-style:normal; color:var(--muted2); font-weight:400; }
.field input, .field select{
  width:100%; height:48px; padding:0 14px; font-size:16px; /* 16px = niente auto-zoom iOS */
  border-radius:11px; border:1px solid #2c4a63; background:#0f2839; color:#fff; outline:none;
  transition:border-color .15s, box-shadow .15s;
}
.field input::placeholder{ color:#6b8394; }
.field input:focus, .field select:focus{ border-color:var(--blue); box-shadow:0 0 0 3px rgba(39,137,187,.25); }

.btn{
  width:100%; height:50px; border:none; border-radius:12px; font-family:var(--head); font-weight:700;
  font-size:16px; cursor:pointer; transition:filter .15s, transform .05s; -webkit-tap-highlight-color:transparent;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:var(--blue); color:#fff; box-shadow:0 6px 16px rgba(39,137,187,.35); }
.btn-primary:hover{ filter:brightness(1.05); }
.btn-primary:disabled{ opacity:.6; cursor:default; box-shadow:none; }

.form-error{
  background:rgba(192,57,43,.12); color:#ff8a7a; border:1px solid rgba(192,57,43,.35);
  border-radius:10px; padding:10px 12px; font-size:13.5px; margin-bottom:14px;
}
.content .form-error{ color:#c0392b; background:#fbecea; border-color:#f3c9c3; }

/* ---------- APP CHROME (onboarding + home) ---------- */
.topbar{
  background:var(--navy); color:#fff; display:flex; align-items:center; justify-content:space-between;
  padding:calc(10px + env(safe-area-inset-top)) 16px 10px; position:sticky; top:0; z-index:10;
}
.topbar-logo{ height:26px; }
.topbar-action{
  background:transparent; border:1px solid rgba(255,255,255,.25); color:#fff; border-radius:999px;
  padding:7px 15px; font-size:13px; font-weight:500; cursor:pointer;
}
.topbar-action:hover{ background:rgba(255,255,255,.08); }

.content{ flex:1; padding:20px 16px calc(28px + env(safe-area-inset-bottom)); max-width:640px; width:100%; margin:0 auto; }
.ph{ margin-bottom:16px; }
.ph h1{ font-family:var(--head); font-weight:900; font-size:26px; letter-spacing:-.02em; color:var(--ink); text-wrap:balance; }
.ph-sub{ color:var(--muted); font-size:14.5px; margin-top:4px; }

.card{ background:var(--card); border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); padding:18px; }
.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:0 12px; }
@media (max-width:420px){ .grid2{ grid-template-columns:1fr; } }

.content .field > span{ color:var(--muted); }
.content .field input, .content .field select{
  background:#fff; border:1px solid var(--line2); color:var(--ink);
}
.content .field input:focus, .content .field select:focus{ border-color:var(--blue); box-shadow:0 0 0 3px rgba(39,137,187,.15); }

.check{ display:flex; gap:10px; align-items:flex-start; margin:6px 0 16px; font-size:13.5px; color:var(--muted); }
.check input{ width:20px; height:20px; margin-top:1px; accent-color:var(--blue); flex:none; }

/* ---------- HOME placeholder ---------- */
.placeholder{ text-align:center; padding:34px 20px; }
.placeholder-mark{ font-size:34px; color:var(--blue); opacity:.5; line-height:1; margin-bottom:8px; }
.placeholder h2{ font-family:var(--head); font-weight:800; font-size:18px; color:var(--blue-dark); margin-bottom:6px; }
.placeholder p{ color:var(--muted); font-size:14px; max-width:34ch; margin:0 auto; }

@media (prefers-reduced-motion:reduce){ *{ transition:none !important; } }

/* ---------- LOGIN: link, divider, ghost ---------- */
.login-links{ text-align:center; margin-top:14px; }
.login-links a{ color:#a9c2d1; font-size:13.5px; text-decoration:none; }
.login-links a:hover{ color:#fff; text-decoration:underline; }
.login-divider{ display:flex; align-items:center; gap:12px; margin:20px 0 14px; color:#6b8394; font-size:12px; }
.login-divider::before, .login-divider::after{ content:""; flex:1; height:1px; background:rgba(255,255,255,.14); }
.btn-ghost{ background:transparent; color:#fff; border:1px solid #2c4a63; }
.btn-ghost:hover{ background:rgba(255,255,255,.06); }
.link-quiet{ display:block; width:100%; background:none; border:none; color:#8fb0c4; font-size:13.5px; margin-top:14px; cursor:pointer; padding:6px; }
.link-quiet:hover{ color:#fff; }

/* ---------- INTRO SLIDER ---------- */
.screen-intro{ background:#fff; color:var(--ink); }
.intro-close{ position:absolute; top:calc(8px + env(safe-area-inset-top)); right:12px; z-index:5;
  width:38px; height:38px; border-radius:999px; border:none; background:#eef2f6; color:var(--muted);
  font-size:24px; line-height:1; cursor:pointer; }
.slider{ flex:1; display:flex; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.slider::-webkit-scrollbar{ display:none; }
.slide{ flex:0 0 100%; scroll-snap-align:center; display:flex; align-items:center; justify-content:center; padding:20px; }
.slide img{ max-width:100%; max-height:100%; object-fit:contain; }
.dots{ display:flex; gap:8px; justify-content:center; padding:6px 0 2px; }
.dot{ width:8px; height:8px; border-radius:999px; border:none; background:var(--line2); cursor:pointer; padding:0; transition:width .2s, background .2s; }
.dot.on{ width:22px; background:var(--blue); }
.intro-cta{ padding:14px 20px calc(20px + env(safe-area-inset-bottom)); }
.intro-cta .link-quiet{ color:var(--muted); }
.intro-cta .link-quiet:hover{ color:var(--blue-dark); }

/* ---------- TOPBAR dark variant + back ---------- */
.topbar-dark{ }
.topbar-back{ background:transparent; border:none; color:#fff; font-size:30px; line-height:1; width:34px; height:34px; cursor:pointer; padding:0; }
.topbar-spacer{ width:34px; }
.topbar-dark .topbar-logo{ height:24px; }

/* ---------- MESSAGGI (registrazione/recupero ok) ---------- */
.screen-msg{ background:var(--bg); align-items:center; justify-content:center; padding:24px; }
.msg-card{ background:var(--card); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow); padding:32px 26px; max-width:380px; text-align:center; }
.msg-mark{ width:60px; height:60px; margin:0 auto 16px; border-radius:999px; background:rgba(77,180,63,.14); color:var(--green);
  font-size:30px; display:flex; align-items:center; justify-content:center; }
#screen-forgot-done .msg-mark{ background:rgba(39,137,187,.12); color:var(--blue); }
.msg-card h1{ font-family:var(--head); font-weight:900; font-size:22px; color:var(--ink); margin-bottom:8px; }
.msg-card p{ color:var(--muted); font-size:14.5px; margin-bottom:22px; }

/* ---------- password show/hide ---------- */
.pw-wrap{ position:relative; display:block; margin-bottom:0; }
.pw-wrap input{ padding-right:88px; }
.pw-toggle{ position:absolute; right:8px; top:50%; transform:translateY(-50%);
  background:none; border:none; color:var(--blue); font-family:var(--body); font-size:13px; font-weight:500;
  cursor:pointer; padding:8px; }
.pw-toggle:hover{ text-decoration:underline; }
.check a{ color:var(--blue-dark); font-weight:500; }

/* fix: l'attributo hidden deve nascondere anche i .field (che hanno display:block) */
.field[hidden]{ display:none; }

/* ---------- HOME · ricerca + elenco fiches ---------- */
.searchbar{
  position:sticky; top:0; z-index:9; display:flex; align-items:center; gap:10px;
  background:var(--bg); padding:12px 16px; border-bottom:1px solid var(--line);
}
.home-topbar{ position:static; }
.search-ico{ color:var(--muted2); font-size:19px; line-height:1; flex:none; }
.searchbar input{
  flex:1; height:44px; border:1px solid var(--line2); border-radius:11px; background:#fff;
  padding:0 14px; font-size:16px; color:var(--ink); outline:none; transition:border-color .15s, box-shadow .15s;
}
.searchbar input:focus{ border-color:var(--blue); box-shadow:0 0 0 3px rgba(39,137,187,.15); }
.searchbar input::placeholder{ color:var(--muted2); }

.fiche-list{ flex:1; max-width:640px; width:100%; margin:0 auto; padding:6px 12px calc(24px + env(safe-area-inset-bottom)); }
.list-loading, .list-empty{ text-align:center; color:var(--muted); font-size:14px; padding:34px 16px; }

.fiche{
  display:flex; align-items:center; gap:14px; width:100%; text-align:left; cursor:pointer;
  background:#fff; border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 2px 8px rgba(13,31,44,.05);
  padding:12px 14px; margin:8px 0; transition:transform .05s, box-shadow .15s, border-color .15s;
}
.fiche:hover{ box-shadow:var(--shadow); border-color:var(--line2); }
.fiche:active{ transform:translateY(1px); }
.fiche-logo{
  width:48px; height:48px; border-radius:999px; flex:none; object-fit:contain;
  background:#fff; border:1px solid var(--line); padding:2px;
}
.fiche-logo-ph{
  display:flex; align-items:center; justify-content:center; font-family:var(--head); font-weight:900;
  color:var(--blue); background:#eef4f8; font-size:20px; text-transform:uppercase;
}
.fiche-body{ flex:1; min-width:0; display:flex; flex-direction:column; gap:2px; }
.fiche-name{ font-family:var(--head); font-weight:700; font-size:16px; color:var(--ink); line-height:1.25;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fiche-sub{ color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fiche-chevron{ color:var(--blue); font-size:24px; line-height:1; flex:none; font-weight:400; }

/* ---------- DETTAGLIO FICHE ---------- */
.topbar-star{ background:transparent; border:none; color:#f4c14e; font-size:26px; line-height:1; width:34px; height:34px; cursor:pointer; padding:0; }
.topbar-star:disabled{ opacity:.5; cursor:default; }

.fd-head{ display:flex; align-items:center; gap:16px; margin-bottom:18px; }
.fd-logo{ width:72px; height:72px; border-radius:999px; flex:none; object-fit:contain; background:#fff; border:1px solid var(--line); padding:4px; }
.fd-logo.fiche-logo-ph{ display:flex; align-items:center; justify-content:center; font-family:var(--head); font-weight:900; color:var(--blue); background:#eef4f8; font-size:30px; text-transform:uppercase; padding:0; }
.fd-titles{ min-width:0; }
.fd-name{ font-family:var(--head); font-weight:900; font-size:23px; letter-spacing:-.02em; color:var(--ink); text-wrap:balance; line-height:1.15; }
.fd-sub{ color:var(--muted); font-size:14px; margin-top:4px; }

.fd-actions{ display:flex; flex-direction:column; gap:10px; margin-bottom:6px; }
.btn-ghost-light{ background:#fff; color:var(--blue-dark); border:1px solid var(--line2); box-shadow:none; }
.btn-ghost-light:hover{ background:#f3f7fa; }

.fd-section{ font-family:var(--head); font-weight:800; font-size:13px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted2); margin:22px 0 10px; }
.fd-svcs{ display:flex; flex-direction:column; gap:10px; }
.svc{ display:flex; align-items:center; gap:13px; width:100%; text-align:left; cursor:pointer;
  background:#fff; border:1px solid var(--line); border-radius:var(--radius); box-shadow:0 2px 8px rgba(13,31,44,.05); padding:14px; transition:box-shadow .15s; }
.svc:hover{ box-shadow:var(--shadow); }
.svc-dot{ width:12px; height:12px; border-radius:999px; flex:none; }
.svc-on .svc-dot{ background:var(--green); box-shadow:0 0 0 4px rgba(77,180,63,.15); }
.svc-off .svc-dot{ background:#c94b45; box-shadow:0 0 0 4px rgba(201,75,69,.12); }
.svc-body{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.svc-label{ font-family:var(--head); font-weight:700; font-size:16px; color:var(--ink); }
.svc-off .svc-label{ color:var(--muted); }
.svc-note{ font-size:12.5px; color:var(--muted2); }

/* ---------- TOAST ---------- */
/* z-index 85: sopra le finestre (.d2-modal 70, condivisione 75) e il menu (80), sotto chiedi() (900). A 60
   restava sotto il velo di una finestra aperta: l'errore dello Scarico saggi, che lascia la finestra aperta
   per riprovare, non si leggeva (19/09, #221.8). Non prende tocchi (pointer-events:none). */
.toast{ position:fixed; left:50%; bottom:calc(24px + env(safe-area-inset-bottom));
  transform:translateX(-50%) translateY(10px); background:var(--navy); color:#fff; font-size:14px; font-weight:500;
  padding:12px 18px; border-radius:12px; box-shadow:0 10px 30px rgba(13,31,44,.3); z-index:85; max-width:90%;
  opacity:0; transition:opacity .25s, transform .25s; pointer-events:none; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ============================================================
   DESIGN 2.0 · handoff "Farmafiches Restyling" (06/07/2026)
   Tema scuro aurora + superfici in vetro. Valori 1:1 dal prototipo.
   Ambito: Home, Viewer fiche, Richiedi visita, modal Conferma visita.
   ============================================================ */
:root{
  --d2-bg:#04101a; --d2-bar:#081a26; --d2-surface:#0e3448;
  --d2-azure:#2f8fc9; --d2-azure-lt:#7cc0e8; --d2-isf:#f5b60f;
  --d2-fresh:#38e08a; --d2-red:#d93a2b;
  --d2-btn-relief:inset 0 2px 0 rgba(255,255,255,.38), inset 0 -3px 5px rgba(0,0,0,.2), 0 3px 6px rgba(4,15,23,.4);
  --d2-glass:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
}
.d2-screen{ position:fixed; inset:0; display:flex; flex-direction:column;
  background:var(--d2-bg); color:#fff; overflow:hidden; font-family:"Lato",system-ui,sans-serif; }
.d2-aurora{ position:absolute; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(55% 35% at 64% 34%, rgba(124,192,232,.18) 0%, rgba(124,192,232,0) 72%),
    radial-gradient(120% 70% at 20% 20%, rgba(47,143,201,.5) 0%, rgba(47,143,201,0) 52%),
    radial-gradient(120% 65% at 82% 48%, rgba(31,159,214,.42) 0%, rgba(31,159,214,0) 50%),
    radial-gradient(140% 90% at 50% 104%, rgba(14,52,72,.7) 0%, rgba(14,52,72,0) 60%),
    linear-gradient(160deg, #082234 0%, #04101a 100%); }

/* --- top bar --- */
.d2-topbar{ position:relative; z-index:2; background:var(--d2-bar); flex:none;
  display:flex; align-items:center; justify-content:space-between; padding:0 16px;
  padding-top:env(safe-area-inset-top); height:calc(60px + env(safe-area-inset-top)); }
.d2-logo{ height:24px; width:auto; max-width:56vw; flex:none; }
.d2-topbar-spacer{ width:22px; flex:none; }
.d2-iconbtn{ background:none; border:none; padding:0; color:#fff; cursor:pointer; flex:none;
  display:flex; align-items:center; justify-content:center; min-width:24px; min-height:44px; }
.d2-iconbtn[aria-pressed="true"]{ color:var(--d2-isf); }
.d2-iconbtn[aria-pressed="true"] svg polygon{ fill:var(--d2-isf); }
/* burger 1:1 col mockup: barre da 22px (content-box), non-collassabile (flex:none) */
.d2-hamburger{ position:relative; box-sizing:content-box; width:22px; padding:8px 4px; flex:none;
  background:none; border:none; cursor:pointer; display:flex; flex-direction:column; gap:5px; }
.d2-hamburger span{ width:22px; height:2px; background:#fff; border-radius:1px; display:block; flex:none; }
.d2-news-dot{ position:absolute; top:2px; right:-4px; width:10px; height:10px; border-radius:50%;
  background:var(--d2-red); border:2px solid var(--d2-bar); box-shadow:0 0 6px rgba(217,58,43,.7); }

/* --- search --- */
.d2-searchwrap{ position:relative; z-index:2; padding:12px 16px; background:var(--d2-bar); flex:none;
  overflow:hidden; max-height:72px; transition:max-height .25s ease, padding .25s ease, opacity .2s ease; }
.d2-searchwrap.d2-hide{ max-height:0; padding-top:0; padding-bottom:0; opacity:0; }
.d2-search{ height:46px; background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.14);
  border-radius:23px; display:flex; align-items:center; gap:10px; padding:0 8px 0 16px; transition:border-color .15s; }
.d2-search:focus-within{ border:2px solid var(--d2-azure); padding-left:15px; }
.d2-search-ico{ color:rgba(255,255,255,.6); flex:none; }
.d2-search input{ flex:1; min-width:0; height:100%; border:none; outline:none; background:none;
  font-family:inherit; font-size:16px; color:#fff; }
.d2-search input::placeholder{ color:rgba(255,255,255,.55); }
.d2-mic{ width:34px; height:34px; border-radius:50%; background:rgba(255,255,255,.1); flex:none;
  display:flex; align-items:center; justify-content:center; border:0; padding:0; color:rgba(255,255,255,.75);
  pointer-events:none; }                                   /* mic decorativo: non cliccabile */
.d2-mic i{ width:9px; height:14px; border:2px solid rgba(255,255,255,.75); border-radius:5px; position:relative; }
.d2-mic i::after{ content:""; position:absolute; left:50%; bottom:-6px; width:2px; height:4px;
  background:rgba(255,255,255,.75); transform:translateX(-1px); }
.d2-mic-x{ display:none; width:17px; height:17px; }
/* con testo nel campo: il microfono diventa una × per pulire e tornare allo stato iniziale */
.d2-search.has-text .d2-mic{ pointer-events:auto; cursor:pointer; }
.d2-search.has-text .d2-mic-glyph{ display:none; }
.d2-search.has-text .d2-mic-x{ display:block; }
/* dettatura vocale self-hosted (cross-platform): mic attivo se il servizio c'è,
   NASCOSTO se non configurato (regola: se c'è l'icona funziona, altrimenti via) */
.d2-search.mic-live .d2-mic{ pointer-events:auto; cursor:pointer; }
.d2-search.mic-off:not(.has-text) .d2-mic{ visibility:hidden; }
.d2-search.rec .d2-mic{ background:rgba(217,58,43,.3); animation:d2micpulse 1.2s ease-in-out infinite; }
.d2-search.rec .d2-mic i{ border-color:#ffb4ab; }
.d2-search.rec .d2-mic i::after{ background:#ffb4ab; }
/* trascrizione in corso: pulsazione azzurra */
.d2-search.rec-busy .d2-mic{ background:rgba(47,143,201,.35); animation:d2micpulse 1s ease-in-out infinite; }
@keyframes d2micpulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(217,58,43,.4); } 50%{ box-shadow:0 0 0 8px rgba(217,58,43,0); } }
/* niente × nativa dell'input type=search (usiamo la nostra) */
.d2-search input[type="search"]::-webkit-search-cancel-button{ -webkit-appearance:none; display:none; }

/* --- lista brand --- */
.d2-list{ position:relative; z-index:2; flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:14px 12px calc(30px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:10px; }
/* sfumatura scura in fondo alle liste scrollabili (effetto usato nell'app in produzione) */
#screen-home::after, #screen-news::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:40px;
  z-index:3; pointer-events:none;
  background:linear-gradient(to bottom, rgba(4,16,26,0) 0%, rgba(4,16,26,.82) 75%, rgba(4,16,26,.97) 100%); }
.d2-loading, .d2-empty{ text-align:center; color:rgba(255,255,255,.55); font-size:14px; padding:32px 8px; }
/* la lista non è arrivata ma sotto c'è la risposta dell'assistente o ci sono le fonti: il perché e «Riprova» in cima */
.d2-lista-ko{ display:flex; flex-direction:column; gap:10px; }
.d2-lista-ko .d2-empty{ padding:8px 8px 0; }
.d2-card{ display:flex; align-items:center; gap:14px; padding:9px 14px; border-radius:16px;
  background:var(--d2-glass); backdrop-filter:blur(14px) saturate(1.3); -webkit-backdrop-filter:blur(14px) saturate(1.3);
  border:1px solid rgba(255,255,255,.18); box-shadow:0 4px 16px rgba(10,6,40,.28);
  width:100%; text-align:left; cursor:pointer; font-family:inherit; }
.d2-avatar{ width:53px; height:53px; border-radius:50%; background:rgba(255,255,255,.18); flex:none;
  display:flex; align-items:center; justify-content:center; font-weight:900; font-size:16px; color:#fff;
  position:relative; border:1px solid rgba(255,255,255,.18); box-sizing:border-box; }
.d2-avatar img{ position:absolute; inset:0; width:100%; height:100%; border-radius:50%;
  object-fit:contain; padding:0; background:transparent; box-sizing:border-box; }
/* (il bollino verde sul logo è stato sostituito dalla data che si accende:
   vedi .d2-date-chip.fresh qui sotto) */
.d2-card-body{ flex:1; min-width:0; }
.d2-card-top{ display:flex; align-items:center; gap:8px; }
.d2-card-name{ font-size:16px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-isf-badge{ display:inline-flex; align-items:center; font-size:9.5px; font-weight:900; letter-spacing:.06em;
  color:#0a2130; background:var(--d2-isf); border-radius:9px; padding:3px 7px; box-shadow:0 0 10px rgba(245,182,15,.45); flex:none; }
/* bollino tondo «ricetta digitale attiva»: prima della data, sull'asse verticale della card
   (la card è flex align-items:center) — stesso verde del tema per dire «servizio attivo» */
.d2-rx-dot{ display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; flex:none; align-self:center;
  background:var(--d2-azure); box-shadow:0 0 8px rgba(47,143,201,.55); }
.d2-rx-dot svg{ display:block; }
/* bollini e data più vicini fra loro (Fabio 06/09): il gap della card resta 14px per logo e freccia */
.d2-isf-round + .d2-rx-dot, .d2-isf-round + .d2-date-chip, .d2-rx-dot + .d2-date-chip{ margin-left:-7px; }
@media (min-width:900px){
  body.wideapp .d2-date-chip{ font-size:10px; padding:2px 6px; }
  body.wideapp .d2-isf-round, body.wideapp .d2-rx-dot{ width:20px; height:20px; }
  body.wideapp .d2-rx-dot svg{ width:11px; height:11px; }
}
/* bollino tondo ISF in lista (giallo, con la scritta) — «d2-isf-dot» è già il pallino rosso «non visto» */
.d2-isf-round{ display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; flex:none; align-self:center;
  font-size:7.5px; font-weight:900; letter-spacing:.04em; color:#0a2130; background:var(--d2-isf); box-shadow:0 0 8px rgba(245,182,15,.5); }
.d2-isf-riservato{ padding:8px 12px; margin:0 0 8px; border-radius:10px; background:rgba(255,255,255,.08); }
.d2-card-co{ font-size:12.5px; color:rgba(255,255,255,.62); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-date-chip{ font-size:11px; color:rgba(255,255,255,.8); background:rgba(255,255,255,.14); padding:3px 8px;
  border-radius:10px; flex:none; border:1px solid rgba(255,255,255,.2); }
/* contenuto aggiornato di recente e non ancora aperto da questo medico: la DATA
   si accende (prima era un bollino sul logo, che si confondeva col marchio). */
.d2-date-chip.fresh{ color:#0a2a1e; background:var(--d2-fresh); border-color:var(--d2-fresh);
  font-weight:800; box-shadow:0 0 10px rgba(56,224,138,.45); }
.d2-chevron{ color:rgba(255,255,255,.55); flex:none; }

/* --- Ricerca dal contenuto (Ricerca AI · A2): fonti + prodotti sotto il filtro --- */
.d2-sr-label{ margin:16px 4px 2px; font-size:11.5px; font-weight:800; letter-spacing:.08em;
  text-transform:uppercase; color:rgba(255,255,255,.55); }
.d2-sr-card{ align-items:flex-start; }
.d2-sr-card .d2-page-chip{ flex:none; margin-left:auto; }
.d2-sr-snip{ display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
  margin-top:3px; font-size:12.5px; line-height:1.45; color:rgba(255,255,255,.66); }
.d2-sr-snip b{ color:var(--d2-azure-lt); font-weight:800; }
.d2-sr-prod .d2-card-name{ font-size:14px; }

/* --- Contenuti ISF (B8): header giallo (requisito) + card video su vetro --- */
.d2-isf-head{ position:relative; z-index:2; background:var(--d2-isf); padding:16px; display:flex; align-items:center; gap:14px; flex:none;
  padding-top:calc(16px + env(safe-area-inset-top)); }
.d2-isf-ico{ width:40px; height:40px; border-radius:50%; background:#0a2130; display:flex; align-items:center; justify-content:center;
  flex:none; font-size:11px; font-weight:900; letter-spacing:.04em; color:var(--d2-isf); }
.d2-isf-headtxt{ flex:1; min-width:0; }
.d2-isf-title{ display:block; font-size:17px; font-weight:900; color:#0a2130; }
.d2-isf-sub{ display:block; font-size:13px; color:rgba(10,33,48,.7); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-isf-x{ background:none; border:0; padding:8px; margin:-8px; color:#0a2130; cursor:pointer; flex:none; min-width:44px; min-height:44px;
  display:flex; align-items:center; justify-content:center; }
.d2-isf-list{ position:relative; z-index:2; flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:10px; }
.d2-isf-card{ display:flex; gap:14px; padding:12px; border-radius:16px; text-align:left; cursor:pointer; font-family:inherit; border:1px solid rgba(255,255,255,.18);
  background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  backdrop-filter:blur(14px) saturate(1.3); -webkit-backdrop-filter:blur(14px) saturate(1.3);
  box-shadow:0 4px 16px rgba(4,16,26,.3); width:100%; }
.d2-isf-thumb{ position:relative; width:110px; height:72px; border-radius:8px; flex:none; overflow:hidden;
  background:repeating-linear-gradient(45deg,#0a2838 0 12px,#0c3042 12px 24px); border:1px solid rgba(255,255,255,.14);
  display:flex; align-items:center; justify-content:center; }
.d2-isf-thumb img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.d2-isf-play{ position:relative; z-index:1; width:30px; height:30px; border-radius:50%; background:rgba(255,255,255,.16);
  display:flex; align-items:center; justify-content:center; }
.d2-isf-play::after{ content:""; width:0; height:0; border-top:6px solid transparent; border-bottom:6px solid transparent;
  border-left:10px solid #fff; margin-left:3px; }
.d2-isf-cbody{ flex:1; min-width:0; }
.d2-isf-ctitle{ display:block; font-size:15px; font-weight:700; line-height:1.3; color:#fff; }
.d2-isf-ccat{ display:block; font-size:12.5px; color:rgba(255,255,255,.6); margin-top:4px; }
.d2-isf-cdate{ display:block; font-size:12px; color:rgba(255,255,255,.45); margin-top:2px; }
.d2-isf-dot{ width:10px; height:10px; border-radius:50%; background:var(--d2-red); flex:none; margin-top:6px; }

/* livello 1 della schermata ISF: card prodotto (foto della Libreria, nome, descrizione) */
.d2-isf-prod{ display:flex; align-items:center; gap:14px; padding:12px; border-radius:16px; text-align:left; cursor:pointer; font-family:inherit;
  border:1px solid rgba(245,182,15,.35); background:linear-gradient(180deg, rgba(245,182,15,.16), rgba(255,255,255,.05));
  backdrop-filter:blur(14px) saturate(1.3); -webkit-backdrop-filter:blur(14px) saturate(1.3); box-shadow:0 4px 16px rgba(4,16,26,.3); width:100%; }
.d2-isf-pimg{ width:72px; height:72px; border-radius:12px; flex:none; overflow:hidden; background:#fff; display:flex; align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.2); }
.d2-isf-pimg img{ width:100%; height:100%; object-fit:contain; display:block; }
.d2-isf-pph{ font-size:12px; font-weight:900; letter-spacing:.06em; color:#0a2130; background:var(--d2-isf); border-radius:9px; padding:4px 8px; }
.d2-isf-pdesc{ display:block; font-size:12.5px; line-height:1.35; color:rgba(255,255,255,.7); margin-top:3px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.d2-isf-chev{ font-size:26px; line-height:1; color:rgba(255,255,255,.55); flex:none; font-style:normal; }
.d2-isf-sect{ margin:8px 4px 0; font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.55); }
.d2-isf-back{ background:none; border:0; padding:8px; margin:-8px 0 -8px -8px; color:#0a2130; cursor:pointer; flex:none; min-width:44px; min-height:44px; display:flex; align-items:center; justify-content:center; }
.d2-isf-back[hidden]{ display:none !important; }  /* solo al livello 2 arrivando dai prodotti: altrimenti sarebbe un tasto senza azione */

/* --- Player ISF (B9): fullscreen, chiudi sempre visibile ------------------- */
.d2-isf-player{ position:fixed; inset:0; z-index:60; background:#04121c; display:flex; align-items:center; justify-content:center; }
.d2-isf-player[hidden]{ display:none; }
.d2-isf-player video{ width:100%; height:100%; object-fit:contain; background:#04121c; }
.d2-isf-pbrand{ position:absolute; top:calc(16px + env(safe-area-inset-top)); left:16px; display:flex; align-items:center; gap:8px;
  background:rgba(4,18,28,.7); padding:6px 12px; border-radius:14px; pointer-events:none; }
.d2-isf-pbrand-ico{ width:22px; height:22px; border-radius:50%; background:var(--d2-isf); display:flex; align-items:center;
  justify-content:center; font-size:9px; font-weight:900; color:#0a2130; }
.d2-isf-pbrand span:last-child{ font-size:12px; font-weight:700; color:#fff; }
.d2-isf-px{ position:absolute; top:calc(16px + env(safe-area-inset-top)); right:16px; width:44px; height:44px; border-radius:50%;
  background:rgba(255,255,255,.14); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border:0; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.d2-isf-pshare{ position:absolute; top:calc(16px + env(safe-area-inset-top)); right:70px; width:44px; height:44px; border-radius:50%;
  background:rgba(255,255,255,.14); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border:0; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.d2-isf-pshare[hidden]{ display:none; }
.d2-isf-pshare.busy{ opacity:.55; }
.d2-isf-pinfo{ position:absolute; left:0; right:0; top:calc(64px + env(safe-area-inset-top)); padding:0 20px; pointer-events:none; }
.d2-isf-ptitle{ font-size:16px; font-weight:700; color:#fff; line-height:1.3; text-shadow:0 1px 6px rgba(4,18,28,.8); }
.d2-isf-psub{ font-size:12.5px; color:rgba(255,255,255,.65); margin-top:4px; text-shadow:0 1px 6px rgba(4,18,28,.8); }

/* --- Assistente (A3): bolla risposta su vetro + chip FONTI ---------------- */
.d2-ask{ margin:14px 0 4px; padding:14px 16px; border-radius:16px;
  background:linear-gradient(180deg, rgba(47,143,201,.16), rgba(255,255,255,.04));
  backdrop-filter:blur(14px) saturate(1.3); -webkit-backdrop-filter:blur(14px) saturate(1.3);
  border:1px solid rgba(124,192,232,.35); box-shadow:0 4px 16px rgba(10,6,40,.28); }
/* Stato "armato" della ricerca: glow azzurro quando l'input è una domanda (AI) */
.d2-search.ai-armed{ border-color:rgba(124,192,232,.8);
  box-shadow:0 0 0 2px rgba(124,192,232,.32), 0 4px 18px rgba(47,143,201,.28); }
.d2-ask-head{ display:flex; align-items:center; gap:8px; font-size:11.5px; font-weight:800;
  letter-spacing:.08em; text-transform:uppercase; color:var(--d2-azure-lt); margin-bottom:8px; }
.d2-ask-head svg{ width:16px; height:16px; }
.d2-ask-wait{ display:flex; align-items:center; gap:10px; color:rgba(255,255,255,.75); font-size:13.5px; }
.d2-ask-answer{ font-size:14px; line-height:1.55; color:#fff; white-space:pre-wrap; }
.d2-ask-answer.err{ color:#ffb4ab; }
.d2-ask-srcs-label{ margin:12px 0 6px; font-size:10.5px; font-weight:800; letter-spacing:.08em;
  text-transform:uppercase; color:rgba(255,255,255,.5); }
.d2-ask-srcs{ display:flex; flex-wrap:wrap; gap:6px; }
.d2-ask-chip{ font-size:12px; font-weight:700; color:var(--d2-azure-lt); background:rgba(47,143,201,.18);
  border:1px solid rgba(47,143,201,.45); border-radius:12px; padding:6px 11px; cursor:pointer;
  font-family:inherit; min-height:30px; }

/* --- viewer fiche --- */
.d2-fiche-band{ position:relative; z-index:2; background:var(--d2-bar); padding:6px 16px 14px; flex:none;
  display:flex; align-items:center; gap:12px; }
.d2-band-avatar{ width:40px; height:40px; border-radius:50%; background:#fff; flex:none;
  display:flex; align-items:center; justify-content:center; font-weight:900; font-size:13px; color:#0e3448; overflow:hidden; }
.d2-band-avatar img{ position:absolute; inset:0; width:100%; height:100%; border-radius:50%;
  object-fit:contain; padding:0; background:#fff; box-sizing:border-box; border:1px solid #799BB3; }
.d2-band-avatar{ position:relative; }
.d2-band-txt{ flex:1; min-width:0; }
.d2-band-name{ display:block; font-size:16px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-band-co{ display:block; font-size:12.5px; color:rgba(255,255,255,.6); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-band-isf{ position:relative; width:44px; height:44px; border-radius:50%; background:var(--d2-isf); flex:none;
  display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(4,15,23,.4);
  font-size:12px; font-weight:900; letter-spacing:.04em; color:#0a2130; border:none; cursor:pointer; }
.d2-band-isf .d2-band-isf-badge{ position:absolute; top:-9px; right:-9px; min-width:20px; height:20px; border-radius:10px;
  background:var(--d2-red); border:2px solid var(--d2-bar); display:flex; align-items:center; justify-content:center;
  font-size:10.5px; font-weight:900; color:#fff; padding:0 4px; }
.d2-page-chip{ font-size:12px; font-weight:700; color:var(--d2-azure-lt); background:rgba(47,143,201,.18);
  padding:5px 10px; border-radius:12px; flex:none; }

.d2-pdf{ position:relative; z-index:1; flex:1; overflow:hidden; display:flex; align-items:center; justify-content:center;
  background:repeating-linear-gradient(45deg,#f2f5f7 0 14px,#e6ecf0 14px 28px); }
.d2-pdf iframe, .d2-pdf embed, .d2-pdf object{ position:absolute; inset:0; width:100%; height:100%; border:0; background:#fff; }
/* viewer PDF.js: scroll + pinch-zoom */
.d2-pdf-scroll{ position:absolute; inset:0; overflow:auto; -webkit-overflow-scrolling:touch; background:#e9edf0; }
.d2-pdf-pages{ transform-origin:0 0; margin:0 auto; padding:8px 0; }
/* wrapper per pagina: ancora le evidenziazioni della ricerca sopra il canvas */
.d2-pdf-pagewrap{ position:relative; display:block; width:100%; margin:0 auto 8px; }
/* Solo per i lettori di schermo (VoiceOver, TalkBack): fuori dalla vista ma non display:none, che lo
   nasconderebbe anche a loro (19/09, #221.5). */
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0; }
/* testo di una pagina del PDF: va a capo dove va a capo il PDF (per leggere riga per riga) e sta in cima
   alla pagina, così VoiceOver, spostandosi sul testo, porta a vista l'inizio della pagina */
.d2-pdf-sr{ white-space:pre; top:0; left:0; }
.d2-pdf-pagewrap:last-child{ margin-bottom:0; }
.d2-pdf-page{ display:block; width:100%; margin:0; background:#fff; box-shadow:0 1px 4px rgba(4,15,23,.22); }
/* evidenziatore dei termini cercati (posizioni in % → regge lo zoom) */
/* bollino ISF sul prodotto: bordo destro della pagina, alla riga in cui compare il nome.
   Bollino GIALLO «ISF ▸» (come il tasto ISF della fiche) con l'alone morbido che pulsa
   (effetto richiesto da Fabio, 04/09). Puntino rosso = video non ancora visto; numerino = più video. */
.d2-isf-pin{ position:absolute; right:8px; width:44px; height:44px; border-radius:50%; border:0; padding:0; cursor:pointer;
  background:var(--d2-isf); color:#0a2130; z-index:3; -webkit-tap-highlight-color:transparent;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px;
  box-shadow:0 0 0 2px rgba(255,255,255,.85), 0 0 0 8px rgba(245,182,15,.22), 0 0 22px 6px rgba(245,182,15,.55), 0 4px 14px rgba(0,0,0,.3);
  animation:d2-isf-pulse 2.2s ease-in-out infinite; }
.d2-isf-pin b{ font-size:9.5px; font-weight:900; letter-spacing:.06em; line-height:1; }
.d2-isf-pin i{ width:0; height:0; border-left:8px solid #0a2130; border-top:5px solid transparent; border-bottom:5px solid transparent; margin-left:2px; }
.d2-isf-pin .n{ position:absolute; top:-6px; left:-6px; min-width:18px; height:18px; border-radius:9px; background:#0a2130; color:#fff; font-size:10px; font-weight:800; line-height:18px; text-align:center; padding:0 4px; }
.d2-isf-pin.new::after{ content:""; position:absolute; top:-3px; right:-3px; width:12px; height:12px; border-radius:50%; background:#e0432d; border:2px solid #fff; }
.d2-isf-pin:active{ transform:scale(.94); }
@keyframes d2-isf-pulse{
  0%,100%{ box-shadow:0 0 0 2px rgba(255,255,255,.85), 0 0 0 8px rgba(245,182,15,.22), 0 0 22px 6px rgba(245,182,15,.55), 0 4px 14px rgba(0,0,0,.3); }
  50%{ box-shadow:0 0 0 2px rgba(255,255,255,.85), 0 0 0 14px rgba(245,182,15,.10), 0 0 34px 12px rgba(245,182,15,.75), 0 4px 14px rgba(0,0,0,.3); } }
@media (prefers-reduced-motion:reduce){ .d2-isf-pin{ animation:none; } }
.d2-pdf-hl{ position:absolute; background:rgba(245,182,15,.45); border-radius:2px;
  pointer-events:none; mix-blend-mode:multiply; }
/* disposizione a due colonne (toggle nella toolbar desktop) */
.d2-pdf-pages.cols2{ display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:8px; }
.d2-pdf-pages.cols2 .d2-pdf-pagewrap{ margin:0; }
.d2-pdf-pages.cols2 .d2-pdf-page{ margin:0; width:100%; height:auto; }
/* toolbar viewer: nascosta su mobile (lì c'è il pinch), visibile nel master-detail */
.d2-pdf-tools{ display:none; }
@media (min-width:900px){
  body.wideapp .d2-pdf-tools{
    position:absolute; top:12px; right:18px; z-index:3;
    display:flex; align-items:center; gap:2px; padding:4px 6px;
    background:rgba(8,26,38,.9); border:1px solid rgba(255,255,255,.16); border-radius:12px;
    backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
    box-shadow:0 4px 14px rgba(4,15,23,.35);
  }
  .d2-pdf-tools button{
    min-width:30px; height:28px; display:flex; align-items:center; justify-content:center;
    background:none; border:0; border-radius:8px; color:#cfe0ea; cursor:pointer;
    font:700 17px/1 "Lato",system-ui,sans-serif; padding:0 6px;
  }
  .d2-pdf-tools button:hover{ background:rgba(255,255,255,.12); color:#fff; }
  .d2-pdf-tools button.on{ background:rgba(47,143,201,.3); color:#fff; }
  .d2-pdf-tools .pct{ font:700 11px "Lato",system-ui,sans-serif; color:#cfe0ea; min-width:38px; text-align:center; }
  .d2-pdf-tools .sep{ width:1px; height:18px; background:rgba(255,255,255,.18); margin:0 5px; }
}
/* avviso nel riquadro del PDF (caricamento, errore, PDF mancante): il carattere dell'app, non più quello a spaziatura
   fissa da sviluppatore; dentro il viewer sta al centro, così la pillola «1 / …» in alto a sinistra non lo copre
   (collaudo del rilascio 27/09: per 1-2 secondi si sovrapponevano) */
.d2-pdf-ph{ font:600 13px/1.3 "Lato",system-ui,sans-serif; color:#5a7285; background:rgba(255,255,255,.85);
  padding:7px 14px; border-radius:10px; z-index:1; }
.d2-pdf-scroll .d2-pdf-ph{ position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); white-space:nowrap; }
/* «Caricamento…» e la fiches che non si apre (tolta, rete che cade, server giù) dentro il viewer: il fondo qui è
   chiaro a righe e il bianco al 55% della lista non si leggeva (contrasto 1,05:1, collaudo generale del 28/09).
   Stessa pillola di «Caricamento PDF…»: #5a7285 su bianco all'85%, sopra 4,5:1 su tutte e due le righe.
   «Riprova» è un tasto vero, scuro e opaco come i tasti che galleggiano sul PDF, alto 44 px */
.d2-pdf-msg{ display:flex; flex-direction:column; align-items:center; gap:12px; padding:0 16px; }
.d2-pdf > .d2-loading, .d2-pdf-msg .d2-empty{ color:#5a7285; background:rgba(255,255,255,.85); border-radius:10px;
  padding:10px 16px; margin:0; max-width:320px; font:600 14px/1.4 "Lato",system-ui,sans-serif; }
.d2-pdf-riprova{ min-height:44px; padding:0 24px; border-radius:13px; cursor:pointer; background:var(--d2-surface);
  border:1px solid rgba(124,192,232,.55); color:#fff; font:700 15px "Lato",system-ui,sans-serif;
  box-shadow:0 4px 16px rgba(4,15,23,.30); }
.d2-pdf-riprova:hover{ border-color:rgba(124,192,232,.80); }
.d2-page-pill{ position:absolute; top:14px; left:14px; z-index:3; font-size:11px; font-weight:700; color:#fff;
  background:rgba(6,20,30,.72); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); padding:5px 11px; border-radius:12px; }
.d2-actions{ position:absolute; left:14px; right:14px; bottom:calc(22px + env(safe-area-inset-bottom)); z-index:3;
  display:flex; align-items:center; gap:16px; }
.d2-svc-circle{ width:56px; height:56px; border-radius:50%; background:rgba(255,255,255,.82);
  border:1px solid rgba(255,255,255,.55); box-shadow:0 2px 8px rgba(4,15,23,.26); flex:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:#0a2130; }
/* servizio NON attivo: visibile ma al 50%, piatto (il perché arriva col toast al tap) */
.d2-svc-circle.off{ opacity:.5; box-shadow:none; }

/* --- bottoni sistema uniforme --- */
.d2-btn{ height:54px; border-radius:13px; border:none; cursor:pointer; font-family:inherit; color:#fff;
  display:flex; align-items:center; justify-content:center; gap:10px; font-size:16px; font-weight:800; width:100%; }
.d2-btn-primary{ background:var(--d2-azure); box-shadow:var(--d2-btn-relief); }
.d2-btn-secondary{ background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.28); font-weight:700; }
.d2-btn-ricetta{ flex:1; height:56px; background:var(--d2-azure); box-shadow:var(--d2-btn-relief);
.d2-btn-ricetta.off{ opacity:.5; filter:saturate(.4); }
  border-radius:13px; border:none; cursor:pointer; color:#fff; font-family:inherit;
  display:flex; align-items:center; justify-content:center; gap:10px; font-size:15.5px; font-weight:800; }

/* --- richiedi visita --- */
.d2-rv{ position:relative; z-index:2; flex:1; overflow-y:auto; padding:22px 20px;
  display:flex; flex-direction:column; gap:16px; }
.d2-rv-title{ font-size:26px; font-weight:900; color:#fff; letter-spacing:-.01em; margin:0; }
.d2-rv-sub{ font-size:14px; line-height:1.55; color:rgba(255,255,255,.7); margin:8px 0 0; }
.d2-rv-sub strong{ color:#fff; font-weight:700; }
.d2-rv-label{ font-size:12px; font-weight:700; letter-spacing:.08em; color:rgba(255,255,255,.5); margin-bottom:8px; }
.d2-rv-textarea{ width:100%; height:110px; resize:none; box-sizing:border-box; background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.16); border-radius:14px; padding:14px 16px; font-family:inherit;
  font-size:16px; color:#fff; outline:none; }
.d2-rv-textarea::placeholder{ color:rgba(255,255,255,.45); }
.d2-rv-consent{ position:relative; display:flex; gap:13px; align-items:flex-start; padding:14px; border-radius:14px;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); cursor:pointer; }
.d2-rv-consent input{ position:absolute; opacity:0; width:0; height:0; }
.d2-rv-check{ width:24px; height:24px; border-radius:6px; border:2px solid var(--d2-azure); background:transparent;
  display:flex; align-items:center; justify-content:center; flex:none; margin-top:1px; }
.d2-rv-check svg{ opacity:0; }
.d2-rv-consent input:checked ~ .d2-rv-check{ background:var(--d2-azure); }
.d2-rv-consent input:checked ~ .d2-rv-check svg{ opacity:1; }
.d2-rv-consent-text{ flex:1; }
.d2-rv-consent-title{ display:block; font-size:14.5px; font-weight:700; color:#fff; }
.d2-rv-consent-note{ display:block; font-size:12.5px; line-height:1.5; color:rgba(255,255,255,.55); margin-top:3px; }
.d2-rv-foot{ position:relative; z-index:2; flex:none; padding:0 20px calc(22px + env(safe-area-inset-bottom)); }
.d2-rv-foot .d2-btn{ background:var(--d2-azure); }

/* --- ricetta digitale · builder (B5 seleziona → B6 componi → B7 inviata) --- */
.d2-rx-head{ position:relative; z-index:2; flex:none; padding:18px 20px 6px; }
.d2-rx-title{ font-size:23px; font-weight:900; color:#fff; letter-spacing:-.01em; margin:0; }
.d2-rx-sub{ font-size:13.5px; line-height:1.5; color:rgba(255,255,255,.62); margin:6px 0 0; }
.d2-rx-sub strong{ color:#fff; font-weight:800; }
.d2-rx-list{ position:relative; z-index:2; flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:12px 16px 8px; display:flex; flex-direction:column; gap:10px; }
.d2-rx-prod{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; cursor:pointer;
  padding:13px 14px; border-radius:14px; background:var(--d2-glass); border:1px solid rgba(255,255,255,.16);
  box-shadow:0 3px 12px rgba(4,16,26,.28); color:#fff; font-family:inherit; }
.d2-rx-prod.on{ border-color:var(--d2-azure); background:linear-gradient(180deg, rgba(47,143,201,.24), rgba(47,143,201,.10)); }
.d2-rx-prod-info{ flex:1; min-width:0; display:flex; flex-direction:column; }
.d2-rx-code{ font:700 11px ui-monospace,Menlo,monospace; color:var(--d2-azure-lt); letter-spacing:.04em; }
.d2-rx-name{ font-size:15px; font-weight:700; color:#fff; margin-top:3px; }
.d2-rx-note{ font-size:12.5px; color:rgba(255,255,255,.55); margin-top:2px; }
.d2-rx-add{ width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.82); border:1px solid rgba(255,255,255,.55); color:#0a2130; box-shadow:0 2px 6px rgba(4,15,23,.24); }
.d2-rx-prod.on .d2-rx-add{ background:var(--d2-fresh); border-color:var(--d2-fresh); color:#04101a; }
.d2-rx-foot{ position:relative; z-index:2; flex:none; padding:0 20px calc(20px + env(safe-area-inset-bottom)); }
.d2-rx-foot .d2-btn{ width:100%; }
.d2-rx-foot .d2-btn:disabled{ opacity:.45; cursor:not-allowed; box-shadow:none; }
.d2-rx-count{ min-width:24px; height:24px; border-radius:12px; background:rgba(255,255,255,.28);
  display:inline-flex; align-items:center; justify-content:center; font-size:13px; font-weight:900; color:#fff; padding:0 6px; }
/* compose (B6) */
.d2-rx-compose{ position:relative; z-index:2; flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:18px 20px; display:flex; flex-direction:column; gap:20px; }
.d2-rx-compose > section{ display:flex; flex-direction:column; }
.d2-rx-compose > section[hidden]{ display:none; } /* il codice sconto compare solo per le aziende su farmaricetta (#44) */
.d2-rx-codice{ margin:0; }
.d2-rx-label{ font-size:12px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:rgba(255,255,255,.5); margin-bottom:8px; }
.d2-rx-input{ width:100%; box-sizing:border-box; height:46px; background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.16); border-radius:12px; padding:0 14px; font-family:inherit;
  font-size:16px; color:#fff; outline:none; }
.d2-rx-input::placeholder{ color:rgba(255,255,255,.42); }
.d2-rx-input:focus{ border-color:var(--d2-azure); }
.d2-rx-contacts{ display:flex; flex-direction:column; gap:8px; margin-top:8px; }
.d2-rx-sel{ background:var(--d2-glass); border:1px solid rgba(255,255,255,.16); border-radius:14px; padding:12px 14px; margin-bottom:10px; }
.d2-rx-sel-name{ font-size:14.5px; font-weight:700; color:#fff; margin-top:3px; }
.d2-rx-pos{ width:100%; box-sizing:border-box; height:40px; margin-top:9px; background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.14); border-radius:10px; padding:0 12px; font-family:inherit; font-size:16px;
  color:#fff; outline:none; }
.d2-rx-pos::placeholder{ color:rgba(255,255,255,.4); font-style:italic; }
.d2-rx-pos:focus{ border-color:var(--d2-azure); }
.d2-rx-textarea{ width:100%; height:80px; resize:none; box-sizing:border-box; background:rgba(255,255,255,.07);
  border:1px solid rgba(255,255,255,.16); border-radius:14px; padding:12px 14px; font-family:inherit; font-size:16px; color:#fff; outline:none; }
.d2-rx-textarea::placeholder{ color:rgba(255,255,255,.45); }
.d2-rx-textarea:focus{ border-color:var(--d2-azure); }
.d2-rx-send{ display:flex; flex-direction:column; }
.d2-rx-warn{ margin:0 0 8px; font-size:12px; line-height:1.4; color:#ffb28a; }
/* canali = TOGGLE (WhatsApp/Email/entrambi). Non selezionato = outline neutro;
   selezionato (aria-pressed) = colore del canale; disabilitato = niente recapito. */
.d2-rx-channels{ display:flex; gap:12px; margin-bottom:12px; }
.d2-rx-ch{ flex:1; height:50px; border-radius:13px; cursor:pointer; font-family:inherit;
  display:flex; align-items:center; justify-content:center; gap:9px; font-size:14.5px; font-weight:800;
  background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.18); color:rgba(255,255,255,.82); }
.d2-rx-ch[aria-pressed="true"]{ color:#fff; border:none; box-shadow:var(--d2-btn-relief); }
.d2-rx-ch-wa[aria-pressed="true"]{ background:#22a557; }
.d2-rx-ch-email[aria-pressed="true"]{ background:var(--d2-azure); }
.d2-rx-ch:disabled{ background:rgba(255,255,255,.04); border:1px solid rgba(255,255,255,.10); color:rgba(255,255,255,.38); cursor:not-allowed; }
/* spunta del consenso del paziente sopra «Invia ricetta» (D22, 30/09/2026): la stessa di Richiedi visita, più compatta */
.d2-rx-consenso{ padding:12px 14px; margin-bottom:12px; }
.d2-rx-consenso .d2-rv-consent-title{ font-size:14px; line-height:1.35; }
.d2-rx-consenso .d2-rv-consent-note{ margin-top:2px; }
.d2-rx-consenso input:disabled ~ .d2-rv-check{ opacity:.55; }
@media (max-height: 700px){ .d2-rx-consenso .d2-rv-consent-note{ display:none; } } /* telefoni bassi: più spazio al modulo */
/* tasto "Invia ricetta" + stato busy con spinner */
.d2-rx-invia{ width:100%; }
.d2-rx-invia:disabled{ opacity:.45; cursor:not-allowed; box-shadow:none; }
.d2-rx-invia.busy{ cursor:progress; opacity:.94; }
.d2-rx-spin{ width:16px; height:16px; flex:none; border-radius:50%; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; animation:d2rxspin .7s linear infinite; }
@keyframes d2rxspin{ to{ transform:rotate(360deg); } }
/* inviata (B7) */
.d2-rx-done{ position:relative; z-index:2; flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:0 32px calc(24px + env(safe-area-inset-bottom)); gap:16px; text-align:center; }
.d2-rx-done-ring{ width:88px; height:88px; border-radius:50%; background:rgba(46,201,107,.15); border:2px solid var(--d2-fresh);
  display:flex; align-items:center; justify-content:center; }
.d2-rx-done-title{ font-size:22px; font-weight:900; color:#fff; margin:0; }
.d2-rx-done-sub{ font-size:14.5px; line-height:1.6; color:rgba(255,255,255,.66); margin:0; }
.d2-rx-code-inline{ font-family:ui-monospace,Menlo,monospace; color:var(--d2-azure-lt); }
.d2-rx-recap{ width:100%; max-width:360px; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12);
  border-radius:14px; padding:4px 16px; margin-top:6px; }
.d2-rx-recap div{ display:flex; justify-content:space-between; align-items:center; padding:12px 0; border-bottom:1px solid rgba(255,255,255,.07); }
.d2-rx-recap div:last-child{ border-bottom:none; }
.d2-rx-recap span{ font-size:13px; color:rgba(255,255,255,.55); }
.d2-rx-recap strong{ font-size:13px; font-weight:700; color:#fff; }
.d2-rx-done #rxShare{ width:100%; max-width:360px; flex:none; margin-top:4px; }
.d2-rx-done .d2-btn-secondary{ width:100%; max-width:360px; margin-top:8px; }
/* «Riprova su WhatsApp» (D51): sotto la frase d'esito; nascosto come gli altri tasti (.d2-btn è flex e vincerebbe su [hidden]) */
.d2-rx-done .d2-btn[hidden]{ display:none; }
.d2-rx-done #rxRetry{ margin:0 0 4px; }

/* --- modal conferma visita (saggi) --- */
.d2-modal{ position:fixed; inset:0; z-index:70; display:flex; align-items:center; justify-content:center; padding:26px; }
.d2-modal[hidden]{ display:none; }
.d2-modal-overlay{ position:absolute; inset:0; background:rgba(4,15,23,.66); }
.d2-modal-card{ position:relative; width:100%; max-width:340px; background:var(--d2-surface); border-radius:22px;
  padding:28px 24px 24px; box-shadow:0 24px 60px rgba(0,0,0,.55); border:1px solid rgba(255,255,255,.12); }
.d2-modal-text{ font-size:18px; font-weight:800; line-height:1.4; color:#fff; text-align:center; margin:0 0 22px; }
.d2-modal-text span{ color:var(--d2-azure-lt); }
.d2-modal-actions{ display:flex; gap:12px; }
.d2-modal-actions .d2-btn{ height:50px; font-size:15px; }
/* condivisione di un video ISF (#100): sopra il lettore, che è a 60 */
.d2-share{ z-index:75; }
.d2-share-sub{ font-size:13.5px; line-height:1.45; color:rgba(255,255,255,.72); text-align:center; margin:-12px 0 18px; }
.d2-share-list{ display:flex; flex-direction:column; gap:10px; }
.d2-share-opt{ display:flex; align-items:center; justify-content:center; gap:10px; min-height:48px; text-decoration:none; }
.d2-share-close{ width:100%; margin-top:14px; min-height:44px; }
.d2-login-share{ margin:-18px 0 22px; padding:12px 14px; border-radius:12px; font-size:13.5px; line-height:1.5; text-align:center;
  color:#fff; background:rgba(245,182,15,.12); border:1px solid rgba(245,182,15,.4); }
.d2-login-share a{ color:var(--d2-isf); font-weight:800; }
/* modal consensi (A18/A9): nota gate + checkbox riusano .d2-check dell'auth */
.d2-consent-note{ font-size:13.5px; line-height:1.5; color:var(--d2-azure-lt); text-align:center; margin:-10px 0 16px; }
#consentModal .d2-check{ margin-bottom:14px; }
#consentModal .d2-check input[disabled]{ opacity:.55; }
#consentModal .d2-modal-actions{ margin-top:8px; }

/* ---- DRAWER menu (A4) ---- */
.d2-drawer{ position:fixed; inset:0; z-index:80; }
.d2-drawer[hidden]{ display:none; }
.d2-drawer-overlay{ position:absolute; inset:0; background:rgba(3,10,15,.42); backdrop-filter:blur(3px); -webkit-backdrop-filter:blur(3px); }
.d2-drawer-panel{ position:absolute; top:0; bottom:0; left:0; width:290px; max-width:86vw; background:var(--d2-bar);
  box-shadow:8px 0 30px rgba(0,0,0,.5); display:flex; flex-direction:column;
  padding:calc(24px + env(safe-area-inset-top)) 0 calc(20px + env(safe-area-inset-bottom));
  overflow-y:auto; animation:d2-drawer-in .22s ease; }
@keyframes d2-drawer-in{ from{ transform:translateX(-100%); } to{ transform:translateX(0); } }
.d2-drawer-head{ padding:0 22px 18px; border-bottom:1px solid rgba(255,255,255,.1);
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.d2-drawer-head .d2-logo{ height:24px; }
.d2-drawer-user{ font-size:13px; color:rgba(255,255,255,.55); margin-top:10px; }
.d2-drawer-label{ padding:16px 22px 6px; font-size:11px; font-weight:700; letter-spacing:.12em; color:rgba(255,255,255,.4); }
.d2-drawer-item{ display:flex; align-items:center; gap:14px; width:100%; padding:14px 22px;
  border:none; border-bottom:1px solid rgba(255,255,255,.07); background:none; cursor:pointer;
  font-family:inherit; font-size:16px; color:#fff; text-align:left; }
.d2-drawer-item span{ flex:1; font-weight:700; }
.d2-drawer-item svg{ flex:none; }
.d2-drawer-badge{ flex:none !important; min-width:22px; height:22px; border-radius:11px; background:var(--d2-red);
  display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:900; color:#fff; padding:0 6px; }
/* il display:flex sopra batte la UA [hidden] → senza questo il badge resta visibile con "0" */
.d2-drawer-badge[hidden], .d2-news-dot[hidden]{ display:none !important; }
/* Notifiche nel menu, sotto Logout: stessa riga delle voci, con l'interruttore a destra */
.d2-drawer-notif{ padding:12px 22px 14px; border-bottom:1px solid rgba(255,255,255,.07); }
.d2-drawer-notif-row{ display:flex; align-items:center; gap:14px; }
.d2-drawer-notif-row > svg{ flex:none; }
.d2-drawer-notif-title{ font-size:16px; font-weight:700; color:#fff; }
.d2-drawer-foot{ margin-top:auto; padding:16px 22px 0; font-size:11px; line-height:1.7; color:rgba(255,255,255,.35); }

/* ---- NEWS lista (C1) ---- */
.d2-news-list{ position:relative; z-index:2; flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:18px 16px calc(34px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:16px; }
/* le card news/eventi vivono in #newsItems (non nella .d2-news-list): il gap va messo qui */
#newsItems{ display:flex; flex-direction:column; gap:16px; }
.d2-news-h1{ font-size:24px; font-weight:900; color:#fff; margin:0; }
.d2-news-card{ display:block; width:100%; text-align:left; border:none; cursor:pointer; font-family:inherit; padding:0;
  background:linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
  backdrop-filter:blur(14px) saturate(1.3); -webkit-backdrop-filter:blur(14px) saturate(1.3);
  border:1px solid rgba(255,255,255,.18); border-radius:16px; overflow:hidden; box-shadow:0 4px 16px rgba(4,16,26,.3); }
.d2-news-img{ height:150px; position:relative; background:repeating-linear-gradient(45deg,#0a2838 0 14px,#0c3042 14px 28px);
  display:flex; align-items:center; justify-content:center; }
.d2-news-img img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.d2-news-img-ph{ font:400 11px ui-monospace,Menlo,monospace; color:rgba(255,255,255,.5); background:rgba(6,20,30,.6); padding:4px 10px; border-radius:6px; }
/* badge "NUOVO": pill come lo studio ma ROSSO (non giallo, richiesta Fabio), solo testo.
   inline-flex + line-height:1: senza, lo span eredita la line-height del body e
   il testo galleggia con un padding-top fantasma (segnalato da Fabio 09/07). */
.d2-news-new{ position:absolute; top:12px; left:12px; display:inline-flex; align-items:center; background:var(--d2-red); padding:5px 9px; border-radius:9px; }
.d2-news-new span{ font-size:10px; font-weight:900; letter-spacing:.06em; line-height:1; color:#fff; }
.d2-news-body{ padding:16px 18px 18px; }
.d2-news-meta{ font-size:11.5px; font-weight:700; color:var(--d2-azure-lt); }
.d2-news-title{ font-size:16px; font-weight:700; line-height:1.35; color:#fff; margin-top:7px; }

/* ---- NEWS dettaglio (C2) ---- */
.d2-nd-screen{ position:fixed; inset:0; display:flex; flex-direction:column; background:var(--d2-surface); color:#fff;
  overflow:hidden; font-family:"Lato",system-ui,sans-serif; }
.d2-nd{ display:flex; flex-direction:column; height:100%; }
.d2-nd-head{ height:240px; flex:none; position:relative; display:flex; align-items:center; justify-content:center;
  background:repeating-linear-gradient(45deg,#0a2838 0 14px,#0c3042 14px 28px); }
.d2-nd-head img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.d2-nd-head-ph{ font:400 11px ui-monospace,Menlo,monospace; color:#9fc2d8; background:rgba(8,26,38,.8); padding:4px 10px; border-radius:6px; }
.d2-nd-back{ position:absolute; top:calc(14px + env(safe-area-inset-top)); left:14px; z-index:2; width:38px; height:38px;
  border-radius:50%; background:rgba(8,26,38,.8); border:none; cursor:pointer; color:#fff;
  display:flex; align-items:center; justify-content:center; }
.d2-nd-fade{ position:absolute; left:0; right:0; bottom:0; height:40px; }
.d2-nd-scroll{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:0 20px 24px; margin-top:22px; }
.d2-nd-meta{ font-size:12px; font-weight:700; letter-spacing:.06em; color:var(--d2-azure-lt); text-transform:uppercase; }
.d2-nd-title{ font:900 23px/1.25 "Lato",sans-serif; color:#fff; margin:10px 0 14px; }
.d2-nd-body{ font:400 15px/1.65 "Lato",sans-serif; color:rgba(255,255,255,.78); }
.d2-nd-body p{ margin:0 0 10px; }
.d2-nd-body div{ margin:0; }
.d2-nd-body b, .d2-nd-body strong{ font-weight:800; color:#fff; }
.d2-nd-body h3, .d2-nd-body h4{ font-weight:800; color:#fff; margin:14px 0 6px; }
.d2-nd-body ul, .d2-nd-body ol{ margin:0 0 10px; padding-left:22px; }
.d2-nd-body li{ margin:3px 0; }
.d2-nd-body a{ color:var(--d2-azure-lt); text-decoration:underline; }
.d2-nd-foot{ flex:none; padding:14px 16px calc(18px + env(safe-area-inset-bottom)); border-top:1px solid rgba(255,255,255,.08);
  display:flex; align-items:center; gap:12px; background:var(--d2-bar); }
.d2-nd-avatar{ width:42px; height:42px; border-radius:50%; background:#fff; flex:none; display:flex; align-items:center;
  justify-content:center; font-weight:900; font-size:13px; color:#0e3448; position:relative; overflow:hidden; }
.d2-nd-avatar img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.d2-nd-foot-txt{ flex:1; min-width:0; }
.d2-nd-foot-co{ display:block; font-size:14px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-nd-foot-sub{ display:block; font-size:12px; color:rgba(255,255,255,.55); }
.d2-nd-apri{ height:48px; padding:0 20px; background:var(--d2-azure); box-shadow:var(--d2-btn-relief); border:none;
  border-radius:13px; color:#fff; font-family:inherit; font-size:15px; font-weight:700; cursor:pointer; flex:none;
  display:inline-flex; align-items:center; gap:9px; }
/* «Chiedi di essere contattato» (richiesta contatto all'azienda, D21 30/09/2026: prima «Maggiori informazioni»):
   la spunta del consenso della visita e il bottone, nel corpo */
.d2-nd-contatto{ max-width:400px; margin:30px 0 20px; display:flex; flex-direction:column; gap:12px; }
.d2-nd-contatto .d2-nd-info{ margin:0; }
.d2-nd-consenso input:disabled ~ .d2-rv-check{ opacity:.55; }
.d2-nd-info{ width:100%; max-width:400px; height:52px; margin:30px 0 20px; border:none; border-radius:13px; background:var(--d2-azure);
  box-shadow:var(--d2-btn-relief); color:#fff; font:800 15px "Lato",sans-serif; letter-spacing:.03em;
  text-transform:uppercase; cursor:pointer; }
.d2-nd-info:disabled{ opacity:.7; cursor:default; }

/* ---- CONTATTI (E1) / ACCOUNT (E2) ---- */
.d2-page{ position:relative; z-index:2; flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:24px 18px calc(24px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:16px; }
.d2-contact-row{ display:flex; align-items:center; gap:13px; width:100%; padding:16px 18px; border-radius:14px;
  background:var(--d2-glass); border:1px solid rgba(255,255,255,.16); box-shadow:0 3px 12px rgba(4,16,26,.28);
  cursor:pointer; font-family:inherit; text-align:left; }
.d2-contact-row svg:first-child{ flex:none; }
.d2-contact-row span{ flex:1; font-size:15px; font-weight:700; color:#fff; }
.d2-credits{ margin-top:auto; padding-top:18px; border-top:1px solid rgba(255,255,255,.1);
  font-size:12px; line-height:1.7; color:rgba(255,255,255,.4); }
.d2-acc-card{ display:flex; align-items:center; gap:14px; padding:16px; border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05)); border:1px solid rgba(255,255,255,.16);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.28); }
.d2-acc-avatar{ width:54px; height:54px; border-radius:50%; background:var(--d2-azure); flex:none;
  display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:900; color:#fff; }
.d2-acc-info{ flex:1; min-width:0; }
.d2-acc-name{ font-size:17px; font-weight:800; color:#fff; }
.d2-acc-email{ font-size:13px; color:rgba(255,255,255,.6); margin-top:2px; word-break:break-all; }
.d2-acc-extra{ font-size:12px; color:var(--d2-azure-lt); margin-top:3px; }
.d2-acc-extra:empty{ display:none; }
.d2-acc-desc{ font-size:14px; line-height:1.6; color:rgba(255,255,255,.68); margin:0; }
.d2-acc-foot{ position:relative; z-index:2; flex:none; padding:0 16px calc(20px + env(safe-area-inset-bottom)); }
.d2-btn-danger{ background:#d5402d; box-shadow:var(--d2-btn-relief); }

/* ---- AMMINISTRAZIONE · box drawer + autorizza utenti ---- */
.d2-drawer-admin{ display:flex; align-items:center; gap:12px; width:calc(100% - 44px); margin:16px 22px 0;
  padding:13px 16px; background:rgba(47,143,201,.14); border:1px solid rgba(47,143,201,.35); border-radius:10px;
  cursor:pointer; font-family:inherit; text-align:left; }
.d2-drawer-admin[hidden]{ display:none; }
.d2-drawer-admin svg{ flex:none; }
.d2-drawer-admin span{ flex:1; font-size:15px; font-weight:700; color:var(--d2-azure-lt); }
.d2-admin-sub{ font-size:13.5px; color:var(--d2-azure-lt); margin:-6px 0 2px; }
.d2-admin-card{ display:flex; align-items:center; gap:12px; padding:14px 16px; border-radius:14px;
  background:var(--d2-glass); border:1px solid rgba(255,255,255,.16); box-shadow:0 3px 12px rgba(4,16,26,.28); }
.d2-admin-info{ flex:1; min-width:0; }
.d2-admin-name{ font-size:15.5px; font-weight:700; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-admin-mail{ font-size:12.5px; color:rgba(255,255,255,.6); margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.d2-admin-meta{ font-size:12px; color:var(--d2-azure-lt); margin-top:3px; }
.d2-admin-actions{ flex:none; display:flex; flex-direction:column; gap:8px; }
.d2-admin-ok, .d2-admin-ban{ height:38px; padding:0 16px; border:none; border-radius:12px; color:#fff;
  font-family:inherit; font-size:13px; font-weight:800; cursor:pointer; min-width:96px; }
.d2-admin-ok{ background:var(--d2-azure); box-shadow:var(--d2-btn-relief); }
.d2-admin-ban{ background:rgba(255,255,255,.08); border:1px solid rgba(213,64,45,.55); color:#f0a99e; }
.d2-admin-ok:disabled, .d2-admin-ban:disabled{ opacity:.5; }
.d2-admin-warn{ font-size:11.5px; color:#f0a99e; margin-top:4px; }

/* --- Admin Utenti nella PWA: ricerca, tab, righe, chip, dettaglio (riusa .d2-modal) --- */
/* blocco superiore utenti (titolo+ricerca+tab+conteggio) FISSO allo scroll della lista.
   Il padding-top va sulla sticky (non su .d2-page) così `top:0` la incolla al bordo
   alto del pannello e il suo sfondo copre le card che scorrono sotto (niente bleed). */
#screen-admin-users .d2-page{ padding-top:0; }
.d2-usticky{ position:sticky; top:0; z-index:5; background:var(--d2-bg);
  margin:0 -18px; padding:24px 18px 12px;
  box-shadow:0 6px 14px -8px rgba(4,15,23,.7); }
.d2-usticky .d2-admin-sub{ margin-bottom:0; }
.d2-usearch{ margin:0 0 12px; }
.d2-usearch input{ width:100%; height:46px; padding:0 16px; border-radius:13px; border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08); color:#fff; font-family:inherit; font-size:16px; outline:none; }
.d2-utabs{ display:flex; gap:8px; overflow-x:auto; padding-bottom:6px; margin:0 0 12px; -webkit-overflow-scrolling:touch; }
.d2-utab{ flex:none; height:36px; padding:0 15px; border-radius:18px; border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.08); color:#eaf2f8; font-family:inherit; font-weight:700; font-size:13px; white-space:nowrap; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; }
.d2-utab.active{ background:var(--d2-azure); border-color:transparent; color:#fff; }
.d2-urow{ width:100%; display:flex; align-items:center; gap:12px; padding:12px 14px; margin-bottom:8px; text-align:left;
  border-radius:14px; border:1px solid rgba(255,255,255,.1); background:rgba(255,255,255,.05); color:#fff; cursor:pointer; font-family:inherit; }
.d2-uavatar{ width:40px; height:40px; flex:none; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14); font-weight:800; font-size:13px; color:#fff; }
.d2-ubody{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
.d2-uname{ font-weight:800; font-size:14.5px; }
.d2-umail{ font-size:12.5px; color:rgba(255,255,255,.6); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.d2-umeta{ font-size:12px; color:rgba(255,255,255,.5); }
.d2-uchip{ flex:none; font-weight:800; font-size:10.5px; letter-spacing:.03em; text-transform:uppercase; padding:5px 9px; border-radius:20px; }
.d2-uchip.ok{ background:rgba(56,224,138,.16); color:#38e08a; }
.d2-uchip.ban{ background:rgba(213,64,45,.18); color:#ff8f7f; }
.d2-uchip.pend{ background:rgba(245,182,15,.16); color:#f5b60f; }
.d2-modal-head{ display:flex; align-items:center; gap:12px; margin:0 0 16px; }
.d2-modal-head > div{ flex:1; min-width:0; }
.d2-udetail{ display:flex; flex-direction:column; margin:0 0 18px; }
.d2-udrow{ display:flex; justify-content:space-between; gap:12px; padding:8px 0; border-top:1px solid rgba(255,255,255,.08); font-size:13.5px; }
.d2-udrow:first-child{ border-top:0; }
.d2-udrow span{ color:rgba(255,255,255,.6); }
.d2-udrow b{ color:#fff; text-align:right; }
.d2-modal .d2-modal-card{ max-height:86vh; overflow-y:auto; }

/* ellipsis nome azienda anche quando non entra nello spazio (fedele al nome fiche).
   `.d2-card-co` è uno <span> inline: senza display:block il text-overflow non scatta. */
.d2-card-co{ display:block; }

/* pill contatore pagina: su mobile appare solo con ISF (senza ISF il conteggio è
   nel chip della banda); su tablet/desktop (banda nascosta) la riattiva il §MD sotto. */
#screen-fiche:not(.has-isf) .d2-page-pill{ display:none; }

/* ============================================================
   TABLET / DESKTOP · layout MASTER-DETAIL
   North-star: _shared/design/restyling/Farmafiches Restyling.dc.html (sez. D1–E).
   ≥900px + body.wideapp (app autenticata): #screen-home diventa una SIDEBAR
   fissa a sinistra (logo + ricerca + lista brand) e le altre schermate app
   vivono nel PANNELLO DESTRO (empty · fiche con viewer+rail azioni · news ·
   account · …). Il mobile (<900px) resta invariato: schermate a tutto schermo.
   Nessun colore/font nuovo: solo i token D2 esistenti.
   ============================================================ */
:root{ --md-sidebar:360px; }

@media (min-width:900px){
  /* la colonna sidebar (lista brand OPPURE nav contestuale) e il pannello destro
     convivono; niente schermate a tutto schermo. show() sceglie quale sidebar mostrare. */
  body.wideapp .d2-sidebar-col{
    right:auto; width:var(--md-sidebar);
    border-right:1px solid rgba(255,255,255,.08); z-index:5;
  }
  body.wideapp #screen-home .d2-topbar{ gap:12px; }

  /* ---- MENU (drawer) come colonna sinistra su desktop/tablet ----
     Aperto, il pannello del menu OCCUPA la colonna della lista fiches (la copre);
     nessun velo scuro sul pannello destro (resta usabile). La × chiude e torna
     alle fiches. Fedele all'espediente richiesto (riuso del drawer, non una nav a parte). */
  body.wideapp #drawer{ right:auto; width:var(--md-sidebar); z-index:6; }
  body.wideapp #drawer .d2-drawer-overlay{ display:none; }   /* niente velo sul pannello destro */
  body.wideapp #drawer .d2-drawer-panel{ width:var(--md-sidebar); max-width:none; box-shadow:none;
    border-right:1px solid rgba(255,255,255,.08); }
  /* evidenza voce attiva del menu */
  #drawer .d2-drawer-item.active{ background:rgba(47,143,201,.16); }
  #drawer .d2-drawer-item.active span:first-of-type{ color:#fff; }

  body.wideapp #screen-fiche,
  body.wideapp #screen-news,
  body.wideapp #screen-news-detail,
  body.wideapp #screen-account,
  body.wideapp #screen-contatti,
  body.wideapp #screen-richiedi-visita,
  body.wideapp #screen-ricetta-products,
  body.wideapp #screen-ricetta-compose,
  body.wideapp #screen-ricetta-sent,
  body.wideapp #screen-isf,
  body.wideapp #screen-admin-users,
  body.wideapp #screen-assistente,
  body.wideapp #screen-empty{ left:var(--md-sidebar); }

  /* ---- ASSISTENTE nel pannello destro (D3 del prototipo, R95 del 27/09) ----
     testata come nel prototipo (tondo azzurro + «Assistente Farmafiches»), la domanda a destra, la risposta in
     vetro a sinistra; poi «Dal contenuto delle fiches» e «Prodotti suggeriti» in griglia di 2 colonne. Larghezza
     che segue il testo (viste compatte, 26/09): il blocco non si stira oltre 920 px. */
  .d2-ai-bar{ position:relative; z-index:2; flex:none; height:66px; display:flex; align-items:center; gap:12px;
    padding:0 28px; background:var(--d2-bar); border-bottom:1px solid rgba(255,255,255,.08); }
  .d2-ai-ico{ width:34px; height:34px; border-radius:50%; background:var(--d2-azure); color:#fff; flex:none;
    display:flex; align-items:center; justify-content:center; box-shadow:var(--d2-btn-relief); }
  .d2-ai-title{ margin:0; font:800 18px "Lato"; color:#fff; }
  .d2-ai-page{ padding:24px 28px calc(28px + env(safe-area-inset-bottom)); }
  .d2-ai-col{ width:100%; max-width:920px; display:flex; flex-direction:column; gap:14px; }
  .d2-ai-q{ align-self:flex-end; max-width:70%; background:var(--d2-azure); color:#fff;
    border-radius:16px 16px 4px 16px; padding:13px 17px; font:600 15px/1.45 "Lato"; box-shadow:var(--d2-btn-relief); }
  #screen-assistente .d2-ask{ margin:0; border-radius:16px 16px 16px 4px; padding:18px 20px; }
  #screen-assistente .d2-ask-answer{ font-size:15px; line-height:1.65; }
  #screen-assistente .d2-sr-label{ margin:10px 0 0; }
  .d2-ai-fonti{ display:flex; flex-direction:column; gap:10px; }
  .d2-ai-prodotti{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; }
  /* il dettaglio news vive nel pannello destro: niente back (la × del menu riporta alle fiches) */
  body.wideapp #screen-news-detail .d2-nd-back{ display:none; }

  /* ---- EMPTY STATE: "Nessuna fiche selezionata" (con legenda bollini) ----
     Scoping a body.wideapp OBBLIGATORIO: il selettore ID #screen-empty (1,0,0)
     batterebbe .screen[hidden] (0,2,0) e forzerebbe l'empty visibile su OGNI
     schermo ≥900px, coprendo il login (che è position:fixed come .d2-screen). */
  body.wideapp #screen-empty{ display:flex; align-items:center; justify-content:center; text-align:center; padding:24px; }
  body.wideapp #screen-empty .d2-aurora{ z-index:0; }
  .d2-empty-card{ position:relative; z-index:2; max-width:420px; display:flex; flex-direction:column; align-items:center; gap:14px; }
  .d2-empty-ico{ width:96px; height:96px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); color:var(--d2-azure-lt); }
  .d2-empty-ico svg{ width:42px; height:42px; }
  .d2-empty-h{ font:900 24px "Lato"; color:#fff; }
  .d2-empty-p{ font:400 15px "Lato"; color:rgba(255,255,255,.62); line-height:1.5; max-width:340px; }
  .d2-empty-legend{ display:flex; gap:22px; margin-top:6px; font:400 13px "Lato"; color:rgba(255,255,255,.7); }
  .d2-empty-legend span{ display:inline-flex; align-items:center; gap:7px; }
  .d2-legend-dot{ width:9px; height:9px; border-radius:50%; }
  .d2-legend-dot.fresh{ background:var(--d2-fresh); box-shadow:0 0 8px rgba(56,224,138,.7); }
  .d2-empty-legend .d2-date-chip{ margin-right:7px; }
  .d2-legend-dot.isf{ background:var(--d2-isf); box-shadow:0 0 8px rgba(245,182,15,.5); }

  /* ---- FICHE: due colonne [ viewer PDF | rail azioni ] ---- */
  body.wideapp #screen-fiche{ flex-direction:row; }
  body.wideapp #screen-fiche .d2-topbar,
  body.wideapp #screen-fiche .d2-fiche-band{ display:none; }
  body.wideapp #screen-fiche .d2-pdf{ flex:1; order:1; }
  body.wideapp #screen-fiche .d2-actions{ display:none; }     /* azioni circolari solo su mobile */
  body.wideapp #screen-fiche .d2-page-pill{ display:block; }  /* contatore sempre visibile (banda nascosta) */

  #ficheRail{ display:none; }
  body.wideapp #screen-fiche #ficheRail{
    order:2; flex:none; width:340px; height:100%; overflow-y:auto;
    background:var(--d2-bar); border-left:1px solid rgba(255,255,255,.08);
    padding:20px 20px calc(20px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:16px; z-index:3;
  }
  /* header brand del rail */
  .d2-rail-head{ display:flex; align-items:flex-start; gap:12px; }
  .d2-rail-head .d2-band-avatar{ position:relative; }
  .d2-rail-htxt{ flex:1; min-width:0; }
  .d2-rail-name{ display:block; font:900 19px "Lato"; color:#fff; }
  .d2-rail-co{ display:block; font:400 12.5px "Lato"; color:rgba(255,255,255,.6); margin-top:3px; }
  .d2-rail-star{ flex:none; color:rgba(255,255,255,.55); background:none; border:0; cursor:pointer; padding:4px; }
  .d2-rail-star[aria-pressed="true"]{ color:var(--d2-isf); }
  .d2-rail-star[aria-pressed="true"] svg polygon{ fill:var(--d2-isf); }
  .d2-rail-label{ font:700 10px "Lato"; letter-spacing:.09em; text-transform:uppercase; color:rgba(255,255,255,.4); margin-top:2px; }
  /* bottoni pieni del rail (Ricetta / Richiedi visita / Scarica saggi) */
  .d2-rail-btn{ width:100%; height:52px; border-radius:14px; display:flex; align-items:center; justify-content:center; gap:9px;
    font:700 15px "Lato"; cursor:pointer; border:1px solid rgba(255,255,255,.14); background:var(--d2-glass); color:#fff; }
  .d2-rail-btn.primary{ background:var(--d2-azure); border-color:transparent; box-shadow:var(--d2-btn-relief); }
  .d2-rail-btn.off{ opacity:.5; }
  .d2-rail-btn svg{ flex:none; }
  /* card contenuti ISF nel rail */
  .d2-rail-isf{ border:1px solid rgba(245,182,15,.35); background:rgba(245,182,15,.07); border-radius:14px; padding:13px 14px;
    display:flex; flex-direction:column; gap:5px; width:100%; text-align:left; cursor:pointer; transition:background .15s; }
  .d2-rail-isf:hover{ background:rgba(245,182,15,.13); }
  .d2-rail-isf b .go{ margin-left:auto; font:700 17px "Lato"; font-style:normal; color:var(--d2-isf); }
  .d2-rail-isf b{ display:flex; align-items:center; gap:8px; font:700 13.5px "Lato"; color:var(--d2-isf); }
  .d2-rail-isf b::before{ content:""; width:8px; height:8px; border-radius:50%; background:var(--d2-isf); box-shadow:0 0 8px rgba(245,182,15,.6); }
  .d2-rail-isf span{ font:400 12.5px "Lato"; color:rgba(255,255,255,.72); line-height:1.45; }

  /* ---- News / Account / Contatti / Utenti nel pannello ---- */
  /* topbar (logo+indietro) ridondante su wide: la nav è nella sidebar → titolo pulito nel pannello */
  body.wideapp #screen-news .d2-topbar,
  body.wideapp #screen-contatti .d2-topbar,
  body.wideapp #screen-account .d2-topbar,
  body.wideapp #screen-admin-users .d2-topbar{ display:none; }
  /* pannello destro: il contenuto usa TUTTA la larghezza disponibile con padding
     coerente (niente cap arbitrari diversi per vista). Le griglie riempiono con
     colonne auto-fill; account/contatti/richiedi-visita riempiono la larghezza. */
  body.wideapp #screen-news .d2-news-list,
  body.wideapp #screen-richiedi-visita .d2-rv,
  body.wideapp #screen-richiedi-visita .d2-rv-foot{ max-width:none; padding-left:28px; padding-right:28px; }
  /* ACCOUNT come nel prototipo (D6): una colonna di 560 px al centro del pannello, con «Elimina account» subito sotto
     le altre voci. Prima profilo, «Consensi privacy», «Informativa privacy» ed «Elimina account» erano larghi tutto
     il pannello, circa 1.000 px per etichette brevi, ed Elimina stava in fondo allo schermo (viste compatte, regola
     del 26/09; collaudo del rilascio 27/09). Stessa colonna per Contatti / Credits, voce sorella del menu con lo
     stesso difetto (tre righe brevi larghe circa 1.000 px). Sul telefono invariato. */
  body.wideapp #screen-account .d2-page,
  body.wideapp #screen-account .d2-acc-foot,
  body.wideapp #screen-contatti .d2-page{ width:100%; max-width:616px; margin:0 auto; box-sizing:border-box; padding-left:28px; padding-right:28px; }
  body.wideapp #screen-account .d2-page{ flex:0 1 auto; padding-top:28px; padding-bottom:18px; }
  body.wideapp #screen-account .d2-acc-foot{ padding-bottom:28px; }
  /* builder ricetta nel pannello destro: contenuto centrato e leggibile (non stirato
     a tutta larghezza — altrimenti il "+" finisce lontanissimo dal testo). */
  body.wideapp #screen-ricetta-products .d2-rx-head,
  body.wideapp #screen-ricetta-products .d2-rx-list,
  body.wideapp #screen-ricetta-products .d2-rx-foot,
  body.wideapp #screen-ricetta-compose .d2-rx-compose,
  body.wideapp #screen-ricetta-compose .d2-rx-send{ max-width:880px; margin-left:auto; margin-right:auto; width:100%; box-sizing:border-box; }
  /* griglia news/eventi: colonne fisse per breakpoint (riempiono la larghezza,
     card di dimensione coerente). Base ≥900px = 2 colonne. */
  body.wideapp #newsItems{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:18px; align-content:start; }
  body.wideapp #newsItems .d2-empty, body.wideapp #newsItems .d2-loading{ grid-column:1 / -1; }
}

@media (min-width:1250px){ body.wideapp #newsItems{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (min-width:1650px){ :root{ --md-sidebar:380px; } body.wideapp #newsItems{ grid-template-columns:repeat(4, minmax(0,1fr)); } }

/* ============================================================
   LOGIN (Design 2.0) — north-star Prelogin.dc.html
   Mobile: aurora + campi in vetro. Tablet/desktop: two-column
   (promessa a sinistra + card in vetro a destra).
   ============================================================ */
/* flex-direction:row ESPLICITO: senza, eredita column da .screen (riga 29) e
   impila brand+form in verticale invece di affiancarli sul tablet/desktop. */
.d2-login{ position:fixed; inset:0; display:flex; flex-direction:row; align-items:stretch; overflow:hidden; background:#04101a; }
.d2-login-aurora{ position:absolute; inset:0; z-index:0; pointer-events:none;
  background:radial-gradient(120% 70% at 20% 20%, rgba(47,143,201,.5) 0%, rgba(47,143,201,0) 52%),
    radial-gradient(120% 65% at 82% 48%, rgba(31,159,214,.42) 0%, rgba(31,159,214,0) 50%),
    radial-gradient(140% 90% at 50% 104%, rgba(14,52,72,.7) 0%, rgba(14,52,72,0) 60%),
    linear-gradient(160deg, #082234 0%, #04101a 100%); }
.d2-login-brand{ display:none; }
.d2-login-panel{ position:relative; z-index:2; flex:1; min-width:0; display:flex; flex-direction:column; justify-content:center; padding:0; }
.d2-login-card{ display:flex; flex-direction:column; }
.d2-login-logo{ height:40px; align-self:center; margin-bottom:10px; }
.d2-login-title{ display:none; }
.d2-login-sub{ text-align:center; font-size:14px; color:rgba(255,255,255,.6); margin:0 0 34px; }
.d2-fld{ display:block; margin-bottom:18px; }
.d2-fld > span{ display:block; font-size:12px; font-weight:700; letter-spacing:.08em; color:rgba(255,255,255,.5); margin:0 4px 7px; }
/* 16px e non 15: sotto i 16 Safari su iPhone ingrandisce la pagina al tocco (checklist iOS; qui lo blocca
   già maximum-scale=1, ma la regola vale per tutti i campi · 19/09, #221.15) */
.d2-fld input{ width:100%; height:54px; box-sizing:border-box; background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16);
  border-radius:14px; padding:0 16px; color:#fff; font-size:16px; font-family:inherit; outline:none; }
.d2-fld input::placeholder{ color:rgba(255,255,255,.45); }
.d2-fld input:focus{ border-color:var(--d2-azure); }
.d2-fld-pw{ position:relative; display:block; }
.d2-fld-pw input{ padding-right:54px; }
.d2-fld-eye{ position:absolute; right:8px; top:50%; transform:translateY(-50%); width:38px; height:38px; border-radius:50%;
  background:rgba(255,255,255,.08); border:0; display:flex; align-items:center; justify-content:center; color:rgba(255,255,255,.7); cursor:pointer; padding:0; }
.d2-login-btn{ width:100%; height:54px; box-sizing:border-box; border:none; border-radius:14px; background:var(--d2-azure);
  box-shadow:var(--d2-btn-relief); color:#fff; font-family:inherit; font-size:16px; font-weight:900; letter-spacing:.04em; text-transform:uppercase; cursor:pointer; margin-top:8px; }
.d2-login-btn:disabled{ opacity:.7; cursor:default; }
.d2-login-err{ margin:12px 0 0; color:#ffb4ab; font-size:13.5px; text-align:center; }
.d2-login-err[hidden]{ display:none; }
/* «Reinvia email di conferma» sotto l'errore del login (chi non ha ancora confermato l'email) */
#loginResend{ display:block; margin:4px auto 0; min-height:44px; padding:0 12px; }
#loginResend[hidden]{ display:none; }
/* registrazione con email già usata: collegamento diretto al recupero password */
#registerForgot{ display:block; grid-column:1 / -1; margin:4px 0 0; min-height:44px; padding:0; text-align:left; }
#registerForgot[hidden]{ display:none; }
.d2-login-links{ display:flex; justify-content:space-between; margin-top:22px; padding:0 2px; }
.d2-login-links a{ font-size:13.5px; font-weight:700; color:var(--d2-azure-lt); text-decoration:none; }
.d2-login-foot{ position:absolute; left:0; right:0; bottom:calc(26px + env(safe-area-inset-bottom)); text-align:center; font-size:12px; color:rgba(255,255,255,.35); z-index:2; }

@media (min-width:900px){
  /* blocco (promessa + card) centrato come gruppo nel viewport, non spalmato ai bordi */
  .d2-login{ justify-content:center; align-items:center; gap:72px; }
  .d2-login-brand{ display:flex; flex-direction:column; justify-content:center; position:relative; z-index:2; flex:0 1 440px; max-width:440px; min-width:0; padding:0; }
  .d2-login-brand-logo{ height:36px; align-self:flex-start; margin-bottom:28px; }
  .d2-login-headline{ font:900 32px/1.2 "Lato",sans-serif; color:#fff; letter-spacing:-.01em; margin:0; }
  .d2-login-lead{ font-size:16px; line-height:1.6; color:rgba(255,255,255,.65); margin:16px 0 0; max-width:430px; }
  .d2-login-features{ margin-top:32px; display:flex; flex-direction:column; gap:14px; max-width:430px; }
  .d2-login-feat{ display:flex; align-items:center; gap:13px; font-size:14.5px; color:rgba(255,255,255,.85); }
  .d2-login-feat-ico{ width:42px; height:42px; border-radius:12px; background:rgba(47,143,201,.16); border:1px solid rgba(47,143,201,.4);
    display:flex; align-items:center; justify-content:center; flex:none; color:var(--d2-azure-lt); }
  .d2-login-panel{ flex:0 0 400px; padding:0; }
  .d2-login-card{ background:linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.05));
    backdrop-filter:blur(22px) saturate(1.3); -webkit-backdrop-filter:blur(22px) saturate(1.3);
    border:1px solid rgba(255,255,255,.2); border-radius:20px; box-shadow:0 20px 50px rgba(4,16,26,.5); padding:34px 32px; }
  .d2-login-logo{ display:none; }
  .d2-login-title{ display:block; font-size:22px; font-weight:900; color:#fff; margin-bottom:6px; }
  .d2-login-sub{ text-align:left; margin-bottom:26px; }
  .d2-fld input{ height:50px; border-radius:13px; }
  .d2-fld > span{ font-size:11.5px; }
  .d2-login-btn{ height:52px; border-radius:13px; font-size:15.5px; }
  .d2-login-links{ margin-top:18px; }
  .d2-login-foot{ display:none; }
}

/* ============================================================
   INFORMATIVA PRIVACY — documento in-app (studio Prelogin)
   header fisso + testo scorrevole su navy + CTA fissa in basso.
   Il contenitore è .d2-screen (fixed inset:0, tema scuro).
   ============================================================ */
.d2-privacy{ overflow:hidden; }
.d2-privacy-bar{ position:relative; z-index:2; flex:none; height:60px; background:var(--d2-bar);
  border-bottom:1px solid rgba(255,255,255,.08); display:flex; align-items:center; justify-content:space-between; padding:0 12px; }
.d2-privacy-back{ width:40px; height:40px; border:0; background:transparent; color:#fff; display:flex;
  align-items:center; justify-content:center; cursor:pointer; border-radius:10px; padding:0; }
.d2-privacy-back:active{ background:rgba(255,255,255,.08); }
.d2-privacy-title{ font-size:16px; font-weight:900; color:#fff; }
.d2-privacy-spacer{ width:40px; }
.d2-privacy-body{ position:relative; z-index:2; flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch;
  padding:22px 20px 26px; }
.d2-privacy-updated{ font-size:12px; color:rgba(255,255,255,.45); margin-bottom:12px; }
.d2-privacy-lead{ font-size:14px; line-height:1.65; color:rgba(255,255,255,.82); margin:0 0 6px; }
.d2-privacy-h{ font-size:12px; font-weight:800; letter-spacing:.06em; text-transform:uppercase; color:var(--d2-azure-lt);
  margin:22px 0 8px; }
.d2-privacy-p{ font-size:14px; line-height:1.65; color:rgba(255,255,255,.7); margin:0 0 10px; }
.d2-privacy-list{ margin:2px 0 10px; padding-left:26px; display:flex; flex-direction:column; gap:8px; }
.d2-privacy-list li{ font-size:13.5px; line-height:1.55; color:rgba(255,255,255,.7); }
.d2-privacy-list li::marker{ color:var(--d2-azure-lt); font-weight:900; }
.d2-privacy-body a{ color:var(--d2-azure-lt); }
.d2-privacy-foot{ position:relative; z-index:2; flex:none; padding:14px 18px calc(18px + env(safe-area-inset-bottom));
  background:linear-gradient(0deg, var(--d2-bg) 60%, transparent); }
.d2-privacy-cta{ width:100%; max-width:420px; margin:0 auto; display:block; height:54px; border:0; border-radius:14px;
  background:var(--d2-azure); box-shadow:var(--d2-btn-relief); color:#fff; font-family:inherit; font-size:16px;
  font-weight:900; letter-spacing:.04em; text-transform:uppercase; cursor:pointer; }

/* Tablet/desktop: colonna leggibile centrata (il documento non deve stirarsi) */
@media (min-width:900px){
  .d2-privacy-body{ padding:34px 28px; }
  .d2-privacy-body > *{ max-width:760px; margin-left:auto; margin-right:auto; }
  .d2-privacy-list{ max-width:734px; }
}

/* ============================================================
   AUTH (registrazione / nuova password / esiti) — Design 2.0
   Contenitore .d2-screen. header + corpo scorrevole in vetro + CTA fissa.
   ============================================================ */
.d2-auth, .d2-authmsg{ background:
  radial-gradient(120% 70% at 20% 14%, rgba(47,143,201,.42) 0%, rgba(47,143,201,0) 52%),
  radial-gradient(140% 90% at 50% 104%, rgba(14,52,72,.6) 0%, rgba(14,52,72,0) 60%),
  linear-gradient(160deg, #082234 0%, #04101a 100%); }
.d2-auth-bar{ position:relative; z-index:2; flex:none; height:60px; background:var(--d2-bar);
  border-bottom:1px solid rgba(255,255,255,.08); display:flex; align-items:center; justify-content:space-between; padding:0 12px; }
.d2-auth-back{ width:40px; height:40px; border:0; background:transparent; color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; border-radius:10px; padding:0; }
.d2-auth-back:active{ background:rgba(255,255,255,.08); }
.d2-auth-logo{ height:24px; }
.d2-auth-sp{ width:40px; }
.d2-auth-body{ position:relative; z-index:2; flex:1; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; padding:22px 18px; }
.d2-auth-inner{ width:100%; }
.d2-auth-title{ font-size:26px; font-weight:900; color:#fff; letter-spacing:-.01em; margin:0 0 6px; }
.d2-auth-lead{ font-size:14px; line-height:1.5; color:rgba(255,255,255,.6); margin:0 0 18px; }
.d2-auth-div{ height:1px; background:rgba(255,255,255,.1); margin:16px 0; }
/* 3 passi in RIGA (schede compatte, come studio tablet) — non impilati */
.d2-reg-steps{ display:flex; flex-direction:row; align-items:stretch; gap:10px; }
.d2-reg-step{ flex:1; min-width:0; padding:12px 13px; border-radius:13px;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.12); }
.d2-reg-step-on{ background:rgba(47,143,201,.14); border-color:rgba(47,143,201,.4); }
.d2-reg-step-t{ font-size:12px; font-weight:900; letter-spacing:.02em; color:rgba(255,255,255,.6); }
.d2-reg-step-on .d2-reg-step-t{ color:var(--d2-azure-lt); }
.d2-reg-step-d{ font-size:12px; line-height:1.3; color:rgba(255,255,255,.55); margin-top:4px; }
.d2-reg-grid2{ display:grid; grid-template-columns:1fr 1fr; gap:11px; }

#screen-register form, #screen-reset form{ display:flex; flex-direction:column; gap:12px; }
.d2-reg .d2-fld, #screen-reset .d2-fld, .d2-reg-grid2 .d2-fld{ margin:0; }
.d2-fld select{ width:100%; height:54px; box-sizing:border-box; background:rgba(255,255,255,.09); border:1px solid rgba(255,255,255,.16);
  border-radius:14px; padding:0 40px 0 16px; color:#fff; font-size:16px; font-family:inherit; outline:none; appearance:none; -webkit-appearance:none; /* 16px: come .d2-fld input (#221.15) */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-opacity='0.5' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center; }
.d2-fld select:focus{ border-color:var(--d2-azure); }
.d2-fld select option{ color:#0b1b27; }
.d2-fld[hidden]{ display:none; }
.d2-fld em{ font-style:normal; font-weight:400; letter-spacing:0; text-transform:none; opacity:.75; }
.d2-check{ display:flex; align-items:flex-start; gap:11px; font-size:13px; line-height:1.5; color:rgba(255,255,255,.72); cursor:pointer; }
.d2-check input{ width:20px; height:20px; margin:1px 0 0; flex:none; accent-color:var(--d2-azure); }
.d2-check a{ color:var(--d2-azure-lt); }
.d2-check em{ color:rgba(255,255,255,.45); font-style:normal; }
.d2-auth-err{ margin:4px 0 0; color:#ffb4ab; font-size:13.5px; }
.d2-auth-err[hidden]{ display:none; }
/* CTA in fondo al blocco form (scorre col contenuto, niente footer fisso/sfumatura) */
.d2-auth-actions{ margin-top:20px; }

@media (min-width:900px){
  .d2-auth-bar{ height:64px; padding:0 24px; }
  .d2-auth-body{ padding:34px 28px; }
  .d2-auth-inner{ max-width:720px; margin:0 auto; }
  #screen-register form, #screen-onboarding form{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  #screen-register form > .d2-fld, #screen-onboarding form > .d2-fld{ margin:0; }
  #screen-register .d2-reg-grid2, #screen-onboarding .d2-reg-grid2{ display:contents; }
  #screen-register .d2-check, #screen-register .d2-auth-err,
  #screen-onboarding .d2-check, #screen-onboarding .d2-auth-err{ grid-column:1 / -1; }
  .d2-auth-actions{ display:flex; justify-content:flex-end; grid-column:1 / -1; }
  .d2-auth-actions .d2-login-btn{ width:260px; }
}

/* modale REIMPOSTA PASSWORD (vetro scuro sopra il login) */
.d2-reset{ position:fixed; inset:0; z-index:50; display:flex; align-items:center; justify-content:center; padding:24px; }
.d2-reset[hidden]{ display:none; }
.d2-reset-scrim{ position:absolute; inset:0; background:rgba(4,16,26,.55); backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px); }
.d2-reset-dialog{ position:relative; z-index:1; width:100%; max-width:420px;
  background:linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.06));
  backdrop-filter:blur(22px) saturate(1.3); -webkit-backdrop-filter:blur(22px) saturate(1.3);
  border:1px solid rgba(255,255,255,.22); border-radius:22px; box-shadow:0 24px 60px rgba(4,16,26,.6); padding:24px 22px; }
.d2-reset-head{ display:flex; align-items:flex-start; gap:10px; margin-bottom:20px; }
.d2-reset-ico{ width:34px; height:34px; border-radius:10px; background:rgba(47,143,201,.22); border:1px solid rgba(47,143,201,.4);
  display:flex; align-items:center; justify-content:center; flex:none; color:var(--d2-azure-lt); }
.d2-reset-htext{ font-size:15px; line-height:1.5; font-weight:700; color:#fff; }
.d2-reset-dialog .d2-login-btn{ margin-top:6px; }
.d2-reset-cancel{ display:block; width:100%; margin-top:14px; background:none; border:0; text-align:center; font-size:13px; font-weight:700; color:rgba(255,255,255,.6); cursor:pointer; }

/* schermate esito (registrazione inviata / password aggiornata) */
.d2-authmsg{ align-items:center; justify-content:center; text-align:center; padding:24px; }
.d2-authmsg-card{ position:relative; z-index:2; max-width:400px; display:flex; flex-direction:column; align-items:center; gap:12px; }
.d2-authmsg-mark{ width:72px; height:72px; border-radius:50%; background:rgba(47,143,201,.18); border:1px solid rgba(47,143,201,.4);
  display:flex; align-items:center; justify-content:center; color:var(--d2-azure-lt); margin-bottom:6px; }
.d2-authmsg-card h1{ font-size:22px; font-weight:900; color:#fff; margin:0; }
.d2-authmsg-card p{ font-size:14px; line-height:1.6; color:rgba(255,255,255,.7); margin:0; }
.d2-authmsg-card .d2-login-btn{ margin-top:14px; width:auto; min-width:240px; padding:0 24px; }
/* nota di rassicurazione sotto il messaggio (avvio sospeso: «non serve rifare l'accesso») */
.d2-authmsg-card p.d2-authmsg-nota{ font-size:13px; color:rgba(255,255,255,.55); }
/* caricamento all'avvio (logo + indicatore), finché boot() non sceglie la schermata */
.d2-caricamento-logo{ height:40px; }
.d2-caricamento-spin{ width:28px; height:28px; margin-top:18px; border-radius:50%; border:3px solid rgba(255,255,255,.2);
  border-top-color:var(--d2-azure-lt); animation:d2rxspin .8s linear infinite; }
@media (prefers-reduced-motion:reduce){ .d2-caricamento-spin{ animation-duration:2.4s; } }
/* link di conferma scaduto: email + «Reinvia email di conferma» */
.d2-verify-resend{ width:100%; margin-top:14px; text-align:left; }
.d2-verify-resend[hidden]{ display:none; }
.d2-verify-resend .d2-fld{ margin-bottom:0; }
.d2-verify-resend .d2-login-btn{ width:100%; min-width:0; }

/* ============================================================
   ONBOARDING (Design 2.0) — carosello 4 slide, precede la registrazione
   ============================================================ */
.d2-onb{ position:relative; overflow:hidden; background:
  radial-gradient(120% 60% at 50% 8%, rgba(47,143,201,.42) 0%, rgba(47,143,201,0) 50%),
  radial-gradient(140% 90% at 50% 104%, rgba(14,52,72,.7) 0%, rgba(14,52,72,0) 60%),
  linear-gradient(160deg, #082234 0%, #04101a 100%); }
.d2-onb-logo{ position:absolute; z-index:3; top:calc(40px + env(safe-area-inset-top)); left:50%; transform:translateX(-50%); height:32px; }
/* «Salta» (D19, 30/09/2026: prima «Accedi»): stesso posto del testo, bersaglio da 44 px per il dito */
.d2-onb-skip{ position:absolute; z-index:4; top:calc(24px + env(safe-area-inset-top)); right:10px; min-width:44px; min-height:44px; padding:0 10px;
  background:none; border:0; color:rgba(255,255,255,.72); font-size:14px; font-weight:700; font-family:inherit; cursor:pointer; }
.d2-onb-track{ position:relative; z-index:2; flex:1; min-height:0; display:flex; overflow-x:auto; overflow-y:hidden;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.d2-onb-track::-webkit-scrollbar{ display:none; }
.d2-onb-slide{ flex:0 0 100%; scroll-snap-align:center; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:0 30px; }
.d2-onb-medal{ width:200px; height:200px; border-radius:50%; flex:none; margin-bottom:32px; color:var(--d2-azure-lt);
  background:radial-gradient(circle at 50% 32%, rgba(124,192,232,.32), rgba(47,143,201,.12) 58%, rgba(255,255,255,.03));
  border:1px solid rgba(255,255,255,.22); display:flex; align-items:center; justify-content:center;
  box-shadow:0 14px 44px rgba(4,16,26,.6), inset 0 1px 0 rgba(255,255,255,.28); }
.d2-onb-medal-in{ width:120px; height:120px; border-radius:50%; background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.14); display:flex; align-items:center; justify-content:center; }
.d2-onb-medal-sm{ width:130px; height:130px; margin-bottom:20px; }
.d2-onb-medal-ok{ color:#38e08a; background:radial-gradient(circle at 50% 32%, rgba(56,224,138,.28), rgba(56,224,138,.08) 58%, rgba(255,255,255,.03)); }
.d2-onb-medal-ok .d2-onb-medal-in{ background:rgba(56,224,138,.1); border-color:rgba(56,224,138,.35); }
.d2-onb-h{ font-size:34px; font-weight:900; color:#fff; letter-spacing:-.01em; text-align:center; }
.d2-onb-h-sm{ font-size:26px; }
.d2-onb-sub{ font-size:16px; line-height:1.5; color:rgba(255,255,255,.7); text-align:center; margin-top:8px; }
.d2-onb-sub b{ color:var(--d2-azure-lt); }
.d2-onb-consents{ width:100%; max-width:420px; display:flex; flex-direction:column; gap:12px; margin-top:20px; }
.d2-onb-consent{ display:flex; align-items:flex-start; gap:13px; padding:15px 16px; border-radius:15px; cursor:pointer;
  background:linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.05)); border:1px solid rgba(255,255,255,.16);
  font-size:13.5px; line-height:1.45; color:#fff; }
.d2-onb-consent input{ position:absolute; opacity:0; width:0; height:0; pointer-events:none; }
.d2-onb-box{ width:24px; height:24px; border-radius:7px; flex:none; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.25); color:transparent; transition:background .15s, border-color .15s; }
.d2-onb-consent input:checked + .d2-onb-box{ background:var(--d2-azure); border-color:var(--d2-azure); color:#fff; box-shadow:0 0 10px rgba(47,143,201,.5); }
.d2-onb-cta{ margin-top:30px; width:100%; max-width:420px; }
.d2-onb-dots{ position:absolute; z-index:3; bottom:calc(34px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:9px; }
.d2-onb-dot{ width:7px; height:7px; border-radius:50%; background:rgba(255,255,255,.28); border:0; padding:0; cursor:pointer; transition:width .2s, background .2s; }
.d2-onb-dot.on{ width:22px; border-radius:4px; background:var(--d2-azure); }
.d2-onb-next{ position:absolute; z-index:3; bottom:calc(30px + env(safe-area-inset-bottom)); right:26px; width:52px; height:52px; border-radius:50%;
  background:var(--d2-azure); border:0; display:flex; align-items:center; justify-content:center; color:#fff; cursor:pointer;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.38), inset 0 -3px 5px rgba(0,0,0,.2), 0 4px 12px rgba(47,143,201,.45); }
.d2-onb-next[hidden]{ display:none; }

/* desktop/tablet: carosello centrato, slide con contenuto max-width */
@media (min-width:900px){
  .d2-onb-slide > *{ max-width:520px; }
  .d2-onb-consents, .d2-onb-cta{ max-width:460px; }
}

/* validazione registrazione: evidenzia OGNI campo mancante/errato */
.d2-fld.d2-invalid input, .d2-fld.d2-invalid select{ border-color:var(--d2-red); box-shadow:0 0 0 1px rgba(217,58,43,.55); }
.d2-fld.d2-invalid > span{ color:#ffb4ab; }
.d2-check.d2-invalid{ color:#ffb4ab; }
.d2-check.d2-invalid input{ outline:2px solid var(--d2-red); outline-offset:2px; border-radius:4px; }

/* esito verifica email fallito (link non valido/scaduto) */
.d2-authmsg-card.fail .d2-authmsg-mark{ color:var(--d2-red); background:rgba(217,58,43,.14); border-color:rgba(217,58,43,.4); }

/* link secondario nelle schermate esito (es. "reinvia email di conferma") */
.d2-authmsg-link{ margin-top:14px; background:none; border:0; color:var(--d2-azure-lt); font-size:13.5px; font-weight:700; cursor:pointer; font-family:inherit; padding:6px; }

/* ============================================================
   TASTI AZIONE · outline scuro (Fabio 10/07: non più blu pieno)
   Fondo navy translucido + bordo tenue azure + lieve alone (come
   allegato). I secondari (.d2-btn-secondary) restano outline neutro:
   i primari prendono il bordo azure per mantenere la gerarchia.
   Override in coda → vince per ordine sorgente sui vecchi "blu pieno".
   ============================================================ */
.d2-btn-primary,
.d2-btn-ricetta,
.d2-rv-foot .d2-btn,
.d2-nd-apri,
.d2-nd-info,
.d2-admin-ok,
.d2-rail-btn.primary,
.d2-login-btn,
.d2-privacy-cta{
  background:linear-gradient(180deg, rgba(47,143,201,.34), rgba(47,143,201,.18));
  border:1px solid rgba(124,192,232,.55);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.14), 0 4px 16px rgba(4,15,23,.42), 0 0 18px rgba(47,143,201,.20);
  color:#fff; box-sizing:border-box;
}
.d2-btn-primary:not(:disabled):hover,
.d2-btn-ricetta:not(:disabled):hover,
.d2-nd-apri:hover, .d2-nd-info:hover, .d2-admin-ok:not(:disabled):hover,
.d2-rail-btn.primary:hover, .d2-login-btn:not(:disabled):hover, .d2-privacy-cta:hover{
  border-color:rgba(124,192,232,.80);
  background:linear-gradient(180deg, rgba(47,143,201,.46), rgba(47,143,201,.26));
}

/* Il bottone "Ricetta digitale" GALLEGGIA sopra il PDF (fondo bianco/variabile):
   qui il translucido diventa slavato → fondo navy-azzurro OPACO, stessa famiglia
   (bordo azure + alone) ma leggibile su qualunque sfondo. Vince sull'override sopra. */
.d2-btn-ricetta{
  background:rgba(47,143,201,.85);
  border:2px solid #2f8fc9;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16), 0 4px 16px rgba(4,15,23,.50), 0 0 18px rgba(47,143,201,.24);
}
.d2-btn-ricetta:not(:disabled):hover{
  background:rgba(47,143,201,.95);
  border-color:#2f8fc9;
}

/* --- Notifiche · interruttore in Account ---------------------------------- */
/* Il riquadro segue lo stile della scheda account (vetro su aurora). Compare
   solo dove le notifiche possono arrivare davvero; dentro l'app iPhone dello
   store (WebView) al posto dell'interruttore c'è la spiegazione. */
.d2-notif{ margin:14px 0 10px; padding:14px 16px; border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05));
  border:1px solid rgba(255,255,255,.16); box-shadow:inset 0 1px 0 rgba(255,255,255,.28); }
.d2-notif-row{ display:flex; align-items:center; gap:14px; }
.d2-notif-txt{ flex:1; min-width:0; }
.d2-notif-title{ font-size:15.5px; font-weight:800; color:#fff; }
.d2-notif-sub{ font-size:13px; font-weight:600; color:rgba(255,255,255,.72); margin-top:3px; line-height:1.4; }
.d2-notif-help{ margin-top:12px; padding-top:12px; border-top:1px solid rgba(255,255,255,.14);
  font-size:13px; font-weight:600; color:rgba(255,255,255,.78); line-height:1.5; }
.d2-notif-help b{ color:#fff; font-weight:800; }

/* interruttore: 44px di area toccabile reale, non solo il disegno */
.d2-switch{ position:relative; flex:none; width:52px; height:31px; border-radius:16px; cursor:pointer;
  background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.28); padding:0;
  transition:background .18s ease, border-color .18s ease; }
.d2-switch::after{ content:""; position:absolute; inset:-7px; } /* area di tocco 44px+ */
.d2-switch[aria-checked="true"]{ background:var(--d2-azure); border-color:var(--d2-azure); }
.d2-switch[disabled]{ opacity:.45; cursor:default; }
.d2-switch-knob{ position:absolute; top:2px; left:2px; width:25px; height:25px; border-radius:50%;
  background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.35); transition:transform .18s ease; }
.d2-switch[aria-checked="true"] .d2-switch-knob{ transform:translateX(21px); }
.d2-switch.busy .d2-switch-knob{ opacity:.6; }

/* --- Messaggi ricevuti ------------------------------------------------------ */
.d2-msg{ background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  border:1px solid rgba(255,255,255,.14); border-radius:16px; padding:16px 17px; margin-bottom:12px; }
.d2-msg.nuovo{ border-color:rgba(56,224,138,.45); cursor:pointer; }
.d2-msg-head{ display:flex; align-items:flex-start; gap:10px; }
.d2-msg-og{ flex:1; font-size:16px; font-weight:800; color:#fff; line-height:1.35; }
.d2-msg-new{ flex:none; font-size:10px; font-weight:900; letter-spacing:.06em; padding:3px 8px; border-radius:8px;
  background:var(--d2-fresh); color:#0a2a1e; }
.d2-msg-data{ font-size:12px; font-weight:600; color:rgba(255,255,255,.5); margin:4px 0 10px; }
.d2-msg-testo{ font-size:14.5px; line-height:1.6; color:rgba(255,255,255,.82); word-break:break-word; }

/* R4/R5 (docs/UI_UX_MANUALE.md §14, 06/09): conferma in-app e niente colori in linea */
/* chiedi(): la conferma in-app con la pelle della PWA (come .d2-modal-card). Prima usava i colori
   della console (--c-primary…), che qui non esistono: il tasto principale restava bianco su bianco. */
.chiedi-ovl { position: fixed; inset: 0; z-index: 900; background: rgba(4,15,23,.66); display: flex; align-items: center; justify-content: center; padding: 20px; }
.chiedi-box { background: var(--d2-surface); color: #fff; border-radius: 22px; padding: 24px 22px 20px; width: 100%; max-width: 360px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12); }
.chiedi-t { font-weight: 800; font-size: 18px; line-height: 1.3; margin-bottom: 8px; }
.chiedi-x { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.78); }
.chiedi-a { display: flex; gap: 12px; margin-top: 20px; }
.chiedi-a button { flex: 1; min-height: 48px; padding: 0 16px; border-radius: 13px; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px;
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.08); color: #fff; }
.chiedi-a .chiedi-ok { background: var(--d2-azure); border-color: var(--d2-azure); box-shadow: var(--d2-btn-relief); }
.chiedi-a .chiedi-ok.danger { background: var(--d2-red); border-color: var(--d2-red); }
.txt-warn { color: #ffb28a; }
