
:root {
  --ava-cyan: #34FFFD;
  --ava-pink: #FF3AF2;
  --ava-violet: #8a4ffb;
  --ava-gold: #FFC56B;
  --ava-space1: #0A021F;
  --ava-space2: #14052A;
  --text-main: #ffffff;
  --bubble-ava-bg: rgba(58,16,102,0.85);
  --bubble-user-bg: rgba(52,255,253,0.18);
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at top, var(--ava-space2) 0%, #020011 70%);
  -webkit-tap-highlight-color: transparent;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: radial-gradient(circle at top, var(--ava-space2) 0%, #020011 70%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
  touch-action: manipulation;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  background: radial-gradient(circle at top, var(--ava-space2) 0%, #020011 70%);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  touch-action: manipulation;
}

/* iOS: avoid input focus zoom while keeping responsive typography elsewhere */
input,
textarea {
  font-size: 16px;
}

.ava-modal-hidden {
  display: none !important;
}

/* Version update banner: new deploy available */
.ava-version-banner-hidden {
  display: none !important;
}
#ava-version-banner:not(.ava-version-banner-hidden) {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000003;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(10, 2, 31, 0.98);
  border-top: 1px solid var(--ava-cyan);
  box-shadow: 0 -4px 20px rgba(52, 255, 253, 0.15);
}
.ava-version-banner-text {
  color: var(--text-main);
  font-size: 14px;
}
.ava-version-refresh-btn {
  padding: 8px 16px;
  background: var(--ava-cyan);
  color: var(--ava-space1);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.ava-version-refresh-btn:hover {
  background: #2ee8e6;
}

/* Referral share modal (post-checkout) - above orb/tagline, fully opaque */
#ava-referral-share-modal,
#ava-referral-dashboard {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000002;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#ava-referral-share-modal:not(.ava-modal-hidden),
#ava-referral-dashboard:not(.ava-modal-hidden) {
  display: flex;
}
#ava-referral-share-modal .ava-modal-content,
#ava-referral-dashboard .ava-modal-content {
  background: rgb(18, 18, 28);
  backdrop-filter: none;
}
.ava-referral-share-content,
.ava-referral-dashboard-content {
  position: relative;
}
.ava-referral-share-text,
.ava-referral-dashboard-text {
  margin-bottom: 20px;
}
.ava-referral-share-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.ava-referral-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid rgba(52, 255, 253, 0.4);
  background: rgba(52, 255, 253, 0.12);
  color: var(--ava-cyan);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.ava-referral-btn:hover {
  background: rgba(52, 255, 253, 0.2);
  border-color: var(--ava-cyan);
}
.ava-referral-dashboard-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}
.ava-referral-stat span {
  font-weight: 600;
  color: var(--ava-cyan);
}
.ava-referral-link-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.ava-referral-link-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.3);
  color: rgba(255,255,255,0.9);
  font-size: 13px;
}
#ava-referral-share-modal .ava-modal-close,
#ava-referral-dashboard .ava-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
#ava-referral-share-modal .ava-modal-close:hover,
#ava-referral-dashboard .ava-modal-close:hover {
  background: rgba(255,255,255,0.1);
}

.ava-order-success-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.6rem 1rem;
  background: rgba(52, 255, 253, 0.2);
  border: 1px solid var(--ava-cyan);
  border-radius: 999px;
  color: var(--text-main);
  font-size: 0.9rem;
  z-index: 100000;
  animation: ava-toast-in 0.3s ease;
}
@keyframes ava-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ToS / Privacy modal - above orb/tagline, fully opaque */
#ava-tos-modal {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000003;
  pointer-events: auto;
}
#ava-tos-modal .ava-modal-content {
  background: rgb(18, 18, 28);
  backdrop-filter: none;
}

body.ava-modal-active #micBtn,
body.ava-modal-active .orb,
body.ava-modal-active #orb-container,
body.ava-modal-active #product-area,
body.ava-modal-active #productArea,
body.ava-modal-active .cart-icon,
body.modal-active #micBtn,
body.modal-active .orb,
body.modal-active #orb-container,
body.modal-active #product-area,
body.modal-active #productArea,
body.modal-active .cart-icon {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.2s ease;
}

.ava-modal-content {
  background: rgba(20, 20, 35, 0.75);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 32px;
  width: 90%;
  max-width: 480px;
  text-align: center;
  color: white;
  box-shadow:
    0 0 40px rgba(170, 120, 255, 0.25),
    0 0 80px rgba(120, 80, 255, 0.15);
  animation: avaFadeIn 0.3s ease-out;
  pointer-events: auto;
}

.ava-modal-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.ava-modal-tab {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.ava-modal-tab:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
}

.ava-modal-tab.active {
  background: rgba(52,255,253,0.15);
  border-color: rgba(52,255,253,0.4);
  color: var(--ava-cyan);
}

.ava-tos-panel {
  text-align: left;
}

.ava-tos-panel.hidden {
  display: none;
}

.ava-modal-full-link {
  margin-top: 14px;
  margin-bottom: 0;
  font-size: 12px;
}

/* :link/:visited beats UA default dark blue for mailto on dark modal background */
.ava-modal-full-link a:link,
.ava-modal-full-link a:visited {
  color: #c9fffc;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(201, 255, 252, 0.5);
}

.ava-modal-full-link a:hover,
.ava-modal-full-link a:focus-visible {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

@keyframes avaFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.ava-modal-content h2 {
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg,
    var(--ava-cyan) 0%,
    var(--ava-pink) 50%,
    var(--ava-cyan) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  animation: metallicShine 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
}

.ava-modal-content p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
}

.ava-tos-scroll {
  margin-top: 20px;
  border-radius: 16px;
  background: rgba(20, 20, 35, 0.6);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  padding: 16px;
}

.ava-tos-scroll h3 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.ava-tos-content {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
}
.ava-tos-content::-webkit-scrollbar {
  width: 8px;
}
.ava-tos-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}
.ava-tos-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
}
.ava-tos-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}

/* Express Mode modal - above orb/tagline, fully opaque */
#ava-express-modal:not(.ava-modal-hidden) {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 1000002;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#ava-express-modal .ava-modal-content {
  background: rgb(18, 18, 28);
  backdrop-filter: none;
}

.ava-express-description {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

.ava-tos-content p {
  margin: 0 0 10px 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,255,255,0.75);
}

.ava-tos-content p:last-child {
  margin-bottom: 0;
}

.ava-tos-content a:link,
.ava-tos-content a:visited {
  color: #c9fffc;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(201, 255, 252, 0.5);
}

.ava-tos-content a:hover,
.ava-tos-content a:focus-visible {
  color: #ffffff;
  text-decoration-color: rgba(255, 255, 255, 0.85);
}

.ava-tos-unlock-hint {
  margin: 14px 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,0.72);
  text-align: left;
}

.ava-tos-checkbox {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
}

.ava-tos-checkbox input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
}

.ava-tos-checkbox label {
  cursor: pointer;
}

#avaAcceptBtn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ava-modal-actions {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ava-modal-actions button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

#ava-tos-decline {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
}

#ava-tos-decline:hover {
  background: rgba(255,255,255,0.15);
}

#ava-tos-accept,
#avaAcceptBtn {
  background: linear-gradient(90deg, #9f7bff, #ff6ad5);
  color: white;
  box-shadow: 0 0 20px rgba(159,123,255,0.5);
}

#ava-tos-accept:hover,
#avaAcceptBtn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 0 30px rgba(255,106,213,0.6);
}

/* Stars background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  background-image: 
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,1), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 33% 60%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 66% 20%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 40% 90%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 70% 50%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 45% 85%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 25% 75%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 85% 45%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 35% 55%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 55% 35%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 95% 65%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 5% 95%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 65% 5%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 12% 45%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 28% 15%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 42% 88%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 58% 32%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 72% 78%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 88% 22%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 8% 62%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 38% 8%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 52% 92%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 68% 48%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 82% 68%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 18% 38%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 32% 82%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 48% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 62% 58%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 78% 28%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 92% 72%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 3% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 7% 88%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 13% 52%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 17% 28%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 23% 76%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 27% 44%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 37% 16%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 43% 64%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 47% 96%, rgba(255,255,255,0.85), transparent),
    radial-gradient(2px 2px at 53% 36%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 57% 84%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 63% 24%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 67% 56%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 73% 4%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 77% 84%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 83% 52%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 87% 20%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 93% 68%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 97% 44%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 11% 96%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 19% 8%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 31% 72%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 39% 40%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 49% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 59% 80%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 69% 48%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 79% 16%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 89% 64%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 99% 32%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 4% 56%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 14% 24%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 24% 88%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 34% 48%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 44% 16%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 54% 76%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 64% 44%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 74% 12%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 84% 60%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 94% 28%, rgba(255,255,255,0.95), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: stars 12s linear infinite;
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

/* Denser, smaller stars layer */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: transparent;
  background-image:
    radial-gradient(1px 1px at 6% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 12% 74%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 18% 42%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 24% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 29% 88%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 33% 33%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 37% 67%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 41% 6%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 46% 54%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 51% 21%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 56% 92%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 61% 36%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 66% 10%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 71% 76%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 76% 46%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 81% 14%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 86% 58%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 92% 24%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 96% 82%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 9% 92%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 22% 56%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 48% 78%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 58% 6%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 88% 8%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 73% 30%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 14% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 35% 92%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 64% 68%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90% 46%, rgba(255,255,255,0.85), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.7;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.25));
  mix-blend-mode: screen;
  animation: stars2 18s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes stars {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-100px);
  }
}

@keyframes stars2 {
  from { transform: translateY(0); }
  to { transform: translateY(-140px); }
}

#app {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Hero: credits + trial chip — top-left, matches Prime/mode glass pills (clickable → Credits Modal) */
.ava-hero-usage-banner {
  position: fixed;
  top: calc(20px + env(safe-area-inset-top, 0px));
  left: calc(16px + env(safe-area-inset-left, 0px));
  z-index: 10002;
  max-width: min(46vw, 220px);
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(52, 255, 253, 0.5);
  background:
    linear-gradient(
      145deg,
      rgba(52, 255, 253, 0.16) 0%,
      rgba(255, 255, 255, 0.08) 45%,
      rgba(255, 58, 242, 0.1) 100%
    ),
    rgba(22, 10, 52, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 16px rgba(52, 255, 253, 0.34),
    0 0 36px rgba(255, 58, 242, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  display: block;
  width: max-content;
}

.ava-hero-usage-banner:hover {
  border-color: rgba(52, 255, 253, 0.62);
  box-shadow:
    0 0 22px rgba(52, 255, 253, 0.42),
    0 0 40px rgba(255, 58, 242, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 24px rgba(0, 0, 0, 0.38);
}

.ava-hero-usage-banner:focus-visible {
  outline: 2px solid rgba(52, 255, 253, 0.85);
  outline-offset: 3px;
}

.ava-hero-usage-banner--low {
  border-color: rgba(250, 204, 21, 0.45);
}

/* Fresh session: make “restore” line readable (was 10px uppercase) */
.ava-hero-usage-banner--recovery .ava-hero-credits-alert {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  line-height: 1.35;
  max-width: 220px;
  color: rgba(253, 224, 71, 0.98);
}

.ava-hero-usage-banner--out {
  border-color: rgba(248, 113, 113, 0.55);
  box-shadow:
    0 0 14px rgba(248, 113, 113, 0.22),
    0 8px 24px rgba(0, 0, 0, 0.45);
}

.ava-hero-credits-alert {
  display: block;
  margin: 6px 0 0;
  padding: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(252, 165, 165, 0.95);
  line-height: 1.25;
}

.ava-hero-usage-banner--low .ava-hero-credits-alert {
  color: rgba(253, 224, 71, 0.95);
}

/* Hover / keyboard focus: explain credits vs Express trial line */
.ava-hero-banner-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 10005;
  min-width: min(260px, 72vw);
  max-width: min(300px, 85vw);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.97);
  background: rgba(26, 12, 54, 0.94);
  border: 1px solid rgba(52, 255, 253, 0.42);
  box-shadow:
    0 0 20px rgba(52, 255, 253, 0.15),
    0 12px 40px rgba(0, 0, 0, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s;
}

.ava-hero-usage-banner:hover .ava-hero-banner-tooltip,
.ava-hero-usage-banner:focus-visible .ava-hero-banner-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

@media (hover: none) {
  .ava-hero-banner-tooltip {
    display: none;
  }
}

/* Table layout so label/value columns line up across credits + secondary row */
.ava-hero-usage-stack {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ava-hero-usage-stack .ava-hero-usage-row {
  display: table-row;
}

.ava-hero-usage-stack .ava-hero-usage-label {
  display: table-cell;
  padding-right: 10px;
  vertical-align: baseline;
}

.ava-hero-usage-stack .ava-hero-usage-value {
  display: table-cell;
  vertical-align: baseline;
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.ava-hero-usage-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  line-height: 1.25;
}

.ava-hero-usage-stack .ava-hero-usage-row + .ava-hero-usage-row {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.ava-hero-usage-stack .ava-hero-usage-row--secondary .ava-hero-usage-label,
.ava-hero-usage-stack .ava-hero-usage-row--secondary .ava-hero-usage-value {
  padding-top: 6px;
  border-top: 1px solid rgba(52, 255, 253, 0.28);
}

.ava-hero-usage-stack .ava-hero-usage-value--secondary {
  white-space: nowrap;
}

.ava-hero-usage-row + .ava-hero-usage-row {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(52, 255, 253, 0.28);
}

.ava-hero-usage-row--hidden {
  display: none !important;
}

.ava-hero-usage-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.ava-hero-usage-value {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, var(--ava-cyan) 0%, var(--ava-pink) 55%, var(--ava-cyan) 100%);
  background-size: 180% 180%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 8px rgba(52, 255, 253, 0.5)) drop-shadow(0 0 12px rgba(255, 58, 242, 0.25));
  white-space: nowrap;
  text-align: right;
  min-width: 0;
}

.ava-hero-usage-value--secondary {
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
  text-align: right;
  line-height: 1.3;
  color: rgba(236, 254, 255, 0.92);
  -webkit-text-fill-color: rgba(236, 254, 255, 0.92);
}

@media (max-width: 380px) {
  .ava-hero-usage-banner {
    max-width: min(52vw, 200px);
    padding: 8px 10px;
  }
  .ava-hero-usage-value {
    font-size: 13px;
  }
  .ava-hero-usage-value--secondary {
    font-size: 11px;
  }
}

#top-bar {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 5;
  text-align: center;
  min-width: 200px; /* Ensure space for cart icon */
}

#top-bar .tagline {
  display: none; /* Hide tagline from header, will show below orb */
}

