/* ─────────────────────────────────────────────────────────────────────
   KubePass v2 — Layering, Glass, Pass palette, Motion
   Loaded AFTER tokens.css. Extends the warm earth-tone system with depth
   tokens, glass surfaces, a single warm pass palette (no tiers), and the
   keyframes used by TiltCard / PulseRing / Reward unlock.
   ───────────────────────────────────────────────────────────────────── */

:root {
  /* ── Z-axis depth stack ─────────────────────────────────────────
     Each level pairs a tight contact shadow with a soft ambient
     shadow — the further from rest, the more separation. */
  --depth-0:        0 1px 1px rgba(40,28,18,0.04);
  --depth-1:        0 1px 2px rgba(40,28,18,0.06), 0 4px 12px -4px rgba(40,28,18,0.08);
  --depth-2:        0 2px 4px rgba(40,28,18,0.06), 0 12px 28px -10px rgba(40,28,18,0.14);
  --depth-3:        0 4px 8px rgba(40,28,18,0.08), 0 24px 48px -16px rgba(40,28,18,0.22);
  --depth-4:        0 8px 16px rgba(40,28,18,0.10), 0 36px 72px -20px rgba(40,28,18,0.30);
  --depth-hero:     0 2px 4px rgba(40,28,18,0.08), 0 18px 40px -12px rgba(40,28,18,0.32), 0 40px 80px -24px rgba(40,28,18,0.40);

  /* Inset highlight — the "lifted" sheen on dark surfaces */
  --inset-top:      inset 0 1px 0 rgba(255,255,255,0.08);
  --inset-top-strong: inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.18);

  /* Hero/coupon card shadow — the canonical drop-shadow used on the
     Passport hero. Standardized across the V2 pass card, the StackedCoupons
     front card, the RedeemScreen coupon, and every gradient-ambient hero
     across the prototype. Centralized so future changes happen in one place. */
  --shadow-card-hero: 0 20px 50px -20px rgba(29,27,32,0.55);

  /* ── Glass surfaces (visionOS-ish, warm-tinted) ─────────────── */
  --glass-light:        rgba(255, 251, 244, 0.62);
  --glass-light-strong: rgba(255, 251, 244, 0.78);
  --glass-dark:         rgba(34, 30, 27, 0.55);
  --glass-dark-strong:  rgba(34, 30, 27, 0.72);
  --glass-border:       rgba(255, 255, 255, 0.45);
  --glass-border-dark:  rgba(255, 255, 255, 0.10);
  --glass-blur:         blur(22px) saturate(160%);
  --glass-blur-lg:      blur(36px) saturate(170%);

  /* ── Pass palette (single, no tiers) ────────────────────────────
     Warm-dark gradient + amber foil sheen + multi-hue holo conic.
     Aliases --gradient-ember, the same warm hero gradient used by
     Quests/Passport cards (--gradient-ambient is a sibling alias), so the
     foil sheen reads as a specular highlight on a shared base. */
  /* Match Quests / Passport hero color (--gradient-ambient in tokens.css) so
     the V2 pass card reads consistent with the rest of the warm-amber hero
     surfaces in the prototype. */
  --pass-grad: var(--gradient-ember);

  /* Onboarding backdrop — a quieter cousin of --gradient-ambient. Mostly
     the flat warm-1000 base, with a small warm accent radial in the
     bottom-right corner so the dark surface picks up some brand colour
     without competing with form content. Used across welcome / phone /
     OTP / WhatsApp / profile-fill / profile-quick so the whole sign-up
     journey shares one atmospheric backdrop. */
  --gradient-onboarding:
    radial-gradient(55% 45% at 100% 100%, rgba(230,146,84,0.32) 0%, rgba(200,71,15,0.14) 35%, rgba(29,27,32,0) 70%),
    #1D1B20;
  --pass-sheen: linear-gradient(115deg,
    transparent 0%,
    rgba(255,170,90,0.22) 45%,
    rgba(255,200,140,0.45) 50%,
    rgba(255,170,90,0.22) 55%,
    transparent 100%);
  /* Holographic overlay — applied on top of the pass on tilt. */
  --holo-sheen: conic-gradient(
    from 180deg at 50% 50%,
    rgba(255, 173, 102, 0.0) 0deg,
    rgba(255, 173, 102, 0.45) 60deg,
    rgba(255, 218, 145, 0.35) 120deg,
    rgba(168, 200, 168, 0.30) 180deg,
    rgba(180, 168, 215, 0.35) 240deg,
    rgba(220, 150, 130, 0.40) 300deg,
    rgba(255, 173, 102, 0.0) 360deg
  );

  /* ── Motion ─────────────────────────────────────────────────────
     Spring-ish easings used for entrances and the unlock burst. */
  --ease-spring:    cubic-bezier(.34, 1.56, .64, 1);
  --ease-out-soft:  cubic-bezier(.22, .61, .36, 1);
  --ease-in-out:    cubic-bezier(.65, 0, .35, 1);
  --dur-fast:       0.18s;
  --dur-med:        0.32s;
  --dur-slow:       0.6s;
  --dur-hero:       0.9s;
}

/* ── Glass utility classes ─────────────────────────────────────── */
.kp-glass {
  background: var(--glass-light);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--depth-1);
}
.kp-glass-dark {
  background: var(--glass-dark);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-dark);
  box-shadow: var(--depth-1), var(--inset-top);
}

/* ── Pass tilt 3D — perspective + tilt transform stack ─────────── */
.kp-tilt-stage {
  perspective: 1400px;
  transform-style: preserve-3d;
}
.kp-tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.18s var(--ease-out-soft);
  will-change: transform;
}

/* ── Foil sheen — moves in response to tilt (var-driven) ───────── */
.kp-foil {
  position: absolute; inset: 0;
  background: var(--pass-sheen);
  background-position: var(--sheen-x, 50%) var(--sheen-y, 50%);
  background-size: 220% 220%;
  mix-blend-mode: overlay;
  opacity: 0.85;
  pointer-events: none;
  transition: background-position 0.1s linear;
  border-radius: inherit;
}

/* ── Reward unlock burst ───────────────────────────────────────── */
@keyframes kpUnlockBurst {
  0%   { transform: scale(0.6) rotate(-6deg); opacity: 0; }
  60%  { transform: scale(1.08) rotate(2deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes kpFoilSweep {
  0%   { background-position: -120% 50%; }
  100% { background-position:  220% 50%; }
}
@keyframes kpPulseRing {
  0%   { transform: scale(0.92); opacity: 0.9; }
  100% { transform: scale(1.45); opacity: 0;   }
}

/* ── Loading shell — three pulsing dots (used by LoadingShell in shared.jsx). */
@keyframes kpLoadingPulse {
  0%, 80%, 100% { transform: scale(0.55); opacity: 0.35; }
  40%           { transform: scale(1);    opacity: 1;    }
}
.kp-loading-dot {
  display: inline-block;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent-500);
  animation: kpLoadingPulse 1.2s ease-in-out infinite both;
}
/* Inline variant — for button captions, "load more" rows and stat slots. */
.kp-loading-dot--inline { width: 6px; height: 6px; }

/* ── Universal state entrance fade — shared by LoadingState, ErrorState, PlaceholderState. */
@keyframes kpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── AmbientHero orb field — drifting orb + two shimmers (copied from the
   kube-orb-drift / kube-shimmer-1 / kube-shimmer-2 blocks in fx-engine.jsx). */
@keyframes kpOrbDrift {
  0%   { transform: translate(0, 0); }
  50%  { transform: translate(-80vw, -60vh); }
  100% { transform: translate(0, 0); }
}
@keyframes kpShimmerA {
  0%   { transform: translate(0, 0); }
  25%  { transform: translate(-30vw, -20vh); }
  50%  { transform: translate(-70vw, -50vh); }
  75%  { transform: translate(-30vw, -20vh); }
  100% { transform: translate(0, 0); }
}
@keyframes kpShimmerB {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-50vw, -30vh); }
  66%  { transform: translate(-80vw, -55vh); }
  100% { transform: translate(0, 0); }
}
.kp-orb-drift  { animation: kpOrbDrift 20s ease-in-out infinite; will-change: transform; }
.kp-shimmer-a  { animation: kpShimmerA 8s ease-in-out infinite;  will-change: transform; }
.kp-shimmer-b  { animation: kpShimmerB 12s ease-in-out infinite; will-change: transform; }

