.ai-chat-panel {
  background: #ededed;
  border-radius: 14px 14px 0 0;
}
.ai-chat-panel .ai-chat-header {
  padding: 11px 14px;
  background: #f7f7f7;
  border-bottom-color: #dedede;
}
.ai-chat-panel [data-ai-title] {
  margin-left: 0;
  font-size: 15px;
  color: #1f1f1f;
}
.ai-chat-panel [data-ai-close] {
  padding: 2px 4px;
  color: #888;
  font-size: 21px;
}
.ai-chat-panel .ai-chat-messages {
  height: 48vh;
  padding: 14px 11px;
}
.ai-chat-panel .consult-disclosure {
  margin-bottom: 13px;
  color: #999;
  font-size: 10px;
}
.ai-chat-panel .ai-message-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
}
.ai-chat-panel .ai-message-row.user {
  flex-direction: row-reverse;
}
.chat-avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: #527f78;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.chat-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
}
.ai-chat-panel .chat-message-body {
  min-width: 0;
  max-width: calc(100% - 48px);
  margin-left: 9px;
}
.ai-chat-panel .user .chat-message-body {
  max-width: calc(100% - 12px);
  margin-right: 0;
  margin-left: 0;
  text-align: right;
}
.ai-chat-panel .ai-chat-message {
  display: inline-block;
  position: relative;
  max-width: 100%;
  margin: 0;
  padding: 8.5px 11px;
  box-sizing: border-box;
  border-radius: 5px;
  background: #fff;
  color: #222;
  font-size: 13px;
  line-height: 1.65;
  text-align: left;
  white-space: pre-line;
  box-shadow: 0 0.5px 1.5px rgba(0, 0, 0, .025);
}
.ai-chat-panel .ai-chat-message::before {
  content: '';
  position: absolute;
  top: 12.5px;
  left: -5px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid #fff;
}
.ai-chat-panel .ai-chat-message.user {
  background: #95ec69;
  color: #172312;
}
.ai-chat-panel .ai-chat-message.user::before {
  left: auto;
  right: -5px;
  border-right: 0;
  border-left: 6px solid #95ec69;
}
.ai-chat-panel .ai-message-meta {
  margin-top: 5px;
  color: #888;
  font-size: 10px;
  line-height: 1.6;
}
.ai-chat-panel .ai-thinking {
  width: fit-content;
  margin-left: 45px;
  padding: 8px 10px;
  border-radius: 5px;
  color: #888;
  font-size: 11px;
}
.ai-chat-panel .ai-dots view {
  background: #07a65a;
}
.ai-chat-panel .consult-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 11px 12px;
  margin-top: 6px;
  padding: 10px;
  border: 0.5px solid #e0e6dd;
  border-radius: 7px;
  background: #f8faf7;
}
.ai-chat-panel .consult-contact button {
  flex: 0 0 78px;
  min-width: 78px;
  height: 32px;
  padding: 0;
  border: 1px solid #e94c46;
  font-size: 12px;
  color: #fff;
  border-color: #e94c46;
  background: linear-gradient(135deg, #ff7168, #e94c46);
  border-radius: 7px;
  box-shadow: 0 3.5px 8px rgba(225, 76, 70, 0.22);
  font-weight: 700;
}
.ai-chat-panel .consult-contact span {
  color: #929b92;
  font-size: 10.5px;
}
.ai-chat-panel .ai-chat-suggestions {
  padding: 6px 11px 9px;
  gap: 8px;
  background: #f7f7f7;
  border-top: 0.5px solid #e2e2e2;
}
.ai-chat-panel .ai-chat-suggestions button {
  padding: 5px 9px;
  background: #fff;
  color: #637967;
  border-color: #e2e8e1;
  font-size: 11px;
}
.ai-chat-panel .ai-chat-input {
  align-items: center;
  padding: 7px 11px 11px;
  background: #f7f7f7;
}
.ai-chat-panel .ai-chat-input input {
  height: 38px;
  padding: 0 10px;
  border: 0.5px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
  color: #222;
  font-size: 13.5px;
}
.ai-chat-panel .ai-chat-input button {
  width: 54px;
  border-radius: 5px;
  background: #07c160;
  font-weight: 500;
}

.ai-chat-panel .ai-chat-input button[disabled] { color: #b4b4b4; background: #e9e9e9; }

.ai-chat-panel .ai-chat-header small { display: none; }
.ai-chat-panel .ai-chat-header button { border: 0; background: transparent; cursor: pointer; }
.ai-chat-panel .chat-avatar { object-fit: cover; object-position: 50% 20%; }
.ai-chat-panel .ai-chat-message { max-width: 100%; margin: 0; }
.ai-chat-panel .user .ai-chat-message { margin-left: 0; }
.ai-chat-panel .ai-message-meta { text-align: left; }
.ai-chat-panel .user .ai-message-meta { text-align: right; }
.ai-chat-panel .ai-chat-input input { box-sizing: border-box; }
.ai-chat-panel .ai-chat-input button { flex: 0 0 54px; padding: 0; border: 0; font-size: 12.5px; }
.ai-chat-panel .ai-chat-suggestions button { line-height: 1.5; border-style: solid; border-width: 1px; cursor: pointer; }
.ai-chat-panel .ai-chat-input { padding-bottom: calc(11px + env(safe-area-inset-bottom)); }
@media (min-width: 601px) { .ai-chat-panel { border-radius: 14px; } }

.detail-page .ai-chat-mask {
  align-items: flex-end;
  padding: 0;
  background: rgba(0, 0, 0, .42);
}
.detail-page .ai-chat-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 64vh;
  height: 64dvh;
  max-height: 88dvh;
  margin: 0;
  border-radius: 15px 15px 0 0;
  background: #ededed;
}
.detail-page .ai-chat-panel .ai-chat-header {
  flex: 0 0 52px;
  box-sizing: border-box;
  padding: 0 14px;
}
.detail-page .ai-chat-header [data-ai-title] {
  font-size: 15px;
  font-weight: 400;
}
.detail-page .ai-chat-panel [data-ai-close] {
  font-size: 26px;
  line-height: 1;
}
.detail-page .ai-chat-panel .ai-chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  padding: 14px 11px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-page .ai-chat-panel .ai-message-row {
  margin-bottom: 18px;
}
.detail-page .ai-chat-panel .chat-avatar {
  width: 35px;
  height: 35px;
  border-radius: 5px;
}
.detail-page .ai-chat-panel .chat-message-body {
  max-width: calc(100% - 44px);
  margin-left: 9px;
}
.detail-page .ai-chat-panel .user .chat-message-body {
  margin-left: 0;
}
.detail-page .ai-chat-panel .ai-chat-message {
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.75;
  border-radius: 5px;
}
.detail-page .ai-chat-panel .ai-message-meta {
  margin-top: 5px;
  color: #999;
  font-size: 10px;
}
.detail-page .ai-chat-panel .consult-contact {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 0 11px 15px;
  padding: 10px;
  border: 1px solid #e0e6dd;
  border-radius: 6px;
}
.detail-page .ai-chat-panel .consult-contact button {
  flex: 0 0 78px;
  width: 78px;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid #e94c46;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1;
}
.detail-page .ai-chat-panel .consult-contact span {
  min-width: 0;
  color: #929b92;
  font-size: 10.5px;
  line-height: 1.65;
}
.detail-page .ai-chat-panel .ai-chat-suggestions {
  flex: 0 0 auto;
  gap: 8px;
  padding: 6px 11px 10px;
  scrollbar-width: none;
}
.detail-page .ai-chat-panel .ai-chat-suggestions::-webkit-scrollbar {
  display: none;
}
.detail-page .ai-chat-panel .ai-chat-suggestions button {
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  line-height: 1.4;
}
.detail-page .ai-chat-panel .ai-chat-input {
  flex: 0 0 auto;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 5px 11px calc(16px + env(safe-area-inset-bottom));
}
.detail-page .ai-chat-panel .ai-chat-input input {
  height: 39px;
  padding: 0 10px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 13px;
}
.detail-page .ai-chat-panel .ai-chat-input input::placeholder {
  color: #888;
  opacity: 1;
}
.detail-page .ai-chat-panel .ai-chat-input button {
  flex: 0 0 54px;
  width: 54px;
  height: 39px;
  padding: 0;
  border-radius: 5px;
  background: #07c160;
  color: #fff;
  font-size: 13px;
  font-weight: 400;
}
.detail-page .ai-chat-panel .ai-chat-input button:disabled {
  background: #e9e9e9;
  color: #b4b4b4;
  cursor: default;
  opacity: 1;
}
@media (min-width: 601px) {
  .detail-page .ai-chat-mask {
    align-items: center;
    padding: 20px;
  }
  .detail-page .ai-chat-panel {
    width: min(100%, 620px);
    height: min(760px, 88dvh);
    border-radius: 15px;
  }
}

.phone-auth-dialog.chat-phone-auth {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: 320px;
  margin: auto;
  padding: 0;
  border-radius: 14px;
}
.phone-auth-dialog.chat-phone-auth::backdrop {
  background: rgba(0, 0, 0, .24);
}
.phone-auth-dialog.chat-phone-auth .needs-hero {
  padding: 16px 18px 8px;
}
.phone-auth-dialog.chat-phone-auth .needs-hero h2 {
  margin: 0;
  font-size: 16px;
}
.phone-auth-dialog.chat-phone-auth .needs-hero p {
  margin: 6px 0 0;
  font-size: 11px;
}
.phone-auth-dialog.chat-phone-auth form {
  padding: 0 18px 16px;
}
.phone-auth-dialog.chat-phone-auth input {
  padding: 8px;
  margin-top: 4px;
  border-radius: 6px;
}
.phone-auth-dialog.chat-phone-auth label {
  margin-top: 8px;
}
.phone-auth-dialog.chat-phone-auth .primary {
  padding: 9px;
  border-radius: 7px;
}
.phone-auth-dialog.chat-phone-auth .phone-auth-message:empty {
  display: none;
}
