/* Payment Store support widget — dark charcoal + gold (site theme) */

.ps-sc-root {
  --ps-sc-ink: #f3efe6;
  --ps-sc-muted: #b0a99a;
  --ps-sc-faint: #7a7468;
  --ps-sc-bg: #0c0e14;
  --ps-sc-panel: #161a24;
  --ps-sc-panel-2: #1c2230;
  --ps-sc-line: rgba(243, 239, 230, 0.1);
  --ps-sc-line-strong: rgba(243, 239, 230, 0.22);
  --ps-sc-gold: #f0b74a;
  --ps-sc-gold-2: #c88820;
  --ps-sc-gold-soft: rgba(240, 183, 74, 0.18);
  --ps-sc-shadow: 0 22px 56px rgba(0, 0, 0, 0.55);
  --ps-sc-font: "Outfit", system-ui, sans-serif;
  --ps-sc-track: rgba(243, 239, 230, 0.06);
  --ps-sc-danger: #ff7a7a;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: var(--ps-sc-font);
  color: var(--ps-sc-ink);
  color-scheme: dark;
}

.ps-sc-root * {
  box-sizing: border-box;
}

.ps-sc-launcher {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(240, 183, 74, 0.35);
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #ffd06a 0%, var(--ps-sc-gold) 45%, var(--ps-sc-gold-2) 100%);
  box-shadow: var(--ps-sc-shadow), 0 0 0 4px var(--ps-sc-gold-soft);
  display: grid;
  place-items: center;
  color: #1a140c;
}

.ps-sc-launcher svg {
  width: 26px;
  height: 26px;
}

.ps-sc-panel {
  width: min(360px, calc(100vw - 28px));
  display: none;
  flex-direction: column;
  margin-bottom: 12px;
}

.ps-sc-root.is-open .ps-sc-panel {
  display: flex;
}

.ps-sc-root.is-open .ps-sc-launcher {
  display: none;
}

/* Avatar + content column: bubble and composer share the same width */
.ps-sc-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ps-sc-avatar {
  width: 44px;
  height: 44px;
  margin-top: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe9a8, var(--ps-sc-gold-2));
  box-shadow: 0 8px 22px rgba(200, 136, 32, 0.4);
  border: 1px solid rgba(255, 208, 106, 0.35);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
}

.ps-sc-avatar img {
  width: 28px;
  height: 28px;
}

.ps-sc-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ps-sc-bubble {
  background:
    radial-gradient(ellipse 90% 60% at 10% 0%, rgba(240, 183, 74, 0.1), transparent 55%),
    linear-gradient(165deg, var(--ps-sc-panel-2) 0%, var(--ps-sc-panel) 55%, #12151d 100%);
  border: 1px solid var(--ps-sc-line-strong);
  border-radius: 18px;
  box-shadow: var(--ps-sc-shadow);
  padding: 12px 12px 14px;
  position: relative;
  min-width: 0;
  width: 100%;
}

.ps-sc-bubble::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--ps-sc-gold), var(--ps-sc-gold-2), transparent);
  opacity: 0.85;
  pointer-events: none;
}

.ps-sc-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--ps-sc-faint);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}

.ps-sc-close:hover {
  color: var(--ps-sc-gold);
}

.ps-sc-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ps-sc-ink);
  margin: 0 22px 8px 0;
}

.ps-sc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ps-sc-gold);
  box-shadow: 0 0 0 3px var(--ps-sc-gold-soft);
}

/* Custom thumb-only scrollbar — native bar fully hidden (no Chromium arrows). */
.ps-sc-thread-shell {
  position: relative;
  max-height: 280px;
}

.ps-sc-thread {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 2px 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* legacy Edge */
}

.ps-sc-thread::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}