/* ── Reduced motion — disable interactive + ambient animations. */
@media (prefers-reduced-motion: reduce) {
  .kp-tilt-card, .kp-foil { transition: none !important; }
  .kp-orb-drift, .kp-shimmer-a, .kp-shimmer-b { animation: none; }
  .kp-loading-dot { animation: none; opacity: 0.6; }
  /* Inline-style animations (animation: 'name …' in JSX, not a class) can't be stilled by the
     class rules in the v2 layer below — neutralised keyframes cover them. Sweep 2026-11-20:
     every inline animation in src now has its keyframe resting here (kpFoilSweep was the one
     still moving — the pass card's 2s foil sweep ran under reduced motion). */
  @keyframes kpUnlockBurst   { 0%,100% { transform: none; opacity: 1; } }
  @keyframes kpFoilSweep     { 0%,100% { background-position: 50% 50%; } }
  @keyframes kpPulseRing     { 0%,100% { transform: scale(1); opacity: 0.5; } }
  @keyframes kpLoadingPulse  { 0%,100% { transform: scale(0.8); opacity: 0.6; } }
  @keyframes pop             { 0%,100% { transform: none; opacity: 1; } }
  @keyframes kblink          { 0%,100% { opacity: 1; } }
  @keyframes kpFadeIn        { 0%,100% { opacity: 1; } }
}

/* ══ v2 motion layer ═════════════════════════════════════════════════════════
   Event-driven only (screen enter, tap, claim, dismiss) — no idle loops, no
   scroll-linked motion. Ported from docs/design/2026-11-10-app-v2/member.html.
   Usage: put .v2-enter on a screen root; children rise in with --i stagger. */
:root {
  --v2-ease-out: cubic-bezier(.22, .9, .24, 1);
  --v2-ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --i: 0;  /* stagger index of a block (set inline per child) */
  --j: 0;  /* stagger index of a rail card */
}

/* Entrance: every direct child rises in, staggered 45ms by its --i index. */
.v2-enter > * { animation: v2Rise .46s var(--v2-ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.v2-enter.v2-from-right > * { animation-name: v2RiseR; }
.v2-enter.v2-from-left > * { animation-name: v2RiseL; }
/* Pull-to-refresh chip (2026-11-25, owner screenshot + live check): it sits as a direct child of the
   Home scroller, so the entrance above animated it too — and an animation's fill (opacity 1, no
   transform) beats the chip's own inline resting state (opacity 0, lifted 44px out of view), leaving
   the arrow chip parked over the greeting. The chip never takes part in the entrance. */
.v2-enter > .kp-pull, .v2-enter.v2-from-right > .kp-pull, .v2-enter.v2-from-left > .kp-pull { animation: none; }
@keyframes v2Rise  { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes v2RiseR { from { opacity: 0; transform: translate(26px, 6px); } to { opacity: 1; transform: none; } }
@keyframes v2RiseL { from { opacity: 0; transform: translate(-26px, 6px); } to { opacity: 1; transform: none; } }

/* Progress bars fill from the left, 220ms after their block has risen. */
.v2-enter .v2-bar-fill { transform-origin: left; animation: v2Fill .9s var(--v2-ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 220ms); }
@keyframes v2Fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
/* Column charts (refinement 2026-11-14): bars rise from the baseline in a quick left-to-right
   stagger (--b = bar index) with the screen entrance; they used to appear fully drawn. */
.v2-enter .v2-col-grow { transform-origin: bottom; animation: v2ColGrow .7s var(--v2-ease-out) both; animation-delay: calc(var(--b, 0) * 28ms + 200ms); }
@keyframes v2ColGrow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Sparkline strokes draw in after the block has risen. */
.v2-enter .v2-spark path { stroke-dasharray: 400; animation: v2Draw 1s var(--v2-ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 220ms); }
@keyframes v2Draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }

/* Rails deal their cards in from the right, --j (60ms) per card. */
.v2-enter .v2-rail > * { animation: v2Deal .5s var(--v2-ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + var(--j, 0) * 60ms + 100ms); }
@keyframes v2Deal { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }

/* Journey stops rail (Quests, refinement 2026-11-14): the route is traced on entrance — each stop
   pops in 110ms after the previous one (--s = stop index) and each finished leg draws across
   just after the stop it leaves. */
.v2-enter .v2-route-stop { animation: v2StopIn .42s var(--v2-ease-spring) both; animation-delay: calc(var(--i, 0) * 45ms + 160ms + var(--s, 0) * 110ms); }
@keyframes v2StopIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.v2-enter .v2-route-seg { transform-origin: left; animation: v2Fill .32s var(--v2-ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 250ms + var(--s, 0) * 110ms); }

/* Tap feedback: hover lifts 2px, press scales to .98. The lift is for real pointers only: on a
   phone a tap applies :hover and it STICKS until the next tap elsewhere, so a tapped card stayed
   lifted (and keep-alive showed it lifted on return) — gated to hover-capable devices (2026-11-21).
   :active stays ungated so the press still answers a finger. */
.v2-tap { transition: transform .18s var(--v2-ease-out), box-shadow .18s; }
@media (hover: hover) { .v2-tap:hover { transform: translateY(-2px); } }
.v2-tap:active { transform: translateY(0) scale(.98); }

/* One-shot moments: check-in dot pop, floating +points, dismissed row collapse. */
.v2-pop { animation: v2Pop .5s var(--v2-ease-spring); }
@keyframes v2Pop { 40% { transform: scaleY(1.9) scaleX(1.15); } }
.v2-float { animation: v2Float .9s var(--v2-ease-out) forwards; pointer-events: none; }
@keyframes v2Float { from { opacity: 0; transform: translateY(6px) scale(.8); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-34px) scale(1.1); } }
.v2-collapse { animation: v2Collapse .38s var(--v2-ease-out) forwards; overflow: hidden; }
@keyframes v2Collapse { 0% { opacity: 1; max-height: 70px; } 40% { opacity: 0; transform: translateX(30px); } 100% { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; transform: translateX(30px); } }

/* Home "For you" list: rows come from self-hiding components, so hairlines are positional
   (adjacent siblings) and the whole section hides when no row rendered. */
.v2-fy > * + * { border-top: 1px solid var(--warm-75) !important; }
.v2-fy-dark > * + * { border-top-color: var(--glass-border-dark) !important; }
.v2-fy-sec:not(:has(.v2-fy > *)) { display: none; }

/* Tab bars (TabBar / MerchantTabBar): sliding indicator + active icon lift (prototype .tabs .ind, .tab.on svg). */
.v2-tab-ind { transition: left .42s var(--v2-ease-spring), opacity .2s; }
.v2-tab-ico { transition: transform .3s var(--v2-ease-spring); }

/* Segment swap (e.g. Rewards Active <-> Used & expired): the body slides in from the side the
   indicator moved to — right when moving to a later segment, left when moving back. */
.v2-swap-r { animation: v2RiseR .34s var(--v2-ease-out) both; }
.v2-swap-l { animation: v2RiseL .34s var(--v2-ease-out) both; }

/* Swap replays (useV2Replay): a pass preview settling in, and a caption fading up. */
.v2-pass-swap { animation: v2PassSwap .42s var(--v2-ease-spring) both; transform-origin: 50% 60%; }
.v2-swap-fade { animation: v2SwapFade .3s var(--v2-ease-out) both; }
@keyframes v2PassSwap { from { opacity: .35; transform: perspective(900px) rotateY(-14deg) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes v2SwapFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Success "pop" (scan found ring, cashier Done check, payment success, setup live badge). It
   used to be defined only inside the member scanner's inline <style>, so on every merchant
   screen the celebration never animated (refinement 2026-11-14). */
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* Text-caret blink for the phone / OTP inputs. It lived only in two screens' inline <style>, so
   the OTP screen's caret blinked only while one of them happened to be mounted (2026-11-14). */
@keyframes kblink { 50% { opacity: 0; } }

/* Daily check-in claim celebration (refinement 2026-11-14): the flame tile flares, sparks burst
   from the Claim button (--sx/--sy per spark), and the Done label pops. */
.kp-flame-flare { animation: kpFlameFlare .7s var(--v2-ease-spring) both; }
@keyframes kpFlameFlare { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.55); } 40% { transform: scale(1.28) rotate(-6deg); box-shadow: 0 0 0 10px rgba(255,255,255,0.18); } 100% { transform: none; box-shadow: 0 0 0 16px rgba(255,255,255,0); } }
.kp-spark { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; pointer-events: none; animation: kpSpark .75s var(--v2-ease-out) both; }
@keyframes kpSpark { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(.35); } }

/* Wrong-code shake (OTP / verify-phone code rows, refinement 2026-11-14): a short horizontal
   shake when an attempt fails, replayed per failure via useV2Replay. */
.kp-shake { animation: kpShake .4s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes kpShake { 0%, 100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }

/* Toast (KPToast, refinement 2026-11-14): rises in, drops out. The pill is centred with
   translateX(-50%), so the keyframes carry that offset too. */
.kp-toast-in  { animation: kpToastIn .32s var(--v2-ease-spring) both; }
.kp-toast-out { animation: kpToastOut .2s ease-in both; pointer-events: none; }
@keyframes kpToastIn  { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes kpToastOut { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, 10px); } }

/* Centred dialogs (v2DialogClasses / useV2Presence): card scales up, scrim fades; .is-closing
   plays both out (and stops taps) before unmount. */
.v2-dialog-scrim { animation: v2ScrimIn .18s ease-out both; }
.v2-dialog-card { animation: v2DialogIn .28s cubic-bezier(.34, 1.56, .64, 1) both; }
.v2-dialog-scrim.is-closing { animation: v2ScrimOut .2s ease-in both; pointer-events: none; }
.v2-dialog-card.is-closing { animation: v2DialogOut .2s ease-in both; pointer-events: none; }
@keyframes v2DialogIn  { from { opacity: 0; transform: scale(.92) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes v2DialogOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.96); } }

