.apple-tour { position: fixed; inset: 0; z-index: 110; pointer-events: none; }
.apple-tour[hidden] { display: none; }
/* Closing: every layer fades on its own (opacity on .apple-tour itself would switch the
   backdrop blur off at once), the bubble and the apple sink a little. */
.apple-tour-leaving, .apple-tour-leaving * { pointer-events: none !important; }
.apple-tour-leaving > *, .apple-tour-blur.apple-tour-leaving { animation: apple-tour-out .26s ease forwards !important; }
.apple-tour-leaving > .apple-tour-bubble, .apple-tour-leaving > .apple-tour-mascot { animation-name: apple-tour-sink !important; }
@keyframes apple-tour-out { to { opacity: 0; } }
@keyframes apple-tour-sink { to { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes apple-tour-in { from { opacity: 0; } }
/* The blur fades in and between steps instead of switching on and off. */
.apple-tour-blur { position: fixed; inset: 0; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); background: #1f163a14; pointer-events: none;
  animation: apple-tour-in .3s ease; transition: opacity .3s ease, visibility 0s; }
.apple-tour-blur[hidden] { display: block; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
/* Waiting tips dock above the tab bar: the page ends above the bubble, so cards are never covered. */
body.apple-tour-docked main { bottom: var(--apple-tour-dock); padding-bottom: 24px; transition: bottom .5s cubic-bezier(.22,.8,.3,1); }
@media (prefers-reduced-motion: reduce) { body.apple-tour-docked main { transition: none; } }
.apple-tour-blur-low { z-index: 19; }
.apple-tour-ring { position: fixed; border: 3px solid #8b5cf6; border-radius: 18px; box-shadow: 0 0 0 5px #a78bfa40; pointer-events: none; }
/* The frame does not travel between targets: it waits for the bubble to settle, then fades in on the new place. */
.apple-tour-ring-in { animation: apple-ring-in .9s ease both; }
@keyframes apple-ring-in { 0%, 55% { opacity: 0; } 100% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .apple-tour-ring-in { animation: none; } }
.apple-tour-ring[hidden] { display: none; }
.apple-tour-bubble { position: fixed; pointer-events: auto; }
.apple-tour-glide .apple-tour-bubble { transition: top .7s cubic-bezier(.22,.8,.3,1), left .7s cubic-bezier(.22,.8,.3,1), height .7s cubic-bezier(.22,.8,.3,1); }
.apple-tour-art { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.apple-tour-opening .apple-tour-art { transform-origin: 17% 100%; animation: apple-bubble-pop .55s cubic-bezier(.22,.8,.3,1) both; }
/* Grows out of the tail with one soft overshoot, no second bounce. */
@keyframes apple-bubble-pop {
  0% { transform: scale(.6); opacity: 0; }
  45% { opacity: 1; }
  70% { transform: scale(1.015); }
  100% { transform: scale(1); opacity: 1; }
}
.apple-tour-copy { position: absolute; left: 12%; right: 10%; top: 10%; color: #24472c; font-family: inherit; }
.apple-tour-label { font-size: 10px; color: #567f48; font-weight: 700; }
.apple-tour-progress { float: right; font-size: 10px; color: #567f48; font-weight: 700; }
.apple-tour-key { color: #e8590c; text-shadow: 0 0 10px #ffd8a855; }
.apple-tour-copy p { margin: 7px 0 10px; font-size: 14px; line-height: 1.4; font-weight: 700; }
.apple-tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; white-space: nowrap; }
.apple-tour-actions button { font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; padding: 8px 8px; border: 0; border-radius: 10px; }
.apple-tour-next { background: #2d8c47; color: #fff; }
.apple-tour-next[hidden] { display: none; }
.apple-tour-skip { background: transparent; color: #526e4b; padding-inline: 4px !important; }
.apple-tour-demo { background: #ede9fe; color: #6d3fdc; }
.apple-tour-demo[hidden] { display: none; }
.apple-tour-actions button:focus-visible { outline: 3px solid #73b84f; outline-offset: 2px; }
.apple-tour-copy { opacity: 1; transition: opacity .35s; }
.apple-tour-opening .apple-tour-copy { opacity: 0; pointer-events: none; transition: none; }
.apple-tour-mascot { position: fixed; width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 5px 7px #43612a40); pointer-events: none; z-index: 1;
  transform-origin: 50% 85%; }
/* The apple trails the bubble with a little inertia: it overshoots and settles, like a living thing. */
.apple-tour-glide .apple-tour-mascot { transition: left .7s cubic-bezier(.22,.8,.3,1), top .7s cubic-bezier(.22,.8,.3,1); }
.apple-tour-mascot.hopping { animation: apple-tour-hop .8s ease-out; }
.apple-tour-mascot.wiggle { animation: apple-wiggle .5s ease-in-out; }
/* Typing: for every letter the apple stretches up a little and leans, then settles back. */
.apple-tour-mascot.typing { animation: apple-type .3s ease-out; }
.apple-tour-mascot.twirl { animation: apple-float 3.8s ease-in-out infinite, apple-twirl 1s cubic-bezier(.35,.05,.4,1); }
/* While prices load the apple spins in place, so the wait reads as progress. */
.apple-tour[data-step="loading"] .apple-tour-mascot, .apple-tour[data-step="pharmacyWait"] .apple-tour-mascot { animation: apple-float 3.8s ease-in-out infinite; }
/* Idle: a slow bob and a little tilt (individual properties, so hop/wiggle/twirl on transform still compose). */
@keyframes apple-float { 0%,100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -4px; rotate: 3deg; } }
@keyframes apple-type { 0% { transform: none; } 40% { transform: translateY(-3px) rotate(var(--tilt, 3deg)) scale(.9, 1.2); } 100% { transform: none; } }
@keyframes apple-wiggle { 0%,100% { transform: none; } 15% { transform: rotate(-14deg) scale(1.04); } 32% { transform: rotate(11deg); } 48% { transform: rotate(-8deg); } 64% { transform: rotate(5deg); } 80% { transform: rotate(-2deg); } }
@keyframes apple-twirl { 0% { transform: scale(1.08,.9); } 25% { transform: translateY(-16px) rotate(140deg) scale(1.02); } 60% { transform: translateY(-9px) rotate(300deg); } 85% { transform: rotate(372deg) scale(1.06,.94); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .apple-tour-mascot, .apple-tour-mascot.hopping, .apple-tour-mascot.wiggle, .apple-tour-mascot.twirl, .apple-tour-mascot.typing { animation: none; } .apple-tour-glide .apple-tour-mascot { transition: none; } }
@keyframes apple-tour-spin { 0% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-10px) rotate(180deg); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes apple-tour-hop { 0% { transform: scale(1.12,.86); } 30% { transform: translateY(-12px) rotate(-6deg) scale(.96,1.06); } 55% { transform: translateY(0) rotate(4deg) scale(1.1,.9); } 75% { transform: translateY(-3px) scale(.99,1.02); } 100% { transform: none; } }
@media (max-height: 440px) { .apple-tour-copy { top: 8%; } .apple-tour-label { font-size: 9px; } .apple-tour-copy p { font-size: 12px; margin: 3px 0 4px; line-height: 1.25; } .apple-tour-actions button { padding: 5px 7px; font-size: 11px; } }
.apple-tour-compact .apple-tour-copy { top: 6%; }
.apple-tour-compact .apple-tour-label, .apple-tour-compact .apple-tour-progress { display: none; }
.apple-tour-compact .apple-tour-label { font-size: 9px; }
.apple-tour-compact .apple-tour-copy p { font-size: 11px; margin: 3px 0 4px; line-height: 1.2; }
.apple-tour-compact .apple-tour-actions button { padding: 5px 7px; font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .apple-tour, .apple-tour-blur, .apple-tour * { transition: none !important; animation: none !important; } }

/* Step swap without the bubble popping: text appears hidden and fades in. */
.apple-tour-swap .apple-tour-copy { opacity: 0; transition: none; }
/* Last bubble: «Что ещё умеет CheapBot» and «Оформить Pro» each on its own row. */
/* the tail and the apple go to the right, toward the settings gear */
.apple-tour-final .apple-tour-art { transform: scaleX(-1); }
.apple-tour-final .apple-tour-actions { flex-wrap: wrap; gap: 6px; }
.apple-tour-final .apple-tour-actions button { flex: 1 1 100%; padding-block: 9px; }
/* Finish with the feature overview; the tariff remains a secondary action. */
.apple-tour-final .apple-tour-demo { order: 2; color: #6d3fdc; position: relative; overflow: hidden;
  background: linear-gradient(110deg, #2d8c47 0%, #3fae5f 30%, #8bd96b 50%, #3fae5f 70%, #2d8c47 100%) 0 0 / 250% 100%;
  background: #ede9fe; }
@keyframes apple-pro-shimmer { 0% { background-position: 100% 0; } 55%, 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .apple-tour-final .apple-tour-demo { animation: none !important; background: #ede9fe; } }
.apple-tour-final .apple-tour-next { order: 1; background: #2d8c47; color: #fff; }
.apple-tour-final .apple-tour-skip { order: 3; padding-block: 4px !important; }

/* Bubble buttons spring in one after another on every step; press squishes. */
.apple-tour-actions.btns-in button { animation: apple-btn-in .5s cubic-bezier(.34,1.56,.64,1) backwards; }
.apple-tour-actions.btns-in button:nth-child(2) { animation-delay: .08s; }
.apple-tour-actions.btns-in button:nth-child(3) { animation-delay: .16s; }
.apple-tour-actions button { transition: transform .15s cubic-bezier(.34,1.56,.64,1), filter .15s; }
.apple-tour-actions button:hover { transform: translateY(-2px) scale(1.04); }
.apple-tour-actions button:active { transform: scale(.92); filter: brightness(.95); }
@keyframes apple-btn-in { 0% { opacity: 0; transform: translateY(10px) scale(.7); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .apple-tour-actions button { transition: none; animation: none !important; } }

/* BJU story: a small reveal, with the apple reacting once at meaningful moments. */
.apple-tour-nutrition .apple-tour-label { color: #aa642f; }
.apple-tour-nutrition .apple-tour-ring { border-color: #ed9951; box-shadow: 0 0 0 5px #ffc07835; }
.apple-tour-nutrition .apple-tour-mascot { filter: drop-shadow(0 5px 8px #ed99514d); }
.nutrition-tour-preview { margin: 0 0 10px; border-radius: 12px; padding: 9px; background: #fff8ed; border: 1px solid #f2d7b8; }
.nutrition-tour-preview[hidden] { display: none; }
.nutrition-tour-preview > small { display: block; color: #82664d; font-size: 9px; margin-bottom: 6px; }
.nutrition-tour-macros { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 5px; }
.nutrition-tour-macros b { display: grid; gap: 2px; text-align: center; color: #376347; background: #fff; border-radius: 8px; padding: 7px 2px; animation: nutrition-macro-reveal .7s ease both; }
.nutrition-tour-macros b:first-child { background: #fff0d4; color: #b95c16; }
.nutrition-tour-macros b:nth-child(2) { animation-delay: .12s; }
.nutrition-tour-macros b:nth-child(3) { animation-delay: .24s; }
.nutrition-tour-macros b:nth-child(4) { animation-delay: .36s; }
.nutrition-tour-macros span { font-size: 15px; white-space: nowrap; }
.nutrition-tour-macros small { font-size: 9px; font-weight: 600; }
.apple-tour-mascot.nutrition-curious { animation: nutrition-curious 1.2s ease both; }
.apple-tour-mascot.nutrition-celebrate { animation: nutrition-celebrate 1.2s ease both; }
.apple-tour-mascot.nutrition-nod { animation: nutrition-nod .9s ease both; }
@keyframes nutrition-macro-reveal { from { opacity: 0; transform: translateY(7px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes nutrition-curious { 0%,100% { transform: none; } 40%,65% { transform: rotate(-7deg) translateY(-2px); } }
@keyframes nutrition-celebrate { 0%,100% { transform: none; } 25% { transform: translateY(-8px) scale(1.08); } 55% { transform: translateY(1px) scale(1.04,.97); } 75% { transform: scale(1.02); } }
@keyframes nutrition-nod { 0%,100% { transform: none; } 35% { transform: translateY(2px) rotate(4deg); } 65% { transform: rotate(-2deg); } }
.apple-tour-nutrition.apple-tour-compact .nutrition-tour-preview { display: none; }
@media (prefers-reduced-motion: reduce) { .nutrition-tour-macros b { animation: none; } }