#cart-icon {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(10, 2, 31, 0.95);
  border: 3px solid var(--ava-cyan);
  color: var(--ava-cyan);
  font-size: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10000;
  box-shadow: 0 0 15px rgba(52, 255, 253, 0.7), 0 0 30px rgba(52, 255, 253, 0.4);
  text-shadow: 0 0 10px rgba(52, 255, 253, 0.8);
}

#cart-icon:hover {
  background: var(--ava-cyan);
  color: var(--ava-space1);
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(52, 255, 253, 0.8), 0 0 40px rgba(52, 255, 253, 0.5);
}

#cart-icon:active {
  transform: scale(0.95);
}

/* Prime toggle wrapper: hover shows tooltip + cart-like fill */
.ava-prime-toggle-wrap {
  position: fixed;
  top: 24px;
  right: 294px;
  width: 160px;
  min-width: 160px;
  height: 40px;
  z-index: 10000;
}

/* Prime preference: Express only; visibility gated in app (trial/preview runs or paying Express). */
.ava-prime-toggle-wrap--hidden {
  display: none !important;
  visibility: hidden;
  pointer-events: none;
}

.ava-prime-preview {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  padding: 12px 14px;
  max-width: 280px;
  background: var(--ava-space2);
  border: 2px solid var(--ava-cyan);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400;
  box-shadow: 0 0 16px rgba(52, 255, 253, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 10001;
}

/* Prime and Express toggles: same pill style, side by side (Prime left, Express right) */
#avaPrimePreferenceToggle,
#avaModeToggle {
  position: fixed;
  top: 24px;
  height: 40px;
  padding: 0 36px 0 16px;
  border-radius: 999px;
  border: 2px solid var(--ava-cyan);
  background: rgba(10, 2, 31, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2334FFFD' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 12px 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ava-cyan);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  box-shadow:
    0 0 10px rgba(52,255,253,0.5),
    0 0 20px rgba(255,58,242,0.3);
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
  z-index: 10000;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ava-prime-toggle-wrap #avaPrimePreferenceToggle {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  min-width: 160px;
}
#avaModeToggle {
  right: 152px;
  min-width: 130px;
}

/* Prime: cart-like hover (fill + scale) and show tooltip */
.ava-prime-toggle-wrap:hover #avaPrimePreferenceToggle {
  background: var(--ava-cyan) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%230A021F' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--ava-space1);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(52, 255, 253, 0.8), 0 0 40px rgba(52, 255, 253, 0.5);
}

#avaModeToggle:hover {
  border-color: var(--ava-cyan);
  background: rgba(15, 4, 40, 0.98) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2334FFFD' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 12px 12px;
  text-shadow:
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  box-shadow:
    0 0 10px rgba(52,255,253,0.5),
    0 0 20px rgba(255,58,242,0.3);
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
}

#avaPrimePreferenceToggle:focus,
#avaModeToggle:focus {
  border-color: var(--ava-cyan);
  box-shadow:
    0 0 0 2px rgba(52, 255, 253, 0.4),
    0 0 10px rgba(52,255,253,0.5),
    0 0 20px rgba(255,58,242,0.3);
  text-shadow:
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
}

.logo {
  font-weight: 500;
  letter-spacing: 0.12em;
  font-size: 72px;
  background: linear-gradient(135deg, 
    var(--ava-cyan) 0%, 
    var(--ava-pink) 50%, 
    var(--ava-cyan) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  animation: metallicShine 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
}

.tagline {
  font-size: 16px;
  opacity: 0.8;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  justify-content: flex-start;
  padding-top: calc(50vh + 100px); /* Product area below centered orb */
  padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}

/* Mobile responsive layout - centered stack */
@media (max-width: 768px) {
  html, body {
    overflow: hidden !important;
    height: 100%;
    height: 100svh;
    overscroll-behavior: none;
    position: fixed;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    touch-action: manipulation;
  }
  
  body {
    position: relative;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100svh;
  }
  
  #top-bar {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    z-index: 5;
    text-align: center;
  }
  
  #top-bar .logo {
    font-size: clamp(24px, 8vw, 36px);
    letter-spacing: 0.08em;
    margin: 0;
    padding: 0;
    line-height: 1;
  }
  
  #cart-icon {
    top: 15px;
    right: 15px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  .ava-prime-toggle-wrap {
    top: 18px;
    right: 268px;
    min-width: 130px;
    height: 36px;
  }
  .ava-prime-toggle-wrap #avaPrimePreferenceToggle {
    min-width: 130px;
  }
  #avaPrimePreferenceToggle,
  #avaModeToggle {
    top: 18px;
    height: 36px;
    font-size: 12px;
    padding: 0 32px 0 12px;
    background-position: right 10px center;
  }
  #avaModeToggle {
    right: 132px;
    min-width: 114px;
  }
  
  #orb-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    margin: 0;
    padding: 0;
    z-index: 1000000;
  }
  
  #orb-container .orb {
    width: 120px;
    height: 120px;
    margin: 0;
    padding: 0;
    position: relative;
    z-index: 2;
    transform: scale(0.95);
    order: 1; /* Orb/button first in flex order */
  }
  
  #orb-container .tagline {
    font-size: clamp(15px, 3.7vw, 18.4px) !important; /* Increased by 15% (was clamp(13px, 3.2vw, 16px)) */
    letter-spacing: 0.05em;
    text-align: center;
    white-space: normal !important;
    display: block;
    margin: 0;
    padding: 0 20px;
    position: relative;
    z-index: 2;
    overflow: visible;
    text-overflow: ellipsis;
    max-width: calc(100vw - 40px);
    width: 100%;
    font-weight: 500;
    line-height: 1.3;
    word-wrap: break-word;
    order: 2; /* Tagline second (below orb/button) */
  }
  
  #micBtn {
    margin: 0;
    touch-action: manipulation;
    position: relative;
    z-index: 10001 !important;
    pointer-events: auto !important;
    /* Button is the orb itself, positioned within orb-container with proper spacing */
  }
  
  #ava-site-footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    width: 100%;
    max-width: min(520px, 100vw);
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 1000001;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0.75em;
    text-align: center;
    pointer-events: none;
  }
  #ava-site-footer a {
    pointer-events: auto;
  }
  
  #main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    justify-content: flex-start;
    padding-top: calc(50vh + 176px);
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
    width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  
  #product-area {
    padding: 28px 16px 12px 16px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
  }
  
  .product-card {
    margin-bottom: 16px;
  }
}

#product-area {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
  padding: 26px 14px 10px 14px;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
  justify-content: flex-start;
}

#product-area:has(> .product-card:only-child) {
  justify-content: center;
}

/* Match engine labels live inside .product-body so we do not change #product-area flex row (site footer stays reachable). */
.product-body .ava-match-tier-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 8px 0;
  line-height: 1.3;
}
.product-body .ava-match-similar-hint {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  margin: 8px 0 4px 0;
  line-height: 1.35;
}

/* Chat bubbles */

.bubble {
  max-width: 80%;
  padding: 9px 13px;
  border-radius: 16px;
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 0 14px rgba(0,0,0,0.35);
}

.bubble.ava {
  background: linear-gradient(135deg, #3A1066 0%, #14052A 100%);
  border: 1px solid rgba(155,92,255,0.5);
}

.bubble.user {
  margin-left: auto;
  background: var(--bubble-user-bg);
  border: 1px solid rgba(52,255,253,0.65);
}

/* Typing indicator */

.bubble.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ava-pink);
  animation: typing 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-3px); opacity: 1; }
}

/* Product cards — shared geometry with prerender skeleton (same --pc-* vars) */

.product-card {
  --pc-thumb: 88px;
  --pc-radius: 22px;
  --pc-width: clamp(320px, 36vw, 380px);
  flex: 0 0 auto;
  width: var(--pc-width);
  min-width: var(--pc-width);
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--pc-radius);
  /* Liquid glass: layered tint + stronger blur (gradient border stays on ::before) */
  background:
    linear-gradient(135deg, rgba(52, 255, 253, 0.08) 0%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 64, 255, 0.06) 100%),
    rgba(20, 5, 42, 0.65);
  border: 2px solid transparent;
  background-clip: padding-box;
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  animation: none; /* Prevent replay on state updates (no flicker) */
  box-sizing: border-box;
}

.product-card--sponsored {
  box-shadow: 0 0 0 1px rgba(255, 197, 107, 0.4);
}

.product-card:not(.product-card-skeleton) {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s ease;
}

.product-card.visible,
.product-card.ava-reveal-in {
  opacity: 1;
  transform: translateY(0);
}

.product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--pc-radius, 18px);
  padding: 2px;
  background: linear-gradient(135deg, 
    var(--ava-cyan) 0%, 
    var(--ava-pink) 50%, 
    var(--ava-cyan) 100%);
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: metallicShine 3s ease-in-out infinite;
  pointer-events: none;
}

.product-thumb {
  width: var(--pc-thumb, 52px);
  height: var(--pc-thumb, 52px);
  flex-shrink: 0;
  border-radius: calc(var(--pc-radius, 18px) * 0.72);
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.05);
  /* Remove any shadows */
  box-shadow: none;
}

.product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0; /* Prevent text overflow */
}

/* Product skeleton (predictive loading) */
.product-card-skeleton {
  pointer-events: none;
  opacity: 0.85;
}
.product-skeleton-thumb {
  width: var(--pc-thumb, 52px);
  height: var(--pc-thumb, 52px);
  flex-shrink: 0;
  border-radius: calc(var(--pc-radius, 18px) * 0.72);
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.2s ease-in-out infinite;
}
.product-skeleton-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.product-skeleton-title {
  height: 11px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.2s ease-in-out infinite 0.15s;
  width: 85%;
}
.product-skeleton-price {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.2s ease-in-out infinite 0.3s;
  width: 40%;
}
/* Match .product-actions row (Yes / No / Buy pills) so skeleton matches final card height */
.product-skeleton-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
  align-items: center;
}
.product-skeleton-pill {
  height: 26px;
  min-width: 44px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.11) 50%, rgba(255,255,255,0.06) 75%);
  background-size: 200% 100%;
  animation: skeletonShine 1.2s ease-in-out infinite 0.35s;
  flex: 0 0 auto;
}
.product-skeleton-pill--narrow {
  min-width: 38px;
  opacity: 0.85;
}
@keyframes skeletonShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Orb state animations (Apple-like presence) */
.mic-btn.orb-pulse { animation: orbPulse 1.5s ease-in-out infinite; }
.mic-btn.orb-rotate { animation: orbRotate 3s linear infinite; }
.mic-btn.orb-ring { animation: orbRing 0.8s ease-in-out infinite; }
.mic-btn.orb-glow-pulse { animation: orbGlowPulse 1.2s ease-in-out infinite; }
@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.95; }
}
@keyframes orbRotate {
  from { filter: hue-rotate(0deg); }
  to { filter: hue-rotate(360deg); }
}
@keyframes orbRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 255, 253, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(52, 255, 253, 0); }
}
@keyframes orbGlowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(52, 255, 253, 0.5); }
  50% { box-shadow: 0 0 32px rgba(52, 255, 253, 0.8); }
}

