/* Ask Mr. Zero (js/ask.js): the site's AI support chat, on the store pages and in the docs.
   Self-contained: the docs load their own stylesheet, so every token falls back to the site's value. */
.ask-launch {
  position: fixed; z-index: 70; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 18px 0 14px;
  border: 1px solid var(--line-2, rgba(255, 255, 255, .16)); border-radius: 999px;
  background: rgba(18, 18, 22, .92); color: var(--text, #f5f4f1);
  font: 600 14px/1 var(--font, 'Inter'), system-ui, sans-serif; letter-spacing: -.005em; cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color .2s, border-color .2s, transform .2s;
}
.ask-launch svg { width: 20px; height: 20px; color: var(--accent, #d9c3a3); flex: none; }
.ask-launch:hover { background: #1b1b1f; border-color: rgba(255, 255, 255, .26); }
.ask-launch:focus-visible, .ask-panel :focus-visible { outline: 2px solid var(--accent, #d9c3a3); outline-offset: 2px; }
.ask-launch[aria-expanded="true"] { background: #1b1b1f; }
.ask-launch.tuck { width: 48px; padding: 0; justify-content: center; }
.ask-launch.tuck span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ask-launch.away { opacity: 0; pointer-events: none; transform: translateY(8px); }
.ask-launch { transition: background-color .2s, border-color .2s, opacity .2s, transform .2s; }
body:has(.lang-bar) .ask-launch { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

.ask-panel {
  position: fixed; z-index: 75; inset-inline-end: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 92px - var(--header, 64px) - env(safe-area-inset-bottom, 0px)));
  display: flex; flex-direction: column; overflow: hidden;
  background: #0d0d10; color: var(--text, #f5f4f1); border: 1px solid var(--line-2, rgba(255, 255, 255, .16)); border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .65); font: 400 14.5px/1.55 var(--font, 'Inter'), system-ui, sans-serif;
  opacity: 0; transform: translateY(10px) scale(.985); transform-origin: bottom right;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .7, .2, 1);
}
.ask-panel.in { opacity: 1; transform: none; }
.ask-panel[hidden] { display: none; }
body:has(.lang-bar) .ask-panel { bottom: calc(156px + env(safe-area-inset-bottom, 0px)); height: min(640px, calc(100dvh - 172px - var(--header, 64px) - env(safe-area-inset-bottom, 0px))); }
.ask-panel .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.ask-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line, rgba(255, 255, 255, .09)); }
.ask-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ask-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent, #d9c3a3); color: var(--accent-ink, #1a1510); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.ask-head h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.ask-head p { margin: 2px 0 0; font-size: 12px; line-height: 1.3; color: var(--text-3, #86857f); }
.ask-tools { display: flex; gap: 2px; }
.ask-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2, #a9a8a4); cursor: pointer; }
.ask-icon svg { width: 18px; height: 18px; }
.ask-icon:hover { background: var(--bg-3, #1b1b1f); color: var(--text, #f5f4f1); }

.ask-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 16px; scrollbar-width: thin; scrollbar-color: #2a2a30 transparent; }
.ask-log:focus { outline: none; }
.ask-msg p { margin: 0; }
.ask-msg p + p, .ask-msg p + ol, .ask-msg p + ul, .ask-msg ol + p, .ask-msg ul + p, .ask-msg pre + p, .ask-msg p + pre { margin-top: 8px; }
.ask-bot { max-width: 100%; overflow-wrap: anywhere; }
.ask-bot ol, .ask-bot ul { margin: 0; padding-inline-start: 22px; }
.ask-bot li + li { margin-top: 4px; }
.ask-bot li::marker { color: var(--text-3, #86857f); font-variant-numeric: tabular-nums; }
.ask-bot a { color: var(--accent, #d9c3a3); text-decoration: underline; text-decoration-color: rgba(217, 195, 163, .4); text-underline-offset: 3px; }
.ask-bot a:hover { text-decoration-color: currentColor; }
.ask-bot strong { font-weight: 600; }
.ask-msg code { font: 13px/1.4 var(--mono, ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace); background: var(--bg-3, #1b1b1f); border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }
.ask-msg pre { margin: 0; padding: 10px 12px; background: var(--bg-3, #1b1b1f); border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 10px; overflow-x: auto; }
.ask-msg pre code { background: none; border: 0; padding: 0; white-space: pre; overflow-wrap: normal; }

.ask-me { align-self: flex-end; max-width: 85%; padding: 9px 13px; background: var(--bg-3, #1b1b1f); border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 16px 16px 4px 16px; overflow-wrap: anywhere; }
[dir="rtl"] .ask-me { border-radius: 16px 16px 16px 4px; }
.ask-intro p { color: var(--text-2, #a9a8a4); }
.ask-mark { position: relative; }
.ask-mark i { position: absolute; inset-inline-end: -3px; bottom: -3px; width: 10px; height: 10px; border-radius: 50%; background: #6fe3a5; border: 2px solid #0d0d10; }

/* welcome: four things visitors come for */
.ask-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ask-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 104px; padding: 12px; border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 14px; background: #131317; color: var(--text, #f5f4f1); font-family: inherit; text-align: start; cursor: pointer; transition: border-color .15s, background-color .15s; }
.ask-tile svg { width: 20px; height: 20px; color: var(--accent, #d9c3a3); flex: none; }
.ask-tile b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.ask-tile small { display: block; margin-top: 3px; font-size: 12px; line-height: 1.35; color: var(--text-3, #86857f); }
.ask-tile:hover { border-color: rgba(217, 195, 163, .45); background: #17171c; }

/* hand-over to a person */
.ask-hand { padding-inline-start: 12px; border-inline-start: 2px solid var(--accent, #d9c3a3); }
.ask-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ask-actions > * { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 15px; border: 1px solid var(--line-2, rgba(255, 255, 255, .16)); border-radius: 999px; background: transparent; color: var(--text, #f5f4f1); font-family: inherit; font-size: 13.5px; font-weight: 600; text-decoration: none; cursor: pointer; }
.ask-actions > :first-child { background: var(--button, #f2f0ec); border-color: transparent; color: var(--button-ink, #0c0c0e); }
.ask-actions > * svg { width: 16px; height: 16px; }
.ask-actions > :hover { filter: brightness(1.08); }
.ask-note { font-size: 13.5px; color: var(--text-2, #a9a8a4); padding-inline-start: 12px; border-inline-start: 2px solid var(--line-2, rgba(255, 255, 255, .16)); }

/* Mr. Zero at work: the steps he reports, the one in progress pulsing */
.ask-work { position: relative; padding: 12px 14px; border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 14px; background: #111115; }
.ask-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--text-2, #a9a8a4); }
.ask-steps li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: start; }
.ask-steps li i { width: 8px; height: 8px; margin: 5px 3px 0; border-radius: 50%; background: var(--text-3, #86857f); }
.ask-steps li.now { color: var(--text, #f5f4f1); }
.ask-steps li.now i { background: var(--accent, #d9c3a3); animation: ask-pulse 1.1s infinite ease-in-out; }
.ask-steps li.done i { background: #6fe3a5; }
.ask-found { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ask-found em { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg-3, #1b1b1f); color: var(--text-2, #a9a8a4); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-timer { position: absolute; inset-inline-end: 12px; top: 11px; font-size: 12px; color: var(--text-3, #86857f); font-variant-numeric: tabular-nums; }
@keyframes ask-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.1); } }

/* under an answer: where it came from, how long it took, was it helpful */
.ask-src { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--text-3, #86857f); }
.ask-src > span { margin-inline-end: 2px; }
.ask-src a { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 999px; color: var(--text-2, #a9a8a4); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-src a svg { width: 13px; height: 13px; flex: none; }
.ask-src a:hover { color: var(--text, #f5f4f1); border-color: var(--line-2, rgba(255, 255, 255, .16)); }
.ask-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--text-3, #86857f); }
.ask-took { display: inline-flex; align-items: center; gap: 5px; }
.ask-took svg { width: 13px; height: 13px; color: #6fe3a5; }
.ask-vote { display: inline-flex; gap: 2px; margin-inline-start: auto; }
.ask-icon.sm { width: 30px; height: 30px; border-radius: 8px; }
.ask-icon.sm svg { width: 15px; height: 15px; }
.ask-voted { margin-inline-start: auto; }

/* a product the answer names: real price, real buy buttons */
.ask-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; margin-top: 12px; padding: 10px; border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 14px; background: #131317; }
.ask-card-img { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #1b1b1f; }
.ask-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ask-card-n { font-size: 14px; font-weight: 600; color: var(--text, #f5f4f1); text-decoration: none; }
.ask-card-n:hover { text-decoration: underline; text-underline-offset: 3px; }
.ask-card-p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-2, #a9a8a4); }
.ask-card-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-buy { display: inline-flex; align-items: center; min-height: 34px; padding: 0 13px; border: 1px solid transparent; border-radius: 999px; background: var(--button, #f2f0ec); color: var(--button-ink, #0c0c0e); font-family: inherit; font-size: 12.5px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.ask-buy.ghost { background: transparent; border-color: var(--line-2, rgba(255, 255, 255, .16)); color: var(--text, #f5f4f1); }
.ask-buy:hover { filter: brightness(1.08); }
/* the docs colour every link; light buttons keep their dark text */
.ask-panel a.ask-buy:not(.ghost), .ask-panel .ask-actions > a:first-child { color: var(--button-ink, #0c0c0e); text-decoration: none; }
.ask-buy:disabled { opacity: .6; cursor: default; }

/* the instant compatibility check */
.ask-compat { padding: 12px; border: 1px solid var(--line, rgba(255, 255, 255, .09)); border-radius: 14px; background: #111115; }
.ask-compat > p { color: var(--text-2, #a9a8a4); font-size: 13.5px; }
.ask-compat > p strong { color: var(--text, #f5f4f1); }
.ask-cc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ask-cc-grid label { display: grid; gap: 4px; min-width: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3, #86857f); }
.ask-cc-grid select { appearance: none; width: 100%; min-height: 38px; padding: 0 28px 0 10px; border: 1px solid var(--line-2, rgba(255, 255, 255, .16)); border-radius: 9px; color: var(--text, #f5f4f1); font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
  background: var(--bg-3, #1b1b1f) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%2386857f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center / 16px; }
[dir="rtl"] .ask-cc-grid select { padding: 0 10px 0 28px; background-position: left 8px center; }
.ask-cc-grid select option { background: #15151a; color: #eee; }
.ask-cc-v { display: flex; align-items: flex-start; gap: 7px; margin-top: 12px !important; font-size: 14px; font-weight: 600; line-height: 1.4; }
.ask-cc-v svg { width: 18px; height: 18px; flex: none; color: #6fe3a5; }
.ask-cc-v.v-supported { color: #e9c46a; }
.ask-cc-v.v-limited { color: #f0a35e; }
.ask-cc-v.v-bridge { color: #9fb4ff; }
.ask-cc-rows { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ask-cc-rows li { display: grid; gap: 2px; font-size: 13px; line-height: 1.45; }
.ask-cc-rows b { font-weight: 600; }
.ask-cc-rows small { color: var(--text-2, #a9a8a4); font-size: 12.5px; }
.ask-st { width: max-content; max-width: 100%; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.ask-st.st-tested, .ask-st.st-checked { color: #6fe3a5; }
.ask-st.st-supported { color: #e9c46a; }
.ask-st.st-limited { color: #f0a35e; }
.ask-st.st-bridge { color: #9fb4ff; }
.ask-st.st-free { color: #b9b6c8; }
.ask-cc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.ask-cc-doc { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2, #a9a8a4); }
.ask-cc-doc svg { width: 14px; height: 14px; }
.ask-link { border: 0; padding: 0; background: none; color: var(--accent, #d9c3a3); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(217, 195, 163, .4); }

.ask-form { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px 8px; border-top: 1px solid var(--line, rgba(255, 255, 255, .09)); }
.ask-form textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; margin: 0; padding: 10px 14px; border: 1px solid var(--line-2, rgba(255, 255, 255, .16)); border-radius: 14px; background: var(--bg-3, #1b1b1f); color: var(--text, #f5f4f1); font-family: inherit; font-size: 14.5px; line-height: 1.4; }
.ask-form textarea::placeholder { color: var(--text-3, #86857f); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-form textarea:focus { outline: none; border-color: rgba(217, 195, 163, .6); }
.ask-send { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--button, #f2f0ec); color: var(--button-ink, #0c0c0e); cursor: pointer; }
.ask-send svg { width: 18px; height: 18px; }
[dir="rtl"] .ask-send svg { transform: scaleX(-1); }
.ask-send:disabled { opacity: .4; cursor: default; }
.ask-fine { margin: 0; padding: 0 16px 12px; font-size: 11.5px; line-height: 1.4; color: var(--text-3, #86857f); }

@media (max-width: 640px) {
  .ask-launch { width: 52px; height: 52px; padding: 0; justify-content: center; }
  .ask-launch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ask-launch svg { width: 22px; height: 22px; }
  .ask-panel, body:has(.lang-bar) .ask-panel { inset: 0; width: auto; height: 100dvh; border-radius: 0; border: 0; transform: translateY(16px); }
  .ask-panel.in { transform: none; }
  .ask-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
  .ask-fine { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .ask-form textarea { font-size: 16px; } /* below 16px iOS zooms the page on focus */
  body.ask-open { overflow: hidden; }
  body.ask-open .ask-launch { display: none; }
}
@media print { .ask-launch, .ask-panel { display: none !important; } }
@media (prefers-reduced-motion: reduce) {
  .ask-panel, .ask-launch { transition: none; }
  .ask-steps li.now i { animation: none; }
}
@media (max-width: 360px) {
  .ask-actions-grid, .ask-cc-grid { grid-template-columns: minmax(0, 1fr); }
  .ask-tile { min-height: 0; flex-direction: row; align-items: center; }
}
