/* 903 Brokers — chat widget (reskinned from the shared chat-widget-template.html) */

.launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -8px rgba(201, 162, 75, 0.6);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
  z-index: 200;
}

.launcher:hover {
  transform: scale(1.06);
}

.launcher svg {
  width: 26px;
  height: 26px;
  stroke: var(--black);
}

.launcher .pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  opacity: 0.55;
  animation: chat-pulse 2.4s ease-out infinite;
}

@keyframes chat-pulse {
  0% { transform: scale(0.85); opacity: 0.55; }
  100% { transform: scale(1.35); opacity: 0; }
}

.panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 330px;
  max-width: calc(100% - 36px);
  height: 460px;
  max-height: calc(100% - 36px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 60px -20px rgba(13, 13, 13, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 210;
  font-family: 'Helvetica Neue', Arial, sans-serif;
}

.panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.panel-head {
  background: var(--black);
  color: var(--gray-light);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 3px solid var(--gold);
  flex: none;
}

.panel-head .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  color: var(--black);
  font-size: 12px;
  flex: none;
}

.panel-head .who {
  flex: 1;
  min-width: 0;
}

.panel-head .who .name {
  font-size: 13.5px;
  font-weight: 600;
}

.panel-head .who .status {
  font-size: 10.5px;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 5px;
}

.panel-head .who .status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4cd97b;
  display: inline-block;
}

.panel-head .close {
  background: none;
  border: none;
  color: var(--gray-mid);
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.panel-head .close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--gray-light);
}

.msg {
  max-width: 82%;
  font-size: 12.8px;
  line-height: 1.55;
  padding: 9px 12px;
  border-radius: 12px;
  animation: chat-rise 0.18s ease;
}

@keyframes chat-rise {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.bot {
  background: #fff;
  color: var(--near-black);
  border: 1px solid var(--gray-mid);
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}

.msg.user {
  background: var(--black);
  color: var(--gray-light);
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}

.msg.bot b {
  color: var(--black);
}

.typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--gray-mid);
  padding: 10px 13px;
  border-radius: 12px;
  border-bottom-left-radius: 3px;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #9a978e;
  animation: chat-bounce 1.1s infinite ease-in-out;
}

.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chat-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
  flex: none;
  background: var(--gray-light);
}

.chip {
  font-size: 11.3px;
  background: #fff;
  border: 1px solid var(--gray-mid);
  color: var(--black);
  padding: 6px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.chip:hover {
  border-color: var(--gold);
  background: #fdf9ef;
}

.inputrow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--gray-mid);
  background: #fff;
  flex: none;
}

.inputrow input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--gray-mid);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 12.8px;
  outline: none;
  font-family: inherit;
}

.inputrow input:focus {
  border-color: var(--gold);
}

.inputrow button {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.inputrow button svg {
  width: 15px;
  height: 15px;
  stroke: var(--gray-light);
}

.inputrow button:disabled {
  opacity: 0.4;
  cursor: default;
}

.chat-disclaimer {
  font-size: 9.5px;
  color: #8a877e;
  text-align: center;
  padding: 0 12px 9px;
  background: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .launcher .pulse, .msg, .typing span {
    animation: none;
  }
}

@media (max-width: 480px) {
  .panel {
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
  }

  .launcher {
    right: 16px;
    bottom: 16px;
  }
}