/* Shopping session panel */
.ava-session-panel {
  position: fixed;
  top: 80px;
  left: 12px;
  right: auto;
  max-width: 220px;
  padding: 12px 14px;
  background: rgba(20, 20, 35, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.8);
  z-index: 1000;
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.ava-session-panel.ava-session-panel-visible {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.ava-session-panel-title {
  font-weight: 600;
  color: var(--ava-cyan);
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ava-session-panel-content {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
}

/* ——— Onboarding: Try voice prompt ——— */
.ava-try-voice-prompt {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255,255,255,0.75);
  text-align: center;
  transition: opacity 0.4s ease;
}
.ava-try-voice-prompt em {
  font-style: normal;
  color: var(--ava-cyan);
}
.ava-try-voice-prompt-fade {
  opacity: 0;
  pointer-events: none;
}

/* Prompt chips under orb (clickable; same behavior as voice) */
#avaPromptChips,
.avaPromptChips {
  margin-top: 20px;
  padding: 12px 16px;
  max-width: 320px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  transition: opacity 0.4s ease;
}
.prompt-chip {
  padding: 10px 16px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.prompt-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ——— Automation victory card ——— */
.ava-automation-victory-card {
  position: fixed;
  inset: 0;
  z-index: 10015;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  padding: 20px;
  animation: avaVictoryIn 0.35s ease-out;
}
.ava-automation-victory-card.ava-victory-hidden {
  display: none;
}
.ava-victory-content {
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid rgba(52, 255, 253, 0.25);
  border-radius: 20px;
  padding: 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.ava-victory-title {
  margin: 0 0 16px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ava-cyan);
}
.ava-victory-checklist {
  list-style: none;
  margin: 0 0 16px 0;
  padding: 0;
  text-align: left;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.ava-victory-checklist li { margin: 6px 0; }
.ava-victory-time {
  margin: 0 0 20px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.ava-victory-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.ava-victory-btn {
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
}
.ava-victory-invite {
  background: rgba(52, 255, 253, 0.2);
  color: var(--ava-cyan);
  border: 1px solid rgba(52, 255, 253, 0.4);
}
.ava-victory-invite:hover {
  background: rgba(52, 255, 253, 0.3);
  transform: translateY(-1px);
}
.ava-victory-continue {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.2);
}
.ava-victory-continue:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}
@keyframes avaVictoryIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ——— Goal shopping panel ——— */
.ava-goal-shopping-panel {
  padding: 16px 20px;
  margin-bottom: 16px;
  background: rgba(20, 20, 35, 0.6);
  border: 1px solid rgba(52, 255, 253, 0.25);
  border-radius: 12px;
  color: rgba(255,255,255,0.9);
}
.ava-goal-title {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ava-cyan, #34fffd);
}
.ava-goal-category-label,
.ava-goal-attr-label {
  margin: 8px 0 4px 0;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
}
.ava-goal-category {
  margin: 0 0 8px 0;
  font-size: 1rem;
}
.ava-goal-attributes {
  margin: 0;
  padding-left: 20px;
}
.ava-goal-attributes li { margin: 4px 0; }

/* ——— Commerce memory panel ——— */
.ava-commerce-memory-panel {
  position: relative;
  padding: 20px 24px;
  margin: 16px 0;
  background: rgba(20, 20, 35, 0.85);
  border: 1px solid rgba(52, 255, 253, 0.25);
  border-radius: 12px;
  color: rgba(255,255,255,0.9);
  max-width: 360px;
}
.ava-memory-panel-title {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ava-cyan, #34fffd);
}
.ava-memory-section {
  margin-bottom: 14px;
}
.ava-memory-section-title {
  margin: 0 0 6px 0;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.ava-memory-list {
  margin: 0;
  padding-left: 18px;
}
.ava-memory-list li { margin: 3px 0; }
.ava-memory-empty {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
}
.ava-memory-restock-msg {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ava-cyan, #34fffd);
}
.ava-memory-panel-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: rgba(255,255,255,0.5);
}

/* ——— Welcome back banner ——— */
.ava-welcome-back-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10005;
  max-width: 90%;
  padding: 12px 20px;
  background: rgba(20, 20, 35, 0.95);
  border: 1px solid rgba(52, 255, 253, 0.3);
  border-radius: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  animation: avaWelcomeIn 0.3s ease-out;
}
.ava-welcome-back-banner strong { color: var(--ava-cyan); }
.ava-welcome-back-banner .ava-welcome-continue {
  margin-top: 10px;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--ava-cyan);
  background: transparent;
  color: var(--ava-cyan);
  cursor: pointer;
}
@keyframes avaWelcomeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.ava-credits-low-banner {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10005;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 520px);
  width: max-content;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 58, 242, 0.28);
  background: rgba(20, 20, 35, 0.95);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  color: rgba(255,255,255,0.92);
  animation: avaWelcomeIn 0.3s ease-out;
}

.ava-credits-low-banner-hidden {
  display: none;
}

.ava-credits-low-banner-visible {
  display: flex;
}

.ava-credits-low-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.ava-credits-low-copy strong {
  color: var(--ava-pink);
}

.ava-credits-low-upgrade {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(52,255,253,0.35);
  background: linear-gradient(135deg, rgba(52,255,253,0.18), rgba(255,58,242,0.18));
  color: var(--ava-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.ava-credits-low-upgrade:hover {
  transform: translateY(-1px);
  border-color: rgba(52,255,253,0.6);
  box-shadow: 0 0 18px rgba(52,255,253,0.22);
}

/* ——— Streak display ——— */
.ava-streak-display {
  position: fixed;
  top: 80px;
  right: 12px;
  z-index: 1000;
  padding: 8px 14px;
  background: rgba(20, 20, 35, 0.9);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}
.ava-streak-display span { color: var(--ava-cyan); font-weight: 600; }

/* ——— Orb celebration (1s) ——— */
.mic-btn.orb-celebration {
  animation: orbCelebration 1s ease-out forwards;
}
@keyframes orbCelebration {
  0% { box-shadow: 0 0 0 0 rgba(52, 255, 253, 0.6), 0 0 20px rgba(52, 255, 253, 0.5); transform: scale(1); }
  30% { box-shadow: 0 0 0 20px rgba(52, 255, 253, 0), 0 0 50px rgba(52, 255, 253, 0.9); transform: scale(1.15); }
  70% { box-shadow: 0 0 0 40px rgba(52, 255, 253, 0), 0 0 30px rgba(52, 255, 253, 0.6); transform: scale(1.08); }
  100% { box-shadow: 0 0 20px rgba(52, 255, 253, 0.5); transform: scale(1); }
}

/* Store identity - isolated badge/pill */
.product-store {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.76);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 6px;
  text-transform: capitalize;
  letter-spacing: 0.3px;
  width: fit-content;
}

.product-title {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* Price hierarchy - honest and final, not salesy */
.product-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--ava-cyan);
  margin-top: 2px;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Availability - subtle, non-intrusive */
.product-availability {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  margin-top: 2px;
}

/* Explain Why - compact section under product details */
.product-why-this {
  margin-top: 8px;
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.product-why-this-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}
.product-why-this-bullets {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.35;
}
.product-why-this-bullets li {
  margin-bottom: 2px;
}

/* Phase 3 deal badges — additive, filled async so search stays instant */
/* Prefetch deal sniper tags (Best deal / Cheapest nearby / Trending) */
.product-prefetch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.product-prefetch-tags .prefetch-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}

.product-deal-ui {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  min-height: 0;
}
.product-deal-ui .deal-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 180, 0, 0.2);
  color: #ffb400;
}
.product-deal-ui .deal-badge.deal-save { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.product-deal-ui .deal-badge.deal-lowest { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.product-deal-ui .deal-badge.deal-tip { background: rgba(168, 85, 247, 0.2); color: #a855f7; }

.product-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.product-rating-line {
  font-size: 12px;
  color: rgba(255, 220, 160, 0.95);
  margin-top: 2px;
}

.tag-btn {
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(145deg, #9B5CFF, #FF3AF2);
  box-shadow: 0 0 10px rgba(255,58,242,0.6);
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-btn.secondary {
  background: rgba(255,255,255,0.08);
  box-shadow: none;
}

/* AVA Personalized Homepage — For You feed (vertical, snap) */
/* min-height: 0 + flex lets the site footer stay in view (body overflow hidden + 100vh app was clipping it) */
#app {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  isolation: isolate;
}
#app::before {
  content: "";
  position: fixed;
  inset: -15%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -5%, rgba(138, 79, 251, 0.14), transparent 58%),
    radial-gradient(ellipse 70% 45% at 85% 45%, rgba(52, 255, 253, 0.07), transparent 52%),
    radial-gradient(ellipse 50% 40% at 12% 70%, rgba(255, 58, 242, 0.06), transparent 50%);
  animation: avaHomeAmbientDrift 22s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes avaHomeAmbientDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-1.5%, 1.2%, 0) scale(1.04);
  }
}
/* Only scrollable columns — never footer, or fixed footer becomes position:relative */
#app > main,
#app > section.ava-feed-home {
  position: relative;
  z-index: 1;
}
#main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  /* Reserve space for fixed #ava-site-footer (links stay tappable; not covered by cards) */
  padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}
.ava-feed-home {
  flex: 0 0 auto;
  width: 100%;
  max-width: 520px;
  margin: 56px auto 0;
  padding: 0 12px 8px;
  z-index: 10;
}
.ava-feed-head {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(25vh + env(safe-area-inset-bottom, 0px) + 42px);
  width: min(88vw, 440px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 0;
  padding: 0 8px;
  text-align: center;
  pointer-events: auto;
  z-index: 999999;
}
.ava-feed-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #34fffd, #8a4ffb, #ff3af2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: filter 0.45s ease;
}
.ava-feed-home.ava-feed-theme--near_you .ava-feed-title {
  background: linear-gradient(90deg, #34c8ff, #50ffc8, #34fffd);
  -webkit-background-clip: text;
  background-clip: text;
}
.ava-feed-home.ava-feed-theme--deals .ava-feed-title {
  background: linear-gradient(90deg, #ffc040, #ff8a28, #ff3af2);
  -webkit-background-clip: text;
  background-clip: text;
}
.ava-feed-home.ava-feed-theme--continue .ava-feed-title {
  background: linear-gradient(90deg, rgba(220, 225, 255, 0.95), rgba(180, 190, 255, 0.85), #c8d0ff);
  -webkit-background-clip: text;
  background-clip: text;
}
.ava-feed-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.04em;
}

/* Feed Tabs — interactive, GPU-friendly (transform/opacity) */
.ava-feed-tabs-wrap {
  position: relative;
  z-index: 2;
  margin-top: 2px;
  pointer-events: auto;
}
.ava-feed-tab-particles {
  position: absolute;
  inset: -6px -10px -10px -10px;
  pointer-events: none;
  overflow: hidden;
  border-radius: 20px;
  opacity: 0.55;
  z-index: 0;
}
.ava-feed-tab-particles::before,
.ava-feed-tab-particles::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.12) 0, transparent 40%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.08) 0, transparent 35%),
    radial-gradient(circle at 60% 70%, rgba(255, 255, 255, 0.06) 0, transparent 40%);
  animation: avaFeedParticlesDrift 8s ease-in-out infinite;
  will-change: transform, opacity;
}
.ava-feed-tab-particles::after {
  animation-duration: 11s;
  animation-direction: reverse;
  opacity: 0.55;
}
@keyframes avaFeedParticlesDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate3d(0, -6px, 0) scale(1.03);
    opacity: 0.75;
  }
}

.ava-feed-tab-toast {
  min-height: 0;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translate3d(0, 4px, 0);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
  max-width: 92vw;
}
.ava-feed-tab-toast.ava-feed-tab-toast--show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  min-height: 1.2em;
}

.ava-feed-tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  pointer-events: auto;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.ava-feed-tab {
  pointer-events: auto;
  appearance: none;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 700;
  padding: 7px 14px 9px;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.6;
  transform: translate3d(0, 0, 0) scale(1);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, color 0.25s ease, background 0.25s ease, opacity 0.25s ease, transform 0.26s cubic-bezier(0.34, 1.2, 0.64, 1);
  will-change: transform, opacity;
}
.ava-feed-tab__label {
  position: relative;
  z-index: 2;
  display: inline-block;
  white-space: nowrap;
}
.ava-feed-tab__count {
  font-variant-numeric: tabular-nums;
}
.ava-feed-tab__underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transform: scaleX(0.35);
  transform-origin: center;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 1;
}
.ava-feed-tab__underline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
  background-size: 200% 100%;
  animation: avaFeedTabUnderlineShimmer 2.4s linear infinite;
  will-change: transform;
}
@keyframes avaFeedTabUnderlineShimmer {
  0% {
    transform: translate3d(-50%, 0, 0);
  }
  100% {
    transform: translate3d(50%, 0, 0);
  }
}
.ava-feed-tab__ripple {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: avaFeedTabRipple 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 3;
}
@keyframes avaFeedTabRipple {
  to {
    transform: scale(18);
    opacity: 0;
  }
}

.ava-feed-tab--active,
.ava-feed-tab[aria-selected="true"] {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.96);
  animation: avaFeedTabBreathe 3.2s ease-in-out infinite;
}
.ava-feed-tab--active .ava-feed-tab__underline,
.ava-feed-tab[aria-selected="true"] .ava-feed-tab__underline {
  opacity: 1;
  transform: scaleX(1);
  box-shadow: 0 0 14px rgba(52, 255, 253, 0.45);
}
.ava-feed-tab--tap {
  transform: translate3d(0, 0, 0) scale(1.06);
  transition-duration: 0.2s;
}
@keyframes avaFeedTabBreathe {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1.02);
  }
  50% {
    transform: translate3d(0, 0, 0) scale(1.05);
  }
}

/* Theme: background tint on feed strip (root section) */
.ava-feed-home {
  transition: background 0.45s ease, box-shadow 0.45s ease;
}
.ava-feed-home.ava-feed-theme--for_you {
  box-shadow: 0 0 40px rgba(138, 79, 251, 0.12);
}
.ava-feed-home.ava-feed-theme--near_you {
  box-shadow: 0 0 42px rgba(52, 180, 255, 0.14);
}
.ava-feed-home.ava-feed-theme--deals {
  box-shadow: 0 0 44px rgba(255, 180, 60, 0.16);
}
.ava-feed-home.ava-feed-theme--continue {
  box-shadow: 0 0 36px rgba(200, 210, 255, 0.1);
  backdrop-filter: blur(0) saturate(1.05);
}

