/* Prime Dock & Door chat widget. All class names start with pdc-. */

.pdc-root {
  --pdc-black: #0a0a0a;
  --pdc-white: #ffffff;
  --pdc-gray-100: #f2f2f2;
  --pdc-gray-300: #d0d0d0;
  --pdc-gray-600: #5c5c5c;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--pdc-black);
  text-align: left;
}

.pdc-root *,
.pdc-root *::before,
.pdc-root *::after {
  box-sizing: border-box;
}

.pdc-root [hidden] {
  display: none !important;
}

.pdc-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Launcher button */

.pdc-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  padding: 0 20px;
  border: 2px solid var(--pdc-white);
  border-radius: 999px;
  background: var(--pdc-black);
  color: var(--pdc-white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.pdc-launcher:hover {
  background: #2a2a2a;
}

.pdc-open .pdc-launcher {
  display: none;
}

.pdc-root button:focus-visible,
.pdc-root a:focus-visible,
.pdc-root textarea:focus-visible,
.pdc-messages:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 2px;
}

/* Panel */

.pdc-panel {
  display: flex;
  flex-direction: column;
  width: 380px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border: 1px solid var(--pdc-black);
  border-radius: 12px;
  background: var(--pdc-white);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.pdc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 12px 12px 12px 16px;
  background: var(--pdc-black);
  color: var(--pdc-white);
}

.pdc-title {
  margin: 0;
  padding: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--pdc-white);
}

.pdc-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--pdc-white);
  cursor: pointer;
}

.pdc-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* Messages */

.pdc-messages {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--pdc-white);
}

.pdc-row {
  display: flex;
}

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

.pdc-row-notice {
  justify-content: center;
}

.pdc-bubble {
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pdc-bubble-assistant {
  border: 1px solid var(--pdc-gray-300);
  border-bottom-left-radius: 4px;
  background: var(--pdc-gray-100);
  color: var(--pdc-black);
}

.pdc-bubble-user {
  border-bottom-right-radius: 4px;
  background: var(--pdc-black);
  color: var(--pdc-white);
}

.pdc-bubble-notice {
  max-width: 100%;
  border: 1px dashed var(--pdc-gray-600);
  background: var(--pdc-white);
  color: var(--pdc-black);
  font-size: 14px;
  text-align: center;
}

.pdc-link-phone { white-space: nowrap; }
.pdc-link {
  color: inherit;
  overflow-wrap: anywhere;
  font-weight: 600;
  text-decoration: underline;
}

/* Typing indicator */

.pdc-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
}

.pdc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pdc-gray-600);
  animation: pdc-blink 1.2s infinite ease-in-out;
}

.pdc-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.pdc-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pdc-blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdc-dot {
    animation: none;
    opacity: 0.6;
  }
}

/* Input */

.pdc-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
  border-top: 1px solid var(--pdc-gray-300);
  background: var(--pdc-white);
}

.pdc-input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 120px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--pdc-gray-600);
  border-radius: 10px;
  background: var(--pdc-white);
  color: var(--pdc-black);
  font: inherit;
  /* 16px stops the zoom on focus in iOS Safari. */
  font-size: 16px;
  line-height: 1.4;
  resize: none;
}

.pdc-input::placeholder {
  color: var(--pdc-gray-600);
}

.pdc-send {
  flex: 0 0 auto;
  min-width: 68px;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--pdc-black);
  border-radius: 10px;
  background: var(--pdc-black);
  color: var(--pdc-white);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pdc-send:hover {
  background: #2a2a2a;
}

.pdc-send:disabled {
  background: var(--pdc-gray-600);
  border-color: var(--pdc-gray-600);
  cursor: default;
}

.pdc-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 12px 10px;
  background: var(--pdc-white);
  color: var(--pdc-gray-600);
  font-size: 12px;
  text-align: center;
}

.pdc-note-link {
  color: var(--pdc-black);
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
}

/* Phone: the panel is a full-width sheet from the bottom of the screen. */

@media (max-width: 480px) {
  .pdc-root {
    right: 12px;
    bottom: 12px;
  }

  .pdc-root.pdc-open {
    right: 0;
    bottom: 0;
    left: 0;
  }

  .pdc-panel {
    width: 100%;
    max-width: 100%;
    height: 82vh;
    height: 82dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
}

/* Below 768px the sticky action bar of the page has the Chat button (window.pdChat.open). */

@media (max-width: 767px) {
  .pdc-launcher {
    display: none;
  }
}

@media print {
  .pdc-root {
    display: none;
  }
}
