/* MindStaq site assistant: launcher + chat panel.
   Everything is scoped to .mqa so it can sit over any page of the site.
   Tokens follow the wireframe Home (Poppins, ink, MindStaq orange, teal for links). */
.mqa {
  --a-bg: #ffffff;
  --a-tint: #f6f6f4;
  --a-tint-2: #efefec;
  --a-fg: #17181a;
  --a-soft: #55585c;
  --a-faint: #6b6e73;
  --a-line: #e6e6e3;
  --a-orange: #EF4E22;
  --a-orange-ink: #C53A12;
  --a-orange-tint: #FDEDE7;
  --a-teal: #50C2DE;
  --a-teal-ink: #137891;
  --a-teal-tint: #E8F6FB;
  --a-user: #17181a;
  --a-user-fg: #ffffff;
  --a-chip-bg: #FFF4D6;
  --a-chip-fg: #8A5A00;
  --a-shadow: 0 28px 64px -18px rgba(23, 24, 26, .32), 0 2px 8px rgba(23, 24, 26, .07);
  --a-ease: cubic-bezier(.16, 1, .3, 1);
  --a-font: "Poppins", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-family: var(--a-font);
  color: var(--a-fg);
  -webkit-font-smoothing: antialiased;
}
.mqa[data-theme="dark"] {
  --a-bg: #17191d;
  --a-tint: #1f2227;
  --a-tint-2: #262a30;
  --a-fg: #f1f1f0;
  --a-soft: #c0c3c8;
  --a-faint: #9a9da3;
  --a-line: #2d3036;
  --a-orange-ink: #FF8A5C;
  --a-orange-tint: #3a1d14;
  --a-teal-ink: #6fd0e8;
  --a-teal-tint: #12303a;
  --a-user: #2c3037;
  --a-user-fg: #ffffff;
  --a-chip-bg: #3a2f12;
  --a-chip-fg: #f3c96b;
  --a-shadow: 0 28px 64px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .04);
}
.mqa *, .mqa *::before, .mqa *::after { box-sizing: border-box; }
.mqa ::selection { background: var(--a-orange-tint); color: var(--a-fg); }
.mqa { font-size: 14px; line-height: 1.5; }
:where(.mqa) button { font: inherit; color: inherit; }
:where(.mqa) svg { display: block; }
.mqa .mqa-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mqa :focus-visible { outline: 2px solid var(--a-orange); outline-offset: 2px; border-radius: 10px; }

/* ---------- launcher (shared shell; each sample draws its own mark) ---------- */
.mqa-launch {
  position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: max(var(--a-lift, 24px), env(safe-area-inset-bottom));
  z-index: 2147483000; border: 0; padding: 0; background: none; cursor: pointer;
  display: grid; place-items: center; -webkit-tap-highlight-color: transparent;
}
.mqa-launch:focus-visible { outline-offset: 6px; border-radius: 22px; }
.mqa-tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translate(8px, -50%); opacity: 0;
  white-space: nowrap; pointer-events: none;
  background: var(--a-fg); color: var(--a-bg); font-size: 13px; font-weight: 600; letter-spacing: -.005em;
  padding: 8px 13px; border-radius: 999px; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .45);
  transition: opacity .2s var(--a-ease), transform .35s var(--a-ease);
}
.mqa-launch:hover .mqa-tip, .mqa-launch:focus-visible .mqa-tip { opacity: 1; transform: translate(0, -50%); }
.mqa.is-open .mqa-tip { opacity: 0 !important; }