/* Active tab glow per theme */
.ava-feed-home.ava-feed-theme--for_you .ava-feed-tab--active {
  box-shadow: 0 0 18px rgba(138, 79, 251, 0.55), 0 0 28px rgba(255, 58, 242, 0.35), inset 0 0 12px rgba(138, 79, 251, 0.15);
  background: linear-gradient(135deg, rgba(138, 79, 251, 0.28), rgba(255, 58, 242, 0.12));
  border-color: rgba(200, 160, 255, 0.45);
}
.ava-feed-home.ava-feed-theme--for_you .ava-feed-tab--active .ava-feed-tab__underline {
  background: linear-gradient(90deg, #8a4ffb, #ff3af2, #34fffd);
}
.ava-feed-home.ava-feed-theme--near_you .ava-feed-tab--active {
  box-shadow: 0 0 18px rgba(52, 200, 255, 0.45), 0 0 26px rgba(80, 255, 200, 0.28), inset 0 0 12px rgba(52, 255, 253, 0.12);
  background: linear-gradient(135deg, rgba(52, 180, 255, 0.22), rgba(80, 255, 200, 0.1));
  border-color: rgba(120, 220, 255, 0.45);
}
.ava-feed-home.ava-feed-theme--near_you .ava-feed-tab--active .ava-feed-tab__underline {
  background: linear-gradient(90deg, #34c8ff, #50ffc8);
}
.ava-feed-home.ava-feed-theme--deals .ava-feed-tab--active {
  box-shadow: 0 0 18px rgba(255, 190, 60, 0.55), 0 0 28px rgba(255, 120, 40, 0.28), inset 0 0 12px rgba(255, 180, 60, 0.12);
  background: linear-gradient(135deg, rgba(255, 180, 60, 0.26), rgba(255, 100, 40, 0.12));
  border-color: rgba(255, 200, 120, 0.5);
}
.ava-feed-home.ava-feed-theme--deals .ava-feed-tab--active .ava-feed-tab__underline {
  background: linear-gradient(90deg, #ffc040, #ff6a28);
}
.ava-feed-home.ava-feed-theme--continue .ava-feed-tab--active {
  box-shadow: 0 0 16px rgba(200, 210, 255, 0.35), 0 0 24px rgba(160, 170, 255, 0.2), inset 0 0 14px rgba(255, 255, 255, 0.06);
  background: linear-gradient(135deg, rgba(180, 190, 255, 0.16), rgba(255, 255, 255, 0.06));
  border-color: rgba(220, 225, 255, 0.35);
}
.ava-feed-home.ava-feed-theme--continue .ava-feed-tab--active .ava-feed-tab__underline {
  background: linear-gradient(90deg, rgba(200, 210, 255, 0.9), rgba(255, 255, 255, 0.5));
}

/* Behavior hints: soft extra glow (does not switch tab) */
.ava-feed-tab--signal {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 14px rgba(52, 255, 253, 0.22);
  opacity: 0.78 !important;
}
.ava-feed-home.ava-feed-theme--for_you .ava-feed-tab[data-tab="near_you"].ava-feed-tab--signal {
  box-shadow: 0 0 16px rgba(52, 200, 255, 0.45);
}
.ava-feed-home.ava-feed-theme--for_you .ava-feed-tab[data-tab="deals"].ava-feed-tab--signal {
  box-shadow: 0 0 16px rgba(255, 180, 60, 0.5);
}

/* Orb: tab sync pulse (added via JS) */
@keyframes avaFeedTabOrbNudge {
  0% {
    filter: drop-shadow(0 0 8px rgba(138, 79, 251, 0.35));
    transform: translate(-50%, -50%) scale(1);
  }
  40% {
    filter: drop-shadow(0 0 22px rgba(255, 58, 242, 0.45));
    transform: translate(-50%, -50%) scale(1.04);
  }
  100% {
    filter: drop-shadow(0 0 10px rgba(52, 255, 253, 0.25));
    transform: translate(-50%, -50%) scale(1);
  }
}
#orb-container.ava-feed-tab-orb-for_you,
#orb-container.ava-feed-tab-orb-near_you,
#orb-container.ava-feed-tab-orb-deals,
#orb-container.ava-feed-tab-orb-continue {
  animation: avaFeedTabOrbNudge 0.65s ease-out;
}
#orb-container.ava-feed-tab-orb-for_you #micBtn.orb {
  box-shadow: 0 0 24px rgba(138, 79, 251, 0.45), 0 0 40px rgba(255, 58, 242, 0.25);
}
#orb-container.ava-feed-tab-orb-near_you #micBtn.orb {
  box-shadow: 0 0 24px rgba(52, 200, 255, 0.4), 0 0 36px rgba(80, 255, 200, 0.22);
}
#orb-container.ava-feed-tab-orb-deals #micBtn.orb {
  box-shadow: 0 0 24px rgba(255, 180, 60, 0.5), 0 0 28px rgba(255, 100, 40, 0.25);
}
#orb-container.ava-feed-tab-orb-continue #micBtn.orb {
  box-shadow: 0 0 20px rgba(200, 210, 255, 0.35), 0 0 24px rgba(255, 255, 255, 0.12);
}
.ava-feed-scroll {
  max-height: min(42vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y proximity;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 10, 18, 0.5);
  -webkit-overflow-scrolling: touch;
}
.ava-feed-home.ava-feed-loading .ava-feed-scroll {
  opacity: 0.72;
  pointer-events: none;
}
.ava-feed-section-label {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(52, 255, 253, 0.85);
  background: linear-gradient(180deg, rgba(12, 14, 22, 0.96), rgba(12, 14, 22, 0.7));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.ava-feed-card {
  scroll-snap-align: start;
  margin: 0 0 10px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  outline: none;
}
.ava-feed-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(52, 255, 253, 0.45);
}
.ava-feed-card-media {
  height: min(28vw, 140px);
  max-height: 160px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.06);
}
.ava-feed-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px 0;
}
.ava-feed-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(138, 79, 251, 0.35);
  color: #e8e0ff;
}
.ava-feed-card-body {
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
}
.ava-feed-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ava-feed-card-price {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #34fffd;
}
.ava-feed-card-query {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}
.ava-feed-card-why {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}
.ava-feed-card-dismiss {
  margin-top: 10px;
  align-self: flex-start;
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}
.ava-feed-card-dismiss:hover {
  border-color: rgba(52, 255, 253, 0.45);
}
.ava-feed-card--ugc {
  border-color: rgba(138, 79, 251, 0.35);
  box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.06);
}
.ava-feed-badge--creator {
  background: linear-gradient(135deg, rgba(52, 255, 253, 0.35), rgba(255, 58, 242, 0.3));
  color: #fff;
}
.ava-feed-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.ava-feed-sentinel {
  height: 1px;
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 768px) {
  .ava-feed-home {
    margin-top: 52px;
    max-width: 100%;
  }
  .ava-feed-scroll {
    max-height: min(38vh, 320px);
  }
}

/* FindItGPT — input + state live inside #ava-findit-panel (chat sheet under glow bar); floating card removed */
#ava-findit-panel.ava-findit-in-sheet {
  position: relative;
  width: min(100%, 440px);
  overflow: visible;
}
.ava-findit-brand-inline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #34fffd, #8a4ffb, #ff3af2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ava-findit-composer {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(52, 255, 253, 0.1);
  background: linear-gradient(0deg, rgba(8, 6, 20, 0.95), rgba(12, 10, 28, 0.88));
}
.ava-findit-in-sheet .ava-findit-input-wrap {
  position: relative;
}
/* Autocomplete opens upward when composer is at bottom */
.ava-findit-in-sheet .ava-findit-autocomplete {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(200px, 32vh);
}
.ava-findit-ambient {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 20%, rgba(52, 255, 253, 0.09), transparent 42%),
    radial-gradient(circle at 75% 80%, rgba(255, 58, 242, 0.08), transparent 45%);
  pointer-events: none;
  opacity: 0.85;
  animation: avaFinditAmbientPulse 8s ease-in-out infinite;
}
@keyframes avaFinditAmbientPulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.03);
  }
}
#ava-findit-panel[data-findit-state="loading"] {
  opacity: 0.94;
}
#ava-findit-panel[data-findit-state="typing"] .ava-chatbot-messages {
  opacity: 0.48;
  pointer-events: none;
  filter: saturate(0.85);
  transition: opacity 0.28s ease, filter 0.28s ease;
}
#ava-findit-panel[data-findit-input-focus="1"] .ava-findit-input-wrap,
#ava-findit-panel[data-findit-state="typing"] .ava-findit-input-wrap {
  box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.25), 0 0 28px rgba(138, 79, 251, 0.22);
  border-radius: 14px;
  transition: box-shadow 0.25s ease;
}
#ava-findit-panel[data-findit-prefetch-pulse="1"] .ava-findit-input-wrap {
  animation: avaFinditPrefetchGlow 0.7s ease-out 1;
}
@keyframes avaFinditPrefetchGlow {
  0% {
    box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.2), 0 0 12px rgba(52, 255, 253, 0.15);
  }
  50% {
    box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.45), 0 0 36px rgba(52, 255, 253, 0.28);
  }
  100% {
    box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.2), 0 0 20px rgba(138, 79, 251, 0.18);
  }
}
.ava-findit-head {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}
.ava-findit-brand {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #34fffd, #8a4ffb, #ff3af2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ava-findit-sub {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.52);
  margin-top: 6px;
  line-height: 1.45;
}
.ava-findit-input-wrap {
  position: relative;
  z-index: 1;
  padding: 2px;
  border-radius: 14px;
  transition: box-shadow 0.3s ease;
}
.ava-findit-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
#ava-findit-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
#ava-findit-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
#ava-findit-input:focus {
  border-color: rgba(52, 255, 253, 0.5);
  box-shadow: 0 0 0 2px rgba(52, 255, 253, 0.12);
}
.ava-findit-camera {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(52, 255, 253, 0.35);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ava-findit-camera:hover,
.ava-findit-camera:focus-visible {
  border-color: rgba(255, 197, 107, 0.55);
  transform: scale(1.04);
  outline: none;
}
.ava-camera-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}
.ava-findit-submit {
  flex: 0 0 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(145deg, #9b5cff, #ff3af2);
  box-shadow: 0 0 14px rgba(255, 58, 242, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ava-findit-submit:hover,
.ava-findit-submit:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 0 22px rgba(255, 58, 242, 0.45);
  outline: none;
}
.ava-findit-autocomplete {
  position: absolute;
  left: 0;
  right: 104px;
  top: calc(100% + 6px);
  max-height: 220px;
  overflow-y: auto;
  border-radius: 14px;
  background: rgba(12, 10, 24, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  z-index: 5;
}
.ava-findit-autocomplete.hidden {
  display: none;
}
.ava-findit-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, padding-left 0.18s ease;
}
.ava-findit-ac-item--thought {
  line-height: 1.35;
}
.ava-findit-ac-item:hover,
.ava-findit-ac-item:focus {
  background: rgba(52, 255, 253, 0.1);
  padding-left: 14px;
  outline: none;
}
.ava-findit-sections {
  position: relative;
  z-index: 1;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: opacity 0.28s ease, filter 0.28s ease;
}
.ava-findit-section {
  animation: avaFinditSectionIn 0.55s ease backwards;
}
.ava-findit-section--primary {
  animation-delay: 0.05s;
}
.ava-findit-section--trending {
  animation-delay: 0.12s;
}
.ava-findit-section--nearby {
  animation-delay: 0.18s;
}
@keyframes avaFinditSectionIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ava-findit-section-title {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}
.ava-findit-section-eyebrow {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(52, 255, 253, 0.95);
  background: rgba(52, 255, 253, 0.1);
  border: 1px solid rgba(52, 255, 253, 0.22);
  vertical-align: middle;
}
.ava-findit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ava-findit-chips--layered {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 10px;
}
.ava-findit-chips--trend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ava-findit-chips--nearby-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@keyframes avaThoughtStagger {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.ava-findit-chip--thought {
  text-align: left;
  justify-content: flex-start;
  white-space: normal;
  animation: avaThoughtStagger 0.45s ease backwards;
  animation-delay: calc(var(--thought-i, 0) * 55ms);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.25s ease, background 0.22s ease;
}
.ava-findit-chip--primary {
  grid-column: auto;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(52, 255, 253, 0.1), rgba(138, 79, 251, 0.08));
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.ava-findit-chips--layered .ava-findit-chip--primary:nth-of-type(1) {
  grid-column: 1;
  grid-row: 1;
}
.ava-findit-chips--layered .ava-findit-chip--primary:nth-of-type(2) {
  grid-column: 2;
  grid-row: 1;
}
.ava-findit-chips--layered .ava-findit-chip--primary.ava-findit-chip--solo {
  grid-column: 1 / -1;
}
.ava-findit-chips--layered .ava-findit-chip--secondary,
.ava-findit-chips--layered .ava-findit-chip--quick {
  grid-column: 1 / -1;
}
.ava-findit-chip--secondary {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}
.ava-findit-chip--quick {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.82);
}
.ava-findit-chip {
  cursor: pointer;
  max-width: 100%;
  color: rgba(255, 255, 255, 0.92);
}
.ava-findit-chip:hover,
.ava-findit-chip:focus-visible {
  border-color: rgba(138, 79, 251, 0.55);
  box-shadow: 0 8px 28px rgba(138, 79, 251, 0.2);
  transform: translateY(-2px) scale(1.01);
  outline: none;
}
.ava-findit-chip--primary:hover,
.ava-findit-chip--primary:focus-visible {
  box-shadow: 0 10px 32px rgba(52, 255, 253, 0.15);
}
.ava-findit-nearby-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .ava-findit-chips--layered {
    grid-template-columns: 1fr;
  }
  .ava-findit-chips--layered .ava-findit-chip--primary:nth-of-type(1),
  .ava-findit-chips--layered .ava-findit-chip--primary:nth-of-type(2) {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app::before,
  .ava-findit-ambient,
  .ava-findit-chip--thought,
  .ava-findit-section,
  #ava-findit-panel[data-findit-prefetch-pulse="1"] .ava-findit-input-wrap {
    animation: none !important;
  }
  .ava-findit-chip--thought {
    animation-delay: 0ms !important;
  }
  .ava-suggestion-message,
  .ava-ephemeral-secondary-msg,
  .ava-suggestion-flash {
    transition: none !important;
  }
  .ava-suggestion-flash .ava-suggestion-message,
  .ava-suggestion-flash .ava-ephemeral-secondary-msg,
  #orb-container.ava-ephemeral-orb-pulse,
  #orb-container.ava-ephemeral-orb-refine,
  #orb-container.ava-ephemeral-orb-lock {
    animation: none !important;
    transition: none !important;
  }
}

