/* Ask AI panel content (js/ask-ai.js). The drawer itself, its header and its buttons are in adverity.css. */
.dx-ask { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.dx-ask__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--adv-space-medium); overscroll-behavior: contain; }

/* empty state */
.dx-ask__empty { padding: var(--adv-space-large) 0 var(--adv-space-medium); }
.dx-ask__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--adv-text-strong); }
.dx-ask__lede { margin: var(--adv-space-xx-small) 0 var(--adv-space-medium); font-size: 14px; line-height: 21px; color: var(--adv-text-secondary); }
.dx-ask__suggest { display: grid; gap: var(--adv-space-x-small); margin: 0; padding: 0; list-style: none; }
.dx-ask__suggest-btn {
  width: 100%; padding: var(--adv-space-x-small) var(--adv-space-small); text-align: left;
  font: inherit; font-size: 14px; line-height: 21px; color: var(--adv-text);
  border: 1px solid var(--adv-border); border-radius: var(--adv-radius-medium); background: var(--adv-surface); cursor: pointer;
  transition: border-color var(--dx-duration) var(--dx-ease), background var(--dx-duration) var(--dx-ease);
}
.dx-ask__suggest-btn:hover { border-color: var(--adv-brand); background: var(--adv-brand-tint); }

/* messages */
.dx-ask__list { display: grid; gap: var(--adv-space-medium); }
.dx-ask__msg p { margin: 0; }
.dx-ask__msg--user { justify-self: end; max-width: 88%; padding: var(--adv-space-x-small) var(--adv-space-small); border-radius: var(--adv-radius-large); background: var(--adv-brand-tint); color: var(--adv-text-strong); font-size: 14px; line-height: 21px; overflow-wrap: anywhere; }
.dx-ask__answer { font-size: 14px; line-height: 22px; color: var(--adv-text); overflow-wrap: anywhere; }
.dx-ask__answer > :first-child { margin-top: 0; }
.dx-ask__answer p { margin: 0 0 var(--adv-space-x-small); }
.dx-ask__answer ul, .dx-ask__answer ol { margin: 0 0 var(--adv-space-x-small); padding-left: 1.3em; }
.dx-ask__answer li { margin: 2px 0; }
.dx-ask__answer h4 { margin: var(--adv-space-small) 0 var(--adv-space-xx-small); font-size: 14px; line-height: 22px; font-weight: 600; color: var(--adv-text-strong); }
.dx-ask__answer a { color: var(--adv-brand); text-decoration: underline; text-underline-offset: 2px; }
.dx-ask__answer code { padding: 1px 5px; border-radius: var(--adv-radius-x-small); background: var(--adv-brand-tint); font-family: var(--adv-font-mono); font-size: 12.5px; }
.dx-ask__answer pre { margin: 0 0 var(--adv-space-x-small); padding: var(--adv-space-small); overflow-x: auto; border-radius: var(--adv-radius-medium); background: var(--adv-code-bg); color: #fff; }
.dx-ask__answer pre code { padding: 0; background: none; color: inherit; font-size: 12.5px; line-height: 19px; }
.dx-ask__typing { display: inline-flex; gap: 4px; padding: var(--adv-space-x-small) 0; }
.dx-ask__typing span { width: 6px; height: 6px; border-radius: var(--adv-radius-round); background: var(--adv-text-muted); animation: dx-ask-dot 1.2s ease-in-out infinite; }
.dx-ask__typing span:nth-child(2) { animation-delay: 0.15s; }
.dx-ask__typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dx-ask-dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dx-ask__typing span { animation: none; opacity: 0.6; } }

/* sources, chips, feedback */
.dx-ask__sources { margin-top: var(--adv-space-x-small); }
.dx-ask__sources-toggle, .dx-ask__retry { padding: 0; font: inherit; font-size: 13px; color: var(--adv-text-secondary); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.dx-ask__sources-toggle:hover, .dx-ask__retry:hover { color: var(--adv-brand); }
.dx-ask__sources-list { display: grid; gap: var(--adv-space-xx-small); margin: var(--adv-space-x-small) 0 0; padding: 0; list-style: none; }
.dx-ask__sources-list li { display: flex; align-items: baseline; gap: var(--adv-space-x-small); min-width: 0; font-size: 13px; line-height: 20px; }
.dx-ask__sources-list a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--adv-brand); text-decoration: none; }
.dx-ask__sources-list a:hover { text-decoration: underline; }
.dx-ask__chip { flex: none; padding: 1px 7px; border: 1px solid var(--adv-border); border-radius: var(--adv-radius-round); font-size: 11px; line-height: 16px; color: var(--adv-text-secondary); white-space: nowrap; }
.dx-ask__chip--atlas { border-color: var(--adv-brand); color: var(--adv-brand); }
.dx-ask__feedback { display: flex; align-items: center; gap: var(--adv-space-xx-small); margin-top: var(--adv-space-x-small); }
.dx-ask__thumb { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: var(--adv-text-secondary); background: none; border: 1px solid transparent; border-radius: var(--adv-radius-medium); cursor: pointer; }
.dx-ask__thumb:hover { color: var(--adv-text-strong); background: var(--adv-brand-tint); }
.dx-ask__thanks { font-size: 12px; color: var(--adv-text-secondary); }

