/* ════════════════════════════════════════════════════════════════
   باستان‌یار — رابط گفتگو و ابزارها
   رنگ‌های تعاملی از رنگ اصلی و تأکیدی قالب سایت گرفته می‌شوند
   برای «شواهد و هشدارها». فقط در صفحهٔ /ai-tools/ بارگذاری می‌شود.
   ════════════════════════════════════════════════════════════════ */

.bsy-page {
    --bg:        #0f1a33;
    --surface:   #152443;
    --raised:    #1d3058;
    --line:      rgba(163, 186, 230, .16);
    --line-2:    rgba(163, 186, 230, .28);
    --ink:       #eef2fa;
    --ink-2:     #b9c4dc;
    --ink-3:     #8796b5;
    --firoozeh:  var(--bs-primary, #dc2626);
    --firoozeh-2:var(--bs-accent, #f59e0b);
    --on-firoozeh:#ffffff;
    --ochre:     #dba64a;
    --ochre-bg:  rgba(219, 166, 74, .12);
    --danger:    #ef7f7f;
    --danger-bg: rgba(239, 127, 127, .12);
    --ok:        var(--bs-accent,#f59e0b);
    --r-s: 8px; --r-m: 14px; --r-l: 22px;
    --top-h: 58px;
    --shadow: 0 18px 50px rgba(3, 8, 20, .45);
    --font: Vazirmatn, Vazir, Tahoma, sans-serif;

    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
}
.bsy-page *, .bsy-page *::before, .bsy-page *::after { box-sizing: border-box; }
/* نوار اسکرول تیره و نازک، هم‌رنگ قالب */
:root:has(body.bsy-page) { color-scheme: dark; scrollbar-color: color-mix(in srgb,var(--bs-primary,#dc2626) 28%,transparent) #0f1a33; scrollbar-width: thin; }
.bsy-page * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb,var(--bs-primary,#dc2626) 26%,transparent) transparent; }
.bsy-page ::-webkit-scrollbar, body.bsy-page::-webkit-scrollbar { width: 6px; height: 6px; }
.bsy-page ::-webkit-scrollbar-track, body.bsy-page::-webkit-scrollbar-track { background: transparent; }
.bsy-page ::-webkit-scrollbar-thumb, body.bsy-page::-webkit-scrollbar-thumb { background: color-mix(in srgb,var(--bs-primary,#dc2626) 25%,transparent); border-radius: 999px; }
.bsy-page ::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb,var(--bs-primary,#dc2626) 45%,transparent); }
.bsy-page ::-webkit-scrollbar-corner { background: transparent; }
.bsy-page svg { width: 20px; height: 20px; flex: none; display: inline-block; }
.bsy-page a { color: inherit; }
.bsy-page button { font: inherit; color: inherit; cursor: pointer; }
.bsy-page textarea, .bsy-page input { font: inherit; color: var(--ink); }
.bsy-page :focus-visible { outline: 2px solid var(--firoozeh-2); outline-offset: 2px; border-radius: 6px; }
.bsy-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bsy-skip { position: absolute; top: -60px; right: 12px; z-index: 99; padding: 8px 14px; border-radius: var(--r-s); background: var(--firoozeh); color: var(--on-firoozeh); }
.bsy-skip:focus { top: 8px; }
.bsy-page [hidden] { display: none !important; }
/* نوار مدیریت وردپرس در این صفحهٔ تمام‌صفحه جای خود را دارد */
.admin-bar.bsy-page .bsy-top { top: 32px; }
@media (max-width: 782px) { .admin-bar.bsy-page .bsy-top { top: 46px; } }

/* ─── دکمه‌ها ─── */
.bsy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; transition: background .15s, border-color .15s, transform .1s; }
.bsy-btn:active { transform: translateY(1px); }
.bsy-btn-primary { background: var(--firoozeh); color: var(--on-firoozeh); }
.bsy-btn-primary:hover { background: var(--bs-primary-dark, #b91c1c); }
.bsy-btn-primary:disabled { background: var(--raised); color: var(--ink-3); cursor: wait; }
.bsy-btn-quiet { border-color: var(--line-2); background: transparent; color: var(--ink); }
.bsy-btn-quiet:hover { border-color: var(--firoozeh); }
.bsy-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); text-decoration: none; }
.bsy-icon-btn:hover { background: var(--raised); color: var(--ink); }
.bsy-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--firoozeh-2); font-size: 13.5px; text-decoration: none; }
.bsy-link:hover { text-decoration: underline; }
.bsy-link svg { width: 17px; height: 17px; }

/* ─── سربرگ ─── */
.bsy-top { position: sticky; top: 0; z-index: 40; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: var(--top-h); padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(15, 26, 51, .92); backdrop-filter: blur(10px); }
.bsy-top-back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.bsy-top-back:hover { color: var(--ink); }
.bsy-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; text-decoration: none; }
.bsy-brand img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--raised); }
.bsy-top-end { display: inline-flex; align-items: center; gap: 6px; justify-self: end; }
.bsy-quota { padding: 4px 11px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.bsy-quota.is-low { border-color: var(--ochre); color: var(--ochre); }

.bsy-main { min-height: calc(100vh - var(--top-h)); }

/* ═══════════ صفحهٔ اصلی ═══════════ */
.bsy-hero { position: relative; padding: 56px 18px 46px; overflow: hidden; border-bottom: 1px solid var(--line); }
/* نوار آجر لعاب‌دار: ردیف‌های آجر جابه‌جا، مانند دیوار کاخ شوش */
.bsy-hero::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
    background-image:
        linear-gradient(180deg, rgba(15,26,51,0) 0%, var(--bg) 92%),
        linear-gradient(90deg, color-mix(in srgb,var(--bs-primary,#dc2626) 10%,transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb,var(--bs-primary,#dc2626) 10%,transparent) 1px, transparent 1px),
        linear-gradient(0deg, color-mix(in srgb,var(--bs-primary,#dc2626) 12%,transparent) 1px, transparent 1px),
        linear-gradient(135deg, #1a2d57 0%, #13244a 45%, #16305a 100%);
    background-size: 100% 100%, 64px 44px, 64px 44px, 100% 22px, 100% 100%;
    background-position: 0 0, 0 0, 32px 22px, 0 0, 0 0;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
}
.bsy-hero::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg, transparent, var(--firoozeh) 30%, var(--ochre) 70%, transparent); opacity: .7; }
.bsy-hero-inner { position: relative; max-width: 720px; margin: 0 auto; text-align: center; }
.bsy-hero h1 { margin: 0 0 10px; font-size: clamp(28px, 6vw, 44px); line-height: 1.3; font-weight: 900; }
.bsy-hero p { max-width: 560px; margin: 0 auto 26px; color: var(--ink-2); font-size: 15.5px; }
.bsy-ask { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 8px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow); text-align: start; }
.bsy-ask:focus-within { border-color: var(--firoozeh); }
.bsy-ask textarea { flex: 1; min-height: 46px; max-height: 180px; padding: 10px 12px; border: 0; background: transparent; resize: none; line-height: 1.8; outline: none; }
.bsy-ask textarea::placeholder, .bsy-page textarea::placeholder, .bsy-page input::placeholder { color: var(--ink-3); }
.bsy-send { display: inline-grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 15px; background: var(--firoozeh); color: var(--on-firoozeh); }
.bsy-send svg { transform: scaleX(-1); }
.bsy-send:hover { background: var(--bs-primary-dark, #b91c1c); }
.bsy-send:disabled { background: var(--raised); color: var(--ink-3); cursor: not-allowed; }
.bsy-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.bsy-starters button, .bsy-chip { padding: 7px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 13px; text-align: start; }
.bsy-starters button:hover, .bsy-chip:hover { border-color: var(--firoozeh); color: var(--ink); }
.bsy-guest { padding: 22px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); }
.bsy-guest p { margin: 0 auto 16px; }

.bsy-home-head { max-width: 1080px; margin: 0 auto; padding: 30px 18px 0; }
.bsy-home-head h1 { margin: 0; font-size: clamp(22px, 4vw, 30px); font-weight: 900; line-height: 1.4; }
.bsy-home-head > p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.bsy-home-head .bsy-guest { margin-top: 18px; text-align: center; }
.bsy-catalog { max-width: 1080px; margin: 0 auto; padding: 22px 18px 60px; }
.bsy-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin-bottom: 14px; }
.bsy-sec-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.bsy-sec-head p { flex-basis: 100%; margin: 0; color: var(--ink-3); font-size: 13.5px; }

/* گفتگوهای اخیر */
.bsy-recent { margin-bottom: 30px; }
.bsy-recent-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.bsy-recent-list button { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-align: start; }
.bsy-recent-list button:hover { border-color: var(--firoozeh); }
.bsy-recent-list b { overflow: hidden; font-size: 14px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.bsy-recent-list small { color: var(--ink-3); font-size: 12px; }

/* دو ورودی اصلی */
.bsy-feature { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 38px; }
.bsy-feature-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--surface); text-decoration: none; transition: border-color .15s, background .15s; }
.bsy-feature-card:hover { border-color: var(--firoozeh); }
.bsy-feature-card.is-main { background: linear-gradient(135deg, color-mix(in srgb,var(--bs-primary,#dc2626) 16%,transparent), color-mix(in srgb,var(--bs-primary,#dc2626) 4%,transparent) 60%), var(--surface); border-color: color-mix(in srgb,var(--bs-primary,#dc2626) 45%,transparent); }
.bsy-feature-icon { display: grid; place-items: center; flex: none; width: 54px; height: 54px; border-radius: 16px; background: var(--raised); color: var(--firoozeh-2); }
.bsy-feature-card.is-main .bsy-feature-icon { background: var(--firoozeh); color: var(--on-firoozeh); }
.bsy-page .bsy-feature-icon svg { width: 26px; height: 26px; }
.bsy-feature-text { display: grid; gap: 3px; min-width: 0; flex: 1; }
.bsy-feature-text strong { font-size: 17px; font-weight: 800; }
.bsy-feature-text small { color: var(--ink-2); font-size: 13.5px; line-height: 1.8; }
.bsy-feature-go { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--ink-2); }
.bsy-feature-card:hover .bsy-feature-go { border-color: var(--firoozeh); color: var(--firoozeh-2); }
.bsy-feature-card.is-off { opacity: .45; pointer-events: none; }

/* کارت ابزارها */
.bsy-group + .bsy-group { margin-top: 36px; }
.bsy-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bsy-tools[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bsy-tool { display: grid; grid-template-rows: auto auto 1fr auto; align-content: start; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
.bsy-tool:hover { border-color: var(--firoozeh); transform: translateY(-2px); }
.bsy-tool.is-off { opacity: .45; pointer-events: none; }
.bsy-tool-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 6px; border-radius: 13px; background: var(--raised); color: var(--firoozeh-2); }
.bsy-page .bsy-tool-icon svg { width: 22px; height: 22px; }
.bsy-tool strong { font-size: 15.5px; font-weight: 800; }
.bsy-tool small { display: -webkit-box; overflow: hidden; color: var(--ink-3); font-size: 13px; line-height: 1.8; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bsy-tool-need { justify-self: start; margin-top: 8px; padding: 2px 10px; border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 11.5px; }
.bsy-footnote { max-width: 760px; margin: 40px 0 0; color: var(--ink-3); font-size: 12.5px; }
.bsy-footnote a { color: var(--firoozeh-2); }

/* ═══════════ گفتگو ═══════════ */
.bsy-page { --ab: 0px; }
.admin-bar.bsy-page { --ab: 32px; }
@media (max-width: 782px) { .admin-bar.bsy-page { --ab: 46px; } }
/* در حالت گفتگو صفحه ثابت است و فقط رشتهٔ پیام‌ها اسکرول می‌شود؛ پس سربرگ گفتگو هیچ‌وقت زیر نوار بالا نمی‌رود. */
.bsy-in-chat { overflow: hidden; }
.bsy-chat { display: grid; grid-template-columns: 280px minmax(0, 1fr); height: calc(100dvh - var(--top-h) - var(--ab)); }
.bsy-in-chat .bsy-chat { position: fixed; top: calc(var(--top-h) + var(--ab)); right: 0; left: 0; bottom: 0; height: auto; }
.bsy-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; padding: 14px 12px; border-inline-end: 1px solid var(--line); background: #0c1630; }
.bsy-side-head { display: flex; gap: 8px; }
.bsy-newchat { flex: 1; justify-content: flex-start; border-radius: 12px; border-color: var(--line-2); background: transparent; color: var(--ink); }
.bsy-newchat:hover { background: var(--raised); }
.bsy-newchat svg { color: var(--firoozeh-2); }
.bsy-side-close { display: none; }
.bsy-conv-search { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.bsy-conv-list { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.bsy-conv-day { margin: 14px 8px 4px; color: var(--ink-3); font-size: 11.5px; }
.bsy-conv { position: relative; display: flex; align-items: center; gap: 6px; border-radius: 10px; }
.bsy-conv > button:first-child { flex: 1; min-width: 0; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font-size: 13.5px; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsy-conv:hover > button:first-child, .bsy-conv.is-active > button:first-child { background: var(--raised); color: var(--ink); }
.bsy-conv-actions { display: flex; opacity: 0; transition: opacity .15s; }
.bsy-conv:hover .bsy-conv-actions, .bsy-conv.is-active .bsy-conv-actions, .bsy-conv:focus-within .bsy-conv-actions { opacity: 1; }
.bsy-conv-actions button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); }
.bsy-conv-actions button:hover { color: var(--ink); background: var(--raised); }
.bsy-conv-actions svg { width: 16px; height: 16px; }
.bsy-conv-empty { padding: 18px 8px; color: var(--ink-3); font-size: 13px; }
.bsy-side-foot { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); }
.bsy-scrim { display: none; }

.bsy-thread-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.bsy-thread-wrap { position: relative; }
.bsy-thread-bar { display: flex; flex: none; align-items: center; gap: 8px; height: 54px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--bg); }
.bsy-side-open { display: none; }
.bsy-thread-title { flex: 1; min-width: 0; display: grid; line-height: 1.4; text-align: center; }
.bsy-thread-title strong { overflow: hidden; font-size: 14.5px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.bsy-thread-title small { color: var(--firoozeh-2); font-size: 12px; }
.bsy-chat-ad { display: none; }
.bsy-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 18px 30px; scroll-behavior: smooth; overscroll-behavior: contain; }
.bsy-thread > * { max-width: 780px; margin-inline: auto; }

.bsy-welcome { display: flex; flex-direction: column; align-items: center; padding: 7vh 0 10px; text-align: center; }
.bsy-welcome-mark { position: relative; display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto; border-radius: 24px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2), 0 0 0 9px color-mix(in srgb,var(--bs-primary,#dc2626) 7%,transparent); }
.bsy-page .bsy-welcome-mark img { display: block; width: 60px; height: 60px; border-radius: 18px; object-fit: cover; }
.bsy-welcome h2 { margin: 18px 0 6px; font-size: 23px; font-weight: 900; }
.bsy-welcome > p { max-width: 440px; margin: 0 auto 26px; color: var(--ink-2); font-size: 14.5px; }
.bsy-ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 620px; }
.bsy-idea { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-align: start; transition: border-color .15s, background .15s; }
.bsy-idea:hover { border-color: var(--firoozeh); background: var(--raised); }
.bsy-idea > svg { margin-top: 3px; color: var(--firoozeh-2); }
.bsy-idea span { display: grid; gap: 1px; line-height: 1.6; }
.bsy-idea b { font-size: 14px; font-weight: 700; }
.bsy-idea small { color: var(--ink-3); font-size: 12px; }

.bsy-msg { display: flex; gap: 12px; margin-bottom: 28px; }
.bsy-msg-user { justify-content: flex-end; }
.bsy-msg-user .bsy-bubble { max-width: min(560px, 86%); padding: 10px 16px; border: 1px solid color-mix(in srgb,var(--bs-primary,#dc2626) 28%,transparent); border-radius: 20px 20px 6px 20px; background: color-mix(in srgb,var(--bs-primary,#dc2626) 13%,transparent); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.9; }
.bsy-msg-user .bsy-msg-media { margin-bottom: 8px; }
.bsy-page .bsy-msg-bot .bsy-avatar { display: block; flex: none; width: 32px; height: 32px; margin-top: 2px; border-radius: 10px; object-fit: cover; background: var(--surface); box-shadow: 0 0 0 1px var(--line-2); }
.bsy-msg-name { display: block; margin: 4px 0 6px; color: var(--ink-3); font-size: 12.5px; font-weight: 700; }
.bsy-msg-bot .bsy-msg-body { flex: 1; min-width: 0; }
.bsy-msg-media { display: flex; flex-wrap: wrap; gap: 6px; }
.bsy-msg-media img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line); }
.bsy-msg-media a.bsy-file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 12.5px; text-decoration: none; }

/* متن پاسخ */
.bsy-md { font-size: 15.5px; line-height: 2; overflow-wrap: anywhere; }
.bsy-md > :first-child { margin-top: 0; }
.bsy-md p { margin: 0 0 12px; }
.bsy-md h3, .bsy-md h4 { margin: 18px 0 8px; font-size: 16.5px; font-weight: 800; line-height: 1.6; }
.bsy-md h4 { font-size: 15.5px; }
.bsy-md ul, .bsy-md ol { margin: 0 0 12px; padding-inline-start: 22px; list-style: disc; }
.bsy-md ol { list-style: decimal; }
.bsy-md li { margin-bottom: 4px; }
.bsy-md li::marker { color: var(--firoozeh); }
.bsy-md strong { color: #fff; font-weight: 800; }
.bsy-md a { color: var(--firoozeh-2); text-underline-offset: 3px; }
.bsy-md code { padding: 1px 6px; border-radius: 6px; background: var(--raised); font-size: .92em; }
.bsy-md pre { overflow-x: auto; padding: 12px 14px; border-radius: var(--r-m); background: #0b1428; direction: ltr; text-align: left; }
.bsy-md pre code { padding: 0; background: none; }
.bsy-md blockquote { margin: 0 0 12px; padding: 4px 14px; border-inline-start: 3px solid var(--ochre); color: var(--ink-2); }
.bsy-md .bsy-table { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--line); border-radius: var(--r-m); }
.bsy-md table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bsy-md th, .bsy-md td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.bsy-md th { background: var(--surface); font-weight: 700; }
.bsy-md tr:last-child td { border-bottom: 0; }

.bsy-msg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; color: var(--ink-3); font-size: 12px; }
.bsy-msg-tools button { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink-3); font-size: 12px; }
.bsy-msg-tools button:hover { background: var(--raised); color: var(--ink); }
.bsy-msg-tools svg { width: 15px; height: 15px; }
.bsy-followups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bsy-notice { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 0; padding: 10px 14px; border-radius: var(--r-m); background: var(--ochre-bg); color: #f3d7a1; font-size: 13.5px; line-height: 1.85; }
.bsy-notice.is-error { background: var(--danger-bg); color: #ffc9c9; }
.bsy-notice button { flex: none; margin-inline-start: auto; padding: 2px 12px; border: 1px solid currentColor; border-radius: 999px; background: none; color: inherit; font-size: 12.5px; }
.bsy-sponsor { margin-top: 8px; color: var(--ink-3); font-size: 12px; }
.bsy-sponsor a { color: var(--ink-2); }

/* در حال نوشتن */
.bsy-thinking { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 14px; }
.bsy-dots { display: inline-flex; gap: 4px; }
.bsy-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--firoozeh); animation: bsy-dot 1.2s infinite ease-in-out; }
.bsy-dots i:nth-child(2) { animation-delay: .15s; } .bsy-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bsy-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.bsy-thinking small { color: var(--ink-3); }

/* منابع پژوهش */
.bsy-research { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); }
.bsy-research > header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.bsy-research > header svg { color: var(--firoozeh-2); }
.bsy-sources { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; counter-reset: src; }
.bsy-sources li { counter-increment: src; }
.bsy-sources a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); text-decoration: none; font-size: 13px; line-height: 1.6; }
.bsy-sources a::before { content: counter(src, persian); display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--raised); color: var(--firoozeh-2); font-size: 12px; }
.bsy-sources a:hover { outline: 1px solid var(--firoozeh); }
.bsy-sources small { display: block; color: var(--ink-3); direction: ltr; text-align: right; }

/* نویسنده */
.bsy-composer { flex: none; padding: 6px 18px max(10px, env(safe-area-inset-bottom)); background: var(--bg); }
.bsy-composer > * { max-width: 780px; margin-inline: auto; }
.bsy-composer-box { border: 1px solid var(--line-2); border-radius: 24px; background: var(--surface); box-shadow: 0 10px 30px rgba(3,8,20,.35); transition: border-color .15s; }
.bsy-composer-box:focus-within { border-color: color-mix(in srgb,var(--bs-primary,#dc2626) 70%,transparent); }
.bsy-composer-row { display: flex; align-items: flex-end; gap: 4px; padding: 6px; }
.bsy-composer textarea { flex: 1; min-height: 44px; max-height: 200px; padding: 9px 6px; border: 0; background: transparent; resize: none; outline: none; line-height: 1.8; }
.bsy-composer-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; padding: 7px 6px 0; text-align: center; }
.bsy-composer-foot .bsy-hint { font-size: 11.5px; }
.bsy-composer-foot #bsy-cost-hint:empty { display: none; }
.bsy-hint { color: var(--ink-3); font-size: 12px; }
.bsy-composer textarea:focus-visible, .bsy-ask textarea:focus-visible { outline: none; }
.bsy-plus { position: relative; }
.bsy-plus-btn { width: 44px; height: 44px; border-radius: 50%; }
.bsy-plus-btn.is-deep { color: var(--firoozeh-2); }
.bsy-composer .bsy-send { width: 44px; height: 44px; border-radius: 50%; }
.bsy-plus-btn[aria-expanded="true"] { background: var(--raised); color: var(--ink); }
.bsy-plus-btn[aria-expanded="true"] svg { transform: rotate(45deg); }
.bsy-menu { position: absolute; bottom: calc(100% + 10px); inset-inline-start: 0; z-index: 30; display: grid; width: max-content; min-width: 270px; max-width: min(340px, 86vw); padding: 6px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--raised); box-shadow: var(--shadow); }
.bsy-menu button { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; border-radius: 10px; background: none; text-align: start; }
.bsy-menu button:hover, .bsy-menu button:focus-visible { background: rgba(255,255,255,.06); }
.bsy-menu span { display: grid; line-height: 1.5; }
.bsy-menu b { font-size: 13.5px; font-weight: 700; }
.bsy-menu small { color: var(--ink-3); font-size: 11.5px; }
.bsy-menu svg { color: var(--firoozeh-2); }
.bsy-menu-sep { height: 1px; margin: 5px 8px; background: var(--line); }
.bsy-menu .bsy-check { position: relative; flex: none; width: 34px; height: 20px; margin-inline-start: auto; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); transition: background .15s; }
.bsy-menu .bsy-check::after { content: ""; position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); transition: transform .15s; }
.bsy-menu [aria-checked="true"] .bsy-check { border-color: var(--firoozeh); background: color-mix(in srgb,var(--bs-primary,#dc2626) 30%,transparent); }
.bsy-menu [aria-checked="true"] .bsy-check::after { transform: translateX(-14px); background: var(--firoozeh-2); }
.bsy-modes { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 10px 0; }
.bsy-mode { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px; background: color-mix(in srgb,var(--bs-primary,#dc2626) 15%,transparent); color: var(--firoozeh-2); font-size: 12.5px; font-weight: 700; }
.bsy-page .bsy-mode svg { width: 15px; height: 15px; }
.bsy-mode button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 15px; line-height: 1; }
.bsy-mode button:hover { background: rgba(255,255,255,.1); }
.bsy-jump { position: absolute; bottom: 132px; left: 50%; z-index: 5; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--raised); color: var(--ink); box-shadow: var(--shadow); transform: translateX(-50%); }
.bsy-page .bsy-jump svg { width: 18px; height: 18px; }

.bsy-switch { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.bsy-switch input { position: absolute; opacity: 0; }
.bsy-switch-ui { position: relative; width: 32px; height: 18px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line-2); transition: background .15s; }
.bsy-switch-ui::after { content: ""; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--ink-3); transition: transform .15s, background .15s; }
.bsy-switch input:checked + .bsy-switch-ui { background: color-mix(in srgb,var(--bs-primary,#dc2626) 25%,transparent); border-color: var(--firoozeh); }
.bsy-switch input:checked + .bsy-switch-ui::after { transform: translateX(-14px); background: var(--firoozeh-2); }
.bsy-switch input:focus-visible + .bsy-switch-ui { outline: 2px solid var(--firoozeh-2); outline-offset: 2px; }

/* پیوست‌ها */
.bsy-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.bsy-composer .bsy-attachments { margin: 0; padding: 12px 10px 0; }
.bsy-att { position: relative; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 4px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); font-size: 12.5px; }
.bsy-att img { width: 48px; height: 48px; border-radius: 9px; object-fit: cover; }
.bsy-att .bsy-att-doc { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 9px; background: var(--raised); color: var(--firoozeh-2); font-size: 11px; font-weight: 800; }
.bsy-att span { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-inline-end: 22px; }
.bsy-att small { display: block; color: var(--ink-3); font-size: 11px; }
.bsy-att button { position: absolute; top: -7px; inset-inline-end: -7px; display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1; }
.bsy-att.is-loading { color: var(--ink-3); }
.bsy-att progress { width: 90px; height: 4px; accent-color: var(--firoozeh); }
.bsy-att.is-error { border-color: var(--danger); color: var(--danger); }

/* ═══════════ ابزار تخصصی ═══════════ */
.bsy-studio, .bsy-agents-view { max-width: 1180px; margin: 0 auto; padding: 18px 18px 60px; }
.bsy-crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; padding: 4px 0; border: 0; background: none; color: var(--ink-2); font-size: 13px; }
.bsy-crumb:hover { color: var(--ink); }
.bsy-studio-grid { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
.bsy-studio-form { display: grid; gap: 20px; }
.bsy-studio-head { display: flex; gap: 14px; align-items: flex-start; }
.bsy-studio-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 15px; background: var(--raised); color: var(--firoozeh-2); }
.bsy-studio-icon svg { width: 26px; height: 26px; }
.bsy-studio-head h1 { margin: 0 0 4px; font-size: 23px; font-weight: 900; line-height: 1.45; }
.bsy-studio-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.bsy-field { display: grid; gap: 8px; }
.bsy-field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 14px; }
.bsy-field-label small { color: var(--ink-3); font-weight: 400; font-size: 12px; }
.bsy-studio-form textarea, .bsy-more textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); resize: vertical; line-height: 1.85; }
.bsy-studio-form textarea:focus { border-color: var(--firoozeh); outline: none; }
.bsy-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.bsy-slot { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 8px; border: 1.5px dashed var(--line-2); border-radius: var(--r-m); background: transparent; color: var(--ink-3); font-size: 12px; line-height: 1.55; text-align: center; }
.bsy-slot:hover, .bsy-slot.is-drop { border-color: var(--firoozeh); color: var(--ink); background: color-mix(in srgb,var(--bs-primary,#dc2626) 5%,transparent); }
.bsy-slot svg { width: 22px; height: 22px; margin-bottom: 2px; color: var(--firoozeh-2); }
.bsy-slot.is-filled { padding: 0; border-style: solid; border-color: var(--line); overflow: hidden; }
.bsy-slot.is-filled img { width: 100%; height: 100%; object-fit: cover; }
.bsy-slot.is-filled .bsy-slot-cap { position: absolute; inset: auto 0 0; padding: 14px 6px 4px; background: linear-gradient(180deg, transparent, rgba(5,10,22,.85)); color: #fff; font-size: 11px; }
.bsy-slot .bsy-slot-x { position: absolute; top: 5px; inset-inline-end: 5px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(5,10,22,.75); color: #fff; }
.bsy-slot.is-loading progress { width: 70%; accent-color: var(--firoozeh); }
.bsy-slot .bsy-q-badge { position: absolute; top: 5px; inset-inline-start: 5px; padding: 0 6px; border-radius: 6px; background: var(--ochre); color: #2a1a00; font-size: 10.5px; }
.bsy-doc-row { display: flex; }
.bsy-more { border: 1px solid var(--line); border-radius: var(--r-m); padding: 0 14px; }
.bsy-more[open] { padding-bottom: 14px; }
.bsy-more summary { padding: 12px 0; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.bsy-more summary:hover { color: var(--ink); }
.bsy-depth { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 0; padding: 0; border: 0; font-size: 13.5px; color: var(--ink-2); }
.bsy-depth legend { width: 100%; margin-bottom: 4px; color: var(--ink); font-weight: 700; font-size: 13.5px; }
.bsy-depth label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.bsy-depth input { accent-color: var(--firoozeh); }
.bsy-studio-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bsy-run { min-height: 50px; padding: 0 26px; font-size: 15px; }
.bsy-outputs { color: var(--ink-3); font-size: 12.5px; line-height: 1.9; }
.bsy-outputs b { color: var(--ink-2); font-weight: 700; }

/* گزارش */
.bsy-report { position: sticky; top: calc(var(--top-h) + 14px); min-height: 360px; padding: 22px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); outline: none; }
.bsy-report-empty { display: grid; place-content: center; min-height: 316px; max-width: 380px; margin: 0 auto; text-align: center; }
.bsy-report-empty h2 { margin: 0 0 8px; color: var(--ink-2); font-size: 17px; font-weight: 700; }
.bsy-report-empty p { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.bsy-report-body { display: grid; gap: 18px; }
.bsy-r-head h2 { margin: 0 0 6px; font-size: 21px; font-weight: 900; line-height: 1.5; }
.bsy-r-head p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.95; }
.bsy-r-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.bsy-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; background: var(--raised); font-size: 13px; }
.bsy-pill.is-period { background: color-mix(in srgb,var(--bs-primary,#dc2626) 14%,transparent); color: var(--firoozeh-2); font-weight: 700; }
.bsy-pill.is-warn { background: var(--ochre-bg); color: var(--ochre); }
.bsy-meter { display: grid; gap: 6px; }
.bsy-meter-head { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--ink-2); }
.bsy-meter-head b { color: var(--ink); font-size: 15px; }
.bsy-meter-track { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bsy-meter-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--ochre), var(--firoozeh)); }
.bsy-meter small { color: var(--ink-3); font-size: 12px; }
.bsy-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin: 0; border-top: 1px solid var(--line); }
.bsy-facts div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.bsy-facts dt { color: var(--ink-3); font-size: 12.5px; }
.bsy-facts dd { margin: 0; font-size: 14.5px; font-weight: 600; }
.bsy-r-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; font-weight: 800; }
.bsy-r-sec h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--firoozeh); transform: rotate(45deg); }
.bsy-r-sec.is-warn h3::before { background: var(--ochre); }
.bsy-r-sec ul, .bsy-r-sec ol { margin: 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 14.5px; list-style: disc; }
.bsy-r-sec li::marker { color: var(--firoozeh); }
.bsy-r-sec.is-warn li::marker { color: var(--ochre); }
.bsy-r-sec li { margin-bottom: 4px; }
.bsy-r-sec.is-warn { padding: 12px 14px; border-radius: var(--r-m); background: var(--ochre-bg); }
.bsy-r-sec.is-warn ul { color: #f1d9a8; }
.bsy-bars { display: grid; gap: 10px; }
.bsy-bar { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 42px; align-items: center; gap: 10px; font-size: 13px; }
.bsy-bar span { color: var(--ink-2); }
.bsy-bar i { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bsy-bar i b { display: block; height: 100%; background: var(--bar, var(--firoozeh)); }
.bsy-bar em { font-style: normal; text-align: end; color: var(--ink); }
.bsy-timeline { display: grid; gap: 6px; }
.bsy-tl-track { position: relative; display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--bg); direction: ltr; }
.bsy-tl-track span { border-inline-end: 1px solid var(--surface); }
.bsy-tl-track span.is-match { background: color-mix(in srgb,var(--bs-primary,#dc2626) 35%,transparent); }
.bsy-tl-marker { position: absolute; top: -2px; bottom: -2px; width: 3px; border-radius: 2px; background: var(--ochre); transform: translateX(-50%); }
.bsy-tl-labels { display: flex; direction: ltr; font-size: 10.5px; color: var(--ink-3); }
.bsy-tl-labels span { overflow: hidden; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.bsy-tl-labels span.is-match { color: var(--firoozeh-2); font-weight: 700; }
.bsy-r-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.bsy-r-actions .bsy-btn { min-height: 38px; font-size: 13px; }
.bsy-visual figure { margin: 0; }
.bsy-visual img { width: 100%; border-radius: var(--r-m); }
.bsy-visual figcaption { margin-top: 6px; color: var(--ink-3); font-size: 12.5px; }
.bsy-progress { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-m); background: var(--bg); color: var(--ink-2); font-size: 14px; }
.bsy-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.bsy-steps li { display: flex; align-items: center; gap: 10px; color: var(--ink-3); }
.bsy-steps li::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--line-2); border-radius: 50%; }
.bsy-steps li.is-done { color: var(--ink-2); }
.bsy-steps li.is-done::before { border-color: var(--firoozeh); background: var(--firoozeh); }
.bsy-steps li.is-now { color: var(--ink); }
.bsy-steps li.is-now::before { border-color: var(--firoozeh); animation: bsy-pulse 1s infinite; }
@keyframes bsy-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb,var(--bs-primary,#dc2626) 25%,transparent); } }

/* دستیارهای شخصی (نشانه‌گذاری از inc/ai-agents.php) */
.bsy-agents-view .bs-agents { display: block !important; }
.bsy-agents-view .bs-agents header h2 { margin: 0 0 6px; color: var(--ink); font-size: 24px; font-weight: 900; }
.bsy-agents-view .bs-agents header small { color: var(--firoozeh-2); }
.bsy-agents-view .bs-agents header p { color: var(--ink-2); }
.bsy-agents-view .bs-agents-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; margin-top: 18px; }
.bsy-agents-view #bs-agent-form { display: grid; gap: 14px; }
.bsy-agents-view #bs-agent-form label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
.bsy-agents-view #bs-agent-form input, .bsy-agents-view #bs-agent-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface); font-weight: 400; }
.bsy-agents-view .bs-agent-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.bsy-agents-view .bs-agent-presets button { padding: 5px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--ink-2); font-size: 12.5px; }
.bsy-agents-view .bs-agent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bsy-agents-view .bs-agent-actions button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; background: none; font-size: 13px; }
.bsy-agents-view .bs-agent-actions button[type="submit"], .bsy-agents-view #bs-agent-list .bs-agent-actions button:first-child { border-color: transparent; background: var(--firoozeh); color: var(--on-firoozeh); font-weight: 700; }
.bsy-agents-view #bs-agent-list { display: grid; gap: 10px; }
.bsy-agents-view #bs-agent-list article { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.bsy-agents-view #bs-agent-list h4 { margin: 0 0 4px; font-size: 15px; }
.bsy-agents-view #bs-agent-list p { margin: 0 0 4px; color: var(--ink-2); font-size: 13.5px; }
.bsy-agents-view #bs-agent-list small { display: block; margin-bottom: 10px; color: var(--ink-3); font-size: 12px; }
.bsy-agents-view #bs-agent-status[data-state="error"] { color: var(--danger); }
.bsy-agents-view #bs-agent-status[data-state="success"] { color: var(--ok); }

/* اعلان کوتاه */
.bsy-toast { position: fixed; bottom: 22px; left: 50%; z-index: 120; max-width: min(92vw, 440px); padding: 10px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 14px; box-shadow: var(--shadow); transform: translateX(-50%); }
.bsy-in-chat .bsy-toast { bottom: auto; top: calc(var(--top-h) + var(--ab) + 64px); }
.bsy-toast.is-error { background: #ffd6d6; color: #5a0d0d; }

/* ═══════════ واکنش‌گرا ═══════════ */
@media (max-width: 960px) {
    .bsy-tools, .bsy-tools[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bsy-studio-grid { grid-template-columns: 1fr; }
    .bsy-report { position: static; min-height: 0; }
    .bsy-report-empty { min-height: 0; padding: 10px 0; }
    .bsy-agents-view .bs-agents-layout { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .bsy-chat { grid-template-columns: 1fr; }
    .bsy-side { position: fixed; inset: 0 0 0 auto; z-index: 60; width: min(86vw, 320px); transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow); }
    .bsy-chat.is-side-open .bsy-side { transform: none; }
    .bsy-chat.is-side-open .bsy-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(3,8,20,.55); }
    .bsy-side-close, .bsy-side-open { display: inline-grid; }
    .bsy-chat-ad { display: block; max-height: 110px; overflow: auto; padding: 6px 12px; border-bottom: 1px solid var(--line); }
    .bsy-thread { padding: 18px 14px 24px; }
    .bsy-composer { padding-inline: 10px; }
    .bsy-top-back span { display: none; }
}
@media (max-width: 560px) {
    .bsy-page { font-size: 14.5px; }
    .bsy-hero { padding: 38px 14px 32px; }
    .bsy-tools, .bsy-tools[data-count="4"] { grid-template-columns: 1fr; gap: 8px; }
    .bsy-tool { grid-template-columns: 44px 1fr; grid-template-rows: auto auto auto; column-gap: 12px; row-gap: 2px; padding: 14px; }
    .bsy-tool-icon { grid-row: 1 / span 3; margin: 0; }
    .bsy-tool small { -webkit-line-clamp: 2; }
    .bsy-tool-need { margin-top: 4px; }
    .bsy-feature { grid-template-columns: 1fr; margin-bottom: 30px; }
    .bsy-feature-card { padding: 16px; }
    .bsy-ideas { grid-template-columns: 1fr; gap: 8px; }
    .bsy-idea { padding: 10px 12px; }
    .bsy-page .bsy-msg-bot .bsy-avatar { display: none; }
    .bsy-msg-name { margin-top: 0; }
    .bsy-recent-list button:nth-child(n+4) { display: none; }
    .bsy-idea small { display: none; }
    .bsy-welcome-mark { width: 64px; height: 64px; }
    .bsy-page .bsy-welcome-mark img { width: 50px; height: 50px; }
    .bsy-welcome h2 { margin-top: 14px; font-size: 20px; }
    .bsy-welcome > p { margin-bottom: 18px; font-size: 14px; }
    .bsy-welcome { padding-top: 4vh; }
    .bsy-jump { bottom: 118px; }
    .bsy-catalog { padding: 24px 14px 50px; }
    .bsy-studio, .bsy-agents-view { padding: 14px 14px 50px; }
    .bsy-report { padding: 16px; border-radius: var(--r-m); }
    .bsy-md { font-size: 15px; }
    .bsy-msg-user .bsy-bubble { max-width: 92%; }
    .bsy-quota { display: none; }
    .bsy-bar { grid-template-columns: 96px 1fr 38px; }
}
@media (max-width: 560px) {
    .bsy-slots { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
    .bsy-slot { font-size: 11px; padding: 4px; }
    .bsy-tl-labels span:not(.is-match) { visibility: hidden; }
}
.bsy-page { overflow-x: hidden; }
.bsy-studio-grid > * { min-width: 0; }
@media (hover: none) { .bsy-conv-actions { opacity: 1; } }
@media (max-width: 820px) { .admin-bar .bsy-side { top: 46px; } }
@media (min-width: 783px) and (max-width: 820px) { .admin-bar .bsy-side { top: 32px; } }
/* صفحهٔ شروع گفتگو باید بدون اسکرول در صفحه‌های کوچک جا شود */
@media (max-width: 560px) {
    .bsy-welcome { padding: 2vh 0 0; }
    .bsy-welcome-mark { width: 52px; height: 52px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line-2), 0 0 0 6px color-mix(in srgb,var(--bs-primary,#dc2626) 7%,transparent); }
    .bsy-page .bsy-welcome-mark img { width: 40px; height: 40px; border-radius: 12px; }
    .bsy-welcome h2 { margin: 10px 0 4px; font-size: 17px; }
    .bsy-welcome > p { margin-bottom: 12px; font-size: 12.5px; line-height: 1.8; }
    .bsy-ideas { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .bsy-idea { gap: 6px; padding: 8px 9px; border-radius: 11px; }
    .bsy-idea > svg { width: 15px; height: 15px; margin-top: 2px; }
    .bsy-idea b { font-size: 12px; font-weight: 600; line-height: 1.65; }
    .bsy-idea small { display: none; }
    .bsy-thread { padding-top: 12px; }
}
@media (max-width: 560px) and (max-height: 700px) {
    .bsy-welcome > p { display: none; }
    .bsy-welcome h2 { margin-bottom: 10px; }
    .bsy-composer-foot { padding-top: 3px; }
    .bsy-composer-foot .bsy-hint { font-size: 10.5px; }
}
@media (max-height: 600px) {
    .bsy-welcome-mark { display: none; }
    .bsy-welcome h2 { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .bsy-page *, .bsy-page *::before, .bsy-page *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Model selection: scoped controls, keyboard focus and small-screen layout. */
.bsy-model-picker{display:grid;grid-template-columns:auto minmax(0,1fr);gap:5px 12px;align-items:center;padding:12px 14px;margin-bottom:12px;border:1px solid var(--line-2);border-radius:var(--r-m);background:var(--surface);min-width:0}
.bsy-model-picker label{font-size:12px;font-weight:700;color:var(--ink-2)}
.bsy-model-picker select{width:100%;min-width:0;max-width:100%;min-height:42px;padding:7px 10px;background:var(--raised);border:1px solid var(--line-2);border-radius:8px;color:var(--ink);font:inherit;font-size:12px;direction:ltr;text-align:left}
.bsy-model-picker select:focus-visible{outline:2px solid var(--firoozeh);outline-offset:3px}
.bsy-model-picker select:disabled{opacity:.6;cursor:wait}
.bsy-model-picker small{grid-column:1/-1;font-size:10px;line-height:1.7;color:var(--ink-3)}
.bsy-model-picker optgroup,.bsy-model-picker option{background:#152443;color:#eef2fa}
.bsy-model-badge{display:block;width:fit-content;max-width:100%;overflow-wrap:anywhere;margin:0 0 10px;padding:3px 9px;border:1px solid var(--line);border-radius:8px;color:var(--firoozeh-2);font-size:10px;unicode-bidi:plaintext}
.bsy-composer>.bsy-model-picker{margin-bottom:8px;padding:8px 12px}
@media(max-width:480px){.bsy-model-picker{grid-template-columns:1fr;gap:4px}.bsy-model-picker select{font-size:12px}.bsy-composer>.bsy-model-picker{grid-template-columns:auto minmax(0,1fr)}.bsy-composer .bsy-model-picker small{font-size:9px}}

/* Compact model control and accessible mobile bottom sheet. */
.bsy-model-picker.is-enhanced{display:block;padding:0;margin-block:0 8px;border:0;border-radius:0;background:none}
.bsy-composer>.bsy-model-picker.is-enhanced{padding:0;margin-inline:auto}
.bsy-model-picker.is-enhanced>label,.bsy-model-picker.is-enhanced>small,.bsy-model-picker.is-enhanced>select[hidden]{display:none}
.bsy-model-trigger{display:flex;align-items:center;gap:9px;width:100%;min-width:0;min-height:44px;padding:7px 11px;border:1px solid var(--line-2);border-radius:13px;background:var(--surface);color:var(--ink);font:inherit;text-align:right;cursor:pointer}
.bsy-model-trigger:disabled{cursor:default;opacity:1;color:var(--ink-2)}
.bsy-model-mark{display:grid;place-items:center;flex:none;width:25px;height:25px;border-radius:8px;background:color-mix(in srgb,var(--bs-primary,#dc2626) 10%,transparent);color:var(--firoozeh-2);font:700 10px/1 sans-serif;letter-spacing:.4px}
.bsy-model-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;font-size:12px;line-height:1.6;font-weight:600}
.bsy-model-access{flex:none;font-size:10px;line-height:1.5;color:var(--ink-3)}
.bsy-model-trigger:focus-visible,.bsy-model-option:focus-visible,.bsy-model-close:focus-visible{outline:2px solid var(--firoozeh);outline-offset:3px}
.bsy-model-sheet{box-sizing:border-box;width:min(540px,calc(100vw - 32px));max-height:min(720px,85vh);max-height:min(720px,85dvh);padding:20px;margin:auto;border:1px solid #344664;border-radius:24px;background:#111f39;color:#eef2fa;font-family:Vazirmatn,Vazir,Tahoma,sans-serif;box-shadow:0 24px 90px #0008;overflow:hidden}
.bsy-model-sheet[open]{display:flex;flex-direction:column;gap:14px}
.bsy-model-sheet::backdrop{background:rgba(3,10,23,.72)}
.bsy-model-handle{display:none;align-self:center;flex:none;width:34px;height:4px;border-radius:8px;background:#4c607d}
.bsy-model-sheet-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;flex:none}
.bsy-model-sheet h2{margin:0;font-size:17px;line-height:1.8;color:#eef2fa}
.bsy-model-sheet-head p{margin:3px 0 0;color:#a7b6cd;font-size:11px;line-height:1.7}
.bsy-model-close{display:grid;place-items:center;width:44px;height:44px;flex:none;background:#1d3052;color:#cdd8e9;border:1px solid #344664;border-radius:12px;font:26px/1 sans-serif;cursor:pointer}
.bsy-model-search{box-sizing:border-box;flex:none;width:100%;min-height:44px;padding:10px 13px;border:1px solid #344664;border-radius:12px;background:#0c1930;color:#eef2fa;font:inherit;font-size:16px;outline-offset:2px}
.bsy-model-search:focus{outline:2px solid var(--bs-accent,#f59e0b)}
.bsy-model-search::placeholder{color:#899ebc;font-size:12px}
.bsy-model-list{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;display:flex;flex-direction:column;gap:7px;padding:3px}
.bsy-model-option{box-sizing:border-box;display:flex;align-items:center;gap:10px;flex:none;width:100%;min-height:65px;padding:11px 13px;border:1px solid #293d5c;border-radius:13px;background:#182944;color:#eef2fa;font:inherit;text-align:right;cursor:pointer}
.bsy-model-option.is-selected{border-color:var(--bs-accent,#f59e0b);background:var(--surface)}
.bsy-model-option-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.bsy-model-option-copy bdi{font:600 13px/1.5 Vazirmatn,Vazir,Tahoma,sans-serif;overflow-wrap:anywhere}
.bsy-model-option-copy small{color:#a7b6cd;font-size:10px;line-height:1.5}
.bsy-model-tick{flex:none;width:20px;color:var(--bs-accent,#f59e0b);text-align:center;font-size:17px}
.bsy-model-group-title{margin:12px 4px 2px;color:#b7c6db;font:600 11px/1.6 sans-serif;direction:ltr;text-align:right}
.bsy-model-sheet-status{flex:none;margin:0;text-align:center;color:#9eb1cb;font-size:10px;line-height:1.7}
@media(max-width:600px){
 .bsy-model-sheet{width:100%;max-width:100%;margin:auto 0 0;padding:10px 14px max(14px,env(safe-area-inset-bottom));border-radius:24px 24px 0 0;max-height:82vh;max-height:82dvh;border-bottom:0}
 .bsy-model-sheet[open]{gap:12px}.bsy-model-handle{display:block}.bsy-model-sheet h2{font-size:16px}
 .bsy-composer>.bsy-model-picker.is-enhanced{padding:0;margin-bottom:6px}
 .bsy-model-trigger{min-height:42px;padding:6px 10px}.bsy-model-value{font-size:11px}
}

/* Subscription prompt stays in the view flow, above the composer on chat. */
.bsy-subscription-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;margin-block:0 10px;border:1px solid var(--line-2);border-radius:14px;background:var(--surface);color:var(--ink);text-align:right}
.bsy-subscription-banner>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.bsy-subscription-banner strong{font-size:13px}.bsy-subscription-banner span{font-size:11px;color:var(--ink-2);line-height:1.7}
.bsy-subscription-banner .bsy-btn{flex:none;font-size:12px;min-height:44px;padding-inline:14px}
@media(max-width:480px){.bsy-subscription-banner{gap:8px;padding:10px}.bsy-subscription-banner strong{font-size:12px}.bsy-subscription-banner span{font-size:10px}.bsy-subscription-banner .bsy-btn{font-size:11px;padding-inline:10px}}