/* Flash hints sit below the glow bar (still above footer via max) */
.ava-suggestion-flash {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  bottom: max(
    calc(env(safe-area-inset-bottom, 0px) + 88px),
    /* Glow bar bottom ≈ 25vh + safe − 14px; leave room for ~2 lines of flash above this bottom edge */
    calc(25vh + env(safe-area-inset-bottom, 0px) - 82px)
  );
  width: min(92vw, 420px);
  z-index: 999996;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  transition: opacity 0.4s ease, transform 0.45s ease;
}
.ava-suggestion-flash.ava-suggestion-flash--idle {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  pointer-events: none;
}
.ava-suggestion-flash.ava-suggestion-flash--idle .ava-flash-primary,
.ava-suggestion-flash.ava-suggestion-flash--idle .ava-flash-secondary {
  pointer-events: none;
}
.ava-suggestion-flash.ava-suggestion-flash--active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: none;
}
.ava-suggestion-flash .ava-ephemeral-secondary-msg--solo {
  max-width: min(92vw, 380px);
  font-size: 11px;
  padding: 4px 12px;
}
.ava-suggestion-flash .ava-flash-primary,
.ava-suggestion-flash .ava-flash-secondary {
  pointer-events: auto;
}
.ava-flash-secondary {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
}
.ava-suggestion-flash .ava-suggest-ephemeral-host.ava-findit-chips--ephemeral {
  min-height: 0;
}
.ava-suggestion-flash .ava-suggestion-message {
  padding: 5px 12px;
  min-height: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  animation: avaFlashHintPulse 2.4s ease-in-out infinite;
}
.ava-suggestion-flash .ava-suggestion-message[data-state="appearing"],
.ava-suggestion-flash .ava-suggestion-message[data-state="fading"] {
  animation: none;
}
.ava-suggestion-flash .ava-suggestion-message[data-state="locked"] {
  animation: avaFlashLockedPulse 1.6s ease-in-out infinite;
  cursor: pointer;
}
@keyframes avaFlashHintPulse {
  0%,
  100% {
    opacity: 0.55;
    box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.12);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 16px rgba(138, 79, 251, 0.35);
  }
}
@keyframes avaFlashLockedPulse {
  0%,
  100% {
    opacity: 0.88;
    box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.22);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(52, 255, 253, 0.45);
  }
}
.ava-suggestion-flash .ava-ephemeral-secondary-row {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
}
.ava-suggestion-flash .ava-ephemeral-secondary-msg {
  width: auto;
  max-width: 44vw;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: avaFlashHintPulse 2.8s ease-in-out infinite;
  animation-delay: calc(var(--ephemeral-i, 0) * 0.12s);
}

/* Ephemeral suggestions (primary stream + secondary rows) — orb button internals unchanged */
.ava-suggest-ephemeral-host.ava-findit-chips--ephemeral {
  display: block;
  min-height: 76px;
}
.ava-ephemeral-root {
  position: relative;
  width: 100%;
}
.ava-suggestion-message {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  min-height: 64px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(145deg, rgba(52, 255, 253, 0.08), rgba(138, 79, 251, 0.06));
  color: rgba(255, 255, 255, 0.94);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  cursor: default;
  transition: opacity 300ms ease, transform 300ms ease, filter 300ms ease, box-shadow 0.35s ease,
    border-color 0.25s ease;
}
.ava-suggestion-message:disabled {
  cursor: default;
  opacity: 1;
}
.ava-suggestion-message[data-state="appearing"] {
  opacity: 0;
  transform: translateY(10px);
  filter: blur(8px);
}
.ava-suggestion-message[data-state="active"] {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}
.ava-suggestion-message[data-state="fading"] {
  opacity: 0;
  transform: translateY(-6px);
  filter: blur(6px);
}
.ava-suggestion-message[data-state="locked"] {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.2), 0 10px 36px rgba(0, 0, 0, 0.35);
  border-color: rgba(52, 255, 253, 0.28);
}
.ava-suggestion-message[data-state="locked"]:hover,
.ava-suggestion-message[data-state="locked"]:focus-visible {
  border-color: rgba(138, 79, 251, 0.5);
  box-shadow: 0 0 0 1px rgba(138, 79, 251, 0.25), 0 12px 40px rgba(138, 79, 251, 0.2);
  outline: none;
}

.ava-ephemeral-secondary-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ava-ephemeral-secondary-msg {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  filter: blur(4px);
  animation: avaEphemeralSecondaryIn 0.45s ease forwards;
  animation-delay: calc(var(--ephemeral-i, 0) * 70ms);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
@keyframes avaEphemeralSecondaryIn {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
.ava-ephemeral-secondary-msg:hover,
.ava-ephemeral-secondary-msg:focus-visible {
  border-color: rgba(52, 255, 253, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  outline: none;
}

/* Orb container only — does not replace .orb keyframes */
@keyframes avaEphemeralOrbPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 10px rgba(52, 255, 253, 0.32));
  }
  50% {
    filter: drop-shadow(0 0 22px rgba(52, 255, 253, 0.5));
  }
}
@keyframes avaEphemeralOrbRipple {
  0%,
  100% {
    filter: drop-shadow(0 0 8px rgba(138, 79, 251, 0.28));
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(255, 58, 242, 0.35));
  }
}
#orb-container.ava-ephemeral-orb-pulse {
  animation: avaEphemeralOrbPulse 1.1s ease-in-out infinite;
}
#orb-container.ava-ephemeral-orb-refine {
  animation: avaEphemeralOrbRipple 1.6s ease-in-out infinite;
}
#orb-container.ava-ephemeral-orb-lock {
  animation: none;
  filter: drop-shadow(0 0 14px rgba(52, 255, 253, 0.28));
  transition: filter 0.4s ease;
}

/* Orb */

#orb-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  pointer-events: none;
}


#orb-container > * {
  pointer-events: auto;
}

#orb-container .tagline {
  font-size: 40px;
  font-weight: 500;
  margin-top: 20px;
  white-space: nowrap;
  background: linear-gradient(135deg, 
    var(--ava-cyan) 0%, 
    var(--ava-pink) 50%, 
    var(--ava-cyan) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  animation: metallicShine 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
}

/* AI indicator — tap target under tagline; inner line uses orb gradient + pulse */
.ava-ai-indicator {
  position: fixed;
  bottom: calc(25vh + env(safe-area-inset-bottom, 0px) - 14px);
  left: 50%;
  transform: translateX(-50%);
  width: min(88vw, 440px);
  min-height: 44px;
  padding: 12px 8px 16px;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  /* Inside #main: below #product-area (z-index:2) so cards/skeletons paint on top of the glow bar */
  z-index: 1;
  opacity: 1;
  transition: opacity 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ava-ai-indicator:focus-visible {
  outline: 2px solid rgba(52, 255, 253, 0.65);
  outline-offset: 4px;
}
.ava-ai-indicator-line {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 6px;
  min-height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(52, 255, 253, 0.5) 0%,
    rgba(138, 79, 251, 0.6) 35%,
    rgba(255, 58, 242, 0.6) 65%,
    rgba(52, 255, 253, 0.5) 100%
  );
  background-size: 200% 100%;
  box-shadow:
    0 0 12px rgba(52, 255, 253, 0.35),
    0 0 24px rgba(255, 58, 242, 0.25),
    0 0 8px rgba(138, 79, 251, 0.3);
  animation: avaIndicatorFlow 4s ease-in-out infinite;
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    box-shadow 0.45s ease,
    height 0.3s ease;
}
/* Product card or skeleton: fade glow line only; button stays for FindItGPT */
.ava-ai-indicator--glow-off .ava-ai-indicator-line {
  opacity: 0;
  transform: scaleY(0.25);
  animation: none !important;
  box-shadow: none;
  pointer-events: none;
}
.ava-product-rendering #ava-ai-indicator .ava-ai-indicator-line {
  opacity: 0.2;
  transform: scaleY(0.72);
}
/* Keep fade active even if speaking class is present during search/TTS. */
.ava-ai-indicator.ava-ai-indicator--glow-off .ava-ai-indicator-line,
.ava-product-rendering .ava-ai-indicator.ava-ai-indicator-speaking .ava-ai-indicator-line {
  opacity: 0 !important;
  transform: scaleY(0.25) !important;
  animation: none !important;
  box-shadow: none !important;
}
.ava-ai-indicator.ava-ai-indicator-hidden {
  opacity: 0 !important;
  pointer-events: none;
  animation: none;
}
.ava-ai-indicator.ava-ai-indicator-hidden .ava-ai-indicator-line {
  animation: none;
}

/* Speaking: tie voice to the bottom chat line (same control as the panel), not only the center orb */
.ava-ai-indicator.ava-ai-indicator-speaking .ava-ai-indicator-line {
  animation: avaIndicatorFlow 1.6s ease-in-out infinite;
  height: 7px;
  min-height: 7px;
  box-shadow:
    0 0 16px rgba(52, 255, 253, 0.55),
    0 0 28px rgba(255, 58, 242, 0.45),
    0 0 10px rgba(138, 79, 251, 0.45);
}

@keyframes avaIndicatorFlow {
  0%, 100% {
    background-position: 0% 50%;
    opacity: 0.85;
  }
  50% {
    background-position: 100% 50%;
    opacity: 1;
  }
}

/* Quick chat panel — matches indicator gradient (cyan / violet / pink) */
.ava-chatbot-panel {
  --ava-chat-cyan: #34fffd;
  --ava-chat-violet: #8a4ffb;
  --ava-chat-pink: #ff3af2;
  position: fixed;
  inset: 0;
  z-index: 1000002;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top, 0px) 12px calc(12px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.ava-chatbot-panel:not(.ava-chatbot-hidden) {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}
.ava-chatbot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 0, 17, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}
.ava-chatbot-sheet {
  position: relative;
  width: min(100%, 440px);
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(12, 10, 28, 0.94);
  box-shadow:
    0 0 0 1px rgba(52, 255, 253, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(138, 79, 251, 0.15);
  overflow: hidden;
}
.ava-chatbot-glow-border {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--ava-chat-cyan),
    var(--ava-chat-violet) 45%,
    var(--ava-chat-pink) 75%,
    var(--ava-chat-cyan)
  );
  background-size: 200% 200%;
  animation: avaChatbotBorderFlow 5s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 0;
}
@keyframes avaChatbotBorderFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.ava-chatbot-header {
  position: relative;
  z-index: 1;
  padding: 16px 100px 10px 18px;
  border-bottom: 1px solid rgba(52, 255, 253, 0.12);
  background: linear-gradient(
    180deg,
    rgba(52, 255, 253, 0.08) 0%,
    transparent 100%
  );
}
.ava-chatbot-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--ava-chat-cyan), var(--ava-chat-violet), var(--ava-chat-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ava-chatbot-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.35;
}
.ava-chatbot-clear {
  position: absolute;
  top: 12px;
  right: 52px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
}
.ava-chatbot-clear:hover,
.ava-chatbot-clear:focus-visible {
  background: rgba(52, 255, 253, 0.15);
  color: rgba(255, 255, 255, 0.95);
  outline: none;
}
.ava-chatbot-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 58, 242, 0.15);
  transition: background 0.2s ease;
}
.ava-chatbot-close:hover,
.ava-chatbot-close:focus-visible {
  background: rgba(52, 255, 253, 0.2);
  outline: none;
}
.ava-chatbot-messages {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 120px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ava-chatbot-msg {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-line;
}
.ava-chatbot-msg--user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(52, 255, 253, 0.22), rgba(138, 79, 251, 0.2));
  border: 1px solid rgba(52, 255, 253, 0.25);
  color: #fff;
}
.ava-chatbot-msg--ava {
  align-self: flex-start;
  background: rgba(138, 79, 251, 0.18);
  border: 1px solid rgba(255, 58, 242, 0.2);
  color: rgba(255, 255, 255, 0.92);
}
.ava-chatbot-msg--thinking {
  align-self: flex-start;
  font-style: italic;
  color: rgba(255, 255, 255, 0.45);
  border: 1px dashed rgba(52, 255, 253, 0.25);
  background: transparent;
}
.ava-chatbot-msg--system {
  align-self: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  border: none;
}
.ava-chatbot-result {
  align-self: flex-start;
  width: min(92%, 360px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(52, 255, 253, 0.28);
  background: rgba(15, 10, 35, 0.72);
}
.ava-chatbot-result-image {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.ava-chatbot-result-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ava-chatbot-result-title {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ava-chatbot-result-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--ava-chat-cyan);
}
.ava-chatbot-result-store {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.ava-chatbot-result-rating {
  font-size: 12px;
  color: rgba(255, 220, 160, 0.9);
}
.ava-chatbot-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.ava-chatbot-result-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #0a021f;
  background: linear-gradient(135deg, var(--ava-chat-cyan), var(--ava-chat-violet) 60%);
}
.ava-chatbot-result-btn--secondary {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  font-weight: 500;
}
.ava-chatbot-result--active-focus {
  border-color: rgba(52, 255, 253, 0.55);
  box-shadow: 0 0 0 1px rgba(52, 255, 253, 0.25);
}
.ava-chatbot-result-wrap {
  position: relative;
  align-self: flex-start;
  width: min(92%, 360px);
}
.ava-chat-card-bubble {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  /* JS sets fixed + z-index; keep fallback above chat sheet if inline missing */
  z-index: 1000004;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(52, 255, 253, 0.35);
  background: rgba(12, 8, 28, 0.96);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.ava-chat-card-bubble-btn {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  color: #0a021f;
  background: linear-gradient(135deg, var(--ava-chat-cyan), var(--ava-chat-violet) 60%);
}
.ava-chat-card-bubble-btn--secondary {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 500;
}
.ava-chatbot-composer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(138, 79, 251, 0.2);
  background: rgba(0, 0, 0, 0.35);
}
.ava-chatbot-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 255, 253, 0.25);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 15px;
  outline: none;
}
.ava-chatbot-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.ava-chatbot-input:focus {
  border-color: rgba(255, 58, 242, 0.45);
  box-shadow: 0 0 0 2px rgba(138, 79, 251, 0.25);
}
.ava-chatbot-send {
  flex: 0 0 auto;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: #0a021f;
  background: linear-gradient(135deg, var(--ava-chat-cyan), var(--ava-chat-violet) 55%, var(--ava-chat-pink));
  background-size: 160% 160%;
  box-shadow: 0 0 16px rgba(255, 58, 242, 0.35);
}
.ava-chatbot-send:hover,
.ava-chatbot-send:focus-visible {
  filter: brightness(1.08);
  outline: none;
}
.ava-chatbot-panel.ava-chatbot-hidden {
  display: none !important;
}
body.ava-chatbot-open #micBtn,
body.ava-chatbot-open .orb {
  pointer-events: none;
}

