/* ---------- Food AI — living gold glass orb (canonical sizes; uifix only hides on modals) ---------- */
.wte-fab {
  position: fixed;
  right: calc(var(--right-w, 236px) + var(--page-pad, 4px) + var(--gap, 6px) + 14px);
  bottom: 64px;
  z-index: 790;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: transparent;
  background-color: transparent;
  background-image: none;
  color: #241a06;
  display: grid;
  place-items: center;
  box-shadow: none;
  border: none;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s ease, transform 0.25s ease;
}
.wte-fab.fab-msg,
.wte-fab.fab-orb {
  width: 72px;
  height: 72px;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible;
  /* Idle: no perpetual float — canvas motion carries life; open/hover still animate */
  will-change: transform;
}
/* APK / Android WebView: kill default button chrome + opaque canvas backing */
#foodAiFab.wte-fab.fab-orb,
#foodAiFab.wte-fab.fab-orb:focus,
#foodAiFab.wte-fab.fab-orb:active,
#foodAiFab.wte-fab.fab-orb:hover {
  -webkit-appearance: none !important;
  appearance: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.fab-orb-stage,
.fab-orb-canvas,
#foodAiOrbCanvas {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
/* r40: circular clip on every viewport so a failed-alpha canvas cannot read as a square */
.fab-orb-canvas,
#foodAiOrbCanvas {
  border-radius: 50%;
  -webkit-clip-path: circle(50% at 50% 50%);
          clip-path: circle(50% at 50% 50%);
}
@supports ((-webkit-mask-image: radial-gradient(#000, transparent)) or (mask-image: radial-gradient(#000, transparent))) {
  .fab-orb-canvas,
  #foodAiOrbCanvas {
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 46%, rgba(0, 0, 0, 0.55) 58%, transparent 72%);
            mask-image: radial-gradient(circle at 50% 50%, #000 0%, #000 46%, rgba(0, 0, 0, 0.55) 58%, transparent 72%);
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
            mask-size: 100% 100%;
  }
}
.wte-fab.fab-orb:hover {
  transform: translateY(-6px) scale(1.05);
}
.wte-fab.fab-orb:active {
  transform: translateY(-2px) scale(0.97);
  transition-duration: 0.12s;
}
.wte-fab.fab-orb.is-open {
  width: 140px;
  height: 140px;
  animation: fabOrbNudge 0.45s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}
.wte-fab:focus-visible {
  outline: 3px solid rgba(255, 230, 150, 0.95);
  outline-offset: 8px;
  border-radius: 50%;
}

/* Soft honey radiance — canvas paints the sphere; this is the outer halo */
.fab-orb-aura {
  position: absolute;
  inset: -28%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 214, 100, 0.42) 0%,
    rgba(224, 182, 79, 0.2) 36%,
    rgba(201, 150, 46, 0.07) 58%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
  filter: blur(2px);
  opacity: 0.55;
}
.wte-fab.fab-orb:hover .fab-orb-aura,
.wte-fab.fab-orb[data-orb-state="hover"] .fab-orb-aura {
  opacity: 1;
  filter: blur(1px) saturate(1.25);
  transform: scale(1.08);
  animation: fabOrbAura 4.2s ease-in-out infinite;
}
.wte-fab.fab-orb[data-orb-state="listening"] .fab-orb-aura {
  animation: fabOrbAuraListen 1.5s ease-in-out infinite;
  filter: blur(1px) saturate(1.15);
}
.wte-fab.fab-orb[data-orb-state="thinking"] .fab-orb-aura {
  animation: fabOrbAuraThink 0.9s ease-in-out infinite;
  filter: blur(0.5px) saturate(1.25) brightness(1.08);
}

.fab-orb-stage {
  position: absolute;
  width: 120%;
  height: 120%;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
}
.fab-orb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fab-orb-fallback {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 52%;
  height: 52%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}
.wte-fab.fab-orb.is-static .fab-orb-fallback,
.wte-fab.fab-orb:not(.is-live) .fab-orb-fallback {
  opacity: 1;
  box-shadow:
    0 0 22px 6px rgba(240, 193, 74, 0.45),
    0 0 48px 12px rgba(201, 150, 46, 0.28);
}

/* Legacy static-sphere bits (kept hidden if leftover markup exists) */
.fab-orb-ring,
.fab-orb-core,
.fab-orb-sheen,
.fab-orb-msg-icon { display: none; }

.fab-orb-dot.d1 { animation: fabOrbDot 1.4s ease-in-out infinite; }
.fab-orb-dot.d2 { animation: fabOrbDot 1.4s ease-in-out 0.16s infinite; }
.fab-orb-dot.d3 { animation: fabOrbDot 1.4s ease-in-out 0.32s infinite; }

@keyframes fabOrbNudge {
  0% { transform: scale(1); }
  40% { transform: scale(0.92); }
  100% { transform: scale(1); }
}
@keyframes fabOrbAura {
  0%, 100% { opacity: 0.62; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.08); }
}
@keyframes fabOrbAuraListen {
  0%, 100% { opacity: 0.7; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.16); }
}
@keyframes fabOrbAuraThink {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}
@keyframes fabOrbDot {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .wte-fab.fab-orb,
  .fab-orb-aura {
    animation: none !important;
  }
}

.wte-fab .fab-label {
  position: absolute;
  right: 88px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 650;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1), transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  box-shadow: var(--shadow-md);
}
.wte-fab.fab-orb.is-open .fab-label { right: 154px; }
.wte-fab:hover .fab-label,
.wte-fab:focus-visible .fab-label {
  opacity: 1;
  transform: translateX(0);
}

/* Chat panel chrome */
.orb-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.orb-chat-head > div { min-width: 0; }
.orb-chat-close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 194, 74, 0.45);
  background: rgba(8, 32, 48, 0.85);
  color: var(--gold-soft, #ffe199);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.orb-chat-close:hover,
.orb-chat-close:focus-visible {
  border-color: var(--cyan, #3ad8ff);
  outline: 2px solid rgba(255, 210, 122, 0.7);
  outline-offset: 2px;
}
#orbGo.orb-go {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
}

@media (max-width: 900px) {
  .wte-fab.fab-orb {
    width: 56px;
    height: 56px;
    right: 14px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
  .wte-fab.fab-orb.is-open { width: 128px; height: 128px; }
  .wte-fab .fab-label { right: 72px; }
}

@media (max-width: 768px) {
  .wte-fab.fab-orb {
    width: 56px;
    height: 56px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
  .wte-fab.fab-orb.is-open { width: 128px; height: 128px; }
}

@media (max-width: 480px) {
  .wte-fab.fab-emoji-only,
  .wte-fab.fab-msg,
  .wte-fab.fab-orb {
    width: 50px;
    height: 50px;
    right: 10px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
  .wte-fab.fab-orb.is-open {
    width: 120px;
    height: 120px;
  }
}

.wte-fab.fab-orb.has-poll-nudge .fab-orb-aura,
.wte-fab.fab-orb[data-orb-state="nudge"] .fab-orb-aura {
  animation: fabOrbAuraListen 2.1s ease-in-out infinite;
  filter: blur(1px) saturate(1.12);
}