/* Bottom sheets (v2SheetClasses / useV2SheetExit): panel rises in and the scrim fades in; with
   .is-closing both play out (and stop taking taps) before the sheet unmounts. */
.v2-sheet-scrim { animation: v2ScrimIn .22s ease-out both; }
.v2-sheet-panel { animation: v2SheetIn .34s var(--v2-ease-out) both; }
.v2-sheet-scrim.is-closing { animation: v2ScrimOut .22s ease-in both; pointer-events: none; }
.v2-sheet-panel.is-closing { animation: v2SheetOut .22s ease-in both; pointer-events: none; }
@keyframes v2ScrimIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes v2ScrimOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes v2SheetIn  { from { transform: translateY(100%); } to { transform: none; } }
@keyframes v2SheetOut { from { transform: none; } to { transform: translateY(100%); } }

/* Popovers and disclosures (refinement 2026-11-14): a dropdown grows from its trigger's corner
   and shrinks back on close (.is-closing, via useV2Presence); an expanded accordion body fades
   down into place; a disclosure chevron turns rather than swapping glyphs. */
.v2-popover { animation: v2PopoverIn .18s var(--v2-ease-out) both; transform-origin: 0 0; }
.v2-popover.is-closing { animation: v2PopoverOut .14s ease-in both; pointer-events: none; }
@keyframes v2PopoverIn  { from { opacity: 0; transform: translateY(-4px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes v2PopoverOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-4px) scale(.97); } }
.v2-disclose { animation: v2Disclose .26s var(--v2-ease-out) both; }
@keyframes v2Disclose { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.v2-chev { display: inline-flex; transition: transform .28s var(--v2-ease-spring); }
/* Row press (2026-11-20, owner ask): a full-bleed disclosure row (Passport's country / city rows)
   must not shrink on tap — the app-wide press scale (.kp-fx button:active) pulled the row's whole
   background in from the card edges. A .kp-press-row stays put; its background (set through
   --kp-row-bg, so the tint can mix over it) deepens while pressed, and the chevron dips 1px. */
.kp-press-row { background: var(--kp-row-bg, transparent); transition: background-color .15s ease; }
.kube-app-frame .kp-press-row:not(:disabled):active,
.kp-fx .kp-press-row:not(:disabled):active {
  transform: none;
  background: color-mix(in srgb, var(--accent-500) 9%, var(--kp-row-bg, transparent));
}
.kp-press-row .v2-chev { translate: 0 0; transition: transform .28s var(--v2-ease-spring), translate .12s ease; }
.kp-press-row:not(:disabled):active .v2-chev { translate: 0 1px; }
/* Reduced motion: the row-press chevron settles without its transitions (the row's own
   background-color tint stays — colour is not motion; 2026-11-20 sweep). */
@media (prefers-reduced-motion: reduce) {
  .kp-press-row .v2-chev { transition: none; }
  .kp-press-row:not(:disabled):active .v2-chev { translate: 0 1px; }
}
/* A screen-entrance row (.v2-enter > *, animated with fill:both) is its own stacking context, so a
   popover inside it painted UNDER the next row (sign-in: the terms card covered the country list).
   The row holding a mounted popover is lifted above its siblings for as long as it shows. */
.v2-enter > :has(.v2-popover) { position: relative; z-index: 20; }

/* Passport exploration hero (refinement 2026-11-14): the dashed flight route marches toward the
   latest stamp, and a dashed orbit ring turns slowly around it. Both loop gently. */
.kp-route { animation: kpRouteMarch 1.6s linear infinite; }
@keyframes kpRouteMarch { to { stroke-dashoffset: -16; } }
.kp-orbit { animation: kpOrbit 16s linear infinite; }
@keyframes kpOrbit { to { transform: rotate(360deg); } }

/* Touch target (2026-11-23): an invisible 44x44 hit area centred on a small icon button (24–40px:
   a filter chip's ×, a dismiss, Reach's header and calendar buttons), so the look stays and the
   tap lands. Not for dense rows (colour swatches, carousel dots) — overlapping areas would send a
   near-edge tap to the neighbour; those keep WCAG's 24px-with-spacing minimum. */
.kp-hit44 { position: relative; }
.kp-hit44::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }

/* Toggle switch (.kp-switch, refinement 2026-11-14): the knob springs across on a transform
   (it used to tween `left` linearly), stretches toward its travel while pressed (iOS-style), and
   the track's colour eases. ::before extends the 24px track to a 44px touch target. */
.kp-switch { transition: background-color .22s ease; -webkit-tap-highlight-color: transparent; }
.kp-switch::before { content: ''; position: absolute; inset: -10px -2px; }
.kp-switch:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 3px; }
.kp-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 10px;
  background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 2px 6px -2px rgba(0,0,0,0.18);
  transition: transform .34s var(--v2-ease-spring), width .18s var(--v2-ease-out);
}
.kp-switch[aria-checked="true"] .kp-switch-knob { transform: translateX(18px); }
.kp-switch:not(:disabled):active .kp-switch-knob { width: 26px; }
.kp-switch[aria-checked="true"]:not(:disabled):active .kp-switch-knob { transform: translateX(12px); }
/* A whole-row switch (onboarding starter rewards, 2026-11-22): the row is the control and the
   switch inside is its look only — the knob follows the row's aria-checked; the row presses in. */
.mo-perk { transition: transform .16s var(--v2-ease-out), border-color .18s; -webkit-tap-highlight-color: transparent; }
.mo-perk:not(:disabled):active { transform: scale(.985); }
.mo-perk:focus-visible { outline: 2px solid var(--accent-500); outline-offset: 2px; }
.mo-perk-switch { transition: background-color .22s ease; }
.mo-perk[aria-checked="true"] .kp-switch-knob { transform: translateX(18px); }
.mo-perk:not(:disabled):active .kp-switch-knob { width: 26px; }
.mo-perk[aria-checked="true"]:not(:disabled):active .kp-switch-knob { transform: translateX(12px); }

/* Busy button spinner (Btn busy / "Saving…" state, refinement 2026-11-14): a small ring in the
   label colour, turning; under reduced motion it rests as a static ring (still reads as working). */
.kp-btn-spin {
  width: 14px; height: 14px; flex-shrink: 0; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; opacity: .9;
  animation: spin .7s linear infinite;
}

/* Loading placeholder bars (refinement 2026-11-15): a soft pulse where content is about to land,
   so a late-loading block does not jump into place; static under reduced motion. */
.kp-skel { border-radius: 6px; background: color-mix(in srgb, var(--fg-tertiary) 16%, transparent); animation: kpSkel 1.4s ease-in-out infinite; }
@keyframes kpSkel { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* Group choice diagram (refinement 2026-11-15): four nodes on the shared line light up in turn,
   like one pass travelling between branches; under reduced motion they rest lit. */
.gc-node { position: absolute; top: -3px; width: 8px; height: 8px; border-radius: 50%; transform: translateX(-50%);
  background: var(--accent-500); animation: gcNode 1.4s var(--v2-ease-out) infinite; }
@keyframes gcNode { 0%, 100% { opacity: .35; transform: translateX(-50%) scale(.8); } 30% { opacity: 1; transform: translateX(-50%) scale(1.25); } }
.gc-opt { transition: border-color .2s var(--v2-ease-out); }

/* Step timeline "you are here" (collab pending, refinement 2026-11-15): a ring breathes out from
   the current step's dot; under reduced motion the ring is not drawn (the filled dot remains). */
.kp-step-now { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: var(--accent-500); animation: kpPulseRing 1.8s var(--v2-ease-out) infinite; }

/* Payment confirmation (MPaymentSuccessScreen, refinement 2026-11-15): while Stripe confirms, an
   accent arc turns round the icon tile; on confirmed success one halo ring breathes out behind the
   popped check. Reduced motion: the arc rests as a static ring and the halo is not drawn. */
.kp-pay-arc {
  position: absolute; inset: -6px; border-radius: 50%; pointer-events: none;
  border: 3px solid var(--accent-500); border-right-color: transparent; border-bottom-color: transparent;
  animation: spin 1.1s linear infinite;
}
.kp-pay-halo {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: var(--accent-400, var(--accent-500)); opacity: 0;
  animation: kpPulseRing .9s var(--v2-ease-out) .12s 1 both;
}

/* Empty / placeholder state (PlaceholderState, refinement 2026-11-14): the icon tile settles in
   just after the dashed card fades in; a pressable state's chevron nudges forward on hover/press. */
/* Quest route rail: a walked segment draws down from the stop above (staggered by --s). */
.kp-rail-fill { transform-origin: top; animation: kpRailFill .42s var(--v2-ease-out) both; animation-delay: calc(var(--s, 0) * 70ms + 260ms); }
@keyframes kpRailFill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.kp-empty-ico { animation: kpEmptyIco .46s var(--v2-ease-spring) 90ms both; }
@keyframes kpEmptyIco { from { opacity: 0; transform: scale(.7) rotate(-8deg); } to { opacity: 1; transform: none; } }
.kp-empty-go { transition: transform .2s var(--v2-ease-out); }
/* Hover nudge for real pointers only (a tap's :hover sticks on touch — 2026-11-21); press and
   keyboard focus nudge everywhere. */
@media (hover: hover) { .kp-empty.is-pressable:hover .kp-empty-go { transform: translateX(3px); } }
.kp-empty.is-pressable:active .kp-empty-go,
.kp-empty.is-pressable:focus-visible .kp-empty-go { transform: translateX(3px); }

/* Done check (share / copy outcomes, refinement 2026-11-14): pops in with a small overshoot. */
.kp-done-pop { animation: kpDonePop .42s var(--v2-ease-spring) both; }
@keyframes kpDonePop { from { opacity: 0; transform: scale(.4) rotate(-20deg); } to { opacity: 1; transform: none; } }

/* Notification bell (KpBell, refinement 2026-11-14): the unread dot pops in when it appears; the
   bell swings once from its top when the unread count rises while the screen is open. */
.kp-bell-dot { animation: kpBellDot .38s var(--v2-ease-spring) both; }
@keyframes kpBellDot { from { transform: scale(0); } to { transform: none; } }
.kp-bell-ico { transform-origin: 50% 2px; }
.kp-bell-ring { animation: kpBellRing .8s ease-in-out both; }
@keyframes kpBellRing { 0%, 100% { transform: none; } 15% { transform: rotate(16deg); } 30% { transform: rotate(-13deg); } 45% { transform: rotate(9deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }

/* Live dashboard (merchant home "Today", refinement 2026-11-14): a breathing dot marks the live
   section, and a KPI tile flashes an accent ring once when a refresh changes its value. */
.kp-live-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--status-success); animation: kpLiveDot 2.4s ease-in-out infinite; }
@keyframes kpLiveDot { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-success) 45%, transparent); } 60% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--status-success) 0%, transparent); } }
.kp-tile-tick { animation: kpTileTick 1.1s var(--v2-ease-out) both; }
@keyframes kpTileTick { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-500) 0%, transparent); } 20% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 45%, transparent); } 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 0%, transparent); } }

