/* Ask Loupe, the help panel on a signed-in client page (ask.js; ASK-LOUPE-FEASIBILITY.md part 3). Built on the page's own tokens
   (base.html :root), so light and dark come free. A launcher in the bottom-right corner; a sheet from the bottom on phones, a 380 px card
   on desktop. The Ask RDA button inside an answer is the page's own (.ask, base.html). prefers-reduced-motion stills every animation. */
body.has-ask .wrap{padding-bottom:max(96px,calc(72px + env(safe-area-inset-bottom)))}
.ask-launch{position:fixed;right:16px;bottom:calc(16px + env(safe-area-inset-bottom));z-index:60;display:inline-flex;align-items:center;gap:8px;padding:7px 16px 7px 9px;border-radius:999px;
  background:var(--panel2);color:var(--ink);border:1px solid var(--line);box-shadow:var(--shadow);font:800 14px/1 Nunito,system-ui,sans-serif;cursor:pointer;transition:transform .15s,border-color .15s}
.ask-launch:hover{border-color:var(--accent);transform:translateY(-1px)}
.ask-launch:focus-visible{outline:3px solid rgba(232,55,45,.55);outline-offset:2px}
.ask-launch img{width:30px;height:30px;display:block}
html.ask-open .ask-launch{visibility:hidden}
.ask-root{position:fixed;inset:0;z-index:100;pointer-events:none}
.ask-root[hidden]{display:none}
.ask-backdrop{position:absolute;inset:0;background:rgba(27,21,20,.35);display:none;pointer-events:auto}
.ask-card{position:absolute;right:16px;bottom:16px;width:380px;max-height:min(640px,calc(100% - 230px));display:flex;flex-direction:column;pointer-events:auto;outline:none;
  background:var(--bg);color:var(--ink);border:1px solid var(--line);border-radius:16px;box-shadow:0 18px 50px rgba(0,0,0,.28);overflow:hidden;animation:askRise .22s ease-out}
@keyframes askRise{from{opacity:0;transform:translateY(10px)}}
.ask-head{display:flex;align-items:center;gap:10px;padding:10px 10px 10px 14px;border-bottom:1px solid var(--line);background:var(--panel)}
.ask-head img{width:34px;height:34px;display:block;flex:none}
.ask-head__title{display:flex;flex-direction:column;min-width:0;flex:1}
.ask-head__title strong{font:700 16px/1.1 Rubik,system-ui,sans-serif}
.ask-head__title span{color:var(--muted);font-size:12px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ask-iconbtn{flex:none;height:32px;min-width:32px;padding:0 10px;border-radius:8px;border:1px solid var(--line);background:var(--bg);color:var(--ink);font:700 12.5px/1 Nunito,system-ui,sans-serif;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.ask-iconbtn:hover{border-color:var(--accent)}
.ask-iconbtn[hidden],.ask-intro[hidden]{display:none}
.ask-iconbtn svg{width:14px;height:14px}
.ask-thread{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:14px 14px 6px;min-height:150px;scroll-behavior:smooth}
.ask-intro p{margin:0 0 10px;color:var(--muted);font-size:13.5px}
.ask-chips{display:flex;flex-wrap:wrap;gap:8px}
.ask-chip{background:var(--panel);border:1px solid var(--line);border-radius:999px;padding:7px 12px;color:var(--ink);font:700 13px/1.2 Nunito,system-ui,sans-serif;cursor:pointer;text-align:left}
.ask-chip:hover{border-color:var(--accent)}
.ask-q{margin:0 0 12px auto;width:fit-content;max-width:88%;background:var(--panel);border:1px solid var(--line);border-radius:14px 14px 4px 14px;padding:8px 12px;font-size:14px;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.ask-a{display:grid;grid-template-columns:28px 1fr;gap:10px;margin:0 0 14px}
.ask-a img{width:28px;height:28px;margin-top:1px}
.ask-body{min-width:0;font-size:14.5px;line-height:1.55}
.ask-body p{margin:0 0 8px;overflow-wrap:anywhere}
.ask-body p:last-child{margin-bottom:0}
.ask-body .ask{margin:4px 0 2px}
.ask-wait{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;min-height:22px}
.ask-wait i{width:6px;height:6px;border-radius:50%;background:var(--accent);animation:askPulse 1.2s infinite ease-in-out}
.ask-wait i:nth-of-type(2){animation-delay:.15s}.ask-wait i:nth-of-type(3){animation-delay:.3s}
@keyframes askPulse{0%,80%,100%{opacity:.25;transform:scale(.8)}40%{opacity:1;transform:none}}
.ask-caret{display:inline-block;width:2px;height:1em;background:var(--accent);vertical-align:-2px;margin-left:1px;animation:askBlink 1s steps(2) infinite}
@keyframes askBlink{50%{opacity:0}}
.ask-err{background:var(--fail-bg);border:1px solid var(--fail);border-radius:8px;padding:8px 12px;font-size:13.5px;margin:4px 0 0}
.ask-err a{color:var(--accent-text);font-weight:700}
.ask-err .ask-iconbtn{margin-top:6px}
.ask-compose{display:flex;align-items:flex-end;gap:8px;padding:10px 12px;border-top:1px solid var(--line);background:var(--bg)}
.ask-compose textarea{flex:1;min-width:0;width:auto;resize:none;max-height:120px;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--bg);color:var(--ink);font:inherit;font-size:15px;line-height:1.4}
.ask-compose textarea:focus{outline:none;border-color:var(--accent)}
.ask-send{flex:none;width:38px;height:38px;padding:0;border-radius:50%;background:var(--accent);color:#fff;border:0;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.ask-send:disabled{opacity:.45;cursor:default}
.ask-send svg{width:18px;height:18px}
.ask-foot{margin:0;padding:0 14px 10px;color:var(--muted);font-size:11.5px;line-height:1.4}
/* phones: a sheet from the bottom over a dimmed page; ask.js sizes .ask-root to the visible viewport while the keyboard is up */
@media (max-width:600px){
  html.ask-open,html.ask-open body{overflow:hidden}
  .ask-backdrop{display:block;animation:askFade .2s ease}
  .ask-card{left:0;right:0;bottom:0;width:auto;max-height:min(88%,calc(100% - 40px));border-radius:18px 18px 0 0;border-bottom:0;padding-bottom:env(safe-area-inset-bottom);animation:askSheet .26s cubic-bezier(.2,.7,.3,1)}
  .ask-compose textarea{font-size:16px}
}
@keyframes askFade{from{opacity:0}}
@keyframes askSheet{from{transform:translateY(100%)}}
@media (prefers-reduced-motion:reduce){.ask-card,.ask-backdrop,.ask-launch{animation:none;transition:none}.ask-caret,.ask-wait i{animation:none}.ask-thread{scroll-behavior:auto}}
