/* ป้ายไมโครโฟนอยู่ด้านข้างตัวน้องตะวัน (ไม่บังมาสคอต) + หน้าต่างสีขาวใสขุ่นอ่านง่าย */
.wc-mascot {
  overflow: visible !important;
}

.wc-mascot-voice-badge {
  position: absolute;
  left: calc(100% + 10px);
  top: 46%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.14);
  border: 1.5px solid rgba(79, 70, 229, 0.25);
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
}

/* หางบอลลูนชี้ไปทางตัวน้องตะวัน */
.wc-mascot-voice-badge::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.96);
  border-left: 1.5px solid rgba(79, 70, 229, 0.25);
  border-bottom: 1.5px solid rgba(79, 70, 229, 0.25);
  transform: translateY(-50%) rotate(45deg);
}

.wc-mascot-mic-circle {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.wc-mascot-mic-circle svg {
  width: 14px;
  height: 14px;
}

/* บนจอมือถือแคบ วางด้านซ้ายของมาสคอตแทนถ้าชิดขอบขวา ไม่ให้ล้นจอหรือบังตัวมาสคอต */
@media (max-width: 576px) {
  .wc-mascot-voice-badge {
    left: auto;
    right: calc(100% + 8px);
    padding: 5px 11px 5px 6px;
    font-size: 12px;
  }
  .wc-mascot-voice-badge::before {
    left: auto;
    right: -6px;
    border-left: 0;
    border-bottom: 0;
    border-right: 1.5px solid rgba(79, 70, 229, 0.25);
    border-top: 1.5px solid rgba(79, 70, 229, 0.25);
  }
}

/* หน้าต่างป๊อปอัปสีขาวใสขุ่น (Frosted Glass) แต่อ่านข้อความชัดเจน */
.wc-voice-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.wc-voice-backdrop.is-open {
  display: flex !important;
}

.wc-voice-modal {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.wc-voice-head {
  background: rgba(255, 255, 255, 0.72);
  color: #0f172a;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wc-voice-head strong {
  color: #0f172a;
  font-size: 15.5px;
}

#wcVoiceStatus {
  color: #4f46e5;
  font-size: 12.5px;
  font-weight: 500;
  margin-top: 2px;
}

#wcVoiceClose {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  border: 0;
  font-size: 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

#wcVoiceClose:hover {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

.wc-voice-log {
  flex: 1;
  min-height: 260px;
  max-height: 430px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(248, 250, 252, 0.55);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wc-voice-msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.58;
}

.wc-voice-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.wc-voice-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.09);
  color: #0f172a;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.wc-voice-pay-card {
  margin: 0 14px 10px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(79, 70, 229, 0.22);
  color: #0f172a;
  font-size: 13.5px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.wc-voice-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
}

.wc-voice-foot input {
  flex: 1;
  min-width: 0;
  padding: 10px 13px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-size: 14.5px;
}

.wc-voice-foot input:focus {
  outline: 2px solid rgba(79, 70, 229, 0.35);
  border-color: #4f46e5;
}

.wc-voice-btn {
  padding: 10px 15px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.wc-voice-btn:active {
  transform: scale(0.97);
}

.wc-voice-btn.mic {
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28);
}

.wc-voice-btn.mic.is-rec {
  background: #dc2626;
  box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.22);
}

.wc-voice-btn.send {
  background: #1e293b;
  color: #ffffff;
}