/* Orb button — image assets (ava-orb-glow.png, ava-orb-core.png) */
.ava-orb-button {
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto !important;
}

.ava-orb-button::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255,120,200,0.35) 0%,
    rgba(120,120,255,0.18) 35%,
    transparent 60%
  );
  pointer-events: none;
  z-index: -1;
}

.ava-orb-glow {
  position: absolute;
  width: 220px;
  opacity: 0.85;
  filter:
    drop-shadow(0 0 18px rgba(255,0,200,0.6))
    drop-shadow(0 0 28px rgba(0,200,255,0.5));
  pointer-events: none;
}

.ava-orb-core {
  width: 110px;
  transition: transform 0.2s ease;
  position: relative;
  z-index: 1;
}

.ava-orb-button:hover .ava-orb-core {
  transform: scale(1.1);
}

@keyframes metallicShine {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* AVA core: energy ring + orb */
.ava-core {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ava-core .orb,
.ava-core .ava-orb {
  pointer-events: auto !important;
}

.ava-ring {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255,0,180,0.4),
      rgba(0,200,255,0.3),
      transparent 70%
    );
  filter: blur(20px);
  animation: avaRingPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

.ava-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    conic-gradient(
      transparent,
      rgba(255,255,255,0.8),
      transparent
    );
  animation: avaScan 3s linear infinite;
}

@keyframes avaRingPulse {
  0% {
    transform: scale(0.9);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.5;
  }
}

@keyframes avaScan {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Ring state: listening = faster pulse */
.ava-core:has(.orb.listening) .ava-ring {
  animation: avaRingPulse 1.2s ease-in-out infinite;
}

/* Ring state: thinking = rotation emphasized */
.ava-core:has(.orb.thinking) .ava-ring::after {
  animation: avaScan 2s linear infinite;
}

/* Ring state: searching = rotation + faster pulse (add .ava-searching to .ava-core when search runs) */
.ava-core.ava-searching .ava-ring {
  animation: avaRingPulse 1.2s ease-in-out infinite;
}
.ava-core.ava-searching .ava-ring::after {
  animation: avaScan 2s linear infinite;
}

/* Liquid glass panel — tight blur, no fog */
.glass-panel {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}

.orb {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 20%, #ffffff33 0%, #8A4FFB22 25%, #15052A 60%, #05010D 100%);
  box-shadow:
    0 0 30px rgba(255,58,242,0.8),
    0 0 80px rgba(52,255,253,0.5);
  cursor: pointer;
  outline: none;
  padding: 0;
  pointer-events: auto !important;
  z-index: 1000001 !important; /* Keep orb above automation overlay */
  position: relative !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.1s ease;
}

/* Image-based orb: override default .orb styles so asset images show */
.ava-orb-button.orb {
  width: auto;
  height: auto;
  min-width: 220px;
  min-height: 220px;
  background: none;
  box-shadow: none;
  border-radius: 0;
}
.ava-orb-button.orb::before,
.ava-orb-button.orb::after {
  display: none;
}

.orb:active {
  transform: scale(0.95);
}

/* inner glow */
.orb::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  border: 2px solid rgba(52,255,253,0.65);
  box-shadow: 0 0 25px rgba(52,255,253,0.75);
  animation: orbIdle 4s ease-in-out infinite;
  pointer-events: none;
}

/* particle orbit */
.orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 80% 20%, var(--ava-gold) 0, transparent 35%),
    radial-gradient(circle at 20% 80%, var(--ava-pink) 0, transparent 40%);
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.9;
  animation: orbit 6s linear infinite;
}

/* Idle breathing */
@keyframes orbIdle {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Orbit motion */
@keyframes orbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Listening waveform ring */
.orb.listening::before {
  animation: listeningPulse 0.9s ease-in-out infinite;
  border-color: var(--ava-cyan);
}

@keyframes listeningPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 10px rgba(52,255,253,0.6); }
  50% { transform: scale(1.14); box-shadow: 0 0 24px rgba(52,255,253,0.9); }
}

/* Thinking: faster orbit, golden warm inner */
.orb.thinking {
  box-shadow:
    0 0 30px rgba(255,197,107,0.9),
    0 0 80px rgba(255,58,242,0.5);
}

.orb.thinking::after {
  animation-duration: 3s;
}

/* Speaking: pink pulse – orb and ::before so it’s visible during TTS */
.orb.speaking,
#micBtn.orb.speaking,
.orb.orb-speak-pulse,
#micBtn.orb-speak-pulse {
  animation: orbSpeakPulse 1s ease-in-out infinite;
}
.orb.speaking::before,
#micBtn.orb.speaking::before,
#orb-container .orb.speaking::before {
  border-color: var(--ava-pink);
  animation: speakingBeat 0.5s ease-in-out infinite;
}

@keyframes orbSpeakPulse {
  0%, 100% {
    box-shadow:
      0 0 16px 4px rgba(255, 58, 242, 0.7),
      0 0 32px 8px rgba(255, 58, 242, 0.4),
      inset 0 0 20px rgba(255, 58, 242, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 28px 10px rgba(255, 58, 242, 0.9),
      0 0 48px 16px rgba(255, 58, 242, 0.5),
      inset 0 0 28px rgba(255, 58, 242, 0.25);
    transform: scale(1.04);
  }
}
@keyframes speakingBeat {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(255, 58, 242, 0.7); }
  50% { transform: scale(1.12); box-shadow: 0 0 28px rgba(255, 58, 242, 1); }
}

.orb.state-speaking,
#micBtn.orb.state-speaking {
  animation: avaPulse 1.4s ease-in-out infinite;
}

@keyframes avaPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 60, 120, 0.35);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 26px rgba(255, 60, 120, 0.95);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 60, 120, 0.35);
  }
}

/* Glass-style upgrade: apply to product cards, overlay content, modals (no layout change) */
.glass-panel {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
}

.ava-overlay,
#avaAutomationOverlay,
#avaOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(8px);
  background: rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.ava-overlay.active,
#avaAutomationOverlay.active,
#avaOverlay.active {
  opacity: 1;
  pointer-events: auto;
}

.ava-overlay.hidden,
#avaOverlay.hidden {
  display: none !important;
}

.avaAutomationCard,
.overlay-content {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 30px 28px;
  width: min(420px, calc(100vw - 32px));
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.38),
    0 0 40px rgba(255, 79, 216, 0.08);
  color: #ffffff;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Express overlay: status line with shimmer */
.overlay-status {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.overlay-status::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: overlay-shimmer 2s infinite;
}

@keyframes overlay-shimmer {
  100% {
    left: 100%;
  }
}

.overlay-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 16px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--ava-pink, #ff4fd8);
  border-radius: 50%;
  animation: overlay-spin 0.8s linear infinite;
}

@keyframes overlay-spin {
  to { transform: rotate(360deg); }
}

.overlay-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overlay-steps .step {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.78);
  margin: 0;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.avaAutomationTitle {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.01em;
}

.avaAutomationSteps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.avaStep,
.ava-step {
  font-size: 18px;
  color: white;
  margin: 10px 0;
  position: relative;
  opacity: 0.78;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.avaStep.active,
.ava-step.active {
  opacity: 1;
  transform: translateY(-1px);
}

.avaStep.active::after,
.ava-step.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 120px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    #ff4fd8,
    transparent
  );
  animation: avaShimmer 1.2s infinite;
}

.avaStep.done,
.ava-step.done {
  color: #6aff9c;
  opacity: 1;
}

.avaStep.done::before,
.ava-step.done::before {
  content: "✓ ";
  color: #6aff9c;
}

@keyframes avaShimmer {
  0% { transform: translateX(-40px); }
  100% { transform: translateX(120px); }
}

/* Scrollbar small */

#product-area::-webkit-scrollbar {
  height: 6px;
}
#product-area::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 999px;
}

/* Small screens tweaks */
@media (max-width: 380px) {
  .logo { font-size: 16px; }
  .tagline { font-size: 10px; }
}

/* Pricing Screen */
#pricing {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(2, 0, 17, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none !important; /* ALWAYS disabled when hidden */
  transition: opacity 0.3s ease;
  visibility: hidden; /* Completely hidden when not visible */
}

#pricing.pricing-visible {
  opacity: 1;
  pointer-events: all;
  visibility: visible; /* Only visible when explicitly shown */
}

/* Disable pricing buttons when modal is hidden */
#pricing.pricing-hidden .plans button {
  pointer-events: none !important;
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modal's z-index (10000) naturally blocks clicks - button stays clickable when modal is hidden */

