/* دستیار هوشمند عمومی — همان ظاهر کشوی «دستیار مدیریت» برای ویترین (روشن/تیره، RTL)
   ساختار و idها همان ویجت چت است (chat-widget.css/js)؛ این فایل فقط ظاهر را بازطراحی می‌کند. */
:root {
  --pa-grad: linear-gradient(135deg, var(--brand, #0d7377), #8b5cf6 62%, #a855f7);
  --pa-panel: var(--card, #fff);
  --pa-body: var(--surface, #f6f7fb);
  --pa-line: var(--border, rgba(29, 36, 51, .1));
  --pa-bot: var(--card, #fff);
  --pa-bot-text: var(--text, #1d2433);
  --pa-me: var(--brand, #0d7377);
  --pa-me-text: var(--brand-contrast, #fff);
}
html[theme-color="dark"] {
  --pa-grad: linear-gradient(135deg, #0f766e, #6d28d9 70%, #7c3aed);
  --pa-panel: var(--card, #0f2422);
  --pa-body: var(--surface, #0a1716);
  --pa-line: var(--border, rgba(148, 163, 184, .16));
  --pa-bot: var(--card-2, #143a37);
  --pa-bot-text: var(--text, #e8eef5);
  --pa-me: #0f766e;
  --pa-me-text: #f0fdfa;
}

/* دکمهٔ شناور قرصی با برچسب */
html .nc-launcher.pa-fab,
html .nc-launcher.pa-fab:not(.is-open) {
  width: auto; min-width: 3.1rem; height: 3.1rem; padding: 0 1.05rem 0 1.15rem; gap: .5rem;
  border-radius: 999px !important; font: inherit; font-weight: 800; font-size: .9rem;
  background: var(--pa-grad) !important; color: #fff !important; border: 0 !important;
  box-shadow: 0 10px 28px rgba(109, 93, 252, .34), 0 2px 6px rgba(15, 23, 42, .18);
}
html[theme-color="dark"] .nc-launcher.pa-fab { box-shadow: 0 10px 28px rgba(0, 0, 0, .55), 0 0 0 1px rgba(167, 139, 250, .35); }
.nc-launcher.pa-fab::after { border-radius: 999px; }
.nc-launcher.pa-fab .nc-launcher-ic { font-size: 1.1rem; }
.nc-launcher.pa-fab.is-open .pa-fab-l { display: none; }
.nc-launcher.pa-fab.is-open { padding: 0; width: 3.1rem; justify-content: center; }
.nc-launcher.pa-fab .nc-launcher-dot { bottom: -2px; inset-inline-start: -2px; left: -2px; }
.nc-launcher.pa-fab:focus-visible { outline: 3px solid rgba(139, 92, 246, .55); outline-offset: 3px; }

/* کشوی کناری (دسکتاپ) */
html .nc-panel.pa-drawer {
  top: .75rem; bottom: .75rem; right: .75rem; left: auto; height: auto;
  width: min(420px, calc(100vw - 1.5rem)); border-radius: 20px;
  background: var(--pa-panel); color: var(--text, #1d2433); border: 1px solid var(--pa-line);
  box-shadow: 0 24px 64px rgba(15, 23, 42, .28); z-index: 2200;
  transform: translateX(calc(100% + 2rem)); transform-origin: center right;
}
html .nc-panel.pa-drawer.is-open { transform: none; }
html .nc-panel.pa-drawer.is-wide { width: min(720px, calc(100vw - 1.5rem)); }
html.nc-open .nc-launcher.pa-fab { opacity: 0; pointer-events: none; }

html .pa-drawer .nc-head { background: var(--pa-grad) !important; padding: .8rem .9rem; padding-top: calc(.8rem + env(safe-area-inset-top, 0px)); color: #fff; }
.pa-drawer .pa-head-ic { width: 2.3rem; height: 2.3rem; border-radius: 12px; background: rgba(255, 255, 255, .18); font-size: 1rem; }
.pa-drawer .nc-online-dot { border-color: transparent; bottom: -3px; inset-inline-end: -3px; right: -3px; }
.pa-drawer .nc-head-copy strong { font-size: .98rem; color: #fff; }
.pa-drawer .nc-head-copy .nc-status { font-size: .72rem; opacity: .9; color: #fff; }
.pa-head-btns { display: flex; gap: .35rem; flex: none; }
.pa-drawer .pa-hbtn { width: 2.1rem; height: 2.1rem; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; }
.pa-drawer .pa-hbtn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.pa-drawer .pa-hbtn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }

.pa-drawer .nc-chat-body, .pa-drawer .nc-messages { background: var(--pa-body); }
.pa-drawer .nc-empty { color: var(--muted, #63667f); }
.pa-drawer .nc-empty-icon { width: 3.6rem; height: 3.6rem; border-radius: 18px; background: var(--pa-grad); color: #fff; }

/* حباب‌ها شبیه کارت‌های دستیار */
html .pa-drawer .nc-bubble.is-staff,
html .pa-drawer .nc-bubble.is-staff.is-bot {
  background: var(--pa-bot) !important; color: var(--pa-bot-text) !important;
  border: 1px solid var(--pa-line) !important; border-radius: 16px; border-start-start-radius: 6px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
html .pa-drawer .nc-bubble.is-staff:not(.is-bot) { border-inline-start: 3px solid var(--brand, #0d7377) !important; }
html .pa-drawer .nc-bubble.is-user { background: var(--pa-me) !important; color: var(--pa-me-text) !important; border-radius: 16px; border-start-end-radius: 6px; }
.pa-drawer .nc-bubble.is-user .nc-bubble-meta, .pa-drawer .nc-bubble.is-user .chat-ticks { color: inherit; opacity: .8; }
.pa-drawer .nc-bubble.is-staff .nc-bubble-meta { color: var(--muted, #63667f); }
.pa-drawer .nc-bubble .chat-link { color: var(--brand, #0d7377); text-decoration: underline; }
html[theme-color="dark"] .pa-drawer .nc-bubble .chat-link { color: #5eead4; }
.pa-drawer .nc-bubble.is-draft .nc-bubble-body { white-space: pre-wrap; }
.pa-caret { display: inline-block; width: .45rem; height: .9rem; margin-inline-start: .25rem; vertical-align: -2px; border-radius: 2px; background: var(--brand, #0d7377); animation: pa-blink 1s steps(2) infinite; }
@keyframes pa-blink { 50% { opacity: 0; } }

.pa-drawer .nc-starters button, .pa-drawer .nc-starters a {
  border: 1px solid rgba(139, 92, 246, .28); background: var(--pa-panel); color: #5b3fd6; border-radius: 999px;
}
html[theme-color="dark"] .pa-drawer .nc-starters button, html[theme-color="dark"] .pa-drawer .nc-starters a { color: #c4b5fd; border-color: rgba(167, 139, 250, .35); background: var(--pa-bot); }
.pa-drawer .nc-starters button:hover, .pa-drawer .nc-starters a:hover { background: rgba(139, 92, 246, .1); }

.pa-drawer .nc-composer { background: var(--pa-panel); border-top: 1px solid var(--pa-line); }
.pa-drawer .nc-field { background: var(--pa-body); border: 1px solid var(--pa-line); border-radius: 14px; color: var(--text, #1d2433); }
.pa-drawer .nc-field:focus-within { border-color: var(--brand, #0d7377); box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 13, 115, 119), .16); }
html .pa-drawer .nc-send { background: var(--pa-grad) !important; color: #fff !important; border-radius: 12px; }
html .pa-drawer .nc-send:disabled { opacity: .5; }
.pa-drawer .nc-chat-img { border-radius: 12px; }

/* تمام‌صفحه در موبایل */
@media (max-width: 991.98px) {
  .nc-launcher.pa-fab, .nc-launcher.pa-fab:not(.is-open) { height: 3rem; }
  html .nc-panel.pa-drawer { inset: 0; top: 0; bottom: 0; right: 0; left: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; z-index: 2200; transform: translateY(24px); }
  html .nc-panel.pa-drawer.is-open { transform: none; }
  .pa-only-desk { display: none !important; }
  .pa-drawer .nc-field textarea, .pa-drawer .nc-field input { font-size: 16px; }
  html.nc-open body { overflow: hidden; }
}
@media (max-width: 576px) {
  .nc-launcher.pa-fab .pa-fab-l { display: none; }
  html .nc-launcher.pa-fab, html .nc-launcher.pa-fab:not(.is-open) { width: 3rem; padding: 0; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .pa-caret { animation: none; } }


/* ai17: دکمهٔ جمع‌کردن چت + زبانهٔ لبهٔ صفحه */
.nc-minbtn, .nc-tab { position: fixed; z-index: calc(var(--nc-z, 1100) + 1); border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.nc-minbtn { right: calc(var(--nc-side) - 4px); bottom: calc(var(--nc-bottom) + env(safe-area-inset-bottom, 0px) + 3.1rem - 8px); width: 22px; height: 22px; border-radius: 50%; font-size: 10px; color: #475569; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(15, 23, 42, .22); }
html[theme-color="dark"] .nc-minbtn { color: #e2e8f0; background: rgba(30, 41, 59, .92); }
.nc-tab { right: 0; bottom: calc(var(--nc-bottom) + env(safe-area-inset-bottom, 0px) + 4px); width: 16px; height: 44px; border-radius: 10px 0 0 10px; font-size: 10px; color: #fff; background: var(--pa-grad, #6d5dfc); opacity: .38; transition: opacity .2s, width .2s; }
.nc-tab:hover, .nc-tab:focus-visible { opacity: .9; width: 22px; }
.nc-minbtn:focus-visible, .nc-tab:focus-visible { outline: 2px solid rgba(139, 92, 246, .6); outline-offset: 2px; }
html:not(.nc-min) .nc-tab { display: none; }
html.nc-min .nc-launcher, html.nc-min .nc-minbtn, html.nc-open .nc-minbtn { display: none !important; }
@media (max-width: 991.98px) { .nc-minbtn { bottom: calc(var(--nc-bottom) + env(safe-area-inset-bottom, 0px) + 3rem - 8px); } }
body.has-stickybuy .nc-minbtn, body.has-stickybuy .nc-tab { --nc-bottom: 172px; }
@media (min-width: 992px) { body.has-stickybuy .nc-minbtn, body.has-stickybuy .nc-tab { --nc-bottom: 24px; } }
