/* یک کادر، دو حالت: پیش‌فرض جستجوی سریع؛ کلاس ask-mode روی body کادر هوشمند را نشان می‌دهد و فرم جستجو را پنهان می‌کند */
.ask-switch { display: flex; width: max-content; max-width: 100%; margin: 0 auto 12px; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(255, 255, 255, .18); backdrop-filter: blur(4px); }
.ask-switch__btn { font: inherit; font-size: 14px; font-weight: 700; padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: #fff; cursor: pointer; transition: background .15s, color .15s; white-space: nowrap; }
.ask-switch__btn:hover { background: rgba(255, 255, 255, .16); }
.ask-switch__btn.is-active { background: #fff; color: #0a46c2; }
.ask-switch__btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ask-box { display: none; }
body.ask-mode .ask-box { display: block; }
body.ask-mode [data-search-form] { display: none; }
.ask-box { max-width: 760px; margin: 0 auto 18px; padding: 16px; background: #fff; color: #14213d; border-radius: 18px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); text-align: start; }
.ask-box__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ask-box__badge { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; color: #fff; background: linear-gradient(135deg, #0a46c2, #2a78d6); }
.ask-box__title { display: block; font-size: 16px; line-height: 1.5; }
.ask-box__sub { display: block; font-size: 13px; color: #5b6784; line-height: 1.7; }

.ask-box__form { display: flex; gap: 8px; }
.ask-box__input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 13px 14px; border: 1px solid #c9d2e0; border-radius: 12px; background: #fff; color: inherit; transition: border-color .15s, box-shadow .15s; }
.ask-box__input:focus { outline: none; border-color: #2a78d6; box-shadow: 0 0 0 3px rgba(42, 120, 214, .18); }
.ask-box__input:disabled { background: #f3f5f9; color: #6b7691; }
.ask-box__btn { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 112px; transition: opacity .15s; }
.ask-box__btn[disabled] { opacity: .92; cursor: progress; }
.ask-box__spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: ask-spin .7s linear infinite; }
.ask-box.is-busy .ask-box__spinner { display: inline-block; }

.ask-box__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ask-box__chips-label { font-size: 12.5px; color: #6b7691; }
.ask-box__chip { font: inherit; font-size: 13px; padding: 5px 11px; border: 1px solid #d5dcea; border-radius: 999px; background: #f6f8fc; color: #26365c; cursor: pointer; transition: background .15s, border-color .15s; }
.ask-box__chip:hover { background: #eaf1fd; border-color: #9db8e6; }
.ask-box.is-busy .ask-box__chips { opacity: .5; pointer-events: none; }

.ask-box [hidden] { display: none !important; }
.ask-box__out { margin-top: 14px; border-top: 1px solid #e3e8f0; padding-top: 14px; }
.ask-box__loading { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(90deg, #eef4ff, #f8fbff, #eef4ff); background-size: 200% 100%; animation: ask-shimmer 1.8s linear infinite; }
.ask-box__loading-main { margin: 0; font-weight: 700; line-height: 1.8; }
.ask-box__loading-step { margin: 0; font-size: 13px; color: #5b6784; min-height: 1.4em; transition: opacity .25s; }
.ask-box__dots { display: inline-flex; gap: 5px; flex: none; }
.ask-box__dots i { width: 9px; height: 9px; border-radius: 50%; background: #2a78d6; animation: ask-bounce 1.1s ease-in-out infinite; }
.ask-box__dots i:nth-child(2) { animation-delay: .15s; }
.ask-box__dots i:nth-child(3) { animation-delay: .3s; }

.ask-box__result { animation: ask-in .3s ease-out; }
.ask-box__answer { margin: 0 0 10px; line-height: 2.1; font-size: 16px; white-space: pre-line; }
.ask-box__answer a { font-weight: 700; padding: 0 2px; }
.ask-box.is-warn .ask-box__answer { color: #7a4a00; }
.ask-box__servers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ask-box__server { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid #bfe3cb; background: #eaf8ef; color: #17683a; }
.ask-box__server.is-bad { border-color: #f0d28f; background: #fff6e0; color: #8a5a00; }
.ask-box__sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ask-box__sources a { display: inline-block; padding: 5px 11px; border: 1px solid #d5dcea; border-radius: 10px; background: #f6f8fc; text-decoration: none; overflow-wrap: anywhere; }
.ask-box__sources a:hover { background: #eaf1fd; }
.ask-box__meta { margin: 8px 0 0; font-size: 13px; color: #8a4b00; }

@keyframes ask-spin { to { transform: rotate(360deg); } }
@keyframes ask-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-6px); opacity: 1; } }
@keyframes ask-shimmer { to { background-position: -200% 0; } }
@keyframes ask-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ask-box__loading, .ask-box__dots i, .ask-box__spinner, .ask-box__result { animation: none; } }
@media (max-width: 575px) { .ask-box { padding: 12px; margin-inline: 0; } .ask-box__form { flex-direction: column; } .ask-box__btn { width: 100%; min-height: 46px; } .ask-box__sub { display: none; } }
