/* docs.arvemo.ai "Ask Arvemo" (built with --ask on): the column of the app's chat (src/components/AgentPanel.module.css) in the docs' tokens – ink bubbles for the visitor, a dashed hatched
   bubble for Arvemo. From 1280 px it is a column that pushes the page (the right "on this page" goes while it is open, below 1760 px); narrower it is an overlay with a scrim. */
.ask-btn { gap: 8px; }
.ask-btn .mk { width: 18px; height: 16px; flex: none; overflow: visible; }
.mk path { stroke-width: 4; stroke-linejoin: round; transform-box: fill-box; transform-origin: center; }
.mk .m-adv { fill: #d7d4cd; stroke: #d7d4cd; }
.mk .m-cli { fill: var(--signal); stroke: var(--signal); }
.mk .m-agt { fill: var(--ink); stroke: var(--ink); }
.ask-btn .mk .m-adv { fill: var(--stone); stroke: var(--stone); }

.ask { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--bg); border-left: 1px solid var(--stone); display: grid; grid-template-rows: var(--head-h) minmax(0, 1fr) auto; color: var(--body); }
.ask[hidden] { display: none; }
.ask.in { animation: ask-slide 240ms cubic-bezier(.2, .7, .2, 1) both; }
@keyframes ask-slide { from { transform: translateX(24px); opacity: 0; } }
.ask-scrim { display: none; }

.ask-head { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--stone); min-width: 0; }
.ask-head .mk { width: 22px; height: 20px; flex: none; overflow: visible; }
.ask-head strong { color: var(--ink); font-weight: 600; font-size: 16px; }
.ask-sub { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ask-btns { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.ask button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ask-new { font: 600 10px var(--mono) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--muted) !important; min-height: 36px; padding: 0 8px !important; }
.ask-new:hover { color: var(--signal-ink) !important; }
.ask-close { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink) !important; }
.ask-close:hover { background: var(--faint); }

.ask-log { position: relative; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: grid; align-content: start; gap: 14px; }
.ask-log:focus-visible { outline-offset: -2px; }
#ask-msgs { display: grid; gap: 14px; }
#ask-msgs:empty { display: none; }
.ask-intro { display: grid; gap: 10px; padding: 8px 0; }
.ask-intro[hidden] { display: none; }
.ask-introhead { font-size: 28px; line-height: 1.15; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.ask-intro p { font-size: 14px; line-height: 1.5; color: var(--muted); }
.ask-intro .ask-introhead { color: var(--ink); font-size: 28px; }
.ask-intro ul { list-style: none; padding: 0; display: grid; gap: 6px; margin-top: 8px; }
.ask-q { display: block; width: 100%; text-align: left; font-size: 14.5px !important; line-height: 1.35; padding: 10px 12px !important; box-shadow: inset 0 0 0 1px var(--stone); color: var(--ink) !important; background: var(--surface) !important; }
.ask-q:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.ask-q:disabled { opacity: .5; cursor: default; }

.ask-h { justify-self: end; max-width: 88%; padding: 10px 12px; background: var(--ink); color: var(--bg); font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: ask-rise 200ms ease-out both; }
.ask-a { display: grid; gap: 8px; padding: 12px 12px 12px 20px; border: 1px dashed var(--muted); background: repeating-linear-gradient(-45deg, var(--muted) 0 1px, transparent 1px 4px) left / 5px 100% no-repeat, var(--bg); font-size: 14.5px; line-height: 1.5; animation: ask-rise 200ms ease-out both; min-width: 0; }
.ask-a.err { border-style: solid; border-color: var(--stone); background: var(--surface); color: var(--body); }
.ask-who { display: flex; align-items: center; gap: 8px; }
.ask-who .mk { width: 20px; height: 18px; flex: none; overflow: visible; }
.ask-who strong { color: var(--ink); font-weight: 600; font-size: 15px; }
.ask-state { font: 600 10px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.ask-dots { width: 18px; height: 4px; background: radial-gradient(circle, var(--ink) 2px, transparent 2px) 0 0 / 6px 4px repeat-x; animation: ask-blink .8s steps(2) infinite; }
.ask-txt { min-width: 0; overflow-wrap: anywhere; }
.ask-txt > :last-child { margin-bottom: 0; }
.ask-txt p, .ask-txt ul, .ask-txt ol { margin: 0 0 8px; }
.ask-txt ul, .ask-txt ol { padding-left: 20px; }
.ask-txt li { margin-bottom: 3px; }
.ask-txt strong { color: var(--ink); font-weight: 600; }
.ask-txt code { font: .92em var(--mono); background: var(--faint); padding: 1px 4px; }
.ask-txt a { border-bottom-color: var(--signal); }
.ask-src { display: grid; gap: 2px; margin-top: 2px; }
.ask-src b { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 2px; }
.ask-src a { display: block; border: 0; padding: 7px 9px; background: var(--faint); color: var(--ink); font-size: 13.5px; line-height: 1.3; }
.ask-src a:hover { text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 3px; }

.ask-foot { display: grid; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--stone); }
.ask-form { display: flex; box-shadow: inset 0 0 0 1px var(--ink); background: var(--surface); }
.ask-form:focus-within { box-shadow: inset 0 0 0 2px var(--signal); }
.ask-form textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; padding: 10px 12px; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); max-height: 150px; }
.ask-form textarea::placeholder { color: var(--muted); }
.ask-form button { width: 48px; flex: none; font-size: 18px !important; background: var(--ink) !important; color: var(--bg) !important; }
.ask-form button:disabled { opacity: .3; cursor: default; }
.ask-form button:not(:disabled):hover { background: var(--signal) !important; }
.ask-note { font-size: 12px; line-height: 1.45; color: var(--muted); }
.ask-note a { color: var(--muted); border-bottom-color: var(--stone); }
.ask-note a:hover { color: var(--ink); }

@keyframes ask-rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes ask-blink { 50% { opacity: .25; } }
@keyframes ask-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .15; } }
.think .m-adv { animation: ask-pulse 1.2s ease-in-out infinite; }
.think .m-cli { animation: ask-pulse 1.2s ease-in-out .2s infinite; }
.think .m-agt { animation: ask-pulse 1.2s ease-in-out .4s infinite; }

/* wide: a column that pushes the page */
@media (min-width: 1280px) {
  .ask { width: 380px; }
  body.ask-open { padding-right: calc(380px + env(safe-area-inset-right, 0px)); }
  .ask-btn[aria-expanded="true"] { background: var(--faint); border-color: var(--ink); }
}
@media (min-width: 1280px) and (max-width: 1759px) { body.ask-open .toc { display: none; } body.ask-open .frame { grid-template-columns: var(--nav-w) minmax(0, 1fr); } body.ask-open.home .frame { grid-template-columns: minmax(0, 1fr); } }
/* narrow: an overlay over the page, the page stays where it is */
@media (max-width: 1279px) {
  .ask { box-shadow: 0 0 40px rgba(0, 0, 0, .18); }
  body.ask-open { overflow: hidden; }
  body.ask-open .ask-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 15, 15, .35); }
}
@media (max-width: 820px) {
  .has-ask .search { flex: 1 1 calc(100% - 160px); min-width: 0; flex-basis: calc(100% - 160px); order: 3; }
  .has-ask .ask-btn { order: 4; }
  .ask-btn { height: 38px; }
  .ask-sub { display: none; }
}
@media (max-width: 560px) { .ask { width: 100vw; border-left: 0; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .ask.in, .ask-h, .ask-a, .ask-dots, .think path { animation: none !important; } }
@media print { .ask, .ask-scrim, .ask-btn { display: none !important; } }
