/* Just ask Pea: five pill tabs over one chat card. The owner asks, Pea lines it up,
   the owner keeps the last word. Beats are classes on .ask-scene, set by ask.js:
   b-you (the question), b-pea (Pea hops in, typing dots), b-reply (the answer), b-chip. */

.anim-ask { max-width: 880px; margin: 44px auto 0; text-align: left; }

/* ---------- the pill tabs ---------- */
.anim-ask .ask-tabs { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); width: max-content; max-width: 100%; margin: 0 auto; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 16px 36px -26px rgba(34, 56, 26, .55), 0 1px 2px rgba(34, 56, 26, .05); }
.anim-ask .ask-tab { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 12px 20px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 700 15.5px/1 var(--body); letter-spacing: -.005em; white-space: nowrap; cursor: pointer; transition: color .3s ease; -webkit-tap-highlight-color: transparent; }
.anim-ask .ask-tab svg { flex: none; width: 18px; height: 18px; color: var(--pea); transition: color .3s ease, transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.anim-ask .ask-tab:hover { color: var(--ink); }
.anim-ask .ask-tab[aria-selected="true"] { color: var(--band-ink); }
.anim-ask .ask-tab[aria-selected="true"] svg { color: #b6e07f; transform: scale(1.1); }
.anim-ask .ask-tab:focus-visible { outline-offset: 1px; border-radius: 999px; }

/* the dark pill that slides between tabs; a thin lime line inside it shows time left on this one */
.anim-ask .ask-ind { position: absolute; z-index: 0; top: 6px; bottom: 6px; left: 6px; width: calc((100% - 12px) / 5); border-radius: 999px; background: var(--band); overflow: hidden; box-shadow: 0 10px 22px -10px rgba(34, 56, 26, .75); transform: translateX(calc(var(--ask-i, 0) * 100%)); transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .18s ease; }
.anim-ask .ask-ind__fill { position: absolute; inset: auto 14px 5px; height: 2px; border-radius: 2px; background: rgba(182, 224, 127, .9); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- the chat card ---------- */
.anim-ask .ask-card { position: relative; margin-top: 22px; background: radial-gradient(60% 75% at 88% 92%, rgba(199, 222, 168, .4), rgba(199, 222, 168, 0) 70%), var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.anim-ask .ask-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 18px; background: linear-gradient(120deg, #e9f1dd, #f6f8f1); border-bottom: 1px solid var(--line); }
.anim-ask .ask-top__ava { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); box-shadow: 0 4px 10px -6px rgba(34, 56, 26, .4); overflow: hidden; }
.anim-ask .ask-top__ava img { width: 25px; height: auto; margin-top: 4px; }
.anim-ask .ask-top__who { display: grid; gap: 2px; min-width: 0; }
.anim-ask .ask-top__who b { font: 800 18px/1.1 var(--display); letter-spacing: -.025em; color: var(--ink); }
.anim-ask .ask-top__who small { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anim-ask .ask-play { flex: none; margin-left: auto; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; transition: color .2s ease, box-shadow .2s ease; }
.anim-ask .ask-play:hover { color: var(--pea); box-shadow: inset 0 0 0 1.5px var(--pea-glow); }
.anim-ask .ask-play:focus-visible { border-radius: 50%; }
.anim-ask .ask-play svg { width: 15px; height: 15px; }
.anim-ask .ask-play__play { display: none; margin-left: 2px; }
.anim-ask.is-stopped .ask-play__pause { display: none; }
.anim-ask.is-stopped .ask-play__play { display: block; }
.anim-ask:not(.is-js) .ask-play { display: none; }
/* the round sound button (sound.js puts it beside the pause button): the same look, green once sound is on */
.anim-ask .ask-top .snd-btn { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); font: inherit; cursor: pointer; transition: color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.anim-ask .ask-top .snd-btn:hover { color: var(--pea); box-shadow: inset 0 0 0 1.5px var(--pea-glow); }
.anim-ask .ask-top .snd-btn:focus-visible { border-radius: 50%; }
.anim-ask .ask-top .snd-btn svg { width: 17px; height: 17px; }
.anim-ask .ask-top .snd-btn.is-on { background: var(--pea-soft); color: var(--pea); box-shadow: inset 0 0 0 1.5px var(--pea-glow); }
/* both round buttons get a 44px tap area without looking any bigger */
.anim-ask .ask-play { position: relative; }
.anim-ask .ask-play::before, .anim-ask .ask-top .snd-btn::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }

.anim-ask .ask-chat { position: relative; padding: 22px 28px 18px; }
.anim-ask .ask-stage { display: grid; }
.anim-ask .ask-scene { position: relative; grid-area: 1 / 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; visibility: hidden; opacity: 0; transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
.anim-ask .ask-scene.is-active { z-index: 1; visibility: visible; opacity: 1; transform: none; transition: opacity .2s ease, visibility 0s; }
.anim-ask .ask-scene.is-out { visibility: visible; opacity: 0; transform: translateY(-10px); transition: opacity .3s ease, transform .3s ease, visibility 0s; }
/* phones: the last answer stays, dimmed, under the next question until the new answer lands (ask.js adds is-prev) */
.anim-ask .ask-scene.is-prev { visibility: visible; opacity: 1; transform: none; transition: opacity .3s ease, visibility 0s; }
.anim-ask .ask-scene.is-prev .ask-you, .anim-ask .ask-scene.is-prev .ask-side { opacity: 0; transition: opacity .2s ease; }
.anim-ask .ask-scene.is-prev .ask-reply { opacity: .32; transition: opacity .35s ease; }
/* it fades out in time for the new answer, which waits 200 ms (ask.js), so the two never overlap */
.anim-ask .ask-scene.is-prev.is-gone { opacity: 0; transition: opacity .18s ease, visibility 0s; }

/* the owner's message, typed in on the right */
.anim-ask .ask-you { position: relative; align-self: flex-end; max-width: 72%; margin: 0; padding: 10px 17px; border-radius: 22px 22px 6px 22px; background: #d9ecc4; color: var(--ink); font-weight: 600; font-size: 17px; line-height: 1.35; box-shadow: 0 8px 18px -14px rgba(34, 56, 26, .5); opacity: 0; transform: translateY(8px) scale(.92); transform-origin: 100% 100%; }
.anim-ask .ask-you__ghost { visibility: hidden; }
.anim-ask .ask-you__typed { position: absolute; top: 10px; left: 17px; right: 17px; }
.anim-ask .is-typing .ask-you__typed::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -.17em; border-radius: 1px; background: var(--pea); animation: ask-caret .9s steps(1) infinite; }

/* Pea's side: the answer card, and Pea beside it (typing dots come from Pea) */
.anim-ask .ask-pea { position: relative; flex: 1 0 auto; display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.anim-ask .ask-side { flex: 1 1 0; align-self: stretch; min-width: 150px; display: flex; justify-content: center; align-items: flex-end; }
.anim-ask .ask-peawrap { position: relative; display: block; }
.anim-ask .ask-dots { position: absolute; z-index: 2; top: 16%; right: 98%; display: inline-flex; gap: 5px; padding: 14px 16px; border-radius: 20px 20px 6px 20px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 10px 22px -14px rgba(34, 56, 26, .55); opacity: 0; transform: scale(.7); transform-origin: 100% 100%; }
.anim-ask .ask-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--pea-hi); animation: ask-dot 1.1s ease-in-out infinite; }
.anim-ask .ask-dots i:nth-child(2) { animation-delay: .15s; }
.anim-ask .ask-dots i:nth-child(3) { animation-delay: .3s; }

.anim-ask .ask-reply { position: relative; flex: 0 1 592px; min-width: 0; padding: 15px 16px 16px; border-radius: 24px 24px 8px 24px; background: var(--paper); border: 1px solid var(--line); opacity: 0; transform: translateX(18px) scale(.97); transform-origin: 100% 100%; }
.anim-ask .ask-reply__lead { margin: 0; font: 800 21px/1.2 var(--display); letter-spacing: -.025em; color: var(--ink); }
.anim-ask .ask-rows { display: grid; gap: 7px; margin: 11px 0 0; padding: 0; list-style: none; }
.anim-ask .ask-rows li { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 9px; border-radius: 14px; background: #fff; border: 1px solid var(--line); font-size: 15.5px; line-height: 1.38; color: var(--ink); text-wrap: pretty; opacity: 0; transform: translateY(8px); }
.anim-ask .ask-ico { flex: none; display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: var(--pea-soft); color: var(--pea); font-style: normal; }
.anim-ask .ask-ico svg { width: 17px; height: 17px; }
.anim-ask .ask-ico--brass { background: var(--brass-soft); color: var(--brass); }

.anim-ask .ask-chip { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 17px 10px 14px; border-radius: 999px; background: var(--band); color: var(--band-ink); font: 700 15px/1 var(--body); box-shadow: 0 12px 24px -12px rgba(34, 56, 26, .85); opacity: 0; transform: scale(.7); transform-origin: 0 50%; }
.anim-ask .ask-chip svg { flex: none; width: 17px; height: 17px; color: #b6e07f; }
.anim-ask .ask-chip::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 0 rgba(111, 161, 74, .55); opacity: 0; }

.anim-ask .ask-pose { display: block; width: auto; height: 178px; max-width: none; margin-bottom: -6px; filter: drop-shadow(0 14px 12px rgba(34, 56, 26, .2)); opacity: 0; transform: translateY(18px) scale(.9); transform-origin: 50% 100%; }

/* composer: dressing that makes it read as a chat */
.anim-ask .ask-compose { display: flex; align-items: center; gap: 12px; margin: 0 18px 18px; padding: 7px 7px 7px 20px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 16px; }
.anim-ask .ask-compose i { flex: none; display: grid; place-items: center; width: 38px; height: 38px; margin-left: auto; border-radius: 50%; background: var(--band); color: var(--band-ink); font-style: normal; }
.anim-ask .ask-compose svg { width: 17px; height: 17px; }

/* ---------- beats ---------- */
.anim-ask .b-you .ask-you { opacity: 1; transform: none; transition: opacity .22s ease, transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.anim-ask .b-pea .ask-dots { opacity: 1; transform: none; transition: opacity .2s ease, transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.anim-ask .b-pea .ask-pose { opacity: 1; transform: none; animation: ask-pop .62s cubic-bezier(.3, 1.4, .5, 1) both; }
.anim-ask .b-reply .ask-dots { opacity: 0; transform: scale(.7); transition: opacity .15s ease, transform .15s ease; }
.anim-ask .b-reply .ask-reply { opacity: 1; transform: none; transition: opacity .3s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.anim-ask .b-reply .ask-rows li { opacity: 1; transform: none; transition: opacity .35s ease calc(var(--k, 0) * 120ms + 160ms), transform .5s cubic-bezier(.2, .7, .2, 1) calc(var(--k, 0) * 120ms + 160ms); }
.anim-ask .b-reply .ask-pose { animation: ask-hop .6s cubic-bezier(.3, 1.4, .5, 1) both; }
.anim-ask .b-chip .ask-chip { opacity: 1; transform: none; transition: opacity .2s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.anim-ask .b-chip .ask-chip::after { animation: ask-ring 1.6s ease-out .5s 2; }
.anim-ask .b-chip .ask-pose { animation: ask-idle 3.4s ease-in-out infinite; }
.anim-ask.is-off .ask-pose, .anim-ask.is-off .ask-dots i { animation-play-state: paused; }

@keyframes ask-caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes ask-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes ask-pop {
  0% { opacity: 0; transform: translateY(22px) scale(.86, .86); }
  45% { opacity: 1; transform: translateY(-6px) scale(.96, 1.04); }
  72% { transform: translateY(0) scale(1.04, .96); }
  100% { opacity: 1; transform: none; }
}
@keyframes ask-hop {
  0% { transform: none; }
  30% { transform: translateY(-12px) scale(.97, 1.03); }
  62% { transform: translateY(0) scale(1.04, .96); }
  100% { transform: none; }
}
@keyframes ask-idle { 0%, 100% { transform: none; } 50% { transform: translateY(-3px) rotate(-1deg); } }
@keyframes ask-ring { 0% { opacity: 1; box-shadow: 0 0 0 0 rgba(111, 161, 74, .5); } 100% { opacity: 0; box-shadow: 0 0 0 12px rgba(111, 161, 74, 0); } }

/* ---------- reduced motion: the same story with fades, nothing moves ---------- */
.anim-ask.is-rm .ask-ind { transition: opacity .18s ease; }
.anim-ask.is-rm .ask-tab svg, .anim-ask.is-rm .ask-tab[aria-selected="true"] svg { transform: none; }
.anim-ask.is-rm .ask-scene, .anim-ask.is-rm .ask-scene.is-out,
.anim-ask.is-rm .ask-you, .anim-ask.is-rm .ask-dots, .anim-ask.is-rm .ask-reply,
.anim-ask.is-rm .ask-rows li, .anim-ask.is-rm .ask-chip, .anim-ask.is-rm .ask-pose { transform: none; }
.anim-ask.is-rm .b-pea .ask-pose, .anim-ask.is-rm .b-reply .ask-pose { animation: ask-fade .45s ease both; }
.anim-ask.is-rm .b-chip .ask-pose, .anim-ask.is-rm .b-chip .ask-chip::after { animation: none; }
.anim-ask.is-rm .ask-dots i { animation-name: ask-blink; }
@keyframes ask-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ask-blink { 0%, 60%, 100% { opacity: .35; } 30% { opacity: 1; } }

/* ---------- phones: the pills become one neat segmented row, icon over label ---------- */
@media (max-width: 640px) {
  .anim-ask { margin-top: 32px; }
  .anim-ask .ask-tabs { width: 100%; padding: 5px; border-radius: 22px; }
  .anim-ask .ask-tab { flex-direction: column; gap: 5px; padding: 10px 2px 9px; border-radius: 17px; font-size: 12px; letter-spacing: 0; }
  .anim-ask .ask-tab svg { width: 20px; height: 20px; }
  .anim-ask .ask-tab:focus-visible { border-radius: 17px; }
  .anim-ask .ask-ind { top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 5); border-radius: 17px; }

  .anim-ask .ask-card { margin-top: 16px; border-radius: 24px; }
  .anim-ask .ask-top { padding: 12px 12px 12px 14px; gap: 10px; }
  .anim-ask .ask-top__ava { width: 38px; height: 38px; }
  .anim-ask .ask-top__ava img { width: 22px; }
  .anim-ask .ask-top__who b { font-size: 17px; }
  .anim-ask .ask-play, .anim-ask .ask-top .snd-btn { width: 36px; height: 36px; }

  .anim-ask .ask-chat { padding: 18px 14px 16px; }
  .anim-ask .ask-scene { gap: 14px; }
  .anim-ask .ask-you { max-width: 84%; padding: 10px 14px; font-size: 15.5px; border-radius: 20px 20px 6px 20px; }
  .anim-ask .ask-you__typed { top: 10px; left: 14px; right: 14px; }

  /* Pea stands just above the answer card's top-right corner, never on it */
  .anim-ask .ask-pea { --ph: 78px; display: block; padding-top: calc(var(--ph) + 4px); }
  .anim-ask .ask-side { position: absolute; z-index: 2; top: 0; right: 10px; display: block; min-width: 0; }
  .anim-ask .ask-dots { top: 18px; right: calc(100% + 4px); padding: 12px 14px; }
  .anim-ask .ask-reply { padding: 14px 12px 14px; border-radius: 22px 8px 22px 22px; transform: translateY(12px); transform-origin: 100% 0; }
  .anim-ask .ask-reply__lead { font-size: 18.5px; }
  .anim-ask .ask-rows { gap: 7px; margin-top: 11px; }
  .anim-ask .ask-rows li { gap: 10px; padding: 9px 11px 9px 9px; font-size: 14.5px; border-radius: 13px; }
  .anim-ask .ask-ico { width: 28px; height: 28px; border-radius: 9px; }
  .anim-ask .ask-ico svg { width: 15px; height: 15px; }
  .anim-ask .ask-chip { margin-top: 12px; padding: 10px 15px 10px 12px; font-size: 14px; }
  .anim-ask .ask-pose { height: var(--ph); margin: 0; filter: drop-shadow(0 6px 6px rgba(34, 56, 26, .2)); }

  .anim-ask .ask-compose { margin: 0 12px 12px; padding: 6px 6px 6px 16px; font-size: 15px; }
  .anim-ask .ask-compose i { width: 34px; height: 34px; }
}

@media (max-width: 480px) {
  .anim-ask .ask-ind__fill { bottom: 4px; inset-inline: 10px; }
}

@media (max-width: 360px) {
  .anim-ask .ask-tab { font-size: 10.5px; letter-spacing: -.01em; }
}

/* the page's "Nothing goes out without your OK" pill sits centred under the card */
.anim-ask + .okline { display: flex; width: fit-content; max-width: 100%; margin: 26px auto 0; }
