/* PromoLab help chat widget — glass / rose accent */
.pl-help-root {
  --plh-bg: #0a0a0e;
  --plh-panel: rgba(12, 12, 18, 0.92);
  --plh-border: rgba(255, 255, 255, 0.1);
  --plh-rose: #ff6b8a;
  --plh-cyan: #06b6d4;
  --plh-emerald: #10b981;
  --plh-text: rgba(255, 255, 255, 0.92);
  --plh-muted: rgba(255, 255, 255, 0.45);
  --plh-user: linear-gradient(135deg, #ff6b8a 0%, #ff8f6b 100%);
  --plh-support: rgba(255, 255, 255, 0.06);
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  position: fixed;
  z-index: 2147483000;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
  pointer-events: none;
}

.pl-help-root * {
  box-sizing: border-box;
}

.pl-help-fab {
  pointer-events: auto;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255, 107, 138, 0.35);
  background:
    radial-gradient(120% 120% at 20% 10%, rgba(255, 107, 138, 0.45), transparent 55%),
    radial-gradient(100% 100% at 90% 90%, rgba(6, 182, 212, 0.25), transparent 50%),
    rgba(10, 10, 14, 0.95);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.pl-help-fab:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: rgba(255, 107, 138, 0.55);
  box-shadow:
    0 14px 36px rgba(255, 107, 138, 0.22),
    0 10px 30px rgba(0, 0, 0, 0.45);
}

.pl-help-fab:active {
  transform: scale(0.97);
}

.pl-help-fab svg {
  width: 24px;
  height: 24px;
}

.pl-help-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--plh-rose);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  display: none;
}

.pl-help-fab-wrap {
  pointer-events: auto;
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.pl-help-panel {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid var(--plh-border);
  background: var(--plh-panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
  visibility: hidden;
}

.pl-help-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.pl-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--plh-border);
  background:
    linear-gradient(180deg, rgba(255, 107, 138, 0.12), transparent 80%),
    rgba(255, 255, 255, 0.02);
}

.pl-help-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pl-help-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 107, 138, 0.35), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.pl-help-avatar svg {
  width: 18px;
  height: 18px;
  color: #fff;
}

.pl-help-title {
  font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--plh-text);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.pl-help-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--plh-muted);
}

.pl-help-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--plh-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.pl-help-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--plh-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.pl-help-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--plh-border);
}

.pl-help-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.pl-help-empty {
  margin: auto;
  text-align: center;
  color: var(--plh-muted);
  font-size: 13px;
  line-height: 1.5;
  padding: 24px 16px;
  max-width: 260px;
}

.pl-help-row {
  display: flex;
}

.pl-help-row.user {
  justify-content: flex-end;
}

.pl-help-row.support {
  justify-content: flex-start;
}

.pl-help-bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--plh-text);
}

.pl-help-row.user .pl-help-bubble {
  background: var(--plh-user);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.pl-help-row.support .pl-help-bubble {
  background: var(--plh-support);
  border: 1px solid var(--plh-border);
  border-bottom-left-radius: 6px;
}

.pl-help-time {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.65;
  text-align: right;
}

.pl-help-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--plh-border);
  background: rgba(0, 0, 0, 0.25);
}

.pl-help-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--plh-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--plh-text);
  padding: 0 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.pl-help-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.pl-help-input:focus {
  border-color: rgba(255, 107, 138, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.pl-help-send {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ff6b8a, #ff8f6b);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.pl-help-send:disabled {
  opacity: 0.4;
  cursor: default;
}

.pl-help-send:not(:disabled):hover {
  transform: scale(1.05);
}

.pl-help-send svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  .pl-help-panel {
    width: calc(100vw - 20px);
    height: min(70vh, 560px);
    bottom: 64px;
  }
}
