/* Widget pubblico MOMÀ: accessibile e non invasivo */
.moma-chat{position:fixed;right:20px;bottom:calc(18px + env(safe-area-inset-bottom,0px));z-index:420;font:14px/1.45 Inter,system-ui,-apple-system,sans-serif;color:#f8f2e9}
.moma-chat *{box-sizing:border-box}
.moma-chat-toggle{display:grid;place-items:center;width:68px;height:68px;min-width:68px;min-height:68px;padding:0;position:relative;isolation:isolate;border:2px solid #f0d29b;border-radius:50%;background:radial-gradient(circle at 30% 22%,#435477 0%,#171f33 40%,#080b12 78%);box-shadow:0 0 0 4px #0008,0 8px 28px #000b,0 0 22px #cf9b5740;color:#f9e3b9;cursor:pointer;transition:transform .18s ease,box-shadow .18s ease}
.moma-chat-toggle:hover{transform:translateY(-3px);box-shadow:0 0 0 4px #0008,0 11px 30px #000b,0 0 22px #e5bd7e99}
.moma-chat-toggle:focus-visible{outline:3px solid #fff2c7;outline-offset:5px}
.moma-chat-toggle .moma-chat-robot{display:block;width:58px;height:58px;line-height:0}
.moma-chat-toggle .moma-chat-robot svg{display:block;width:58px;height:58px}
.moma-chat-toggle .moma-chat-close-symbol{font-size:39px;font-weight:300;line-height:1}
@media(hover:hover) and (min-width:651px){.moma-chat-toggle:not(.is-open):after{content:'Chiedi a MOMÀ';position:absolute;right:calc(100% + 11px);top:50%;transform:translateY(-50%);padding:8px 11px;background:#171b27;color:#f4d9a5;border:1px solid #8f724e;border-radius:9px;font-size:12px;font-weight:700;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s}.moma-chat-toggle:hover:after,.moma-chat-toggle:focus-visible:after{opacity:1}}
.moma-chat-panel{width:min(380px,calc(100vw - 24px));height:min(565px,calc(100dvh - 125px));min-height:280px;margin-bottom:12px;border:1px solid #9c8055;border-radius:18px;overflow:hidden;box-shadow:0 18px 60px #000d;background:#0d121d;display:flex;flex-direction:column}
.moma-chat-panel[hidden]{display:none!important}
.moma-chat-top{display:flex;align-items:center;gap:12px;padding:14px 16px;background:linear-gradient(110deg,#1e1d25,#111522);border-bottom:1px solid #65533e;flex:none}
.moma-chat-top img{display:block;width:72px;max-height:46px;object-fit:contain}
.moma-chat-heading{flex:1;display:grid;gap:3px;min-width:0}
.moma-chat-heading strong{letter-spacing:.055em;color:#f7d89e;font-size:12px}
.moma-chat-heading small{color:#cec0b9;font-size:11px}
.moma-chat-close{background:#25232a;color:#fff;border:1px solid #685b56;border-radius:50%;min-width:34px;min-height:34px;font-size:24px;line-height:1;cursor:pointer}
.moma-chat-messages{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:17px 14px;display:flex;gap:13px;flex-direction:column}
.moma-chat-message{display:flex;flex-direction:column;gap:8px;align-items:flex-start;max-width:92%}
.moma-chat-message.is-user{align-self:flex-end;align-items:flex-end}
.moma-chat-bubble{font-size:13px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;padding:11px 13px;background:#222837;border:1px solid #3f4655;color:#f4f0ec;border-radius:14px 14px 14px 4px}
.moma-chat-message.is-user .moma-chat-bubble{background:#ebcf94;color:#20170c;border-color:#e4b873;border-radius:14px 14px 4px 14px}
.moma-chat-actions{display:flex;flex-wrap:wrap;gap:7px}
.moma-chat-actions a{color:#f1d6a0;background:#312c27;border:1px solid #7b6339;border-radius:9px;font-size:12px;font-weight:650;text-decoration:none;padding:9px 11px}
.moma-chat-actions a:hover{background:#51402b}
.moma-chat-thinking{font-size:12px;color:#c8b18c;margin:0}
.moma-chat-quick{flex:none;display:flex;gap:6px;overflow-x:auto;padding:10px 13px;scrollbar-width:thin;border-top:1px solid #353444}
.moma-chat-quick button{flex:none;padding:8px 10px;background:#1a202d;border:1px solid #55505d;color:#f4dcab;border-radius:999px;font-size:11px;cursor:pointer}
.moma-chat-form{flex:none;display:flex;gap:8px;padding:8px 12px}
.moma-chat-form input{flex:1;min-width:0;min-height:44px;padding:9px 11px;border:1px solid #746b71;border-radius:10px;background:#0e131d;color:#fff;font:inherit;font-size:13px}
.moma-chat-form input:focus-visible{outline:2px solid #ecd19e;outline-offset:1px}
.moma-chat-form button{min-width:63px;border:0;border-radius:10px;background:#e7c17e;color:#231b12;font-size:12px;font-weight:800;cursor:pointer}
.moma-chat-form button:disabled{opacity:.6;cursor:wait}
.moma-chat-privacy{flex:none;margin:0 12px 11px;color:#aaa8ae;font-size:10px;line-height:1.4}
.moma-chat-privacy a{color:#efd09a}
@media(max-width:650px){.moma-chat{right:10px;bottom:calc(10px + env(safe-area-inset-bottom,0px))}.moma-chat-toggle{width:62px;height:62px;min-width:62px;min-height:62px}.moma-chat-toggle .moma-chat-robot,.moma-chat-toggle .moma-chat-robot svg{width:53px;height:53px}.moma-chat-panel{width:calc(100vw - 20px);height:min(560px,calc(100dvh - 115px))}.moma-chat-messages{padding:12px 10px}}
@media(prefers-reduced-motion:reduce){.moma-chat *{scroll-behavior:auto!important}}

/* Mascotte MOMÀ 3D: mezzo busto nel cerchio, testa e mano fuori dal bordo.
   Nessun secondo contorno sul pulsante; l'oro è già parte della grafica. */
.moma-chat-toggle{
  width:112px;height:112px;min-width:112px;min-height:112px;
  padding:0;border:0;border-radius:0;background:transparent;
  box-shadow:none;overflow:visible;
  filter:drop-shadow(0 8px 16px rgba(0,0,0,.65));
  transform-origin:65% 72%;
}
.moma-chat-toggle:hover{transform:translateY(-3px);box-shadow:none;filter:drop-shadow(0 9px 18px rgba(214,163,79,.42))}
.moma-chat-toggle .moma-chat-robot{display:block;width:112px;height:112px;overflow:visible;line-height:0;pointer-events:none}
.moma-chat-toggle .moma-chat-robot img{
  display:block;width:112px;height:112px;object-fit:contain;
  animation:moma-robot-wave 5.5s ease-in-out infinite;
  transform-origin:60% 74%;
}
.moma-chat-toggle.is-open{width:62px;height:62px;min-width:62px;min-height:62px;background:#141923;border:2px solid #e4ba77;border-radius:50%;filter:none}
.moma-chat-toggle.is-open:hover{box-shadow:0 0 15px #bd945b70}
.moma-chat-toggle.is-open .moma-chat-close-symbol{display:grid;place-items:center;width:100%;height:100%}
@keyframes moma-robot-wave {
  0%,73%,100%{transform:rotate(0deg) translateY(0)}
  78%{transform:rotate(-5deg) translateY(-2px)}
  83%{transform:rotate(4deg) translateY(0)}
  89%{transform:rotate(-4deg) translateY(-1px)}
  94%{transform:rotate(0deg) translateY(0)}
}
@media(max-width:650px){
 .moma-chat-toggle,.moma-chat-toggle .moma-chat-robot,.moma-chat-toggle .moma-chat-robot img{
  width:100px;height:100px;min-width:100px;min-height:100px;
 }
 .moma-chat-toggle.is-open{width:58px;height:58px;min-width:58px;min-height:58px}
 .moma-chat-panel{height:min(560px,calc(100dvh - 152px))}
}
@media(prefers-reduced-motion:reduce){.moma-chat-toggle .moma-chat-robot img{animation:none}}