.ps-sc-scroll-rail {
  position: absolute;
  top: 2px;
  right: 1px;
  bottom: 2px;
  width: 4px;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ps-sc-thread-shell.has-scroll .ps-sc-scroll-rail {
  opacity: 1;
  pointer-events: auto;
}

.ps-sc-scroll-thumb {
  width: 100%;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(240, 183, 74, 0.38);
  box-shadow: none;
  border: 0;
  cursor: grab;
  transform: translateY(0);
  will-change: transform;
}

.ps-sc-scroll-thumb:hover {
  background: rgba(240, 183, 74, 0.52);
}

.ps-sc-scroll-thumb:active {
  cursor: grabbing;
  background: rgba(240, 183, 74, 0.62);
}

.ps-sc-date {
  align-self: center;
  font-size: 11px;
  color: var(--ps-sc-faint);
  margin: 2px 0 4px;
}

.ps-sc-msg {
  max-width: 100%;
  width: fit-content;
  padding: 8px 11px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ps-sc-msg.is-system,
.ps-sc-msg.is-staff {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ps-sc-line);
  color: var(--ps-sc-ink);
  max-width: 100%;
}

.ps-sc-msg.is-staff {
  border-color: rgba(240, 183, 74, 0.28);
  background: rgba(240, 183, 74, 0.1);
}

.ps-sc-msg.is-visitor {
  align-self: flex-end;
  background: rgba(240, 183, 74, 0.14);
  border: 1px solid rgba(240, 183, 74, 0.4);
  color: var(--ps-sc-ink);
  max-width: 100%;
}

.ps-sc-msg a.ps-sc-file {
  color: var(--ps-sc-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ps-sc-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}

.ps-sc-choice {
  border: 1px solid var(--ps-sc-line-strong);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ps-sc-ink);
}

.ps-sc-choice:hover {
  border-color: rgba(240, 183, 74, 0.55);
  background: var(--ps-sc-gold-soft);
  color: #fff6e4;
}

.ps-sc-closed-note {
  margin: 0 0 6px;
  font-size: 12.5px;
  color: var(--ps-sc-muted);
  width: 100%;
}

.ps-sc-wrap {
  position: relative;
  width: 100%;
}

.ps-sc-composer {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  background:
    linear-gradient(165deg, var(--ps-sc-panel-2) 0%, var(--ps-sc-panel) 100%);
  border-radius: 999px;
  box-shadow: var(--ps-sc-shadow);
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--ps-sc-line-strong);
}

.ps-sc-composer input[type="text"] {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  min-width: 0;
  color: var(--ps-sc-ink);
}

.ps-sc-composer input::placeholder {
  color: var(--ps-sc-faint);
}

.ps-sc-icon-btn {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ps-sc-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ps-sc-icon-btn:hover {
  color: var(--ps-sc-gold);
  background: var(--ps-sc-gold-soft);
}

.ps-sc-icon-btn svg {
  width: 18px;
  height: 18px;
}

.ps-sc-send {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  color: #1a140c;
  background: linear-gradient(135deg, #ffd06a 0%, var(--ps-sc-gold) 45%, var(--ps-sc-gold-2) 100%);
  box-shadow: 0 4px 14px rgba(200, 136, 32, 0.4);
}

.ps-sc-send:hover {
  filter: brightness(1.06);
}

.ps-sc-send:active {
  transform: scale(0.96);
}

.ps-sc-send svg {
  width: 17px;
  height: 17px;
  margin-left: 1px;
}

.ps-sc-error {
  font-size: 12px;
  color: var(--ps-sc-danger);
  padding: 0 6px;
}

.ps-sc-emoji-pop {
  position: absolute;
  right: 52px;
  bottom: 52px;
  background: var(--ps-sc-panel-2);
  border: 1px solid var(--ps-sc-line-strong);
  border-radius: 12px;
  box-shadow: var(--ps-sc-shadow);
  padding: 8px;
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  z-index: 2;
}

.ps-sc-emoji-pop.is-open {
  display: grid;
}

.ps-sc-emoji-pop button {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px;
}

.ps-sc-emoji-pop button:hover {
  background: var(--ps-sc-gold-soft);
}

@media (max-width: 480px) {
  .ps-sc-root {
    right: 12px;
    bottom: 12px;
  }
  .ps-sc-thread {
    max-height: 42vh;
  }
}
