/* Loaded only when the optional SGS AI assistant is enabled. */
.sgs-ai-chat { position:fixed; right:24px; bottom:24px; z-index:99990; font-family:'Vazirmatn',sans-serif; }
.sgs-ai-launcher { display:flex; align-items:center; justify-content:center; gap:9px; min-height:50px; padding:11px 18px; border:0; border-radius:999px; background:#b94700; color:#fff; box-shadow:0 10px 30px rgba(0,0,0,.25); font:700 14px/1.4 'Vazirmatn',sans-serif; cursor:pointer; transition:transform .2s ease,background .2s ease; }
.sgs-ai-launcher:hover { background:#c94e00; transform:translateY(-2px); }
.sgs-ai-launcher svg { width:23px; height:23px; fill:currentColor; flex:0 0 auto; }
.sgs-ai-chat.is-open .sgs-ai-launcher { visibility:hidden; }
.sgs-ai-panel { position:absolute; right:0; bottom:0; width:min(380px,calc(100vw - 32px)); height:min(570px,calc(100vh - 48px)); background:#fff; border:1px solid #dce1e4; border-radius:14px; overflow:hidden; box-shadow:0 18px 55px rgba(0,0,0,.26); color:#293941; grid-template-rows:auto minmax(0,1fr) auto auto; }
.sgs-ai-panel:not([hidden]) { display:grid; }
.sgs-ai-header { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 17px; background:#374952; color:#fff; text-align:start; }
.sgs-ai-header > div { display:flex; flex-direction:column; min-width:0; }
.sgs-ai-header strong { font-size:14px; line-height:1.5; }
.sgs-ai-header small { color:rgba(255,255,255,.82); font-size:10.5px; }
.sgs-ai-close { width:34px; height:34px; border:0; border-radius:50%; background:rgba(255,255,255,.12); color:#fff; font:400 25px/1 Arial,sans-serif; cursor:pointer; flex:0 0 auto; }
.sgs-ai-close:hover { background:rgba(255,255,255,.22); }
.sgs-ai-messages { min-height:0; overflow-y:auto; padding:16px; background:#f5f7f8; display:flex; flex-direction:column; gap:10px; }
.sgs-ai-message { width:fit-content; max-width:88%; padding:10px 12px; border-radius:12px; font-size:13px; line-height:1.75; white-space:pre-wrap; overflow-wrap:anywhere; text-align:start; }
.sgs-ai-message.assistant { align-self:flex-start; background:#fff; border:1px solid #e0e5e8; border-bottom-start-radius:3px; }
.sgs-ai-message.user { align-self:flex-end; background:#b94700; color:#fff; border-bottom-end-radius:3px; }
.sgs-ai-message.notice { background:#fff8f0; border-color:#f1d3bc; color:#7a3500; }
.sgs-ai-message.error { background:#fdecea; border-color:#f1c8c2; color:#9b3328; }
.sgs-ai-message.typing { color:#58636a; font-style:italic; }
.sgs-ai-form { display:grid; grid-template-columns:minmax(0,1fr) 42px; align-items:end; gap:8px; padding:12px; background:#fff; border-top:1px solid #e7eaec; }
.sgs-ai-form textarea { width:100%; min-height:42px; max-height:112px; resize:none; padding:10px 12px; border:1px solid #cfd6da; border-radius:8px; background:#fff; color:#293941; font:400 13px/1.55 'Vazirmatn',sans-serif; outline:none; }
.sgs-ai-form textarea:focus { border-color:#e65c00; box-shadow:0 0 0 3px rgba(230,92,0,.1); }
.sgs-ai-form textarea:disabled { background:#f0f2f3; cursor:not-allowed; }
.sgs-ai-form button { width:42px; height:42px; display:flex; align-items:center; justify-content:center; border:0; border-radius:8px; background:#b94700; color:#fff; cursor:pointer; }
.sgs-ai-form button:hover { background:#c94e00; }
.sgs-ai-form button:disabled { background:#6f777c; cursor:not-allowed; }
.sgs-ai-form button svg { width:19px; height:19px; fill:currentColor; }
[dir="rtl"] .sgs-ai-form button svg { transform:scaleX(-1); }
.sgs-ai-disclaimer { margin:0; padding:0 12px 10px; background:#fff; color:#626d73; font-size:10px; line-height:1.5; text-align:center; }
@media (max-width:640px) {
    .sgs-ai-chat { right:12px; bottom:12px; }
    .sgs-ai-launcher { min-height:46px; padding:10px 15px; }
    .sgs-ai-panel { position:fixed; right:10px; bottom:10px; width:calc(100vw - 20px); height:min(590px,calc(100dvh - 20px)); border-radius:12px; }
}