/* A row that just arrived in a live list (useV2FreshKeys → V2Row motionClass, e.g. the merchant
   home ledger after a refresh): it opens from zero height so the rows below glide down instead of
   jumping, slides in, and its accent tint fades. `backwards` fill only: once done, nothing clamps
   the row's height. */
/* Merchant onboarding hours: a schedule row slides in when added and folds away when removed
   (it appeared and vanished in one frame, the rows below jumping). Max-heights cover the tallest
   row (day chips + times, ~110px; a wrapped custom-days row a little more). */
.mo-sched-in { animation: moSchedIn .32s var(--v2-ease-out) backwards; }
@keyframes moSchedIn { 0% { opacity: 0; transform: translateY(-6px) scale(.98); } 100% { opacity: 1; transform: none; } }
.mo-sched-out { animation: moSchedOut .26s var(--v2-ease-out) forwards; overflow: hidden; pointer-events: none; }
@keyframes moSchedOut {
  0%   { opacity: 1; max-height: 180px; }
  45%  { opacity: 0; transform: translateX(24px); }
  100% { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-top: -8px; border-width: 0; }
}
/* Editable rows (link rows, Reach interests) fold away the same way (useKpRowEdit). The doubled
   class outranks the row's own entrance class (.v2-tile-in, Reach's later-loaded .l-row-in). */
.kp-row-out.kp-row-out { animation: kpRowOut .26s var(--v2-ease-out) forwards; overflow: hidden; pointer-events: none; }
@keyframes kpRowOut {
  0%   { opacity: 1; max-height: 240px; }
  45%  { opacity: 0; transform: translateX(24px); }
  100% { opacity: 0; transform: translateX(24px); max-height: 0; padding-top: 0; padding-bottom: 0; margin-bottom: 0; border-width: 0; }
}
.v2-row-in { overflow: hidden; animation: v2RowIn .6s var(--v2-ease-out) backwards; }
@keyframes v2RowIn {
  0%   { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; transform: translateY(-8px); background-color: color-mix(in srgb, var(--accent-500) 16%, transparent); }
  50%  { max-height: 96px; padding-top: 13px; padding-bottom: 13px; opacity: 1; transform: none; background-color: color-mix(in srgb, var(--accent-500) 16%, transparent); }
  100% { max-height: 96px; padding-top: 13px; padding-bottom: 13px; background-color: transparent; }
}

/* A card that deals into a grid (refinement 2026-11-18): fades and rises without touching its
   height. v2-row-in (above) grows max-height to 96px with overflow hidden, so a taller card — the
   merchant Rewards hub tiles are 120px+ — showed clipped, then jumped to full height when the
   animation ended. Stagger with an inline animation-delay. */
.v2-tile-in { animation: v2Rise .46s var(--v2-ease-out) backwards; }

/* A settings group that is paused by another setting (notification categories while push is
   off, refinement 2026-11-14): it eases to half strength and back; taps are blocked by the
   disabled switches inside, not by pointer-events, so screen readers still read the rows. */
.kp-dim-group { transition: opacity .28s var(--v2-ease-out), filter .28s var(--v2-ease-out); }
.kp-dim-group.is-off { opacity: .5; filter: saturate(.4); }
/* The group already dims its switches; their own disabled fade (inline .55) would stack to ~.27 and
   hide which categories are on, so inside a paused group the switch keeps full strength. */
.kp-dim-group.is-off .kp-switch:disabled { opacity: 1 !important; }

/* Connectivity pill (KpConnectivityBanner, refinement 2026-11-14): drops in from the top, centred
   (its translateX(-50%) is part of the keyframes), and lifts away when "Back online" ends. */
.kp-net-pill { transform: translateX(-50%); animation: kpNetIn .34s var(--v2-ease-spring) both; }
.kp-net-pill.is-leaving { animation: kpNetOut .22s ease-in both; }
@keyframes kpNetIn  { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes kpNetOut { from { opacity: 1; transform: translateX(-50%); } to { opacity: 0; transform: translate(-50%, -10px); } }

/* OTP resend cooldown ring (OtpCooldownRing): each second's step glides instead of jumping. */
.kp-otp-ring { transition: stroke-dashoffset 1s linear; }

/* Focus rail (V2Rail focus / useV2RailFocus, refinement 2026-11-14): the card at the snap point is
   full size; neighbours ease to 94% and 60% opacity by --f (1 = focused). Dots stretch to a pill. */
.v2-focus-item { transform: scale(calc(.94 + .06 * var(--f, 1))); opacity: calc(.6 + .4 * var(--f, 1));
  transform-origin: left center; transition: transform .18s var(--v2-ease-out), opacity .18s var(--v2-ease-out); }
.v2-rail-dot { transition: width .28s var(--v2-ease-spring), background-color .2s ease; }
/* "Use now" reward card: a soft light sweep every few seconds, so a ready reward invites a tap. */
.kp-card-shimmer { position: relative; overflow: hidden; }
.kp-card-shimmer::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.55) 48%, transparent 66%);
  transform: translateX(-120%); animation: kpCardShimmer 4.2s ease-in-out 1s infinite; }
@keyframes kpCardShimmer { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
/* Flip-to-confirm reward card: the front turns over to a "Spend X points?" back. The hidden face
   becomes visibility:hidden once the turn ends, so it leaves the tab order and screen readers. */
.kp-flip { perspective: 900px; }
.kp-flip-inner { position: relative; height: 100%; transform-style: preserve-3d; transition: transform .5s var(--v2-ease-spring); }
.kp-flip.is-flipped .kp-flip-inner { transform: rotateY(180deg); }
.kp-flip-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: visibility 0s linear .25s; }
.kp-flip-back { position: absolute; inset: 0; transform: rotateY(180deg); }
.kp-flip:not(.is-flipped) .kp-flip-back, .kp-flip.is-flipped .kp-flip-front { visibility: hidden; }
/* A turned card is never shown dimmed/shrunk by the focus rail (its Confirm must read clearly). */
.v2-focus-item:has(.kp-flip.is-flipped) { opacity: 1; transform: none; }

/* Member shop page (taste pass, 2026-11-14). Hero entrance, once per open: the logo springs in,
   name / tagline / meta rise in turn (--d), the pass card lifts last. */
.mdh-in-logo { animation: mdhLogoIn .55s var(--v2-ease-spring) both; }
@keyframes mdhLogoIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.mdh-in { animation: v2Rise .5s var(--v2-ease-out) both; animation-delay: var(--d, 0ms); }
.mdh-in-card { animation: mdhCardIn .6s var(--v2-ease-out) .22s both; }
@keyframes mdhCardIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
/* Compact header: slides down from above once the hero is out of view. */
.mdh-bar { transform: translateY(-105%); opacity: 0; pointer-events: none;
  transition: transform .28s var(--v2-ease-out), opacity .2s ease; }
