/* Wrapper card (tema scuro attuale) */
.nfx-card{
  display:flex; align-items:center; gap:12px;
  padding:14px 16px; border-radius:10px;
  background:#0f172a; border:1px solid rgba(255,255,255,.06);
}

/* Icona (SVG o font-agnostico) */
.nfx-icon, .nfx-svg{
  width:32px; height:32px; display:grid; place-items:center;
  border-radius:8px; font-size:16px;
  color:var(--nfx-fg,#60a5fa); background:var(--nfx-bg,rgba(96,165,250,.12));
}
.nfx-svg{ fill:currentColor }

/* Testi */
.nfx-content{ flex:1 1 auto; min-width:0 }
.nfx-title{ font-weight:600; margin-bottom:2px }
.nfx-body{ opacity:.85; font-size:.95rem }
.nfx-meta{ opacity:.65; font-size:.85rem; margin-top:4px }

/* Badge colori (coerenti con palette verde/oro/blu + funzionali) */
.nfx--trade-done     { --nfx-fg:#22c55e; --nfx-bg:rgba(34,197,94,.15); }
.nfx--trade-proposed { --nfx-fg:#3b82f6; --nfx-bg:rgba(59,130,246,.15); }
.nfx--deadline       { --nfx-fg:#f59e0b; --nfx-bg:rgba(245,158,11,.18); } /* oro */
.nfx--chat           { --nfx-fg:#14b8a6; --nfx-bg:rgba(20,184,166,.16); }
.nfx--postpone       { --nfx-fg:#6366f1; --nfx-bg:rgba(99,102,241,.16); }
.nfx--finance        { --nfx-fg:#eab308; --nfx-bg:rgba(234,179,8,.18); }
.nfx--admin          { --nfx-fg:#9333ea; --nfx-bg:rgba(147,51,234,.16); }
.nfx--warning        { --nfx-fg:#ef4444; --nfx-bg:rgba(239,68,68,.16); }
.nfx--default        { --nfx-fg:#60a5fa; --nfx-bg:rgba(96,165,250,.12); }

/* Pallino “non letta” opzionale */
.nfx-card[data-unread="1"] .nfx-icon {
  box-shadow: 0 0 0 2px rgba(255,255,255,.06);
  position: relative;
}
.nfx-card[data-unread="1"] .nfx-icon::after{
  content:""; position:absolute; top:-3px; right:-3px; width:10px; height:10px;
  border-radius:50%; background:#22c55e;
}

/* ===== Popup “hai posta” / notifiche (gaming toast) ===== */
.xg-notify-toast-portal{
  position:fixed;z-index:100050;left:0;right:0;bottom:0;
  display:flex;justify-content:center;align-items:flex-end;
  padding:14px 14px calc(14px + env(safe-area-inset-bottom,0));
  pointer-events:none;
}
@media (min-width:720px){
  .xg-notify-toast-portal{
    left:auto;right:16px;bottom:24px;
    justify-content:flex-end;align-items:flex-end;
  }
}
.xg-notify-toast{
  pointer-events:auto;
  position:relative;overflow:hidden;
  max-width:400px;width:100%;
  border-radius:16px;
  background:linear-gradient(165deg,rgba(22,32,52,.98),rgba(8,12,24,.99));
  border:1px solid rgba(56,189,248,.45);
  box-shadow:
    0 0 0 1px rgba(0,0,0,.5) inset,
    0 0 40px rgba(56,189,248,.2),
    0 16px 48px rgba(0,0,0,.55);
  transform:translateY(120%) scale(.92);
  opacity:0;
  transition:opacity .35s cubic-bezier(.34,1.56,.64,1),transform .4s cubic-bezier(.34,1.56,.64,1);
}
.xg-notify-toast.is-in{
  transform:translateY(0) scale(1);
  opacity:1;
}
.xg-notify-toast.is-out{
  transform:translateY(40px) scale(.94);
  opacity:0;
  transition:opacity .25s ease,transform .28s ease;
}
.xg-notify-toast__scan{
  position:absolute;inset:0;pointer-events:none;
  background:repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(56,189,248,.03) 2px,
    rgba(56,189,248,.03) 3px
  );
  opacity:.6;
}
.xg-notify-toast__bar{
  position:absolute;left:0;top:0;right:0;height:3px;
  background:linear-gradient(90deg,#22d3ee,#4ade80,#38bdf8,#a78bfa);
  background-size:200% 100%;
  animation:xg-notify-bar 2.5s ease-in-out infinite;
}
@keyframes xg-notify-bar{
  0%{background-position:0% 50%}
  100%{background-position:200% 50%}
}
.xg-notify-toast__inner{
  position:relative;z-index:1;display:flex;gap:14px;align-items:flex-start;
  padding:16px 16px 14px;
}
.xg-notify-toast__bell{
  flex-shrink:0;width:48px;height:48px;border-radius:14px;
  display:grid;place-items:center;
  font-size:1.35rem;
  color:#fef08a;
  background:linear-gradient(145deg,rgba(234,179,8,.25),rgba(15,23,42,.6));
  border:1px solid rgba(250,204,21,.4);
  box-shadow:0 0 20px rgba(250,204,21,.2),inset 0 1px 0 rgba(255,255,255,.1);
  animation:xg-notify-wiggle 2.2s ease-in-out infinite;
}
@keyframes xg-notify-wiggle{
  0%,100%{transform:rotate(0)}
  10%{transform:rotate(-14deg)}
  20%{transform:rotate(12deg)}
  30%{transform:rotate(-8deg)}
  40%{transform:rotate(6deg)}
  50%{transform:rotate(0)}
}
.xg-notify-toast__text{flex:1;min-width:0}
.xg-notify-toast__kicker{
  font-size:.62rem;font-weight:800;letter-spacing:.14em;text-transform:uppercase;
  color:#38bdf8;margin-bottom:4px;
}
.xg-notify-toast__title{
  margin:0 0 6px;font-size:1.05rem;font-weight:900;line-height:1.2;
  color:#f8fafc;text-shadow:0 0 20px rgba(56,189,248,.25);
}
.xg-notify-toast__sub{
  margin:0;font-size:.84rem;line-height:1.35;color:#94a3b8;
}
.xg-notify-toast__sub strong{color:#e2e8f0;font-weight:800}
.xg-notify-toast__actions{
  display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;align-items:center;
}
.xg-notify-toast__btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  padding:8px 14px;border-radius:10px;font-size:.78rem;font-weight:800;
  letter-spacing:.05em;text-transform:uppercase;text-decoration:none!important;
  border:1px solid rgba(56,189,248,.5);
  background:linear-gradient(180deg,rgba(14,165,233,.35),rgba(3,105,161,.25));
  color:#e0f2fe!important;
  box-shadow:0 2px 12px rgba(14,165,233,.2);
  cursor:pointer;
  transition:transform .12s ease,box-shadow .18s ease,border-color .18s ease;
}
.xg-notify-toast__btn:hover{
  border-color:rgba(125,211,252,.7);
  box-shadow:0 0 20px rgba(56,189,248,.25);
  transform:translateY(-1px);
}
.xg-notify-toast__btn--ghost{
  background:rgba(15,23,42,.6);
  border-color:rgba(148,163,184,.35);
  color:#cbd5e1!important;
  text-transform:none;font-weight:700;letter-spacing:0;
}
.xg-notify-toast__close{
  position:absolute;top:8px;right:8px;z-index:20;width:36px;height:36px;padding:0;
  border:0;border-radius:10px;background:rgba(255,255,255,.06);
  color:#94a3b8;font-size:1.2rem;line-height:1;cursor:pointer;
  display:grid;place-items:center;
  pointer-events:auto;
  transition:background .15s ease,color .15s ease;
}
.xg-notify-toast__close:hover{background:rgba(248,113,113,.15);color:#fecaca}
@media (prefers-reduced-motion:reduce){
  .xg-notify-toast{transition:opacity .2s ease}
  .xg-notify-toast__bar{animation:none;opacity:.9}
  .xg-notify-toast__bell{animation:none}
}

/* Toast con avatar Camilla */
.xg-notify-toast--camilla{
  max-width:440px;
}
.xg-notify-toast__camilla{
  flex-shrink:0;
  width:72px;
  height:88px;
  margin:-6px 0 -10px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  overflow:hidden;
}
.xg-notify-toast__camilla img{
  display:block;
  width:72px;
  height:auto;
  max-height:96px;
  object-fit:contain;
  object-position:bottom center;
  mix-blend-mode:lighten;
  filter:drop-shadow(0 6px 12px rgba(0,0,0,.4));
}
.xg-notify-toast--camilla .xg-notify-toast__kicker{
  color:#7dd3fc;
}