/* Digital Human Studio chat-style product advisor */

.dh-advisor-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #c4a574;
  color: #09090a;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.dh-advisor-fab:hover { filter: brightness(1.06); }

.dh-advisor-panel {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 9999;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 110px));
  display: none;
  flex-direction: column;
  border: 1px solid #2a2a2c;
  border-radius: 14px;
  overflow: hidden;
  background: #121214;
  color: #f2efe8;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}
.dh-advisor-panel.open { display: flex; }

.dh-advisor-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #09090a;
  border-bottom: 1px solid #2a2a2c;
}
.dh-advisor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(196, 165, 116, 0.22);
  border: 1px solid rgba(196, 165, 116, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.dh-advisor-head-main { flex: 1; min-width: 0; }
.dh-advisor-head-main h2 {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dh-advisor-status {
  font-size: 11px;
  color: #7cb87c;
  margin-top: 2px;
}
.dh-advisor-head-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.dh-advisor-head-actions button {
  border: 1px solid #2a2a2c;
  border-radius: 6px;
  background: transparent;
  color: #9a958c;
  font-size: 10px;
  padding: 4px 7px;
  cursor: pointer;
}
.dh-advisor-head-actions button.active {
  border-color: #c4a574;
  color: #c4a574;
}
.dh-advisor-close {
  border: none;
  background: transparent;
  color: #9a958c;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 2px;
}

.dh-advisor-banner {
  display: none;
  padding: 6px 12px;
  font-size: 10px;
  color: #c4a574;
  background: rgba(196, 165, 116, 0.1);
  border-bottom: 1px solid #2a2a2c;
}
.dh-advisor-banner.show { display: block; }

.dh-advisor-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #101012 0%, #121214 100%);
}

.dh-advisor-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}
.dh-advisor-row.user { justify-content: flex-end; }
.dh-advisor-row.bot { justify-content: flex-start; }

.dh-advisor-bubble {
  max-width: 82%;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
}
.dh-advisor-row.bot .dh-advisor-bubble {
  background: #1c1c1f;
  border: 1px solid #2a2a2c;
  border-bottom-left-radius: 4px;
  color: #f2efe8;
}
.dh-advisor-row.user .dh-advisor-bubble {
  background: #c4a574;
  color: #09090a;
  border-bottom-right-radius: 4px;
}
.dh-advisor-row.bot.escalate .dh-advisor-bubble {
  border-color: #c4a574;
}

.dh-advisor-card {
  max-width: 88%;
  padding: 10px 12px;
  background: #1c1c1f;
  border: 1px solid #2a2a2c;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  font-size: 12px;
  line-height: 1.55;
}
.dh-advisor-card-title {
  color: #c4a574;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 12px;
}
.dh-advisor-card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dh-advisor-card-links a {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid #2a2a2c;
  border-radius: 999px;
  color: #f2efe8;
  font-size: 11px;
  text-decoration: none;
  background: #09090a;
}
.dh-advisor-card-links a:hover {
  border-color: #c4a574;
  color: #c4a574;
}
.dh-advisor-card-qr {
  margin-top: 8px;
}
.dh-advisor-card-qr img {
  width: 96px;
  height: 96px;
  border: 1px solid #2a2a2c;
  background: #fff;
  display: block;
}

.dh-advisor-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 4px 44px;
}
.dh-advisor-chips button {
  border: 1px solid #2a2a2c;
  border-radius: 999px;
  background: #09090a;
  color: #d8d3c8;
  font-size: 11px;
  padding: 6px 11px;
  cursor: pointer;
  white-space: nowrap;
}
.dh-advisor-chips button:hover {
  border-color: #c4a574;
  color: #c4a574;
}

.dh-advisor-typing-row {
  display: none;
  align-items: flex-end;
  gap: 8px;
  padding: 0 12px 6px;
}
.dh-advisor-typing-row.show { display: flex; }
.dh-advisor-typing-bubble {
  padding: 10px 14px;
  background: #1c1c1f;
  border: 1px solid #2a2a2c;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 12px;
  color: #9a958c;
  letter-spacing: 0.08em;
}

.dh-advisor-composer {
  border-top: 1px solid #2a2a2c;
  background: #09090a;
  padding: 8px 10px 10px;
}
.dh-advisor-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dh-advisor-toolbar::-webkit-scrollbar { display: none; }
.dh-advisor-toolbar button {
  flex-shrink: 0;
  border: 1px solid #2a2a2c;
  border-radius: 999px;
  background: transparent;
  color: #9a958c;
  font-size: 10px;
  padding: 4px 9px;
  cursor: pointer;
}
.dh-advisor-toolbar button:hover {
  border-color: #c4a574;
  color: #c4a574;
}
.dh-advisor-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dh-advisor-input-row input {
  flex: 1;
  height: 40px;
  border: 1px solid #2a2a2c;
  border-radius: 999px;
  background: #121214;
  color: #f2efe8;
  padding: 0 14px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}
.dh-advisor-input-row input:focus {
  border-color: #c4a574;
}
.dh-advisor-input-row button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #c4a574;
  color: #09090a;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.dh-advisor-input-row button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .dh-advisor-fab { right: 14px; bottom: 14px; }
  .dh-advisor-panel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 78px;
    height: min(520px, calc(100vh - 96px));
  }
}