.mdh-bar.is-shown { transform: none; opacity: 1; pointer-events: auto; }
/* Pass card: lifts 2px on hover; the kp press layer handles the tap scale. */
.mdp-card { transition: transform .18s var(--v2-ease-out), box-shadow .18s var(--v2-ease-out); }
@media (hover: hover) { .mdp-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,0.32) !important; } }
/* Next-reward knob within 10% of the goal: three soft pulses, then rest. */
.mdp-knob.is-near { animation: mdpKnobPulse 1.2s ease-out .7s 3; }
@keyframes mdpKnobPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-500) 55%, transparent); } 100% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-500) 0%, transparent); } }

/* Campaign share landing (refinement 2026-11-14) — a signed-out visitor's first sight of KubePass:
   the shop mark springs in and its name rises, the photo settles from a slight zoom once loaded,
   the join bar slides up after the content, and an open offer's gift tile springs in last. */
.cl-in-pop { animation: mdhLogoIn .55s var(--v2-ease-spring) both; }
.cl-in-rise { animation: v2Rise .5s var(--v2-ease-out) .08s both; }
.cl-hero-settle { animation: clHeroSettle 1.2s var(--v2-ease-out) both; }
@keyframes clHeroSettle { from { transform: scale(1.06); } to { transform: none; } }
.cl-bar-in { animation: clBarIn .5s var(--v2-ease-out) .25s both; }
@keyframes clBarIn { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.cl-gift-pop { animation: mdhLogoIn .5s var(--v2-ease-spring) .6s both; }

/* Offer coupon ticket (refinement 2026-11-14): a dashed perforation across the card with a
   half-circle notch at each edge (painted the page colour via --kp-ticket-bg; the 22px offsets
   match the card's padding), and the value springs in after the card's own rise. */
.kp-ticket-cut { position: relative; margin: 18px -22px 16px; border-top: 1.5px dashed var(--border-card, rgba(0,0,0,.14)); }
.kp-ticket-cut::before, .kp-ticket-cut::after { content: ''; position: absolute; top: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--kp-ticket-bg, var(--surface-1)); }
.kp-ticket-cut::before { left: -10px; }
.kp-ticket-cut::after { right: -10px; }
.kp-ticket-value { display: inline-block; transform-origin: 0 60%; animation: mdhLogoIn .55s var(--v2-ease-spring) .35s both; }

/* Branch list (refinement 2026-11-14): rows rise in turn after the banner; an open branch's
   dot breathes twice, then rests. */
.br-row-in { animation: v2Rise .45s var(--v2-ease-out) both; animation-delay: calc(180ms + var(--i, 0) * 55ms); }
.br-open-dot { animation: brOpenDot 1.6s ease-out .8s 2; }
@keyframes brOpenDot { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--status-success) 55%, transparent); } 100% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--status-success) 0%, transparent); } }

/* Memberships category chips (refinement 2026-11-14): selection eases instead of snapping. */
.ms-chip { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }

/* Onboarding profile chips (refinement 2026-11-14): selection eases instead of snapping. */
.pq-chip { transition: background-color .2s ease, color .2s ease, border-color .2s ease; }

/* Chip pop-in (refinement 2026-11-14): a chip added to a selection springs in on mount. */
.kp-chip-in { animation: kpChipIn .32s var(--v2-ease-spring) both; }
@keyframes kpChipIn { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* Feedback stars (refinement 2026-11-14): the filled stars pop in turn when a rating is picked. */
.fb-star-pop { animation: fbStarPop .4s var(--v2-ease-spring) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fbStarPop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: none; } }

/* My feedback (refinement 2026-11-15): a new entry rises in; a card opened from the reply push
   glows twice, a reply that lands live glows once. */
.fb-card-in { animation: v2Rise .45s var(--v2-ease-out) both; }
.fb-card-glow { border-radius: var(--radius-lg); animation: fbCardGlow 1.4s ease-out .3s 2; }
.fb-card-glow.is-once { animation-iteration-count: 1; }
@keyframes fbCardGlow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent-500) 45%, transparent); } 100% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent-500) 0%, transparent); } }

/* Home hero pass card (2026-11-15). Entrance: the QR tile pops in after the card rises; one soft
   light sweep crosses the card (also replayed on each press). Press: the card presses in and the
   QR tile lifts toward the member. Live award: "+N" floats up from Lifetime, the glow brightens once. */
.hp-qr { animation: hpQrPop .5s var(--v2-ease-spring) .28s both; transition: transform .18s var(--v2-ease-out), box-shadow .18s var(--v2-ease-out); }
@keyframes hpQrPop { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
.hp-card:active .hp-qr { transform: translateY(-3px) scale(1.04); box-shadow: 0 12px 26px rgba(0,0,0,0.42), 0 1px 2px rgba(0,0,0,0.3) !important; }
.hp-sheen { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; overflow: hidden; z-index: 1; }
.hp-sheen::before { content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,235,210,0.16) 45%, rgba(255,255,255,0.22) 50%, rgba(255,235,210,0.16) 55%, transparent 100%);
  transform: translateX(-130%) skewX(-12deg); animation: hpSheen 1.1s var(--v2-ease-out) .45s both; }
@keyframes hpSheen { to { transform: translateX(330%) skewX(-12deg); } }
.hp-plus { position: absolute; left: 100%; top: -2px; margin-left: 6px; font-size: 12px; font-weight: 800; color: var(--accent-300); white-space: nowrap; animation: hpPlus 1.6s var(--v2-ease-out) both; }
@keyframes hpPlus { 0% { opacity: 0; transform: translateY(6px); } 18% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.hp-glow { position: absolute; inset: 0; border-radius: 28px; pointer-events: none; animation: hpGlow 1.4s ease-out both; }
@keyframes hpGlow { 0% { box-shadow: 0 0 0 0 rgba(232,101,26,0.55); } 100% { box-shadow: 0 0 0 16px rgba(232,101,26,0); } }

/* Shop look preview + onboarding logo (2026-11-22, shop-look-fields.jsx / onboarding Basics).
   .sl-hero-in   a look change: the new hero fades in over the previous background;
   .sl-sheen     one light sweep across the hero on each look change (the home pass card's sweep);
   .sl-logo-pop  a new logo / initial springs in (the home QR tile's pop);
   .sl-opt       a style option presses in; the picked one lifts;
   .sl-drop      the logo drop zone: a keyboard focus ring (its input is visually hidden) and a lit
                 state while a file is dragged over it. */
.sl-hero-in { animation: slHeroIn .42s var(--v2-ease-out) both; }
@keyframes slHeroIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
.sl-sheen { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.sl-sheen::before { content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.14) 45%, rgba(255,255,255,0.26) 50%, rgba(255,255,255,0.14) 55%, transparent 100%);
  transform: translateX(-130%) skewX(-12deg); animation: hpSheen 1s var(--v2-ease-out) .18s both; }
.sl-logo-pop { animation: hpQrPop .5s var(--v2-ease-spring) both; }
.sl-opt { transition: transform .18s var(--v2-ease-out), box-shadow .18s var(--v2-ease-out); }
.sl-opt[aria-checked="true"] { box-shadow: 0 8px 18px -10px rgba(0,0,0,0.45); }
.sl-opt:not(:disabled):active { transform: scale(.96); }
.mo-tag { transition: background-color .18s, color .18s, transform .16s var(--v2-ease-out); }
.mo-tag:not(:disabled):active { transform: scale(.94); }
.sl-drop { transition: border-color .18s, background-color .18s, transform .18s var(--v2-ease-out); }
.sl-drop:focus-within { outline: 2px solid var(--accent-500); outline-offset: 2px; }
.sl-drop.is-over { border-color: var(--accent-500) !important; border-style: solid !important; transform: scale(1.015);
  background-color: color-mix(in srgb, var(--accent-500) 10%, transparent) !important; }
@media (prefers-reduced-motion: reduce) {
  .sl-hero-in, .sl-logo-pop, .sl-sheen::before { animation: none; }
  .sl-sheen::before { opacity: 0; }
  .sl-opt, .sl-drop, .mo-tag { transition: none; }
  .mo-tag:not(:disabled):active { transform: none; }
  .mo-perk:not(:disabled):active { transform: none; }
  .sl-opt:not(:disabled):active, .sl-drop.is-over { transform: none; }
}

/* Onboarding "You're live!" (2026-11-22): the badge springs in, its check draws, two rings
   ripple out once; the "Members now see" page rises in after; the next-step card presses in. */
/* Onboarding map pin: a short drop + settle each time it moves (search pick, drag, my location). */
.mlm-pin-drop { animation: mlmPinDrop .5s var(--v2-ease-spring) both; transform-origin: 50% 100%; }
@keyframes mlmPinDrop { 0% { transform: translateY(-16px); } 60% { transform: translateY(0) scaleY(.92); } 100% { transform: none; } }
.mo-qr-pop { animation: hpQrPop .5s var(--v2-ease-spring) .12s both; }
.mo-live-badge { animation: hpQrPop .55s var(--v2-ease-spring) both; }
.mo-live-check path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: moCheckDraw .5s var(--v2-ease-out) .3s forwards; }
@keyframes moCheckDraw { to { stroke-dashoffset: 0; } }
.mo-live-ring { position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 55%, transparent);
  animation: moLiveRing 1.1s var(--v2-ease-out) .35s both; }
