/* اسأل فلك: the floating text assistant on the site and the portal. Uses site.css tokens.
   The button sits in the bottom corner (inline end, the left in Arabic); every page that carries it keeps an empty
   strip under its last row (--ask-clear) so the button never sits on content, the footer's last line included. */
:root{--ask-clear:76px}
.ask{position:fixed;inset-inline-end:16px;bottom:16px;z-index:60;font-family:var(--font)}
.ask-fab{display:inline-flex;align-items:center;gap:7px;height:44px;padding:0 15px 0 13px;border:0;border-radius:22px;background:var(--ink);color:#fff;font-size:14px;font-weight:600;box-shadow:0 8px 24px rgba(17,15,13,.2),0 0 0 1px rgba(255,255,255,.16)}
.ask-fab:hover{background:var(--ink2)}
.ask-fab svg{color:var(--or)}
.ask.open .ask-fab{display:none}
.ask-panel{width:min(392px,calc(100vw - 32px));height:min(600px,calc(100vh - 40px));display:flex;flex-direction:column;background:#fff;border:1px solid var(--ln);border-radius:22px;box-shadow:0 24px 60px rgba(17,15,13,.2);overflow:hidden}
.ask-panel[hidden]{display:none}
.ask-head{display:flex;align-items:center;gap:10px;padding:14px 14px 12px 16px;border-bottom:1px solid var(--ln)}
.ask-head b{display:block;font-size:15px}
.ask-head small{display:block;font-size:12px;color:var(--mu);line-height:1.5}
.ask-mark{width:30px;height:30px;border-radius:9px;background:var(--ink);flex:none;position:relative}
.ask-mark span{position:absolute;top:7px;inset-inline-end:7px;width:7px;height:7px;border-radius:50%;background:var(--or)}
.ask-icon{width:32px;height:32px;border-radius:50%;border:0;background:transparent;color:var(--mu);display:inline-flex;align-items:center;justify-content:center;flex:none}
.ask-icon:hover{background:var(--sf);color:var(--ink)}
.ask-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;background:var(--bg)}
.ask-msg{max-width:88%;padding:10px 13px;border-radius:16px;font-size:14px;line-height:1.75;background:#fff;border:1px solid var(--ln);align-self:flex-start;overflow-wrap:anywhere}
.ask-msg.me{align-self:flex-end;background:var(--ink);border-color:var(--ink);color:#fff}
.ask-msg.err{background:var(--rdT);border-color:transparent;color:var(--rd)}
.ask-text{white-space:pre-line}
.ask-acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:9px}
.ask-act{display:inline-flex;align-items:center;height:32px;padding:0 12px;border-radius:16px;background:var(--orT);color:var(--orD);font-size:13px;font-weight:600}
.ask-act:hover{background:var(--or);color:var(--ink)}
.ask-rate{display:flex;align-items:center;gap:4px;margin-top:6px}
.ask-thumb{width:28px;height:28px;border-radius:50%;border:1px solid transparent;background:transparent;color:var(--muL);display:inline-flex;align-items:center;justify-content:center}
.ask-thumb:hover{color:var(--ink);background:var(--sf)}
.ask-thumb.on{color:var(--ink);border-color:var(--ln)}
.ask-rate[data-done] .ask-thumb:not(.on){display:none}
.ask-thanks{font-size:12px;color:var(--mu)}
.ask-typing{display:flex;gap:4px;align-items:center;min-height:38px}
.ask-typing i{width:6px;height:6px;border-radius:50%;background:var(--muL);animation:ask-dot 1.1s infinite ease-in-out}
.ask-typing i:nth-child(2){animation-delay:.15s}.ask-typing i:nth-child(3){animation-delay:.3s}
@keyframes ask-dot{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-3px)}}
.ask-sugs{display:flex;gap:6px;padding:8px 12px 0;overflow-x:auto;scrollbar-width:none}
.ask-sugs:empty{display:none}
.ask-sug{flex:none;height:32px;padding:0 12px;border-radius:16px;border:1px solid var(--ln);background:#fff;font-size:13px;color:var(--ink2);white-space:nowrap}
.ask-sug:hover{border-color:var(--ink)}
.ask-form{display:flex;align-items:flex-end;gap:8px;padding:10px 12px 12px}
.ask-form textarea{flex:1;min-height:42px;max-height:120px;resize:none;padding:10px 13px;border:1px solid var(--ln);border-radius:14px;background:#fff;font-size:14px;line-height:1.5}
.ask-form textarea:focus{outline:none;border-color:var(--ink)}
.ask-send{width:42px;height:42px;border-radius:50%;border:0;background:var(--or);color:var(--ink);display:inline-flex;align-items:center;justify-content:center;flex:none}
[dir=ltr] .ask-send svg{transform:scaleX(-1)}
.ask-form.busy .ask-send{opacity:.5;pointer-events:none}
.ask-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
/* The element the assistant points at on the page. */
.ask-glow{position:relative;z-index:1;outline:3px solid var(--or)!important;outline-offset:3px;border-radius:12px;animation:ask-glow 1.2s ease-in-out 3}
@keyframes ask-glow{50%{outline-color:rgba(243,104,15,.25)}}
/* The strip under the last row of the page: the site footer's bottom bar and the portal's content. */
body:has(.ask) .ftr-bottom{padding-bottom:var(--ask-clear)}
body:has(.ask) .portal .content{padding-bottom:calc(24px + var(--ask-clear))}
@media (max-width:560px){
  :root{--ask-clear:68px}
  .ask{inset-inline-end:12px;bottom:12px}
  .ask.open{inset:auto 0 0 0}
  .ask-panel{width:100vw;height:min(82vh,640px);border-radius:22px 22px 0 0;border-inline:0;border-bottom:0}
  .ask-fab span{display:none}
  .ask-fab{width:48px;height:48px;padding:0;justify-content:center;border-radius:50%}
}
@media (prefers-reduced-motion:reduce){.ask-typing i,.ask-glow{animation:none}}
