/* Visione – finestra chat */
.joinchat{display:none!important}

.vchat{--vc-navy:#090E1C;--vc-ink:#F4F2EF;--vc-quiet:rgba(244,242,239,.62);--vc-line:rgba(244,242,239,.12);--vc-orange:#E84C10;--vc-blue:#145FC8;
  position:fixed;left:20px;bottom:20px;z-index:99990;font-family:inherit;font-size:15px;line-height:1.45;color:var(--vc-ink)}
.vchat *{box-sizing:border-box}

/* pulsante */
.vchat-launch{display:flex;align-items:center;gap:10px;height:56px;padding:0 20px 0 8px;border:0;border-radius:999px;cursor:pointer;
  background:var(--vc-navy);color:var(--vc-ink);font:inherit;font-weight:600;box-shadow:0 10px 30px rgba(9,14,28,.35);transition:transform .2s ease}
.vchat-launch:hover{transform:translateY(-2px)}
.vchat-orb{width:40px;height:40px;border-radius:50%;flex:none;position:relative;overflow:hidden;
  background:radial-gradient(60% 60% at 30% 30%,rgba(20,95,200,1),rgba(20,95,200,0) 70%),radial-gradient(60% 60% at 75% 75%,rgba(232,76,16,.9),rgba(232,76,16,0) 70%),#0d1530}
.vchat-orb::after{content:"";position:absolute;inset:0;border-radius:50%;background:inherit;animation:vchatOrb 6s linear infinite;opacity:.8;filter:blur(2px)}
@keyframes vchatOrb{to{transform:rotate(360deg)}}
.vchat-open .vchat-launch{display:none}

/* fumetto */
.vchat-nudge{position:absolute;left:0;bottom:68px;width:260px;padding:14px 36px 14px 16px;border-radius:16px 16px 16px 4px;background:#fff;color:#151515;
  font-size:14px;box-shadow:0 12px 30px rgba(9,14,28,.18);cursor:pointer;animation:vchatIn .35s ease both}
.vchat-nudge button{position:absolute;top:6px;right:6px;width:24px;height:24px;border:0;background:none;color:#888;font-size:18px;line-height:1;cursor:pointer}

/* pannello */
.vchat-panel{display:none;flex-direction:column;width:380px;height:min(600px,calc(100vh - 40px));border-radius:22px;overflow:hidden;position:relative;
  background:var(--vc-navy);box-shadow:0 24px 60px rgba(9,14,28,.45);animation:vchatIn .3s ease both}
.vchat-open .vchat-panel{display:flex}
.vchat-panel::before{content:"";position:absolute;inset:-20%;z-index:0;pointer-events:none;
  background:radial-gradient(60% 50% at 10% 0%,rgba(20,95,200,.55),rgba(20,95,200,0) 70%),radial-gradient(55% 45% at 100% 100%,rgba(232,76,16,.24),rgba(232,76,16,0) 70%);
  animation:vchatDrift 14s ease-in-out infinite alternate}
@keyframes vchatDrift{to{transform:translate(4%,3%)}}
@keyframes vchatIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.vchat-panel>*{position:relative;z-index:1}

.vchat-head{display:flex;align-items:center;gap:12px;padding:16px 16px 14px;border-bottom:1px solid var(--vc-line)}
.vchat-head .vchat-orb{width:36px;height:36px}
.vchat-title{flex:1;min-width:0}
.vchat-title strong{display:block;font-size:16px}
.vchat-title span{display:block;font-size:12px;color:var(--vc-quiet)}
.vchat-x{width:34px;height:34px;border:0;border-radius:50%;background:rgba(244,242,239,.08);color:var(--vc-ink);font-size:20px;line-height:1;cursor:pointer}

.vchat-log{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:10px;scrollbar-width:thin}
.vchat-msg{max-width:85%;padding:10px 14px;border-radius:16px;white-space:pre-wrap;word-wrap:break-word;animation:vchatIn .25s ease both}
.vchat-msg a{color:inherit;text-decoration:underline}
.vchat-bot{align-self:flex-start;background:rgba(244,242,239,.08);border:1px solid var(--vc-line);border-bottom-left-radius:4px}
.vchat-user{align-self:flex-end;background:var(--vc-orange);color:#fff;border-bottom-right-radius:4px}
.vchat-typing{display:flex;gap:4px;padding:14px}
.vchat-typing i{width:7px;height:7px;border-radius:50%;background:var(--vc-quiet);animation:vchatDot 1.2s infinite}
.vchat-typing i:nth-child(2){animation-delay:.15s}.vchat-typing i:nth-child(3){animation-delay:.3s}
@keyframes vchatDot{0%,60%,100%{opacity:.3;transform:none}30%{opacity:1;transform:translateY(-3px)}}

.vchat-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:2px}
.vchat-chip{border:1px solid rgba(244,242,239,.28);background:none;color:var(--vc-ink);border-radius:999px;padding:7px 12px;font:inherit;font-size:13px;cursor:pointer}
.vchat-chip:hover{background:rgba(244,242,239,.1)}

.vchat-form{display:flex;gap:8px;padding:12px 12px 8px;border-top:1px solid var(--vc-line)}
.vchat-input{flex:1;min-width:0;resize:none;max-height:110px;padding:11px 14px;border-radius:14px;border:1px solid var(--vc-line);background:rgba(244,242,239,.06);color:var(--vc-ink);font:inherit;outline:none}
.vchat-input::placeholder{color:var(--vc-quiet)}
.vchat-input:focus{border-color:rgba(244,242,239,.35)}
.vchat-send{width:44px;height:44px;flex:none;align-self:flex-end;border:0;border-radius:50%;background:var(--vc-orange);color:#fff;cursor:pointer;display:grid;place-items:center}
.vchat-send:disabled{opacity:.45;cursor:default}
.vchat-send svg{width:18px;height:18px}

.vchat-foot{display:flex;justify-content:space-between;gap:10px;padding:0 16px 12px;font-size:12px;color:var(--vc-quiet)}
.vchat-foot a{color:var(--vc-quiet);text-decoration:underline}
.vchat-foot a.vchat-human{color:var(--vc-ink);text-decoration:none;font-weight:600}
.vchat-test{position:absolute;top:10px;right:56px;font-size:10px;letter-spacing:.08em;text-transform:uppercase;padding:3px 8px;border-radius:999px;background:var(--vc-orange);color:#fff}

@media (max-width:600px){
  .vchat{left:12px;bottom:12px}
  .vchat-launch{height:48px;padding:0 16px 0 6px;font-size:14px}
  .vchat-launch .vchat-orb{width:36px;height:36px}
  .vchat-open{left:0;bottom:0;right:0;top:0}
  .vchat-panel{width:100vw;height:100%;height:100dvh;border-radius:0}
  .vchat-nudge{width:min(260px,calc(100vw - 40px));bottom:60px}
  body.admin-bar .vchat-open{top:46px}
  body.admin-bar .vchat-panel{height:calc(100dvh - 46px)}
}
@media (prefers-reduced-motion:reduce){.vchat *,.vchat-panel::before{animation:none!important}}