/* Starts invisible (kpPulseRing starts at 0.9 opacity, which showed a static ring during the delay). */
@keyframes moLiveRing { 0% { opacity: 0; transform: scale(.92); } 12% { opacity: .9; } 100% { opacity: 0; transform: scale(1.5); } }
.mo-live-ring.is-late { animation-delay: .6s; }
.mo-live-page { animation: v2Rise .5s var(--v2-ease-out) .55s both; }
.mo-next { transition: transform .16s var(--v2-ease-out); }
.mo-next:not(:disabled):active { transform: scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .mo-live-badge, .mo-live-page, .mo-qr-pop, .mlm-pin-drop { animation: none; }
  .mo-live-check path { animation: none; stroke-dashoffset: 0; }
  .mo-live-ring { animation: none; opacity: 0; }
  .mo-next { transition: none; }
  .mo-next:not(:disabled):active { transform: none; }
}

/* Passport badges + world tree (refinement 2026-11-18, passport-badges.jsx / passport-screen.jsx).
   .pp-ring       a locked badge's progress ring draws from empty to its value (--pp-from → --pp-to);
   .pp-medal-pop  an earned medal springs in;
   .pp-shine      one light sweep across an earned tile, after its medal lands;
   .pp-halo       the badge sheet's earned medal breathes a soft halo;
   .pp-stamp      a VISITED chip lands like a passport stamp (big → set, a slight tilt). */
/* --pp-from / --pp-to are set inline per ring (circumference / target offset); 0 defaults keep a
   ring without them drawn as-is. */
.pp-ring { --pp-from: 0; --pp-to: 0; animation: ppRing .9s var(--v2-ease-out) both; }
@keyframes ppRing { from { stroke-dashoffset: var(--pp-from); } to { stroke-dashoffset: var(--pp-to); } }
.pp-medal-pop { animation: ppMedalPop .5s var(--v2-ease-spring) both; }
@keyframes ppMedalPop { 0% { opacity: 0; transform: scale(.3) rotate(-25deg); } 70% { opacity: 1; transform: scale(1.12) rotate(4deg); } 100% { opacity: 1; transform: none; } }
.pp-shine { position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg);
  animation: ppShine .9s ease-out both; }
@keyframes ppShine { from { left: -60%; opacity: 1; } to { left: 130%; opacity: 1; } }
.pp-halo { position: absolute; inset: 6px; border-radius: 50%; background: color-mix(in srgb, var(--accent-500) 30%, transparent);
  animation: ppHalo 2.6s ease-in-out infinite; }
@keyframes ppHalo { 0%, 100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.22); opacity: 0; } }
.pp-stamp { display: inline-block; animation: ppStamp .42s var(--v2-ease-spring) both; }
@keyframes ppStamp { 0% { opacity: 0; transform: scale(1.9) rotate(-14deg); } 100% { opacity: 1; transform: rotate(-4deg); } }
/* .pp-stamp-in  a round merchant stamp lands (big, swung) and settles at its own tilt (--r). */
.pp-stamp-in { --r: 0deg; animation: ppStampIn .46s var(--v2-ease-spring) both; }
@keyframes ppStampIn { 0% { opacity: 0; transform: scale(1.7) rotate(calc(var(--r) - 16deg)); } 100% { opacity: 1; transform: rotate(var(--r)); } }

/* Customer intelligence (customer-intel-screen.jsx, 2026-11-19): each cohort heatmap cell fades
   and settles in, staggered as one diagonal wave from week 0 of the oldest cohort. */
.ci-cell-in { animation: ciCellIn .36s var(--v2-ease-out) both; }
@keyframes ciCellIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* Around map pins (google-around-map.jsx, 2026-11-19): a teardrop in the shop's colour with its logo,
   dropping in with a bounce; the nearest pulses a soft ring on the ground; a tapped pin pops up and
   the rest dim; the shop's preview card slides up inside the map. The wrapper carries the selection
   transform and the body the drop, so the two never fight. */
.kp-map-pin { --kp-pin-gold: var(--accent-glow); position: relative; width: 44px; height: 56px; cursor: pointer; transform-origin: 50% 100%;
  transition: transform .3s var(--v2-ease-spring), opacity .2s ease, filter .2s ease; }
.kp-map-pin.is-selected { transform: scale(1.22) translateY(-4px); }
.kp-map-pin.is-dim { opacity: .5; }
.kp-map-pin.is-closed .kp-map-pin-drop { filter: grayscale(.85); }
.kp-map-pin-drop { position: absolute; inset: 0; animation: kpPinDrop .56s var(--v2-ease-spring) backwards; }
@keyframes kpPinDrop { 0% { opacity: 0; transform: translateY(-30px) scale(.6); } 60% { opacity: 1; transform: translateY(3px) scale(1.05); } 100% { opacity: 1; transform: none; } }
.kp-map-pin-head { position: absolute; left: 3px; top: 0; width: 38px; height: 38px; border-radius: 50%; overflow: hidden;
  border: 3px solid var(--warm-0); box-shadow: 0 4px 10px rgba(0,0,0,.28); display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
.kp-map-pin-head img { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--warm-0); }
.kp-map-pin-mark { color: var(--warm-0); font-family: var(--font-brand); font-weight: 800; font-size: 14px; line-height: 1; }
.kp-map-pin-tail { position: absolute; left: 50%; top: 31px; width: 12px; height: 12px; margin-left: -6px; transform: rotate(45deg);
  border-right: 3px solid var(--warm-0); border-bottom: 3px solid var(--warm-0); box-sizing: border-box; border-bottom-right-radius: 3px; }
.kp-map-pin-star { position: absolute; right: -1px; top: -3px; width: 17px; height: 17px; border-radius: 50%; background: var(--kp-pin-gold); color: var(--warm-1000);
  border: 2px solid var(--warm-0); font-size: 9px; line-height: 13px; text-align: center; box-sizing: border-box; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.kp-map-pin.is-selected .kp-map-pin-head { box-shadow: 0 8px 18px rgba(0,0,0,.32); }
.kp-map-pin-pulse { position: absolute; left: 50%; bottom: 0; width: 20px; height: 8px; margin-left: -10px; border-radius: 50%;
  opacity: .5; animation: kpPinPulse 2.4s ease-out infinite; }
@keyframes kpPinPulse { 0% { transform: scale(.6); opacity: .55; } 100% { transform: scale(2.8); opacity: 0; } }
.kp-map-preview { animation: kpMapPreviewIn .34s var(--v2-ease-out) both; }
@keyframes kpMapPreviewIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* OTP verified (otp-screen.jsx, 2026-11-18): each code box gives one small bounce, staggered. */
.otp-ok { animation: otpOk .38s var(--v2-ease-spring) both; }
/* .kp-bump — the same small bounce for any figure a stepper just changed (earning rules, 2026-11-19);
   applied to a span re-keyed by its value, never to an <input> (re-keying would drop focus). */
.kp-bump { display: inline-block; animation: otpOk .38s var(--v2-ease-spring) both; }
@keyframes otpOk { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }

/* Tap feedback on the design tokens (owner ask, 2026-11-18). Mobile browsers flash their own
   highlight on every tap — Android Chrome's is blue — which no part of the app chose and which
   ignored the theme. It is switched off everywhere (the property inherits), and every enabled
   tappable thing in the app frame answers the press with --press-filter instead: buttons, role=button
   rows and cards (kpPressProps sets the role), links, tabs, switches, radios and checkboxes. It
   stacks with the existing press scale (.kp-fx, Reach .l-btn / [data-kp-press]). Disabled controls
   do not react. A filter is not motion, so it stays under reduced motion too. */
html { -webkit-tap-highlight-color: transparent; }
.kube-app-frame :is(button, [role="button"], [role="link"], [role="tab"], [role="switch"], [role="radio"], [role="checkbox"], a[href], summary):not(:disabled):not([aria-disabled="true"]):active {
  filter: var(--press-filter);
}

/* Merchant scan success (scan-screen.jsx DoneStepM, 2026-11-18): one success ring bursts outward
   behind the badge as it pops in. Not drawn under reduced motion (it would rest as a stray ring). */
.scan-ok-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--status-success);
  pointer-events: none; animation: scanOkRing .7s var(--v2-ease-out) .12s both; }
@keyframes scanOkRing { from { opacity: .9; transform: scale(.9); } to { opacity: 0; transform: scale(1.7); } }

/* Shop setup: Home's "Continue setting up" card and the setup guide (2026-11-24).
   The card's progress fills once from empty as it lands; the guide's step headers and the wizard's
   Guide pill dim a touch on press (a touch app: :active, not hover). Reduced motion: the fill rests
   at its value, nothing presses. */