.pricing-content {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.pricing-content.glass-panel {
  background: linear-gradient(135deg, rgba(58, 16, 102, 0.85), rgba(20, 5, 42, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(52, 255, 253, 0.1);
  z-index: 10001;
  pointer-events: auto;
}

.pricing-content h2 {
  margin: 0 0 12px 0;
  font-size: 28px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--ava-cyan), var(--ava-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pricing-content > p {
  margin: 0 0 24px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.5;
}

.pricing-intro {
  margin-bottom: 20px !important;
  font-size: 14px;
  opacity: 0.85;
}

.ava-plans {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.ava-plan-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(52, 255, 253, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  list-style: none;
}

.ava-plan-card h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

.ava-plan-card h3 .per {
  font-weight: 400;
  font-size: 14px;
  opacity: 0.8;
}

.ava-plan-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 12px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

.ava-plan-card ul li {
  padding: 2px 0;
}

.ava-plan-card .plan-cta {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  background: rgba(52, 255, 253, 0.15);
  border: 1px solid rgba(52, 255, 253, 0.4);
  border-radius: 8px;
  color: var(--ava-cyan);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ava-plan-card .plan-cta:not(:disabled):hover {
  background: rgba(52, 255, 253, 0.25);
}

.ava-plan-card .plan-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.plan-plus .plan-cta:not(:disabled),
.plan-pro .plan-cta:not(:disabled) {
  cursor: pointer;
}

.extra-credits-label {
  margin-top: 8px;
  margin-bottom: 10px !important;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.early-access-credit {
  margin-top: 20px !important;
  margin-bottom: 0 !important;
  padding: 12px 16px;
  background: rgba(52, 255, 253, 0.1);
  border: 1px solid rgba(52, 255, 253, 0.25);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ava-cyan);
  text-align: center;
}

.plans {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.plans button {
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 500;
  background: rgba(52, 255, 253, 0.1);
  border: 2px solid rgba(52, 255, 253, 0.3);
  border-radius: 12px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.plans button:hover {
  background: rgba(52, 255, 253, 0.2);
  border-color: var(--ava-cyan);
  transform: translateY(-2px);
}

.plans button.popular {
  border-color: var(--ava-cyan);
  background: rgba(52, 255, 253, 0.15);
  box-shadow: 0 0 20px rgba(52, 255, 253, 0.3);
}

.usage {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.8;
}

.usage li {
  padding: 4px 0;
}

.usage strong {
  color: var(--ava-cyan);
  font-weight: 600;
}

.pricing-content footer {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(52, 255, 253, 0.2);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.pricing-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--text-main);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.pricing-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* Safari Install Helper */
#safari-install-helper {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(58, 16, 102, 0.95), rgba(20, 5, 42, 0.95));
  border: 1px solid rgba(52, 255, 253, 0.3);
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 320px;
  width: 90%;
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateX(-50%) translateY(20px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

#safari-install-helper.safari-helper-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.safari-helper-content h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  color: var(--ava-cyan);
}

.safari-helper-content p {
  margin: 0 0 12px 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.5;
}

.safari-helper-content strong {
  color: var(--ava-cyan);
}

.safari-helper-close {
  width: 100%;
  padding: 10px;
  background: rgba(52, 255, 253, 0.1);
  border: 1px solid rgba(52, 255, 253, 0.3);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.safari-helper-close:hover {
  background: rgba(52, 255, 253, 0.2);
  border-color: var(--ava-cyan);
}

/* How it works modal — same space gradient as body + lighter starfield (not pure black) */
#info-modal {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, var(--ava-space2) 0%, #020011 70%);
  z-index: 1000002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  isolation: isolate;
  overflow: hidden;
  padding: 20px;
}

#info-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,1), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 33% 60%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 40% 90%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 70% 50%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 45% 85%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 25% 75%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 85% 45%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 35% 55%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 55% 35%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 95% 65%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 5% 95%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 65% 5%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 82% 68%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 18% 38%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 48% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 88% 22%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 8% 62%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 58% 32%, rgba(255,255,255,0.85), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: stars 12s linear infinite;
  opacity: 0.52;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

#info-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  background-image:
    radial-gradient(1px 1px at 6% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 12% 74%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 18% 42%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 24% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 29% 88%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 41% 6%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 56% 92%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 71% 76%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 86% 58%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 96% 82%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 22% 56%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 48% 78%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 58% 6%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 88% 8%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 64% 68%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90% 46%, rgba(255,255,255,0.85), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.4;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.25));
  mix-blend-mode: screen;
  animation: stars2 18s linear infinite;
  pointer-events: none;
  z-index: 0;
}

#info-modal.info-modal-hidden {
  display: none;
}

#info-modal.info-modal-visible {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

/* How it works panel — liquid glass aligned with .product-card tints */
#info-modal .info-modal-content {
  background:
    linear-gradient(135deg,
      rgba(52, 255, 253, 0.1) 0%,
      rgba(255, 255, 255, 0.08) 48%,
      rgba(255, 64, 255, 0.08) 100%),
    rgba(20, 5, 42, 0.52);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  border: 1px solid rgba(52, 255, 253, 0.32);
  border-radius: 20px;
  padding: 24px;
  max-width: 560px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 0 24px rgba(52, 255, 253, 0.14),
    0 16px 40px rgba(0, 0, 0, 0.32);
}

#info-modal .info-modal-content .ava-hiw-modal-title {
  margin-bottom: 16px;
  font-weight: 500;
  font-size: 22px;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg,
    var(--ava-cyan) 0%,
    var(--ava-pink) 50%,
    var(--ava-cyan) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  animation: metallicShine 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(52,255,253,0.5)) drop-shadow(0 0 12px rgba(255,58,242,0.3));
}

.info-modal-content {
  background: var(--ava-space2);
  border: 1px solid rgba(52, 255, 253, 0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.ava-hiw-body {
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}

.ava-hiw-card p.ava-hiw-example-line {
  margin: 0 0 8px 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.ava-hiw-card p.ava-hiw-example-line strong {
  color: var(--ava-cyan);
  font-weight: 600;
}

.ava-hiw-card p.ava-hiw-example-line.ava-hiw-example-ava {
  margin-bottom: 10px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
}

.ava-hiw-trust-inner {
  flex: 1;
  min-width: 0;
}

.ava-hiw-trust-banner-title {
  display: block;
  font-size: 14px;
  margin-bottom: 0;
}

.ava-hiw-trust-banner-text {
  margin: 8px 0 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.ava-hiw-lead {
  margin: 0 0 14px 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
}

.ava-hiw-ext-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px 0;
}

.ava-hiw-ext-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(52, 255, 253, 0.45);
  background: linear-gradient(
    135deg,
    rgba(52, 255, 253, 0.1) 0%,
    rgba(138, 79, 251, 0.12) 100%
  );
  box-shadow: 0 0 12px rgba(52, 255, 253, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.ava-hiw-ext-btn:hover {
  border-color: rgba(52, 255, 253, 0.65);
  box-shadow: 0 0 14px rgba(52, 255, 253, 0.18);
  color: #fff;
}

.ava-hiw-ext-btn:focus-visible {
  outline: 2px solid var(--ava-cyan);
  outline-offset: 2px;
}

@media (max-width: 360px) {
  .ava-hiw-ext-btn {
    flex: 1 1 100%;
  }
}

.ava-hiw-ext-link {
  color: var(--ava-cyan);
  text-decoration: none;
  font-weight: 600;
}
.ava-hiw-ext-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ava-hiw-inline-strong {
  background: linear-gradient(90deg, var(--ava-cyan), var(--ava-pink));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.ava-hiw-trust-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 18px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(52, 255, 253, 0.45);
  background: linear-gradient(135deg,
    rgba(52, 255, 253, 0.12) 0%,
    rgba(255, 58, 242, 0.1) 50%,
    rgba(138, 79, 251, 0.12) 100%);
  box-shadow: 0 0 18px rgba(52, 255, 253, 0.15);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.ava-hiw-trust-banner strong {
  color: var(--ava-cyan);
}

.ava-hiw-trust-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}

.ava-hiw-card {
  margin: 0 0 14px 0;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 255, 253, 0.2);
  background:
    linear-gradient(135deg, rgba(52, 255, 253, 0.06) 0%, rgba(255, 255, 255, 0.04) 50%, rgba(255, 64, 255, 0.06) 100%),
    rgba(20, 5, 42, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.ava-hiw-card p {
  margin: 0 0 10px 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.ava-hiw-card p:last-child {
  margin-bottom: 0;
}

.ava-hiw-card p.ava-hiw-example-line:last-child {
  margin-bottom: 0;
}

.ava-hiw-h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg,
    var(--ava-cyan) 0%,
    var(--ava-pink) 45%,
    var(--ava-violet) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: metallicShine 4s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(52,255,253,0.35));
}

.ava-hiw-tagline {
  margin: 0 0 8px 0 !important;
  font-size: 12px !important;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(52, 255, 253, 0.85) !important;
}

.ava-hiw-affiliate {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.ava-hiw-prefs {
  margin-top: 18px;
  padding: 16px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(138, 79, 251, 0.45);
  background: rgba(10, 2, 31, 0.45);
}

.ava-hiw-prefs-title {
  margin-bottom: 6px !important;
}

.ava-hiw-optional {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.5);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  animation: none;
  filter: none;
}

.ava-hiw-prefs-desc {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.ava-hiw-prefs-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ava-hiw-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
}

/* Match #avaModeToggle / Prime pill dropdowns */
#info-modal .ava-hiw-select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  height: 40px;
  padding: 0 36px 0 16px;
  border-radius: 999px;
  border: 2px solid var(--ava-cyan);
  background: rgba(10, 2, 31, 0.95) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2334FFFD' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 12px 12px;
  color: var(--ava-cyan);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow:
    0 0 10px rgba(52,255,253,0.6),
    0 0 20px rgba(255,58,242,0.4);
  box-shadow:
    0 0 10px rgba(52,255,253,0.45),
    0 0 20px rgba(255,58,242,0.25);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#info-modal .ava-hiw-select:hover {
  border-color: var(--ava-cyan);
  background: rgba(15, 4, 40, 0.98) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%2334FFFD' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 12px 12px;
}

#info-modal .ava-hiw-select:focus {
  border-color: var(--ava-cyan);
  box-shadow:
    0 0 0 2px rgba(52, 255, 253, 0.4),
    0 0 10px rgba(52,255,253,0.5),
    0 0 20px rgba(255,58,242,0.3);
}

#info-modal .ava-hiw-select option {
  background: rgb(18, 18, 28);
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.ava-hiw-prefs-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ava-hiw-pref-save {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--ava-pink);
  background: linear-gradient(135deg, rgba(255, 58, 242, 0.25), rgba(138, 79, 251, 0.2));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ava-hiw-pref-save:hover {
  box-shadow: 0 0 16px rgba(255, 58, 242, 0.35);
  transform: translateY(-1px);
}

.ava-hiw-pref-status {
  font-size: 12px;
  color: var(--ava-cyan);
  min-height: 1.2em;
}
.ava-wake-toggle-wrap {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(52, 255, 253, 0.2);
}
.ava-wake-toggle-wrap label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
}
.ava-wake-toggle-wrap input[type="checkbox"] {
  accent-color: var(--ava-cyan);
}
.ava-wake-toggle-wrap input[type="checkbox"]:focus {
  outline: 2px solid var(--ava-cyan);
  outline-offset: 2px;
}
.ava-wake-subtext {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
}

/* Cart modal - positioned near cart icon, smaller size */
#cart-modal {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0;
}

#cart-modal.info-modal-hidden {
  display: none;
}

#cart-modal.info-modal-visible {
  display: flex;
}

#cart-modal .info-modal-content {
  max-width: 280px;
  max-height: 350px;
  padding: 16px;
  position: fixed;
  top: 80px;
  right: 20px;
  width: auto;
  margin: 0;
}

/* Cart items styling */
.cart-items {
  margin-bottom: 16px;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  pointer-events: auto; /* Ensure items are clickable */
  z-index: 1; /* Ensure items are above any overlays */
}

.cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cart-item-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
}

.cart-item-details {
  flex-grow: 1;
  min-width: 0;
  padding-right: 32px; /* Make space for remove button */
}

.cart-item-title {
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  line-height: 1.3;
}

.cart-item-store {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.cart-item-price {
  font-size: 14px;
  font-weight: 500;
  color: var(--ava-cyan);
}

.cart-item-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.cart-item-qty-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.65);
}

.cart-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(52, 255, 253, 0.35);
  background: rgba(52, 255, 253, 0.12);
  color: var(--ava-cyan);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cart-qty-btn:hover {
  background: rgba(52, 255, 253, 0.22);
}

.cart-qty-btn:active {
  transform: scale(0.95);
}

.cart-item-qty-value {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.cart-empty {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  padding: 20px;
}

.cart-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-total {
  font-size: 16px;
  font-weight: 600;
  color: var(--ava-pink);
}

/* Remove item button - matches AVA × style */
.cart-item-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(255, 58, 242, 0.15);
  border: 1px solid rgba(255, 58, 242, 0.4);
  color: var(--ava-pink);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  z-index: 20; /* Ensure button is above text and other elements */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-item-remove:hover {
  background: rgba(255, 58, 242, 0.3);
  border-color: var(--ava-pink);
  box-shadow: 0 0 10px rgba(255, 58, 242, 0.5);
  transform: scale(1.1);
}

.cart-item-remove:active {
  transform: scale(0.95);
}

/* Selectable cart items for checkout */
.cart-item-selectable {
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.cart-item-selectable:hover {
  background: rgba(52, 255, 253, 0.05);
  transform: translateX(2px);
}

.cart-item-selected {
  background: rgba(52, 255, 253, 0.15) !important;
  border: 1px solid rgba(52, 255, 253, 0.3);
  border-radius: 8px;
  padding: 8px;
  margin: -8px;
}

/* Checkout button in cart modal - AVA theme gradient */
.cart-checkout-btn {
  width: 100%;
  background: linear-gradient(135deg, 
    rgba(52, 255, 253, 0.15) 0%, 
    rgba(255, 58, 242, 0.15) 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  color: var(--text-main);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
  overflow: hidden;
}

.cart-checkout-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(135deg, 
    var(--ava-cyan) 0%, 
    var(--ava-pink) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.cart-checkout-btn:hover {
  background: linear-gradient(135deg, 
    rgba(52, 255, 253, 0.25) 0%, 
    rgba(255, 58, 242, 0.25) 100%);
  box-shadow: 0 0 15px rgba(52, 255, 253, 0.4), 0 0 15px rgba(255, 58, 242, 0.4);
  transform: translateY(-1px);
}

.cart-checkout-btn:active {
  transform: scale(0.98);
}

.clear-cart-btn {
  width: 100%;
  background: rgba(255, 0, 0, 0.2);
  border: 1px solid rgba(255, 0, 0, 0.4);
  color: rgba(255, 100, 100, 0.9);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.clear-cart-btn:hover {
  background: rgba(255, 0, 0, 0.3);
  border-color: rgba(255, 0, 0, 0.6);
  color: rgba(255, 150, 150, 1);
}

.clear-cart-btn:active {
  transform: scale(0.98);
}

.info-modal-content h2 {
  margin: 0 0 16px 0;
  font-size: 20px;
  color: var(--ava-cyan);
  text-shadow: 0 0 10px rgba(52, 255, 253, 0.5);
}

#info-modal .info-content {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
  margin-bottom: 16px;
}

.info-content {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
  margin-bottom: 16px;
}

.info-disclosure {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-line;
  margin-bottom: 16px;
}

#info-modal .info-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 2px solid var(--ava-cyan);
  color: var(--ava-cyan);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

#info-modal .info-modal-close:hover {
  background: rgba(52, 255, 253, 0.15);
  border-color: var(--ava-cyan);
  box-shadow: 0 0 12px rgba(52, 255, 253, 0.4);
}

.info-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s ease;
}

.info-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Site footer — fixed inside #app so product rerenders never drop it; no bar background */
#ava-site-footer {
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: min(520px, 100vw);
  z-index: 1000001; /* above orb / glow UI; below .ava-chatbot-panel (1000002) */
  margin: 0 !important;
  margin-top: 0 !important;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  /* Footer stacks above #main in z-order; don't steal taps from FindIt glow bar in the overlap band */
  pointer-events: none;
}
#ava-site-footer a {
  pointer-events: auto;
  cursor: pointer;
}

footer {
  margin-top: auto;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

footer p {
  margin: 4px 0;
}

footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--ava-cyan);
}

/* Referral link: solid cyan + glow (swapped with toggle) */
#ava-invite-link {
  font-weight: 500;
  color: var(--ava-cyan);
  text-shadow: 0 0 10px rgba(52, 255, 253, 0.6);
  filter: drop-shadow(0 0 8px rgba(52, 255, 253, 0.5));
  transition: filter 0.2s ease, opacity 0.2s ease;
}
#ava-invite-link:hover {
  color: var(--ava-cyan);
  filter: drop-shadow(0 0 12px rgba(52, 255, 253, 0.7));
  opacity: 1;
}