/* the teaser, once per visit */
.mqa-tease {
  position: fixed; right: max(24px, env(safe-area-inset-right)); bottom: calc(max(var(--a-lift, 24px), env(safe-area-inset-bottom)) + 82px);
  z-index: 2147483000; width: 248px; padding: 14px 40px 14px 16px; border-radius: 16px 16px 4px 16px;
  background: var(--a-bg); color: var(--a-fg); border: 1px solid var(--a-line); box-shadow: var(--a-shadow);
  font-size: 13.5px; line-height: 1.45; cursor: pointer;
  opacity: 0; transform: translateY(10px) scale(.97); transform-origin: bottom right; pointer-events: none;
  transition: opacity .3s var(--a-ease), transform .5s var(--a-ease);
}
.mqa-tease b { display: block; font-weight: 600; margin-bottom: 2px; }
.mqa-tease span { color: var(--a-soft); }
.mqa-tease.is-on { opacity: 1; transform: none; pointer-events: auto; }
.mqa-tease-x {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; background: none; border-radius: 9px;
  color: var(--a-faint); cursor: pointer; display: grid; place-items: center;
}
.mqa-tease-x:hover { background: var(--a-tint); color: var(--a-fg); }

/* ---------- panel ---------- */
.mqa-panel {
  position: fixed; z-index: 2147483001;
  right: max(24px, env(safe-area-inset-right)); bottom: calc(max(var(--a-lift, 24px), env(safe-area-inset-bottom)) + 84px);
  width: 408px; height: min(660px, calc(100dvh - 108px - var(--a-lift, 24px)));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--a-bg); color: var(--a-fg); border: 1px solid var(--a-line); border-radius: 22px; box-shadow: var(--a-shadow);
  transform-origin: calc(100% - 30px) calc(100% + 50px);
  opacity: 0; transform: translateY(14px) scale(.94); visibility: hidden; pointer-events: none;
  clip-path: inset(30% 0 0 30% round 22px);
  transition: opacity .22s ease, transform .5s var(--a-ease), clip-path .5s var(--a-ease), visibility 0s .5s;
}
.mqa.is-open .mqa-panel {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto; clip-path: inset(0 0 0 0 round 22px);
  transition: opacity .2s ease, transform .55s var(--a-ease), clip-path .55s var(--a-ease), visibility 0s;
}
/* before the first question there is only the greeting and the box: as tall as its content, anchored at the bottom */
@media (min-width: 561px) {
  .mqa.is-empty .mqa-panel { height: auto; }
}

.mqa-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--a-line);
  flex: none;
}
.mqa-av { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--a-tint); }
.mqa-av svg { width: 28px; height: auto; }
.mqa-title { flex: 1; min-width: 0; }
.mqa-title h2 { margin: 0; font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; }
.mqa-title p { margin: 2px 0 0; font-size: 12px; color: var(--a-soft); line-height: 1.35; display: flex; align-items: center; gap: 6px; }
.mqa-title p i { width: 6px; height: 6px; border-radius: 50%; background: #2BA36B; flex: none; }
.mqa-ib {
  width: 36px; height: 36px; flex: none; border: 0; background: none; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; color: var(--a-soft); transition: background .15s, color .15s;
}
.mqa-ib:hover { background: var(--a-tint); color: var(--a-fg); }
.mqa-ib svg { width: 18px; height: 18px; }

.mqa-log {
  position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px 8px; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: var(--a-line) transparent;
}
.mqa-log::-webkit-scrollbar { width: 8px; }
.mqa-log::-webkit-scrollbar-thumb { background: var(--a-line); border-radius: 8px; border: 2px solid var(--a-bg); }

/* welcome */
.mqa-hello h3 { margin: 4px 0 6px; font-size: 21px; line-height: 1.22; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
.mqa-hello > p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--a-soft); }
.mqa-qs { list-style: none; margin: 0 0 22px; padding: 0; border-top: 1px solid var(--a-line); }
.mqa-qs button {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; background: none; cursor: pointer;
  padding: 12px 4px; border-bottom: 1px solid var(--a-line); font-size: 14px; font-weight: 500; color: var(--a-fg);
  transition: color .15s;
}
.mqa-qs button span { flex: 1; transition: transform .3s var(--a-ease); }
.mqa-qs button svg { width: 16px; height: 16px; color: var(--a-faint); transition: transform .25s var(--a-ease), color .15s; }
.mqa-qs button:hover { color: var(--a-orange-ink); }
.mqa-qs button:hover span { transform: translateX(6px); }
.mqa-qs button:hover svg { transform: translateX(3px); color: var(--a-orange-ink); }
.mqa-browse-h { font-size: 12.5px; font-weight: 600; color: var(--a-soft); margin: 0 0 8px; }
.mqa-browse { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.mqa-browse a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--a-tint);
  color: var(--a-fg); text-decoration: none; font-size: 13px; line-height: 1.25; transition: background .15s;
}
.mqa-browse a:hover { background: var(--a-tint-2); }
.mqa-browse a svg { width: 18px; height: 18px; flex: none; color: var(--a-orange-ink); }
.mqa-browse a b { display: block; font-weight: 600; }
.mqa-browse a small { color: var(--a-soft); font-size: 12px; }