.setup-resume-fill { transform-origin: left; animation: setupResumeFill .45s var(--v2-ease-out) both; animation-delay: calc(var(--s, 0) * 70ms + 180ms); }
/* The step it reopens at glows twice after landing; Continue's arrow steps forward on press. */
.setup-resume-now { animation: setupResumeGlow 1.2s ease-in-out 2 both; animation-delay: calc(var(--s, 0) * 70ms + 650ms); }
@keyframes setupResumeGlow { 50% { opacity: .45; } }
.setup-resume-go { transition: transform .18s var(--v2-ease-out); }
button:active .setup-resume-go { transform: translateX(4px); }
@keyframes setupResumeFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.mo-guide-head, .mo-guide-btn { transition: opacity .15s ease, transform .15s ease; -webkit-tap-highlight-color: transparent; }
.mo-guide-head:active { opacity: .72; }
.mo-guide-btn:active { transform: scale(.96); }

/* Home's empty-memberships actions (2026-11-24): a press squeezes the pill a touch. */
.home-empty-act { transition: transform .15s ease; -webkit-tap-highlight-color: transparent; }
.home-empty-act:active { transform: scale(.96); }

/* Home greeting skies (2026-11-24): each scene plays once as Home appears and again on a tap (the
   SVG is re-keyed). Morning: the sun rises over the horizon. Afternoon: the rays turn a quarter and
   the cloud drifts in. Evening: the sun settles onto the horizon. Night: the moon swings in and the
   stars twinkle twice. The greeting pill squeezes on press. */
