/* Priya AI — launcher, glass panel, chat, voice orb, voice message card (W7).
   Brand: navy #1B2B52, fox-orange #E8650F (primary buttons), gold #D4A04A
   small accents only. Mobile-first; panel fits 320px viewports. */
.priya-launcher { position: fixed; right: 18px; bottom: 18px; z-index: 9990; }
.priya-launcher-btn {
  position: relative; width: 60px; height: 60px; border: 0; border-radius: 50%;
  padding: 0; cursor: pointer; background: #1B2B52;
  box-shadow: 0 10px 28px rgba(18, 38, 77, .35), 0 0 0 3px rgba(212, 160, 74, .45);
  transition: transform .18s ease, box-shadow .18s ease;
}
.priya-launcher-btn:hover { transform: translateY(-2px) scale(1.03); }
.priya-launcher-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.priya-launcher-dot {
  position: absolute; right: 2px; top: 2px; width: 13px; height: 13px;
  border-radius: 50%; background: #1d9e6c; border: 2px solid #fff;
}

.priya-panel {
  position: fixed; right: 18px; bottom: 90px; z-index: 9991;
  width: min(380px, calc(100vw - 24px)); max-height: min(640px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; border: 1px solid rgba(255, 255, 255, .55);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 24px 60px rgba(13, 26, 51, .28);
  font-family: 'Hind Siliguri', 'Inter', system-ui, sans-serif; color: #16233c;
}
.priya-panel[hidden] { display: none; }

.priya-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px;
  background: linear-gradient(135deg, #1B2B52, #16294d 60%, #0d1a33); color: #fff;
}
.priya-ava { position: relative; flex: none; width: 40px; height: 40px; }
.priya-ava img { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; background: #0d1a33; }
.priya-ava-dot { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: #1d9e6c; border: 2px solid #fff; }
.priya-head-text { flex: 1; min-width: 0; line-height: 1.25; }
.priya-head-text b { font-size: 15.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.priya-status { font-size: 12px; color: #c9d6f2; display: inline-flex; align-items: center; gap: 5px; }
.priya-sdot { width: 7px; height: 7px; border-radius: 50%; background: #2fd08a; display: inline-block; }
.priya-icon-btn {
  flex: none; width: 34px; height: 34px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.priya-icon-btn svg { width: 18px; height: 18px; }
.priya-icon-btn.off { opacity: .55; }

.priya-modes {
  display: flex; gap: 6px; padding: 8px 10px 0; background: transparent;
}
.priya-modes button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px solid #dde4f0; background: #fff; color: #44557a; border-radius: 12px;
  padding: 9px 6px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.priya-modes button svg { width: 16px; height: 16px; }
.priya-modes button.on { background: #1B2B52; border-color: #1B2B52; color: #fff; }

.priya-mode { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.priya-mode[hidden] { display: none; }

.priya-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px 0; }
.priya-quick button {
  border: 1px solid #dde4f0; background: #f0f3fa; color: #1B2B52; border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.priya-quick button:hover { border-color: #D4A04A; background: #fff4dd; }

.priya-body {
  flex: 1; min-height: 180px; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.priya-msg { display: flex; gap: 6px; align-items: flex-start; max-width: 92%; }
.priya-msg span {
  padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.55;
  white-space: pre-line; word-break: break-word;
}
.priya-msg.me { align-self: flex-end; }
.priya-msg.me span { background: #E8650F; color: #fff; border-bottom-right-radius: 4px; }
.priya-msg.bot span { background: #eef2f9; color: #16233c; border-bottom-left-radius: 4px; }
.priya-msg-spk {
  flex: none; border: 0; background: transparent; cursor: pointer; font-size: 15px;
  padding: 8px 2px; line-height: 1; opacity: .75;
}
.priya-msg-spk:hover { opacity: 1; }
.priya-typing { align-items: center; }
.priya-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: #8fa0bf; display: inline-block;
  margin: 12px 2px; animation: priya-blink 1.2s infinite;
}
.priya-typing i:nth-child(2) { animation-delay: .2s; }
.priya-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes priya-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.priya-vm-slot { padding: 2px 12px 8px; }
.priya-vm-slot:empty { display: none; }

.priya-wa {
  margin: 0 12px 8px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #e7f5ec; color: #14532d; border: 1px solid #bfe3cc; border-radius: 12px;
  padding: 10px; font-size: 13.5px; font-weight: 700; text-decoration: none;
}
.priya-wa svg { width: 18px; height: 18px; flex: none; }

.priya-input { display: flex; gap: 6px; padding: 0 12px 12px; }
.priya-input input {
  flex: 1; min-width: 0; border: 1.5px solid #dde4f0; border-radius: 12px;
  padding: 10px 12px; font-size: 14px; font-family: inherit; color: #16233c; background: #fff;
}
.priya-input input:focus { outline: none; border-color: #D4A04A; box-shadow: 0 0 0 3px rgba(212, 160, 74, .25); }
.priya-mic-btn {
  flex: none; width: 42px; border: 1.5px solid #dde4f0; border-radius: 12px; background: #fff;
  color: #1B2B52; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.priya-mic-btn svg { width: 18px; height: 18px; }
.priya-mic-btn.listening { background: #fdeedd; border-color: #E8650F; color: #E8650F; animation: priya-pulse 1.2s infinite; }
.priya-input button[type="submit"] {
  flex: none; border: 0; border-radius: 12px; background: #E8650F; color: #fff;
  padding: 0 16px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
}
@keyframes priya-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 101, 15, .35); } 50% { box-shadow: 0 0 0 6px rgba(232, 101, 15, 0); } }

/* Voice Message mode */
.priya-voice-stage { padding: 18px 14px 16px; text-align: center; overflow-y: auto; }
.priya-orb {
  position: relative; width: 132px; height: 132px; margin: 6px auto 14px; cursor: pointer;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.priya-orb-halo {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 101, 15, .22), rgba(27, 43, 82, .08) 65%, transparent 75%);
}
.priya-orb-ring {
  position: absolute; border-radius: 50%; border: 2px solid rgba(232, 101, 15, .5);
  inset: 6px; opacity: 0; pointer-events: none;
}
.priya-orb.st-listening .priya-orb-ring { animation: priya-ring 1.6s ease-out infinite; }
.priya-orb.st-listening .r2 { animation-delay: .8s; }
@keyframes priya-ring { 0% { transform: scale(.85); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
.priya-orb-core {
  position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: hidden;
  background: #1B2B52; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(18, 38, 77, .3);
}
.priya-orb-core img { width: 56px; height: 56px; object-fit: cover; border-radius: 50%; }
.priya-orb-eq { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: none; gap: 2px; align-items: flex-end; height: 16px; }
.priya-orb-eq i { width: 3px; background: #E8650F; border-radius: 2px; height: 6px; }
.priya-orb.st-speaking .priya-orb-eq { display: flex; }
.priya-orb.st-speaking .priya-orb-eq i { animation: priya-eq .7s ease-in-out infinite alternate; }
.priya-orb.st-speaking .priya-orb-eq i:nth-child(2) { animation-delay: .15s; }
.priya-orb.st-speaking .priya-orb-eq i:nth-child(3) { animation-delay: .3s; }
.priya-orb.st-speaking .priya-orb-eq i:nth-child(4) { animation-delay: .1s; }
.priya-orb.st-speaking .priya-orb-eq i:nth-child(5) { animation-delay: .25s; }
@keyframes priya-eq { from { height: 4px; } to { height: 15px; } }
.priya-call-name { font-weight: 800; font-size: 16px; color: #1B2B52; }
.priya-call-status { font-size: 13px; color: #5b6b8c; margin-top: 4px; line-height: 1.5; }
.priya-call-timer { font-size: 13px; color: #44557a; margin-top: 8px; font-variant-numeric: tabular-nums; }
.priya-call-subs { font-size: 14px; line-height: 1.6; color: #16233c; background: #eef2f9; border-radius: 12px; padding: 10px 12px; margin-top: 10px; min-height: 42px; text-align: left; }
.priya-call-lang { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.priya-call-lang button {
  border: 1.5px solid #dde4f0; background: #fff; color: #44557a; border-radius: 999px;
  padding: 7px 16px; font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.priya-call-lang button.on { background: #1B2B52; border-color: #1B2B52; color: #fff; }
.priya-call-prompts { margin-top: 12px; text-align: left; }
.priya-call-prompts p { font-size: 13px; color: #5b6b8c; margin: 0 0 8px; }
.priya-call-prompts button {
  display: block; width: 100%; text-align: left; margin-bottom: 6px;
  border: 1px solid #dde4f0; background: #fff; color: #1B2B52; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.priya-call-prompts[hidden] { display: none; }

/* Priya Voice Message player card (chat + order pages only) */
.pvm-card {
  display: flex; gap: 10px; align-items: flex-start; background: #fff;
  border: 1px solid #dde4f0; border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 6px 18px rgba(18, 38, 77, .07);
}
.pvm-card > img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #1B2B52; }
.pvm-play {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: #E8650F; color: #fff; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.pvm-main { flex: 1; min-width: 0; }
.pvm-wave { display: flex; align-items: center; gap: 2px; height: 22px; }
.pvm-wave i { width: 3px; background: #8fa0bf; border-radius: 2px; display: block; }
.pvm-card.playing .pvm-wave i { background: #E8650F; }
.pvm-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: #5b6b8c; margin-top: 2px; }
.pvm-meta b { color: #1B2B52; }
.pvm-text { font-size: 13px; line-height: 1.55; color: #44557a; margin: 6px 0 0; }

@media (max-width: 420px) {
  /* BUG-044: lift the launcher (and the panel above it) by the
     device safe-area so the home indicator never crowds it; the
     panel keeps its 10px gap above the launcher (82px vs 72px).
     The storefront footer clearance lives in store.css. */
  .priya-launcher { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .priya-panel { right: 12px; bottom: calc(82px + env(safe-area-inset-bottom, 0px)); border-radius: 16px; }
  .priya-body { min-height: 150px; }
}
