/* Poppo live support — standalone CSS so JS cache cannot collapse panel height */
.ps-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(8, 4, 7, 0.72);
  backdrop-filter: blur(6px);
}

.ps-backdrop[hidden] {
  display: none !important;
}

.ps-panel {
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #26101a;
  border: 1px solid rgba(255, 214, 170, 0.22);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  /* Default: large panel at bottom-right */
  right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 12px;
  width: auto;
  max-width: 420px;
  margin-left: auto;
  height: min(560px, calc(100vh - 96px));
  min-height: 420px;
  border-radius: 16px;
}

@media (min-width: 520px) {
  .ps-panel {
    left: auto;
    width: min(400px, calc(100vw - 24px));
  }
}

/* Send to support: fullscreen chat */
.ps-panel.ps-fullscreen {
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-height: 100% !important;
  margin: 0 !important;
  border-radius: 0;
  border: none;
}

.ps-panel[hidden] {
  display: none !important;
}

.ps-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 214, 170, 0.12);
  font-weight: 700;
  font-size: 16px;
  color: #fff6ee;
}

.ps-close {
  border: 0;
  background: transparent;
  color: #fff6ee;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
}

.ps-status {
  flex: 0 0 auto;
  padding: 8px 16px;
  font-size: 13px;
  color: #f0c36a;
  text-align: center;
  border-bottom: 1px solid rgba(255, 214, 170, 0.08);
}

.ps-status[hidden] {
  display: none !important;
}

.ps-msgs {
  flex: 1 1 auto;
  min-height: 200px;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 15px;
  background: rgba(0, 0, 0, 0.15);
  -webkit-overflow-scrolling: touch;
}

.ps-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 92%;
}

.ps-msg.is-me {
  align-self: flex-end;
  text-align: right;
}

.ps-msg.is-admin {
  align-self: flex-start;
}

.ps-who {
  font-size: 11px;
  color: #c9b3b8;
}

.ps-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  text-align: left;
  word-break: break-word;
  line-height: 1.55;
  white-space: pre-wrap;
  color: #fff6ee;
}

.ps-msg.is-me .ps-bubble {
  background: linear-gradient(180deg, #ff7aa6, #c81e56);
  color: #fff;
}

.ps-order-card {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 214, 170, 0.35);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ps-img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin-top: 4px;
}

.ps-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 214, 170, 0.12);
  align-items: flex-end;
}

.ps-input {
  flex: 1;
  min-height: 48px;
  max-height: 120px;
  resize: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 214, 170, 0.28);
  background: #140910;
  color: #fff6ee;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
}

.ps-send,
.ps-upload {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
  background: linear-gradient(180deg, #ffe3a4, #e0a84a);
  color: #3d2208;
}

.ps-upload {
  background: transparent;
  border: 1px solid rgba(255, 214, 170, 0.35);
  color: #fff6ee;
}

html[dir="rtl"] .ps-panel:not(.ps-fullscreen) {
  right: auto;
  left: 12px;
  margin-left: 0;
  margin-right: auto;
}

.ps-fab-chat {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 998;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, #ff7aa6, #c81e56);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

html[dir="rtl"] .ps-fab-chat {
  right: auto;
  left: 16px;
}