/* messages */
.mqa-msg { margin: 0 0 18px; animation: mqa-in .5s var(--a-ease) both; }
@keyframes mqa-in { from { opacity: 0; transform: translateY(8px); } }
.mqa-u { display: flex; justify-content: flex-end; }
.mqa-u p {
  margin: 0; max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 4px 18px; background: var(--a-user); color: var(--a-user-fg);
  font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
}
.mqa-a { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; }
.mqa-a > .mqa-mini { margin-top: 1px; }
.mqa-mini { width: 28px; height: 28px; border-radius: 9px; background: var(--a-tint); display: grid; place-items: center; }
.mqa-mini svg { width: 20px; height: auto; }
.mqa-body { min-width: 0; }
.mqa-body > * { animation: mqa-in .55s var(--a-ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.mqa-src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--a-teal-ink); text-decoration: none; margin: 3px 0 4px; }
.mqa-src:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Help Center answers: the source line carries the guide's status, steps are a numbered list */
.mqa-from { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.mqa-status { background: var(--a-teal-tint); color: var(--a-teal-ink); }
.mqa-steps { margin: 8px 0 0; padding: 0 0 0 20px; font-size: 14px; line-height: 1.55; color: var(--a-fg); }
.mqa-steps li { margin: 0 0 5px; padding-left: 2px; text-wrap: pretty; }
.mqa-steps li::marker { font-weight: 600; color: var(--a-soft); font-variant-numeric: tabular-nums; }
.mqa-prod a { white-space: normal; }
.mqa-src svg { width: 13px; height: 13px; }
.mqa-h { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.005em; text-wrap: pretty; }
.mqa-t { margin: 0; font-size: 14px; line-height: 1.6; color: var(--a-fg); text-wrap: pretty; }
.mqa-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 10px; padding: 9px 11px; border-radius: 11px;
  background: var(--a-chip-bg); color: var(--a-chip-fg); font-size: 12.5px; line-height: 1.45;
}
.mqa-note svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.mqa-list { list-style: none; margin: 10px 0 0; padding: 0; border-top: 1px solid var(--a-line); }
.mqa-list li { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; padding: 9px 0; border-bottom: 1px solid var(--a-line); }
.mqa-list b { font-size: 13.5px; font-weight: 600; }
.mqa-list em { font-style: normal; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.mqa-list small { grid-column: 1 / -1; font-size: 12px; color: var(--a-soft); line-height: 1.4; }
.mqa-foot { margin: 8px 0 0; font-size: 12px; color: var(--a-faint); line-height: 1.45; }
.mqa-also { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--a-tint); font-size: 13px; line-height: 1.55; }
.mqa-also b { font-weight: 600; }
.mqa-also a { color: var(--a-teal-ink); font-size: 12px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.mqa-also a:hover { text-decoration: underline; }

/* read next */
.mqa-recs-h { margin: 16px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--a-soft); }
.mqa-recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mqa-rec {
  display: grid; grid-template-columns: 34px 1fr 16px; gap: 10px; align-items: center; padding: 9px 10px 9px 9px;
  border-radius: 13px; border: 1px solid var(--a-line); color: var(--a-fg); text-decoration: none; background: var(--a-bg);
  transition: border-color .15s, background .15s, transform .3s var(--a-ease);
}
.mqa-rec:hover { border-color: color-mix(in srgb, var(--a-orange) 45%, var(--a-line)); background: var(--a-tint); }
.mqa-rec:active { transform: scale(.985); }
.mqa-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--a-tint-2); color: var(--a-fg); }
.mqa-ico svg { width: 17px; height: 17px; }
.mqa-rec[data-k="page"] .mqa-ico, .mqa-rec[data-k="guide"] .mqa-ico { background: var(--a-teal-tint); color: var(--a-teal-ink); }
.mqa-rec[data-k="blog"] .mqa-ico, .mqa-rec[data-k="paper"] .mqa-ico { background: var(--a-orange-tint); color: var(--a-orange-ink); }
.mqa-rec[data-k="video"] .mqa-ico, .mqa-rec[data-k="case"] .mqa-ico { background: var(--a-fg); color: var(--a-bg); }
.mqa-rec-t { min-width: 0; }
.mqa-rec-t small { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--a-soft); line-height: 1.3; }
.mqa-rec-t b {
  display: block; font-size: 13.5px; font-weight: 600; line-height: 1.35; margin: 1px 0;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.mqa-rec-t span { display: block; font-size: 12px; color: var(--a-soft); line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mqa-tag { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 5px; background: var(--a-chip-bg); color: var(--a-chip-fg); white-space: nowrap; }
.mqa-go { width: 16px; height: 16px; color: var(--a-faint); transition: transform .3s var(--a-ease), color .15s; }
.mqa-rec:hover .mqa-go { color: var(--a-orange-ink); transform: translate(2px, -2px); }

/* ask next */
.mqa-next { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.mqa-chip {
  border: 1px solid var(--a-line); background: var(--a-bg); border-radius: 999px; padding: 7px 12px; cursor: pointer;
  font-size: 12.5px; line-height: 1.3; color: var(--a-fg); text-align: left; transition: border-color .15s, background .15s, color .15s;
}
.mqa-chip:hover { border-color: var(--a-orange); color: var(--a-orange-ink); background: var(--a-orange-tint); }
.mqa-refuse .mqa-t { color: var(--a-soft); }

/* thinking row */
.mqa-think { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; margin: 0 0 18px; animation: mqa-in .3s var(--a-ease) both; }
.mqa-think span { font-size: 12.5px; color: var(--a-soft); }

/* composer */
.mqa-compose { flex: none; padding: 10px 14px 6px; border-top: 1px solid var(--a-line); background: var(--a-bg); }
.mqa-field {
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--a-line); border-radius: 16px;
  background: var(--a-bg); transition: border-color .15s, box-shadow .15s;
}
.mqa-field:focus-within { border-color: var(--a-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-orange) 18%, transparent); }
.mqa-field textarea {
  flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none; color: var(--a-fg); font: inherit;
  font-size: 14.5px; line-height: 1.45; padding: 7px 0; max-height: 120px; caret-color: var(--a-orange);
}
.mqa-field textarea::placeholder { color: var(--a-faint); }
/* the field draws the focus ring; the text box inside it takes none of its own */
.mqa .mqa-field textarea:focus, .mqa .mqa-field textarea:focus-visible { outline: none; box-shadow: none; }
/* The live theme styles every textarea and heading: keep one border on the field (no inner box), and Poppins throughout. */
.mqa .mqa-field textarea { border: 0 !important; background: transparent !important; padding: 7px 0 !important; min-height: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.mqa :is(h2, h3, h4) { font-family: var(--a-font); }
.mqa-send {
  width: 36px; height: 36px; flex: none; border: 0; border-radius: 11px; cursor: pointer; display: grid; place-items: center;
  background: var(--a-tint-2); color: var(--a-faint); transition: background .2s, color .2s, transform .3s var(--a-ease);
}
.mqa-send svg { width: 18px; height: 18px; }
.mqa-field.has-text .mqa-send { background: var(--a-orange); color: #fff; }
.mqa-field.has-text .mqa-send:hover { transform: translateY(-1px); }
.mqa-send:disabled { cursor: default; }
.mqa-fine { margin: 6px 2px 2px; font-size: 11.5px; line-height: 1.4; color: var(--a-faint); text-align: center; }

/* ---------- Sample A: the Q speaks (2D) ---------- */
.mqa-launch--a { width: 72px; height: 58px; }
.mqa-launch--a .qa { width: 72px; height: auto; overflow: visible; filter: drop-shadow(0 10px 14px rgba(23, 24, 26, .22)) drop-shadow(0 2px 3px rgba(23, 24, 26, .12)); transition: transform .5s var(--a-ease); }
.mqa-launch--a:hover .qa { transform: rotate(-5deg) scale(1.05); }
.mqa-launch--a:active .qa { transform: scale(.94); transition-duration: .12s; }
.qa-draw { fill: none; stroke: var(--a-orange); stroke-width: 1.1; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; }
.qa-fill { opacity: 1; }
.mqa.is-intro .qa-draw { animation: qa-draw 1.1s cubic-bezier(.65, 0, .35, 1) .2s both; }
.mqa.is-intro .qa-fill { animation: qa-fillin .45s ease 1.05s both; }
@keyframes qa-draw { 0% { opacity: 1; stroke-dashoffset: 1; } 90% { opacity: 1; stroke-dashoffset: 0; } 100% { opacity: 0; stroke-dashoffset: 0; } }
@keyframes qa-fillin { from { opacity: 0; } }
.qa-dot { fill: #fff; opacity: 0; transform-box: fill-box; transform-origin: center; }
/* idle: every 9 s the bubble types for a moment */
.mqa-launch--a .qa-dot { animation: qa-idle 9s infinite; }
.mqa-launch--a .qa-dot:nth-of-type(2) { animation-name: qa-idle2; }
.mqa-launch--a .qa-dot:nth-of-type(3) { animation-name: qa-idle3; }
@keyframes qa-idle { 0%, 70%, 92%, 100% { opacity: 0; transform: none; } 72%, 90% { opacity: 1; } 75%, 81%, 87% { transform: translateY(-1.1px); } 78%, 84% { transform: none; } }
@keyframes qa-idle2 { 0%, 71%, 92%, 100% { opacity: 0; transform: none; } 73%, 90% { opacity: 1; } 76.5%, 82.5%, 88.5% { transform: translateY(-1.1px); } 79.5%, 85.5% { transform: none; } }
@keyframes qa-idle3 { 0%, 72%, 92%, 100% { opacity: 0; transform: none; } 74%, 90% { opacity: 1; } 78%, 84% { transform: translateY(-1.1px); } 81%, 87% { transform: none; } }
.qa-pill { fill: var(--a-orange); }
.qa-pill-hi { fill: #fff; opacity: 0; }
/* hover, focus and thinking: it types for as long as you look */
.mqa-launch--a:hover .qa-dot, .mqa-launch--a:focus-visible .qa-dot, .mqa.is-busy .qa .qa-dot, .mqa-mini.is-busy .qa-dot { animation: qa-type 1.05s infinite ease-in-out; opacity: 1; }
.mqa-launch--a:hover .qa-dot:nth-of-type(2), .mqa.is-busy .qa .qa-dot:nth-of-type(2), .mqa-mini.is-busy .qa-dot:nth-of-type(2) { animation-delay: .15s; }
.mqa-launch--a:hover .qa-dot:nth-of-type(3), .mqa.is-busy .qa .qa-dot:nth-of-type(3), .mqa-mini.is-busy .qa-dot:nth-of-type(3) { animation-delay: .3s; }
@keyframes qa-type { 0%, 60%, 100% { transform: none; opacity: .55; } 30% { transform: translateY(-1.6px); opacity: 1; } }
.qa-chev { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: translateY(-1.5px); transform-box: fill-box; transform-origin: center; transition: opacity .2s, transform .45s var(--a-ease); }
.mqa.is-open .mqa-launch--a .qa-dot { opacity: 0 !important; animation: none !important; }
.mqa.is-open .mqa-launch--a .qa-chev { opacity: 1; transform: none; }

/* ---------- Sample B: the solid Q (3D) ---------- */
.mqa-launch--b { width: 92px; height: 84px; margin: -14px -10px; }
.mqa-launch--b canvas { width: 92px; height: 84px; position: relative; z-index: 1; }
.mqa-launch--b .qb-floor {
  position: absolute; left: 50%; bottom: 6px; width: 54px; height: 10px; margin-left: -27px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(23, 24, 26, .32), rgba(23, 24, 26, 0)); transform: scale(var(--fs, 1)); opacity: var(--fo, 1);
}
.mqa[data-theme="dark"] .mqa-launch--b .qb-floor { background: radial-gradient(closest-side, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); }
.mqa-launch--b .qb-flat { position: absolute; width: 64px; height: auto; display: none; }
.mqa-launch--b.no-gl canvas { display: none; }
.mqa-launch--b.no-gl .qb-flat { display: block; filter: drop-shadow(0 10px 14px rgba(23, 24, 26, .22)); }
.mqa-launch--b .qb-x {
  position: absolute; z-index: 2; right: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--a-fg); color: var(--a-bg);
  display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .45s var(--a-ease);
}
.mqa-launch--b .qb-x svg { width: 14px; height: 14px; }
.mqa.is-open .mqa-launch--b .qb-x { opacity: 1; transform: none; }
/* a 2D echo of the 3D turn, for the small marks */
.mqa-mini.is-busy .qb-coin, .mqa-av.is-busy .qb-coin { animation: qb-coin 1.1s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes qb-coin { 0% { transform: perspective(80px) rotateY(0); } 100% { transform: perspective(80px) rotateY(360deg); } }

/* ---------- Sample C: the Staq deck (2.5D, CSS only) ---------- */
.mqa-launch--c { width: 66px; height: 66px; perspective: 520px; }
.qc-deck { position: relative; width: 60px; height: 60px; transform-style: preserve-3d; }
.qc-card {
  position: absolute; inset: 0; border-radius: 17px; display: grid; place-items: start; padding: 9px;
  transform-origin: 210% 62%; transition: transform .7s var(--a-ease), box-shadow .6s var(--a-ease);
}
.qc-card svg { width: 18px; height: 18px; opacity: 0; transition: opacity .25s; }
.qc-1 { background: #E8F6FB; color: #137891; transform: translate(3px, 3px); box-shadow: 0 6px 12px -6px rgba(23, 24, 26, .3); }
.qc-2 { background: #FDEDE7; color: #C53A12; transform: translate(6px, 6px); box-shadow: 0 6px 12px -6px rgba(23, 24, 26, .3); }
.qc-3 { background: #17181a; color: #fff; transform: translate(9px, 9px); box-shadow: 0 12px 20px -8px rgba(23, 24, 26, .45); }
.qc-top {
  padding: 0; place-items: center; background: #fff; border: 1px solid rgba(23, 24, 26, .08);
  box-shadow: 0 12px 22px -8px rgba(23, 24, 26, .36), 0 2px 4px rgba(23, 24, 26, .08);
  transform-style: preserve-3d; transform-origin: 50% 50%;
}
.qc-top .qc-face, .qc-top .qc-back { position: absolute; inset: 0; display: grid; place-items: center; backface-visibility: hidden; border-radius: inherit; }
.qc-top .qc-face svg { width: 40px; height: auto; opacity: 1; }
.qc-top .qc-back { transform: rotateY(180deg); background: #17181a; color: #fff; }
.qc-top .qc-back svg { width: 22px; height: 22px; opacity: 1; }
.mqa[data-theme="dark"] .qc-top { border-color: rgba(255, 255, 255, .12); }
.mqa[data-theme="dark"] .qc-3 { background: #50C2DE; color: #0b2a33; }
/* the deal: a hand of three cards, page, whitepaper, video, fanned out behind the Q */
.mqa-launch--c:hover .qc-1, .mqa-launch--c:focus-visible .qc-1, .mqa-launch--c.is-deal .qc-1 { transform: rotate(13deg); }
.mqa-launch--c:hover .qc-2, .mqa-launch--c:focus-visible .qc-2, .mqa-launch--c.is-deal .qc-2 { transform: rotate(26deg); transition-delay: .05s; }
.mqa-launch--c:hover .qc-3, .mqa-launch--c:focus-visible .qc-3, .mqa-launch--c.is-deal .qc-3 { transform: rotate(39deg); transition-delay: .1s; }
.mqa-launch--c:hover .qc-card svg, .mqa-launch--c:focus-visible .qc-card svg, .mqa-launch--c.is-deal .qc-card svg { opacity: 1; transition-delay: .22s; }
.mqa-launch--c:hover .qc-top, .mqa-launch--c.is-deal .qc-top { transform: translateY(-3px); }
.mqa-launch--c .mqa-tip { right: calc(100% + 96px); top: 30%; }
.mqa.is-open .mqa-launch--c .qc-card:not(.qc-top) { transform: translate(0, 0); }
.mqa.is-open .mqa-launch--c .qc-card:not(.qc-top) svg { opacity: 0; }
.mqa.is-open .mqa-launch--c .qc-top { transform: rotateY(180deg); }
.mqa.is-busy .mqa-launch--c .qc-1 { animation: qc-shuffle 1.2s var(--a-ease) infinite; }
@keyframes qc-shuffle { 50% { transform: rotate(12deg); } }
/* thinking: three small cards dealt in turn */
.qc-load { display: flex; gap: 3px; align-items: flex-end; height: 16px; }
.qc-load i { width: 7px; height: 10px; border-radius: 2px; background: #E8F6FB; box-shadow: inset 0 0 0 1px rgba(19, 120, 145, .35); animation: qc-load 1.1s var(--a-ease) infinite; }
.qc-load i:nth-child(2) { background: #FDEDE7; box-shadow: inset 0 0 0 1px rgba(197, 58, 18, .35); animation-delay: .15s; }
.qc-load i:nth-child(3) { background: #17181a; box-shadow: none; animation-delay: .3s; }
.mqa[data-theme="dark"] .qc-load i:nth-child(3) { background: #50C2DE; }
@keyframes qc-load { 0%, 100% { transform: none; } 35% { transform: translateY(-5px) rotate(-10deg); } }

/* ---------- phones: the panel takes the screen ---------- */
@media (max-width: 560px) {
  .mqa-panel {
    inset: 0; width: auto; height: 100dvh; border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
    transform-origin: 85% 100%; clip-path: inset(40% 0 0 40%);
  }
  .mqa.is-open .mqa-panel { clip-path: inset(0); }
  .mqa.is-open .mqa-launch { opacity: 0; pointer-events: none; transform: scale(.6); transition: opacity .2s, transform .3s; }
  .mqa-launch { right: max(16px, env(safe-area-inset-right)); bottom: max(var(--a-lift-m, 16px), env(safe-area-inset-bottom)); }
  .mqa-tease { right: 16px; bottom: calc(max(16px, env(safe-area-inset-bottom)) + 78px); }
  .mqa-log { padding: 18px 16px 8px; }
  .mqa-field textarea { font-size: 16px; }   /* no zoom on focus */
  .mqa-browse { grid-template-columns: 1fr 1fr; }
  .mqa-tip { display: none; }
  body:has(.mqa.is-open) .rv, body:has(.mqa.is-open) .rv-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .mqa *, .mqa *::before, .mqa *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .mqa .qa-dot { opacity: 0 !important; }
  .mqa.is-busy .qa .qa-dot, .mqa-mini.is-busy .qa-dot { opacity: 1 !important; }
  .mqa-panel { clip-path: none !important; }
}