.footer-disclosure {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  opacity: 0.85;
  font-weight: normal;
  text-decoration: none;
  line-height: 1.4;
}

#top-bar .logo,
#orb-container .orb,
#orb-container .tagline {
  position: relative;
  z-index: 2;
}

@media (display-mode: standalone) {
  #top-bar {
    top: 84px;
  }
  
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* Mobile product card — in-flow with skeleton (no fixed overlay) so actions stay inside the card */
@media (max-width: 768px) {
  #product-area:has(> .product-card:only-child) {
    justify-content: center;
  }

  .product-card {
    --pc-thumb: 72px;
    --pc-radius: 20px;
    --pc-width: min(340px, calc(100vw - 24px));
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    width: min(340px, calc(100vw - 24px)) !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none;
    overflow: visible;
    z-index: 2;
    touch-action: manipulation;
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 10px !important;
    padding: 12px !important;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
  }

  .product-card::before {
    border-radius: var(--pc-radius);
  }

  .product-card img,
  .product-thumb,
  .product-skeleton-thumb {
    width: var(--pc-thumb) !important;
    height: var(--pc-thumb) !important;
    min-width: var(--pc-thumb) !important;
    min-height: var(--pc-thumb) !important;
    object-fit: contain;
    flex-shrink: 0 !important;
  }
  
  .product-card-content,
  .product-body {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    flex: 1 !important;
    min-width: 0 !important;
  }

  .product-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 100%;
    gap: 6px;
  }
  
  .product-title {
    font-size: 14px !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 3 !important;
  }
  
  .product-price {
    font-size: 18px !important;
    font-weight: 700 !important;
  }
  
  .product-area {
    position: relative;
    min-height: 0;
    overflow: visible;
  }
  
  /* Lock body scroll when card is active */
  body.card-active {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
  }
}

/* Mobile touch optimizations */
@media (max-width: 768px) {
  button,
  .tag-btn,
  .orb {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
  }
  
  button:active,
  .tag-btn:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
  }
}

/* Responsive layout stabilization - modal responsive, cart preview hover, Prime tooltip */
@media (hover: hover) {
  .cart-icon:hover .cart-preview,
  #cart-icon:hover .cart-preview {
    display: block;
  }
  .ava-prime-toggle-wrap:hover .ava-prime-preview {
    display: block;
  }
}

/* Early access / demo modal — black + starfield (match hero / How it works overlay) */
.ava-beta-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000002;
  isolation: isolate;
  overflow: hidden;
}

.ava-beta-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 60% 70%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255,255,255,1), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 33% 60%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 10% 80%, rgba(255,255,255,0.75), transparent),
    radial-gradient(1px 1px at 40% 90%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 70% 50%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 15% 25%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 45% 85%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 75% 15%, rgba(255,255,255,1), transparent),
    radial-gradient(2px 2px at 25% 75%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 85% 45%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 35% 55%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 55% 35%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 95% 65%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 5% 95%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 65% 5%, rgba(255,255,255,0.95), transparent),
    radial-gradient(1px 1px at 82% 68%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 18% 38%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 48% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 88% 22%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 8% 62%, rgba(255,255,255,0.95), transparent),
    radial-gradient(2px 2px at 58% 32%, rgba(255,255,255,0.85), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  animation: stars 12s linear infinite;
  opacity: 0.88;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.35));
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 0;
}

.ava-beta-modal::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  background-image:
    radial-gradient(1px 1px at 6% 18%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 12% 74%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 18% 42%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 24% 12%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 29% 88%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 41% 6%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 56% 92%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 71% 76%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 86% 58%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 96% 82%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 22% 56%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 48% 78%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 58% 6%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1px 1px at 88% 8%, rgba(255,255,255,0.85), transparent),
    radial-gradient(1px 1px at 64% 68%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 90% 46%, rgba(255,255,255,0.85), transparent);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: 0.72;
  filter: drop-shadow(0 0 4px rgba(255,255,255,0.25));
  mix-blend-mode: screen;
  animation: stars2 18s linear infinite;
  pointer-events: none;
  z-index: 0;
}

/* Mobile assistant overlay — WEB_ASSISTANT entry (mobile Chrome): orb bottom-right */
.ava-mobile-assistant-overlay {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  z-index: 99999;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.ava-mobile-assistant-overlay #orb-container {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  transform: none !important;
  pointer-events: auto;
}

.ava-beta-modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  color: #111;
  border-radius: 12px;
  padding: 24px 20px 20px;
  max-width: 440px;
  width: 92%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  font-family: system-ui, sans-serif;
}

.ava-beta-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ava-beta-modal-close:hover {
  background: #fff;
  color: #111;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ava-beta-modal-content h2 {
  margin-bottom: 10px;
}

.ava-beta-modal-status {
  margin: 12px 0;
}

.ava-beta-modal .ava-status {
  margin: 4px 0;
}

.ava-beta-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.ava-beta-modal-actions button {
  padding: 10px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* Demo modal: structured layout (content → footer → disclaimer) */
.ava-demo-modal {
  max-width: 400px;
  width: min(400px, 92vw);
  /* Keep slide transitions stable without forcing a large empty block under short copy. */
  min-height: auto;
  padding: 20px 20px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-sizing: border-box;
}

.ava-demo-slides {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  flex-shrink: 0;
}

.ava-demo-slide {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: opacity, transform;
}
.ava-demo-slide.ava-demo-slide-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  will-change: auto;
}

/* Exit: current slide fades out and moves down (overlay) */
.ava-demo-slide.ava-demo-slide-exit {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  transition: opacity 250ms ease-out, transform 250ms ease-out;
}
.ava-demo-slide.ava-demo-slide-exit.ava-demo-slide-exit-active {
  opacity: 0;
  transform: translateY(10px);
}
.ava-demo-slide.ava-demo-slide-exit.ava-demo-slide-exit-prev.ava-demo-slide-exit-active {
  transform: translateY(-10px);
}

/* Enter: next slide fades in and moves up (overlay) */
.ava-demo-slide.ava-demo-slide-enter {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  opacity: 0;
  transform: translateY(10px);
  transition: none;
  visibility: visible;
  pointer-events: none;
}
.ava-demo-slide.ava-demo-slide-enter.ava-demo-slide-enter-prev {
  transform: translateY(-10px);
}
.ava-demo-slide.ava-demo-slide-enter.ava-demo-slide-enter-active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 300ms ease-out, transform 300ms ease-out;
}

/* Demo images: no per-slide keyframe (avoids flash on each Next). */

/* Text: headline first, subtext 80ms later */
.ava-demo-slide-enter-active .ava-demo-headline {
  animation: ava-demo-text-in 250ms ease-out;
}
.ava-demo-slide-enter-active .ava-demo-text,
.ava-demo-slide-enter-active .ava-beta-modal-status {
  animation: ava-demo-text-in 250ms ease-out 80ms both;
}
.ava-demo-slide-enter-active .ava-waitlist-form {
  animation: ava-demo-text-in 250ms ease-out 120ms both;
}
.ava-demo-slide-enter-active .ava-demo-init-wrap {
  animation: ava-demo-text-in 250ms ease-out 80ms both;
}
@keyframes ava-demo-text-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Slide 0: Explore Demo + Try AVA Now side by side */
.ava-demo-init-wrap {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.ava-demo-btn {
  display: inline-block;
  padding: 12px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.ava-demo-btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}
.ava-demo-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.6);
}
.ava-demo-btn-secondary {
  color: #333;
  background: #fff;
  border: 1px solid #d0d0d0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.ava-demo-btn-secondary:hover {
  background: #f8f8f8;
  border-color: #b0b0b0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.ava-demo-btn:active {
  transform: translateY(0);
}

.ava-demo-image {
  width: 100%;
  max-height: 200px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  background: #f5f5f5;
}
.ava-demo-image img {
  width: 100%;
  height: auto;
  max-height: 200px;
  object-fit: contain;
  object-position: center;
  display: block;
}
.ava-demo-image:has(img[src]) .ava-demo-image-placeholder {
  display: none;
}
.ava-demo-image-placeholder {
  width: 100%;
  height: 140px;
  min-height: 120px;
  background: linear-gradient(145deg, #f0eef4 0%, #e8e4f0 100%);
  border-radius: 8px;
}

.ava-demo-headline {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: #111;
  line-height: 1.3;
}
.ava-demo-text {
  font-size: 0.875rem;
  color: #444;
  margin: 0 0 12px;
  line-height: 1.45;
}
/* Slide 0: one body color + offer uses same spectrum as demo CTAs (purple → pink), not cyan mix */
.ava-demo-offer-paragraph {
  color: #2f2f35;
}
.ava-demo-offer-paragraph .ava-demo-text-lead {
  color: inherit;
  font-weight: 400;
}
.ava-demo-offer-highlight {
  display: inline;
  font-weight: 700;
  /* Match .ava-demo-btn-primary / progress bar — single smooth sweep, no per-letter hue shift */
  background: linear-gradient(135deg, #a855f7 0%, #c026d3 52%, #ec4899 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.ava-demo-extension-link {
  margin-bottom: 8px;
}
.ava-demo-extension-link a {
  color: #0066cc;
  font-weight: 600;
  text-decoration: none;
}
.ava-demo-extension-link a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Footer: progress + nav in clear structure */
.ava-demo-footer {
  flex-shrink: 0;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}
.ava-demo-footer-progress {
  margin-bottom: 14px;
}
.ava-demo-step {
  font-size: 0.8125rem;
  color: #666;
  margin: 0 0 6px;
  font-weight: 500;
}
.ava-demo-progress-bar {
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
}
.ava-demo-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  border-radius: 2px;
  transition: width 300ms ease-out;
  width: 16.666%;
}

.ava-demo-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ava-demo-prev,
.ava-demo-next {
  padding: 10px 16px;
  font-size: 0.9375rem;
  font-weight: 500;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s ease-out;
}
.ava-demo-prev:active:not(:disabled),
.ava-demo-next:active:not(:disabled) {
  transform: scale(0.97);
}
.ava-demo-prev:hover:not(:disabled),
.ava-demo-next:hover:not(:disabled) {
  background: #f8f8f8;
  border-color: #ccc;
}
.ava-demo-prev:disabled,
.ava-demo-next:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ava-demo-disclaimer {
  flex-shrink: 0;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  margin-bottom: 0;
}

@media (max-width: 480px) {
  .ava-demo-modal {
    padding: 14px 16px 18px;
    width: 95%;
    min-height: auto;
  }
  .ava-demo-slides {
    min-height: 0;
  }
  .ava-demo-image,
  .ava-demo-image img {
    max-height: 160px;
  }
  .ava-demo-image-placeholder {
    height: 120px;
    min-height: 100px;
  }
  .ava-demo-headline {
    font-size: 1.125rem;
  }
  .ava-demo-text {
    font-size: 0.875rem;
  }
  .ava-demo-prev,
  .ava-demo-next {
    padding: 8px 12px;
    font-size: 0.875rem;
  }
  .ava-demo-init-wrap {
    gap: 10px;
    margin-top: 16px;
  }
  .ava-demo-btn {
    padding: 10px 16px;
    font-size: 0.875rem;
  }
  .ava-demo-footer {
    margin-top: 16px;
    padding-top: 12px;
  }
}

#avaNotifyBtn {
  background: #e5e5e5;
  color: #111;
}

.ava-beta-modal-disclaimer {
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.75;
}

.ava-beta-modal-disclaimer a {
  color: #0066cc;
  text-decoration: underline;
}

.ava-waitlist-form {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.ava-waitlist-form input {
  padding: 10px 12px;
  width: 200px;
  max-width: 100%;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.ava-waitlist-form button {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: #e5e5e5;
  color: #111;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
}

.ava-beta-modal .waitlist-success {
  margin-top: 12px;
  color: #0a0;
  font-size: 14px;
}

/* Run-demo overlay (demo/runDemo.js) - above orb/tagline */
.ava-run-demo-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ava-run-demo-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.ava-run-demo-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 420px;
  width: 100%;
  padding: 24px;
}
.ava-run-demo-slide-content { margin-bottom: 12px; }
.ava-run-demo-title { font-size: 1.25rem; margin: 0 0 8px; }
.ava-run-demo-desc { font-size: 0.9375rem; color: #444; margin: 0 0 16px; line-height: 1.5; }
.ava-run-demo-step-label { font-size: 0.8125rem; color: #666; margin-bottom: 12px; }
.ava-run-demo-nav { display: flex; gap: 8px; margin-bottom: 12px; }
.ava-run-demo-prev, .ava-run-demo-next { padding: 8px 14px; border-radius: 6px; border: 1px solid #ccc; background: #fff; cursor: pointer; }
.ava-run-demo-close { position: absolute; top: 12px; right: 12px; border: none; background: none; font-size: 1.25rem; cursor: pointer; color: #666; }

/* Goal shopping panel (GoalShoppingPanel.js) */
.ava-goal-shopping-panel {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.ava-goal-panel-title { font-size: 1.125rem; margin: 0 0 12px; color: #212529; }
.ava-goal-panel-category { font-size: 0.9375rem; color: #495057; margin: 0 0 12px; line-height: 1.5; }
.ava-goal-panel-attr-label { font-size: 0.8125rem; font-weight: 600; color: #495057; margin: 0 0 6px; }
.ava-goal-panel-attr-list { margin: 0; padding-left: 20px; font-size: 0.875rem; color: #495057; line-height: 1.6; }
