.retell-doug-chat {
  --rdc-navy: #031b35;
  --rdc-navy-2: #062b52;
  --rdc-orange: #f47721;
  --rdc-ink: #17263a;
  --rdc-muted: #627386;
  --rdc-line: #dce6ef;
  --rdc-white: #ffffff;
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 99999;
  font-family: Poppins, Arial, Helvetica, sans-serif;
}

.retell-doug-chat__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(320px, calc(100vw - 32px));
  background: var(--rdc-white);
  border: 1px solid var(--rdc-line);
  border-radius: 8px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(520px, calc(100vh - 120px));
}

.retell-doug-chat__panel[hidden] {
  display: none !important;
}

.retell-doug-chat__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--rdc-navy-2), var(--rdc-navy));
  color: var(--rdc-white);
}

.retell-doug-chat__head strong {
  display: block;
  font-size: 14px;
  line-height: 1.2;
}

.retell-doug-chat__head span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.78);
}

.retell-doug-chat__close {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.retell-doug-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.retell-doug-chat__msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}

.retell-doug-chat__msg--agent {
  align-self: flex-start;
  background: var(--rdc-white);
  border: 1px solid var(--rdc-line);
  color: var(--rdc-ink);
}

.retell-doug-chat__msg--user {
  align-self: flex-end;
  background: var(--rdc-orange);
  color: var(--rdc-white);
}

.retell-doug-chat__msg--typing {
  align-self: flex-start;
  background: var(--rdc-white);
  border: 1px solid var(--rdc-line);
  color: var(--rdc-muted);
  font-style: italic;
}

.retell-doug-chat__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--rdc-line);
  background: var(--rdc-white);
}

.retell-doug-chat__form input {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--rdc-line);
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  color: var(--rdc-ink);
}

.retell-doug-chat__form input:focus {
  outline: 2px solid rgba(244, 119, 33, 0.25);
  border-color: var(--rdc-orange);
}

.retell-doug-chat__send {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 4px;
  background: var(--rdc-orange);
  color: var(--rdc-white);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
}

.retell-doug-chat__send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.retell-doug-chat__bot {
  position: relative;
  width: 64px;
  height: 64px;
  border: 6px solid var(--rdc-white);
  border-radius: 50%;
  background: #0b5ec9;
  box-shadow: 0 15px 32px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.retell-doug-chat__bot::before {
  content: "";
  width: 36px;
  height: 27px;
  border-radius: 9px;
  background: var(--rdc-white);
  box-shadow: inset 0 -4px 0 #d8eaff;
}

.retell-doug-chat__bot::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 6px;
  border-radius: 8px;
  background: #0b5ec9;
  box-shadow: 11px 0 0 #0b5ec9;
  transform: translateY(-1px);
}

.retell-doug-chat__badge {
  display: none;
}

@media (max-width: 760px) {
  .retell-doug-chat {
    right: 14px;
    bottom: 14px;
  }

  .retell-doug-chat__panel {
    width: min(300px, calc(100vw - 28px));
  }
}

.rdc-call-wrap {
  margin-top: 0;
}

.rdc-call-wrap .btn[data-retell-call] {
  width: 100%;
}

.retell-doug-chat__call-btn {
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--rdc-orange);
  border-radius: 4px;
  background: transparent;
  color: var(--rdc-orange);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.retell-doug-chat__call-btn::before {
  content: "📞";
  font-size: 13px;
}

.retell-doug-chat__call-btn:hover {
  background: var(--rdc-orange);
  color: var(--rdc-white);
}

.rdc-call-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3, 27, 53, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 10040;
  pointer-events: none;
  animation: rdc-fade-in 0.18s ease;
}

.rdc-call-overlay.is-open {
  display: block;
  pointer-events: auto;
}

@keyframes rdc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.rdc-call-popover {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(360px, calc(100vw - 32px));
  z-index: 10050;
  padding: 28px 24px 20px;
  background: #fff;
  border: 1px solid #f3c9a8;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(3, 27, 53, 0.22), 0 8px 24px rgba(244, 119, 33, 0.12);
  text-align: center;
  font-family: Poppins, Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  pointer-events: none;
  animation: rdc-pop-in 0.2s ease forwards;
}

.rdc-call-popover.is-open {
  display: block;
  pointer-events: auto;
}

@keyframes rdc-pop-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.93); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.rdc-call-popover__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 1.5px solid #f47721;
  border-radius: 50%;
  background: #fff;
  color: #f47721;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}

.rdc-call-popover__close:hover {
  background: #f47721;
  color: #fff;
}

.rdc-call-popover__title {
  margin: 8px 0 8px;
  color: #17263a;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
}

.rdc-call-popover__title span {
  color: #f47721;
}

.rdc-call-popover__text {
  margin: 0 0 14px;
  color: #627386;
  font-size: 11px;
  line-height: 1.45;
}

.rdc-call-popover__field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 12px;
  min-height: 42px;
  border: 1px solid #f47721;
  border-radius: 8px;
  background: #fff;
}

.rdc-call-popover__field-icon {
  width: 18px;
  height: 18px;
  color: #f47721;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 18px;
  display: grid;
  place-items: center;
}

.rdc-call-popover__field-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.rdc-call-popover__field input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  color: #17263a;
  outline: none;
}

.rdc-call-popover__field input::placeholder {
  color: #9aa8b6;
}

.rdc-call-popover__submit {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #f47721;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rdc-call-popover__submit::after {
  content: "›";
  font-size: 18px;
  line-height: 1;
}

.rdc-call-popover__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.rdc-call-popover__tail {
  display: none;
}

.chat-actions .btn[data-retell-call],
.rdc-call-wrap .btn[data-retell-call] {
  width: 100%;
}

#hopman-chat-panel,
.chat {
  overflow: visible;
}

#hopman-chat-panel .chat-actions,
.chat-actions {
  border-top: 1px solid #e7edf4;
  padding: 12px;
  background: #fff;
  flex: 0 0 auto;
  position: relative;
}
