.giso-aiw{position:fixed;z-index:1200;pointer-events:none;--aiw-color:#8b5cf6;--aiw-color-2:#4f46e5}.giso-aiw.is-hidden{display:none}.giso-aiw.right-bottom{right:18px;bottom:18px}.giso-aiw.left-bottom{left:18px;bottom:18px}.giso-aiw.right-top{right:18px;top:88px}.giso-aiw.left-top{left:18px;top:88px}.giso-aiw-fab,.giso-aiw-panel,.giso-aiw-footer button,.giso-aiw-close,.giso-aiw-suggestions button,.giso-aiw-actions a{pointer-events:auto}.giso-aiw-fab{width:60px;height:60px;border:none;border-radius:50%;box-shadow:0 12px 30px rgba(15,23,42,.18);background:linear-gradient(135deg,var(--aiw-color),var(--aiw-color-2));color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;animation:aiwPulse 2.2s infinite}.giso-aiw-fab-icon{font-size:26px}.giso-aiw-badge{position:absolute;top:-6px;left:-6px;background:#ef4444;color:#fff;border-radius:999px;padding:3px 8px;font-size:11px;font-weight:800}.giso-aiw-badge.is-hidden{display:none}.giso-aiw-panel{width:min(390px,calc(100vw - 24px));height:min(580px,calc(100vh - 130px));background:#fff;border:1px solid rgba(15,23,42,.08);border-radius:24px;box-shadow:0 18px 50px rgba(15,23,42,.18);display:flex;flex-direction:column;overflow:hidden;animation:aiwSlide .24s ease-out}.giso-aiw-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:linear-gradient(135deg,var(--aiw-color),var(--aiw-color-2));color:#fff}.giso-aiw-titlebox{display:flex;flex-direction:column;gap:2px}.giso-aiw-titlebox strong{font-size:15px}.giso-aiw-role{font-size:12px;opacity:.92}.giso-aiw-close{border:none;background:transparent;color:#fff;font-size:26px;cursor:pointer;line-height:1}.giso-aiw-context{padding:8px 14px;border-bottom:1px solid #ede9fe;background:#faf7ff;color:#6d28d9;font-size:11px;font-weight:700;line-height:1.8}.giso-aiw-context[hidden]{display:none}.giso-aiw-summary{padding:10px 14px;border-bottom:1px solid #eef2f7;background:#fff;color:#4338ca;font-size:12px;line-height:1.9}.giso-aiw-messages{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:linear-gradient(180deg,#fcfcff 0,#faf5ff 100%)}.giso-aiw-msg{max-width:86%;padding:10px 12px;border-radius:18px;line-height:1.95;font-size:13px;white-space:pre-wrap;box-shadow:0 4px 14px rgba(15,23,42,.04)}.giso-aiw-msg.user{align-self:flex-end;background:#e0e7ff;color:#312e81;border-bottom-right-radius:6px}.giso-aiw-msg.ai{align-self:flex-start;background:#fff;color:#111827;border:1px solid #ede9fe;border-bottom-left-radius:6px}.giso-aiw-typing{display:flex;gap:6px;padding:0 16px 8px}.giso-aiw-typing span{width:8px;height:8px;border-radius:50%;background:#a78bfa;animation:aiwBounce 1.1s infinite}.giso-aiw-typing span:nth-child(2){animation-delay:.15s}.giso-aiw-typing span:nth-child(3){animation-delay:.3s}.giso-aiw-suggestions{display:flex;gap:8px;overflow:auto;padding:0 14px 10px}.giso-aiw-suggestions button{border:1px solid #ddd6fe;background:#fff;border-radius:999px;padding:8px 12px;font-size:12px;cursor:pointer;white-space:nowrap;color:#4c1d95;transition:.18s ease all}.giso-aiw-suggestions button.is-primary,.giso-aiw-suggestions button:hover{background:#f5f3ff;border-color:#c4b5fd;transform:translateY(-1px)}.giso-aiw-actions{display:flex;flex-wrap:wrap;gap:8px;padding:0 14px 10px}.giso-aiw-actions a{display:inline-flex;align-items:center;justify-content:space-between;gap:8px;min-width:calc(50% - 4px);text-decoration:none;border-radius:14px;padding:9px 11px;background:#f8f5ff;color:#5b21b6;border:1px solid #ddd6fe;font-size:12px;font-weight:700;transition:.18s ease all}.giso-aiw-actions a:hover{background:#ede9fe;transform:translateY(-1px)}.giso-aiw-actions a b{font-size:13px}.giso-aiw-footer{display:flex;gap:10px;padding:12px;border-top:1px solid #eef2f7;background:#fff;align-items:stretch}.giso-aiw-footer button{min-width:72px;align-self:stretch}.giso-aiw-footer textarea{flex:1;resize:none;min-height:44px;max-height:120px;border:1px solid #e5e7eb;border-radius:14px;padding:10px 12px;font-family:inherit;line-height:1.85;background:#fff}.giso-aiw-footer textarea:focus{outline:none;border-color:var(--aiw-color);box-shadow:0 0 0 3px rgba(139,92,246,.12)}.giso-aiw-footer button{border:none;border-radius:14px;padding:0 16px;background:linear-gradient(135deg,var(--aiw-color),var(--aiw-color-2));color:#fff;font-weight:700;cursor:pointer;min-width:72px}.giso-aiw-footer button:disabled,.giso-aiw.is-loading .giso-aiw-footer button{opacity:.65;cursor:wait}.giso-aiw-note{font-size:11px;color:#6b7280;padding:0 14px 8px}.giso-aiw-error{color:#b91c1c}@keyframes aiwPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.05)}}@keyframes aiwBounce{0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-5px)}}@keyframes aiwSlide{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@media(max-width:720px){.giso-aiw.right-bottom,.giso-aiw.left-bottom,.giso-aiw.right-top,.giso-aiw.left-top{inset:0}.giso-aiw-panel{width:100vw;height:100vh;max-height:100vh;border-radius:0}.giso-aiw-fab{right:16px;bottom:16px;position:fixed}.giso-aiw-actions a{min-width:100%}}

/* ==== آیکن برندمحور گیسو + حباب جلب‌توجه (طراحی جدید) ==== */
.giso-aiw-fab{position:relative;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--aiw-color) 0%,#e89090 45%,#d4af37 100%);animation:aiwFloat 3.6s ease-in-out infinite;overflow:visible}
.giso-aiw-fab:hover{animation-play-state:paused;transform:translateY(-2px) scale(1.06)}
.giso-aiw-fab:active{transform:scale(.96)}
.giso-aiw-fab-svg{width:30px;height:30px;display:block}
.giso-aiw-fab-ring{position:absolute;inset:-6px;border-radius:50%;border:2px solid rgba(212,175,55,.6);animation:aiwRingPulse 2.6s ease-out infinite;pointer-events:none}
@keyframes aiwFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
@keyframes aiwRingPulse{0%{transform:scale(.82);opacity:.85}100%{transform:scale(1.35);opacity:0}}
.giso-aiw-badge{position:absolute;top:-4px;left:-4px}
/* حباب جلب توجه */
.giso-aiw-bubble{position:absolute;display:flex;align-items:center;gap:7px;max-width:230px;min-width:150px;background:#fbf6ec;color:#5a3e1b;border:1.5px solid #d4af37;border-radius:16px;padding:9px 30px 9px 12px;font-size:12.5px;line-height:1.7;box-shadow:0 10px 30px rgba(139,90,43,.20);opacity:1;transition:opacity .35s ease,transform .35s ease;text-align:right;pointer-events:auto}
.giso-aiw-bubble.is-hidden{display:none}
.giso-aiw-bubble.is-fading{opacity:0;transform:translateY(6px)}
.giso-aiw.right-bottom .giso-aiw-bubble{right:0;bottom:78px}
.giso-aiw.right-bottom .giso-aiw-bubble::after{content:'';position:absolute;bottom:-8px;right:22px;border:8px solid transparent;border-top-color:#d4af37;border-bottom:0}
.giso-aiw.left-bottom .giso-aiw-bubble{left:0;bottom:78px}
.giso-aiw.left-bottom .giso-aiw-bubble::after{content:'';position:absolute;bottom:-8px;left:22px;border:8px solid transparent;border-top-color:#d4af37;border-bottom:0}
.giso-aiw.right-top .giso-aiw-bubble{right:0;top:78px}
.giso-aiw.right-top .giso-aiw-bubble::after{content:'';position:absolute;top:-8px;right:22px;border:8px solid transparent;border-bottom-color:#d4af37;border-top:0}
.giso-aiw.left-top .giso-aiw-bubble{left:0;top:78px}
.giso-aiw.left-top .giso-aiw-bubble::after{content:'';position:absolute;top:-8px;left:22px;border:8px solid transparent;border-bottom-color:#d4af37;border-top:0}
.giso-aiw-bubble-text{display:block}
.giso-aiw-bubble-text.is-typing::after{content:'▍';color:#d4af37;animation:aiwCaret .7s step-end infinite;margin-right:2px}
@keyframes aiwCaret{0%,100%{opacity:1}50%{opacity:0}}
.giso-aiw-bubble-dots{display:none;gap:3px;align-items:center}
.giso-aiw-bubble.is-thinking .giso-aiw-bubble-dots{display:inline-flex}
.giso-aiw-bubble.is-thinking .giso-aiw-bubble-text{display:none}
.giso-aiw-bubble-dots i{width:5px;height:5px;border-radius:50%;background:#b8941f;animation:aiwDot 1s infinite;display:block}
.giso-aiw-bubble-dots i:nth-child(2){animation-delay:.15s}
.giso-aiw-bubble-dots i:nth-child(3){animation-delay:.3s}
@keyframes aiwDot{0%,100%{transform:translateY(0);opacity:.5}50%{transform:translateY(-4px);opacity:1}}
.giso-aiw-bubble-close{position:absolute;top:4px;left:8px;background:none;border:none;color:#8b5a2b;font-size:15px;line-height:1;cursor:pointer;opacity:.7;padding:2px}
.giso-aiw-bubble-close:hover{opacity:1}
@media(max-width:720px){.giso-aiw-bubble{display:none}}

/* ==== سبک‌سازی پنل + راهنمای نقش (رفع شلوغی) ==== */
.giso-aiw-hint{display:inline-block;font-size:11px;color:#b8941f;text-decoration:none;margin-top:2px;line-height:1.4}
.giso-aiw-hint:hover{text-decoration:underline}
.giso-aiw-hint[hidden],.giso-aiw-summary[hidden],#gisoAiWidgetContext[hidden]{display:none!important}
.giso-aiw-summary{font-size:11.5px;line-height:1.6;border-top:1px dashed rgba(139,90,43,.18);padding-top:6px;margin-top:2px}

/* ==== سناریوی نهایی: آیکن هنگام باز بودن پنل مخفی ==== */
.giso-aiw.panel-open .giso-aiw-fab{display:none}
.giso-aiw.panel-open .giso-aiw-bubble{display:none}
.giso-aiw-msg.is-typing-live::after{content:'▍';color:#d4af37;animation:aiwCaret .7s step-end infinite;margin-right:2px}

/* ==== باگ بستن پنل و نقطه‌های گیرکرده: گارد hidden ==== */
.giso-aiw-panel[hidden]{display:none!important}
.giso-aiw-typing[hidden]{display:none!important}

/* ==== سایز بزرگ‌تر آیکن + کارت حباب قشنگ (بازشدن نرم، تایپ، محو مرتب) ==== */
.giso-aiw-fab{width:96px;height:96px}
.giso-aiw-fab-svg{width:46px;height:46px}
.giso-aiw-fab-ring{inset:-8px;border-width:3px}
.giso-aiw-badge{font-size:12px;padding:3px 8px;top:-6px;left:-6px}
.giso-aiw-bubble{max-width:250px;min-width:190px;padding:12px 32px 12px 14px;font-size:13.5px;line-height:2;border-radius:18px;border-width:2px;box-shadow:0 14px 40px rgba(139,90,43,.25);transform-origin:bottom right;animation:aiwBubbleIn .38s cubic-bezier(.2,.9,.3,1.2)}
.giso-aiw-bubble.is-fading{opacity:0;transform:translateY(8px) scale(.92);transition:opacity .45s ease,transform .45s ease}
@keyframes aiwBubbleIn{from{opacity:0;transform:translateY(10px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}
.giso-aiw.right-bottom .giso-aiw-bubble{bottom:116px}
.giso-aiw.left-bottom .giso-aiw-bubble{bottom:116px}
.giso-aiw.right-top .giso-aiw-bubble{top:116px}
.giso-aiw.left-top .giso-aiw-bubble{top:116px}
.giso-aiw.right-bottom .giso-aiw-bubble::after{right:40px}
.giso-aiw.left-bottom .giso-aiw-bubble::after{left:40px}
.giso-aiw-bubble-close{top:6px;left:10px;font-size:16px}
@media(max-width:720px){.giso-aiw-fab{width:72px;height:72px}}

/* ==== چیپ‌ها زیر هم + کادر سبز روشن + بازخورد ==== */
.giso-aiw-suggestions{flex-direction:column;gap:6px;background:#e9f7ee;border:1.5px solid #8ecf9f;border-radius:14px;padding:8px 10px}
.giso-aiw-suggestions:empty{display:none!important}
.giso-aiw-suggestions button{width:100%;background:#fff;border:1px solid #b9e2c5;border-radius:10px;padding:7px 10px;text-align:right;font-size:12.5px;color:#2f6b45}
.giso-aiw-suggestions button.is-primary{background:#dcf3e3;border-color:#8ecf9f;font-weight:700}
.giso-aiw-feedback{display:flex;align-items:center;gap:8px;margin:0 12px 8px;padding:6px 10px;background:#fbfff9;border:1px dashed #8ecf9f;border-radius:12px;font-size:12px;color:#3d6b4c}
.giso-aiw-feedback[hidden]{display:none!important}
.giso-aiw-feedback button{border:1px solid #b9e2c5;background:#fff;border-radius:9px;padding:3px 10px;cursor:pointer;font-size:12px;color:#2f6b45}
.giso-aiw-feedback button:hover{background:#e9f7ee}
/* ── جریان گفتگو: چیپ‌های پویا و بازخورد همراه پیام‌ها داخل اسکرول می‌روند ── */
.giso-aiw-flow{display:flex;flex-direction:column;gap:8px;margin-top:2px}
.giso-aiw-suggestions{margin:0;width:100%}
.giso-aiw-suggestions[hidden]{display:none!important}
.giso-aiw-feedback{margin:0}

/* ==== رفع جابه‌جایی پنل در حالت باز: پنل به گوشهٔ متناظرِ موقعیت کانتینر لنگر می‌خورد ==== */
.giso-aiw-panel{position:absolute}
.giso-aiw.right-bottom .giso-aiw-panel{right:0;bottom:0}
.giso-aiw.left-bottom .giso-aiw-panel{left:0;bottom:0}
.giso-aiw.right-top .giso-aiw-panel{right:0;top:0}
.giso-aiw.left-top .giso-aiw-panel{left:0;top:0}
/* در موبایل پنل تمام‌صفحه درون کانتینر inset:0 می‌نشیند */
@media(max-width:720px){
  .giso-aiw.right-bottom .giso-aiw-panel,
  .giso-aiw.left-bottom .giso-aiw-panel,
  .giso-aiw.right-top .giso-aiw-panel,
  .giso-aiw.left-top .giso-aiw-panel{inset:0;right:auto;bottom:auto;width:auto;height:auto;max-height:none}
}

/* ─── فیکس تایپوگرافی و کادربندی چت ویجت (فونت فارسی + RTL درست) ─── */
.giso-aiw,.giso-aiw *{font-family:'Vazirmatn','Segoe UI',sans-serif !important}
.giso-aiw-panel{direction:rtl}
.giso-aiw-msg{font-size:13.5px;line-height:2.1;word-break:break-word;text-align:right;border-radius:16px;padding:11px 14px;max-width:88%}
.giso-aiw-msg.user{border-bottom-right-radius:6px;border-bottom-left-radius:16px}
.giso-aiw-msg.ai{border-bottom-left-radius:6px;border-bottom-right-radius:16px;background:#fffdf8;border:1px solid #efe4d2;color:#3d2e1e}
.giso-aiw-footer textarea{font-size:13.5px;line-height:1.9;direction:rtl;text-align:right}
.giso-aiw-suggestions button{font-family:inherit}

/* Mobile FAB is always anchored at the lower-right, regardless of admin setting. */
.widget-support-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  padding: 8px;
  border-top: 1px solid #f3f4f6;
  pointer-events: auto;
}
.widget-support-link {
  color: #8B5A2B;
  text-decoration: none;
}
.widget-support-link:hover {
  text-decoration: underline;
}

@media(max-width:720px){
 .giso-aiw.right-bottom,.giso-aiw.left-bottom,.giso-aiw.right-top,.giso-aiw.left-top{inset:auto!important;right:14px!important;left:auto!important;top:auto!important;bottom:14px!important;width:60px;height:60px}
 .giso-aiw-fab{position:fixed!important;right:14px!important;left:auto!important;top:auto!important;bottom:14px!important}
 .giso-aiw.is-open,.giso-aiw:has(.giso-aiw-panel:not([hidden])){inset:0!important;width:100vw!important;height:100dvh!important}
 .giso-aiw.right-bottom .giso-aiw-panel,.giso-aiw.left-bottom .giso-aiw-panel,.giso-aiw.right-top .giso-aiw-panel,.giso-aiw.left-top .giso-aiw-panel{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;max-height:100dvh!important;border-radius:0!important}
 .giso-aiw-bubble{display:none!important}
}