/* scroll stage with its own "jump to latest" */
.dx-ask__stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.dx-ask__stage .dx-ask__scroll { flex: 1 1 auto; }
.dx-ask__jump { position: absolute; left: 50%; bottom: var(--adv-space-small); transform: translateX(-50%); display: inline-flex; align-items: center; justify-content: center; width: var(--adv-control-md); height: var(--adv-control-md); color: var(--adv-text-secondary); background: var(--adv-surface); border: 1px solid var(--adv-border); border-radius: var(--adv-radius-round); box-shadow: var(--adv-shadow-md); cursor: pointer; }
.dx-ask__jump[hidden] { display: none; }
.dx-ask__jump:hover { color: var(--adv-text-strong); border-color: var(--adv-text-muted); }

/* footer: notice, composer (input on top, toolbar below), legal */
.dx-ask__foot { flex: none; padding: 0 var(--adv-space-small) var(--adv-space-small); background: var(--adv-surface); }
.dx-ask__notice { margin: 0 0 var(--adv-space-x-small); padding: var(--adv-space-x-small) var(--adv-space-small); border-radius: var(--adv-radius-medium); background: var(--adv-brand-tint); font-size: 13px; line-height: 19px; color: var(--adv-text-strong); }
.dx-ask__notice[hidden] { display: none; }
.dx-ask__form { display: flex; flex-direction: column; gap: var(--adv-space-xx-small); padding: var(--adv-space-x-small) var(--adv-space-x-small) var(--adv-space-x-small) var(--adv-space-small); border: 1px solid var(--adv-border); border-radius: var(--adv-radius-large); background: var(--adv-surface); transition: border-color var(--dx-duration) var(--dx-ease), box-shadow var(--dx-duration) var(--dx-ease); }
.dx-ask__form:focus-within { border-color: var(--adv-brand-active); box-shadow: 0 0 0 3px color-mix(in srgb, var(--adv-brand) 18%, transparent); }
.dx-ask__input { display: block; width: 100%; min-height: 44px; max-height: 160px; padding: 2px 0; font: inherit; font-size: 14px; line-height: 22px; color: var(--adv-text); background: none; border: 0; outline: 0; resize: none; }
.dx-ask__input::placeholder { color: var(--adv-text-muted); }
.dx-ask__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--adv-space-x-small); }
.dx-ask__scope { display: flex; flex-wrap: wrap; gap: var(--adv-space-xx-small); min-width: 0; }
.dx-ask__chipwrap { position: relative; display: inline-flex; min-width: 0; }
.dx-ask__scope-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 var(--adv-space-x-small); font: inherit; font-size: 13px; line-height: 20px; color: var(--adv-text); background: var(--adv-brand-tint); border: 1px solid transparent; border-radius: var(--adv-radius-medium); cursor: pointer; }
.dx-ask__scope-btn:hover { border-color: var(--adv-text-muted); }
.dx-ask__scope-prefix { color: var(--adv-text-secondary); }
.dx-ask__scope-name { font-weight: 600; color: var(--adv-text-strong); white-space: nowrap; }
.dx-ask__menu { position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 3; min-width: 220px; margin: 0; padding: var(--adv-space-xx-small); list-style: none; background: var(--adv-surface); border: 1px solid var(--adv-border); border-radius: var(--adv-radius-large); box-shadow: var(--adv-shadow-md); }
.dx-ask__menu-item { display: flex; align-items: baseline; justify-content: space-between; gap: var(--adv-space-small); padding: 6px var(--adv-space-x-small); font-size: 14px; line-height: 20px; color: var(--adv-text); border-radius: var(--adv-radius-medium); cursor: pointer; }
.dx-ask__menu-item:hover, .dx-ask__menu-item:focus-visible { background: var(--adv-brand-tint); outline: 0; }
.dx-ask__menu-item.is-active .dx-ask__menu-name { font-weight: 600; color: var(--adv-brand); }
.dx-ask__menu-hint { font-size: 12px; color: var(--adv-text-secondary); }
.dx-ask__send { flex: none; display: inline-flex; align-items: center; justify-content: center; width: var(--adv-control-md); height: var(--adv-control-md); color: var(--adv-surface); background: var(--adv-brand); border: 1px solid transparent; border-radius: var(--adv-radius-round); cursor: pointer; }
.dx-ask__send:hover:not(:disabled) { background: var(--adv-brand-hover); }
.dx-ask__send:disabled { opacity: 0.4; cursor: default; }
.dx-ask__send.is-stop { color: var(--adv-text-strong); background: var(--adv-surface); border-color: var(--adv-border); }
.dx-ask__send.is-stop:hover { border-color: var(--adv-text-muted); background: var(--adv-surface); }
/* 16px keeps iOS Safari from zooming the page when the composer takes focus */
@media (max-width: 767px) { .dx-ask__input { font-size: 16px; } }
.dx-ask__legal { margin: var(--adv-space-x-small) var(--adv-space-xx-small) 0; font-size: 11px; line-height: 16px; color: var(--adv-text-secondary); }
.dx-ask__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dx-ask__copy { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: var(--adv-text-secondary); background: none; border: 1px solid transparent; border-radius: var(--adv-radius-medium); cursor: pointer; }
.dx-ask__copy:hover { color: var(--adv-text-strong); background: var(--adv-brand-tint); }
.dx-ask__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dx-ask button:focus-visible, .dx-ask a:focus-visible { outline: 2px solid var(--adv-brand-active); outline-offset: 2px; }