.hg-rise { animation: hgRise .9s var(--v2-ease-out) both; }
@keyframes hgRise { from { transform: translateY(9px); } to { transform: none; } }
.hg-spin { animation: hgSpin 1.1s var(--v2-ease-out) both; }
@keyframes hgSpin { from { transform: rotate(-45deg); opacity: .3; } to { transform: none; opacity: 1; } }
.hg-drift { animation: hgDrift .9s var(--v2-ease-out) .15s both; }
@keyframes hgDrift { from { transform: translateX(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.hg-set { animation: hgSet 1s var(--v2-ease-out) both; }
@keyframes hgSet { from { transform: translateY(-8px); } to { transform: none; } }
.hg-swing { animation: hgSwing .9s var(--v2-ease-spring) both; }
@keyframes hgSwing { from { transform: rotate(-35deg) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.hg-twinkle { animation: hgTwinkle .8s ease-in-out 2 both; }
@keyframes hgTwinkle { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.home-greet-btn { transition: transform .15s ease; -webkit-tap-highlight-color: transparent; }
.home-greet-btn:active { transform: scale(.96); }

/* Attention ring (2026-11-24): the greeting note's "Show me" rings Today's check-in card twice. */
.kp-attn { animation: kpAttn .65s ease-in-out 2; }
@keyframes kpAttn { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-500) 55%, transparent); } }

/* Home install card (2026-11-24): the KubePass tile drops onto the phone's home screen, then the
   notification slides down and its bell swings once — the order tells the story (install → alert). */
.ih-tile { animation: ihTile .5s var(--v2-ease-spring) .25s both; }
@keyframes ihTile { from { transform: translateY(-14px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.ih-note { animation: ihNote .45s var(--v2-ease-out) .8s both; }
@keyframes ihNote { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
.ih-bell { animation: ihBell .6s ease-in-out 1.25s both; }
@keyframes ihBell { 0%, 100% { transform: none; } 25% { transform: rotate(18deg); } 50% { transform: rotate(-14deg); } 75% { transform: rotate(8deg); } }

/* Merchant Visit card (2026-11-24): Directions' route icon steps forward on press; a day chip squeezes. */
.visit-go { transition: transform .18s var(--v2-ease-out); }
button:active .visit-go { transform: translateX(3px); }
.visit-day:active { transform: scale(.94); }

/* Pull to refresh (2026-11-25): the arrow turns once the pull is armed; the chip eases back. */
.kp-pull { transition: opacity .2s ease; }
.kp-pull-arrow { transition: transform .2s var(--v2-ease-out); }
.kp-pull[data-armed="1"] .kp-pull-arrow { transform: rotate(180deg); }

/* Reduced motion: everything rests in its final state, nothing animates. */
@media (prefers-reduced-motion: reduce) {
  .v2-enter > *, .v2-enter .v2-bar-fill, .v2-enter .v2-col-grow, .v2-enter .v2-route-stop, .v2-enter .v2-route-seg, .v2-enter .v2-spark path, .v2-enter .v2-rail > *,
  .mo-sched-in, .mo-sched-out, .kp-row-out.kp-row-out, .v2-pop, .v2-float, .v2-collapse, .v2-swap-r, .v2-swap-l, .v2-sheet-scrim, .v2-sheet-panel,
  .v2-pass-swap, .v2-swap-fade, .v2-dialog-scrim, .v2-dialog-card, .kp-toast-in, .kp-toast-out, .kp-shake, .kp-flame-flare, .kp-btn-spin, .kp-empty-ico, .kp-rail-fill, .kp-done-pop, .kp-bell-dot, .kp-bell-ring, .kp-live-dot, .kp-tile-tick, .v2-row-in, .v2-tile-in, .kp-net-pill, .kp-net-pill.is-leaving,
  .mdh-in-logo, .mdh-in, .mdh-in-card, .mdp-knob.is-near,
  .cl-in-pop, .cl-in-rise, .cl-hero-settle, .cl-bar-in, .cl-gift-pop,
  .kp-ticket-value, .br-row-in, .br-open-dot, .kp-chip-in, .fb-star-pop, .fb-card-in, .fb-card-glow,
  .hp-qr, .hp-sheen::before, .hp-plus, .hp-glow,
  .v2-popover, .v2-disclose, .kp-route, .kp-orbit { animation: none; }
  /* Passport: rings rest at their value, medals and stamps set, no sweep or halo. */
  .pp-ring, .pp-medal-pop, .pp-stamp-in { animation: none; }
  .otp-ok { animation: none; }
  .kp-bump { animation: none; }
  .kp-map-pin-drop, .kp-map-preview { animation: none; }
  .kp-map-pin { transition: none; }
  .kp-map-pin-pulse { display: none; }
  .ci-cell-in { animation: none; }
  .scan-ok-ring { display: none; }
  /* Shop setup (2026-11-24): the card's fill rests at its value, nothing presses. */
  .setup-resume-fill, .setup-resume-now { animation: none; }
  .setup-resume-go { transition: none; }
  button:active .setup-resume-go { transform: none; }
  .mo-guide-head, .mo-guide-btn { transition: none; }
  .mo-guide-btn:active { transform: none; }
  .home-empty-act { transition: none; }
  .home-empty-act:active { transform: none; }
  .hg-rise, .hg-spin, .hg-drift, .hg-set, .hg-swing, .hg-twinkle { animation: none; }
  .home-greet-btn { transition: none; }
  .home-greet-btn:active { transform: none; }
  .kp-attn { animation: none; }
  .ih-tile, .ih-note, .ih-bell { animation: none; }
  .visit-go { transition: none; }
  .kp-pull, .kp-pull-arrow { transition: none; }
  button:active .visit-go, .visit-day:active { transform: none; }
  .pp-stamp { animation: none; transform: rotate(-4deg); }
  .pp-shine, .pp-halo { display: none; }
  /* Payment confirmation: the arc rests as a static ring; the one-shot halo is not drawn. */
  .kp-pay-arc { animation: none; }
  .kp-pay-halo { display: none; }
  .kp-step-now { display: none; }
  .gc-node { animation: none; opacity: 1; }
  .kp-skel { animation: none; }
  .gc-opt { transition: none; }
  /* Sparks would rest at their origin with no animation, so they are not drawn at all. */
  .kp-spark { display: none; }
  /* Final states of the forwards-filled one-shots (else they rest in their START state). */
  .v2-float { opacity: 0; }
  .v2-collapse { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
  .v2-enter .v2-spark path { stroke-dasharray: none; }
  .v2-tap { transition: none; }
  .v2-tap:hover, .v2-tap:active { transform: none; }
  .mo-perk, .mo-perk-switch, .v2-tab-ind, .v2-tab-ico, .v2-chev, .kp-switch, .kp-switch-knob, .kp-empty-go, .kp-dim-group, .kp-otp-ring,
  .v2-focus-item, .v2-rail-dot, .kp-flip-inner, .kp-flip-face { transition: none; }
  .mdh-bar, .mdp-card, .ms-chip, .pq-chip { transition: none; }
  .hp-qr { transition: none; }
  .hp-card:active .hp-qr { transform: none; }
  .hp-sheen { display: none; }
  .mdp-card:hover { transform: none; }
  /* Focus rail: no scaling under reduced motion (dimming stays — it is not motion). */
  .v2-focus-item { transform: none; }
  .kp-card-shimmer::after { animation: none; display: none; }
  .kp-empty.is-pressable:is(:hover, :active, :focus-visible) .kp-empty-go { transform: none; }
  /* App-wide field focus (end of file): field, box and V2Row transitions. Those rules come LATER
     in the file with the same specificity, so these are raised with an `html` prefix to win. */
  html .kube-app-frame :is(input, textarea, select),
  html .kube-app-frame div:has(> :is(input, textarea):is([style*="border: none"], [style*="border-style: none"])), html .v2-row { transition: none; }
  /* Inline animations (style={{ animation: … }} — pulses, foil sweeps, scanner sweeps, cursor
     blinks, the Reach waveform, toasts) are outside every class above, and a stylesheet cannot
     reach them without !important. They settle at their end state: one near-instant run, no
     delay, no loop (2026-11-18 reduced-motion audit — 35 inline animations ignored the setting). */
  [style*="animation"] {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
  }
  /* Collab wizard flow dot rests mid-arrow (2026-11-26). */
  .cw-flow-dot { animation: none; opacity: .8; transform: translateX(11px); }
  /* Collab hero line is simply drawn (2026-11-27). */
  .kp-hero-link { animation: none; }
  /* Banner photos hold still (2026-11-27). */
  .kp-banner-drift { animation: none; }
  /* Check-in calendar days and runs appear at once; today's ring holds still (2026-11-27). */
  .kp-cal-pop, .kp-cal-run, .kp-cal-open, .kp-cal-pick { animation: none; }
  /* Banner strip + banners list (2026-11-27): no progress fill, no pulse, no reorder slide. */
  .kp-banner-progress, .kp-banner-moved-up, .kp-banner-moved-down { animation: none; }
  .kp-banner-progress { transform: none; }
  /* Collab cards on the business page (2026-11-27): the chevron holds still. */
  .kp-collab-nudge { animation: none; }
}


/* v2 form fields: accent focus ring on editable inputs (InputBox). */
.v2-field:focus { border-color: var(--accent-500); box-shadow: 0 0 0 3px var(--accent-100); }

/* App-wide field focus (refinement 2026-11-14): most screens style their inputs inline with
   outline:none and no focus state, so tapping into a field changed nothing. Scoped to the app
   frame, without touching every screen:
   - a field that draws its own border gets the accent border + soft ring when focused;
   - a borderless input (border: none — Chrome serialises it as border-style: none, so both
     spellings are matched) rings its immediate wrapper instead, but ONLY when that
     wrapper has a visible inline border (the search-box pattern), never a layout div;
   - hidden inputs (opacity: 0, e.g. OTP code capture), checkboxes, radios, ranges, colour and
     file pickers are excluded. !important is needed to beat the inline border colour. */
.kube-app-frame :is(input, textarea, select),
.kube-app-frame div:has(> :is(input, textarea):is([style*="border: none"], [style*="border-style: none"])) {
  transition: border-color .18s ease, box-shadow .18s ease;
}
.kube-app-frame :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([style*="border: none"]):not([style*="border-style: none"]):not([style*="opacity: 0"]):focus {
  border-color: var(--accent-500) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 22%, transparent) !important;
}
.kube-app-frame div:is([style*="border: 1px"], [style*="border-style: solid"]):has(> :is(input, textarea):is([style*="border: none"], [style*="border-style: none"]):not([style*="opacity: 0"]):focus) {
  border-color: var(--accent-500) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-500) 22%, transparent) !important;
}
/* An invalid field keeps its danger colour while focused (2026-11-27, Chrome check of the banner
   editor): the accent ring above is !important, so a field marked aria-invalid="true" turned orange
   the moment the app focused it to show the problem — the red outline vanished exactly when the
   member was looking at it. Same selectors plus [aria-invalid="true"] (higher specificity, later in
   the file) so the danger ring wins for both a bordered field and a borderless field's wrapper. */
.kube-app-frame :is(input, textarea, select)[aria-invalid="true"]:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([style*="border: none"]):not([style*="border-style: none"]):not([style*="opacity: 0"]):focus {
  border-color: var(--status-danger-text) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-danger-text) 20%, transparent) !important;
}
.kube-app-frame div:is([style*="border: 1px"], [style*="border-style: solid"]):has(> :is(input, textarea)[aria-invalid="true"]:is([style*="border: none"], [style*="border-style: none"]):not([style*="opacity: 0"]):focus) {
  border-color: var(--status-danger-text) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-danger-text) 20%, transparent) !important;
}
/* Where the field ring above applies, it replaces the global :focus-visible outline (index.html),
   which Chrome also shows on a tapped text input and which drew a second, tight rectangle around
   the bare text area inside the ringed box. Inputs the ring does not cover keep the outline. */
.kube-app-frame :is(input, textarea, select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([style*="border: none"]):not([style*="border-style: none"]):not([style*="opacity: 0"]):focus-visible,
.kube-app-frame div:is([style*="border: 1px"], [style*="border-style: solid"]) > :is(input, textarea):is([style*="border: none"], [style*="border-style: none"]):not([style*="opacity: 0"]):focus-visible {
  outline: none !important;
}
/* A V2Row editing in place (an input in its sub slot, Personal info): the whole row is the field,
   so it takes a soft accent tint and an accent edge while its input is focused, and the input's
   own tight outline is dropped. */
.v2-row { transition: background-color .18s ease, box-shadow .18s ease; }
.v2-row:has(:is(input, textarea, select):focus) {
  background: color-mix(in srgb, var(--accent-500) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--accent-500);
}
.v2-row :is(input, textarea, select):focus-visible { outline: none !important; }

/* iOS Safari date/time fields (2026-11-21). WebKit draws the value inside its own
   ::-webkit-date-and-time-value box, with two documented quirks the app's 18 date/time fields hit:
   - an EMPTY field's value box has no height, so a blank date field collapses shorter than the
     text fields beside it (padding is not enough to hold it open);
   - since iOS 15 the value is CENTRED, while every other field in the app reads left-aligned.
   The pseudo-element exists only in WebKit, so Chrome / Android / desktop are untouched. Unscoped
   (not .kube-app-frame) so fields in portalled sheets get it too. */
input::-webkit-date-and-time-value {
  min-height: 1.2em;
  text-align: left;
}


/* Collab wizard flow diagram (2026-11-26): a coupon dot travels along the spend → coupon arrow.
   Decorative; stopped under reduced motion. */
.cw-flow-track { position: absolute; left: 0; right: 6px; top: 8px; height: 2px; border-radius: 1px; background: currentColor; opacity: .25; }
.cw-flow-dot { position: absolute; left: 0; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  animation: cwFlowTravel 1.8s var(--ease-in-out) infinite; }
@keyframes cwFlowTravel { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateX(22px); opacity: 0; } }

/* Collab hero (2026-11-27): the line between the two businesses draws in from the middle. */
.kp-hero-link { transform-origin: center; animation: kpHeroLink .5s var(--v2-ease-out) .24s both; }
@keyframes kpHeroLink { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Business banner carousel (2026-11-27): the active card's photo drifts slowly. */
.kp-banner-drift { animation: kpBannerDrift 9s var(--ease-in-out) infinite alternate; transform-origin: 60% 40%; }
@keyframes kpBannerDrift { from { transform: scale(1); } to { transform: scale(1.06); } }

/* Check-in calendar (2026-11-27): checked-in days pop in on a stagger, a run's bar grows from its
   day, and today's ring breathes while today is still open. */
.kp-cal-pop { animation: kpCalPop .42s var(--v2-ease-spring) backwards; }
.kp-cal-run { transform-origin: left center; animation: kpCalRun .36s var(--v2-ease-out) backwards; }
.kp-cal-open { animation: kpCalOpen 2.4s var(--ease-in-out) infinite; }
@keyframes kpCalPop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes kpCalRun { from { transform: scaleX(0); } to { transform: none; } }
@keyframes kpCalOpen { 0%, 100% { transform: none; } 50% { transform: scale(1.08); } }

/* Banner strip (member business page, 2026-11-27): the active dot fills over the auto-advance
   interval (duration set inline from BANNER_ADVANCE_MS). */
.kp-banner-progress { transform-origin: left center; animation: kpBannerProgress linear both; }
@keyframes kpBannerProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Banners list (business, 2026-11-27): a moved card slides in from where it was. */
.kp-banner-moved-up { animation: kpBannerFromBelow .38s var(--v2-ease-out) both; }
.kp-banner-moved-down { animation: kpBannerFromAbove .38s var(--v2-ease-out) both; }
@keyframes kpBannerFromBelow { from { transform: translateY(40%); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes kpBannerFromAbove { from { transform: translateY(-40%); opacity: .6; } to { transform: none; opacity: 1; } }

/* Collab cards on the member business page (2026-11-27): "How it works ›" nudges its chevron. */
.kp-collab-nudge { animation: kpCollabNudge 1.8s var(--ease-in-out) infinite; }
@keyframes kpCollabNudge { 0%, 60%, 100% { transform: none; } 30% { transform: translateX(3px); } }

/* Check-in calendar: the tapped day's ring pops in (2026-11-28). */
.kp-cal-pick { animation: kpCalPick .28s var(--v2-ease-spring) both; }
@keyframes kpCalPick { from { transform: scale(.82); } to { transform: none; } }
