/* دستیار خرید (۱.۶.۵) — همه‌ی کلاس‌ها با پیشوند spc-as؛ رنگ اصلی از پنل در --spc-as */
:root { --spc-as: #7c3aed; --spc-as-ink: #1f2937; --spc-as-mute: #6b7280; --spc-as-line: #e5e7eb; --spc-as-bg: #ffffff; --spc-as-soft: #f6f5fb; }
.spc-as-root, .spc-as-backdrop, .spc-as-panel { font-family: inherit; direction: rtl; text-align: right; }
.spc-as-root *, .spc-as-backdrop *, .spc-as-panel * { box-sizing: border-box; }
html.spc-as-lock, html.spc-as-lock body { overflow: hidden; }

/* دکمه‌ی شناور */
.spc-as-fab { position: fixed; bottom: 22px; z-index: 99990; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px 12px 16px; border: 0; border-radius: 999px; cursor: pointer;
  color: #fff; background: var(--spc-as); background: linear-gradient(135deg, var(--spc-as), color-mix(in srgb, var(--spc-as) 70%, #ec4899)); box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--spc-as) 70%, transparent), 0 2px 6px rgba(0,0,0,.12);
  font: inherit; font-size: 15px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease; }
.spc-as-left .spc-as-fab { left: 22px; } .spc-as-right .spc-as-fab { right: 22px; }
.spc-as-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 34px -8px color-mix(in srgb, var(--spc-as) 75%, transparent), 0 3px 8px rgba(0,0,0,.14); }
.spc-as-fab:focus-visible { outline: 3px solid color-mix(in srgb, var(--spc-as) 40%, #fff); outline-offset: 3px; }
.spc-as-fab svg { flex: none; }
@media (max-width: 600px) { .spc-as-fab { bottom: 76px; padding: 13px; } .spc-as-fab span { display: none; } .spc-as-left .spc-as-fab { left: 14px; } .spc-as-right .spc-as-fab { right: 14px; } }

/* پنجره‌ی وسط صفحه */
.spc-as-backdrop { position: fixed; inset: 0; z-index: 99995; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(17, 12, 34, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s ease; }
.spc-as-backdrop[hidden] { display: none; }
.spc-as-backdrop.is-open { opacity: 1; }
.spc-as-modal { width: min(720px, 100%); height: min(760px, calc(100dvh - 32px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; background: var(--spc-as-bg);
  box-shadow: 0 30px 80px -20px rgba(17, 12, 34, .45), 0 0 0 1px rgba(255,255,255,.06); transform: translateY(14px) scale(.98); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
.spc-as-backdrop.is-open .spc-as-modal { transform: none; }
@media (max-width: 600px) { .spc-as-backdrop { padding: 10px; } .spc-as-modal { height: calc(100dvh - 20px); border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .spc-as-backdrop, .spc-as-modal, .spc-as-fab { transition: none; } }

/* حالت درون‌صفحه */
.spc-as-panel { display: flex; flex-direction: column; height: min(720px, 80vh); min-height: 460px; overflow: hidden; border-radius: 20px; background: var(--spc-as-bg); border: 1px solid var(--spc-as-line); box-shadow: 0 12px 40px -18px rgba(17,12,34,.25); margin: 0 auto 24px; max-width: 860px; }

/* سربرگ */
.spc-as-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: #fff; background: var(--spc-as); background: linear-gradient(135deg, var(--spc-as), color-mix(in srgb, var(--spc-as) 72%, #ec4899)); }
.spc-as-avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.18); }
.spc-as-titles { flex: 1; min-width: 0; }
.spc-as-title { font-weight: 800; font-size: 16px; line-height: 1.4; }
.spc-as-sub { font-size: 12px; opacity: .85; }
.spc-as-acts { display: flex; gap: 6px; }
.spc-as-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; padding: 0; }
.spc-as-icon:hover { background: rgba(255,255,255,.26); }

/* گفتگو */
.spc-as-log { position: relative; flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--spc-as-soft); scroll-behavior: smooth; overscroll-behavior: contain; }
.spc-as-msg { display: flex; margin: 0 0 10px; }
.spc-as-me { justify-content: flex-start; }
.spc-as-bot { justify-content: flex-end; }
.spc-as-bubble { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.9; white-space: pre-wrap; word-wrap: break-word; color: var(--spc-as-ink); }
.spc-as-me .spc-as-bubble { background: var(--spc-as); color: #fff; border-bottom-right-radius: 4px; }
.spc-as-bot .spc-as-bubble { background: #fff; border: 1px solid var(--spc-as-line); border-bottom-left-radius: 4px; }
.spc-as-err .spc-as-bubble { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.spc-as-think .spc-as-bubble { display: inline-flex; align-items: center; gap: 10px; color: var(--spc-as-mute); font-size: 13.5px; }
.spc-as-dots { display: inline-flex; gap: 4px; }
.spc-as-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--spc-as); opacity: .35; animation: spc-as-b 1.1s infinite ease-in-out; }
.spc-as-dots i:nth-child(2) { animation-delay: .15s; } .spc-as-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes spc-as-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }
.spc-as-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin: 0 0 12px; }
.spc-as-chip { border: 1px solid color-mix(in srgb, var(--spc-as) 35%, #fff); background: #fff; color: var(--spc-as); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13.5px; cursor: pointer; transition: background .15s; }
.spc-as-chip:hover { background: color-mix(in srgb, var(--spc-as) 10%, #fff); }
.spc-as-steps { margin: -4px 0 12px; font-size: 12.5px; color: var(--spc-as-mute); }
.spc-as-steps summary { cursor: pointer; list-style: none; display: inline-block; padding: 2px 8px; border-radius: 6px; }
.spc-as-steps summary::before { content: '◂ '; } .spc-as-steps[open] summary::before { content: '▾ '; }
.spc-as-steps ol { margin: 6px 18px 0 0; padding: 0; line-height: 1.9; }
.spc-as-note { font-size: 12px; color: var(--spc-as-mute); margin: -4px 0 12px; }

/* کارت‌ها: همان کارت زنده‌ی مجله با یک خط «چرا» */
.spc-as-cards-wrap { margin: 2px 0 14px; }
.spc-as-cards-label { font-size: 13px; font-weight: 700; color: var(--spc-as-mute); margin: 0 0 8px; }
.spc-as-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.spc-as-pick { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.spc-as-why { font-size: 12.5px; line-height: 1.8; color: var(--spc-as-ink); background: color-mix(in srgb, var(--spc-as) 8%, #fff); border-radius: 10px; padding: 6px 10px; }
.spc-as-pick .spc-pcard { margin: 0; flex: 1; flex-direction: column; }
.spc-as-pick .spc-pcard__media { width: 100%; max-width: none; }
.spc-as-pick .spc-pcard__img { width: 100%; height: 160px; object-fit: contain; }
@media (max-width: 600px) { .spc-as-cards { grid-template-columns: 1fr 1fr; gap: 8px; } .spc-as-pick .spc-pcard__img { height: 120px; } }

/* ورودی */
.spc-as-form { display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--spc-as-line); background: #fff; }
.spc-as-input { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: 11px 14px; border: 1px solid var(--spc-as-line); border-radius: 14px; font: inherit; font-size: 15px; line-height: 1.6; color: var(--spc-as-ink); background: #fff; outline: none; }
.spc-as-input:focus { border-color: var(--spc-as); box-shadow: 0 0 0 3px color-mix(in srgb, var(--spc-as) 18%, transparent); }
.spc-as-send { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 14px; color: #fff; background: var(--spc-as); cursor: pointer; padding: 0; transform: scaleX(-1); }
.spc-as-send:disabled, .spc-as-input:disabled { opacity: .55; cursor: default; }
.spc-as-foot { padding: 0 14px 10px; font-size: 11px; color: var(--spc-as-mute); background: #fff; text-align: center; }
