#smart-support-widget-root {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 2147482000;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.smart-support-toggle {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.26);
  cursor: pointer;
}

.smart-support-toggle::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
  transition: opacity 160ms ease;
}

.smart-support-toggle:hover::before,
.smart-support-toggle:focus-visible::before {
  opacity: 1;
}

.smart-support-toggle img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
}

.smart-support-panel {
  position: fixed;
  right: 24px;
  bottom: 156px;
  display: none;
  width: min(380px, calc(100vw - 32px));
  max-height: min(620px, calc(100dvh - 180px));
  overflow: hidden;
  border: 1px solid #d8e0eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.25);
}

.smart-support-panel.is-open {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
}

.smart-support-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #1463d9;
  color: #fff;
}

.smart-support-head img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.smart-support-head strong {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.smart-support-head span {
  display: block;
  font-size: 12px;
  opacity: 0.86;
}

.smart-support-close {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  font-size: 22px;
  line-height: 26px;
}

.smart-support-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px;
  background: #f6f8fb;
}

.smart-support-msg {
  display: flex;
}

.smart-support-msg.user {
  justify-content: flex-end;
}

.smart-support-bubble {
  max-width: 84%;
  border-radius: 12px;
  padding: 9px 11px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.55;
}

.smart-support-msg.assistant .smart-support-bubble {
  background: #fff;
  color: #1f2937;
  border: 1px solid #e4e9f2;
}

.smart-support-msg.user .smart-support-bubble {
  background: #1463d9;
  color: #fff;
}

.smart-support-bubble a {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  word-break: break-all;
}

.smart-support-meta {
  margin-top: 4px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.4;
}

.smart-support-speak {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  min-height: 28px;
  border: 1px solid #cfe0f7;
  border-radius: 999px;
  background: #fff;
  color: #17406f;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 0 10px;
}

.smart-support-speak:hover,
.smart-support-speak:focus-visible {
  border-color: #1463d9;
  outline: none;
}

.smart-support-speak.is-speaking {
  background: #17406f;
  border-color: #17406f;
  color: #fff;
}

.smart-support-msg.user .smart-support-meta {
  text-align: right;
}

.smart-support-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px 0;
  background: #fff;
}

.smart-support-actions button {
  border: 1px solid #d8e0eb;
  border-radius: 999px;
  background: #f7faff;
  color: #17406f;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 12px;
  min-height: 31px;
  font-weight: 700;
}

.smart-support-actions button[data-guide],
.smart-support-actions button[data-loan-guide] {
  border-color: #1463d9;
  background: #1463d9;
  color: #fff;
}

.smart-support-form {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid #e4e9f2;
}

.smart-support-voice {
  width: 42px;
  height: 42px;
  align-self: end;
  border: 0;
  border-radius: 50%;
  background: #eef5ff;
  color: #1463d9;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.smart-support-voice svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.smart-support-voice.is-recording {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 0 7px rgba(239, 68, 68, 0.18);
}

.smart-support-form textarea {
  min-height: 42px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
}

.smart-support-form button {
  border: 0;
  border-radius: 10px;
  background: #1463d9;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 0 14px;
}

.smart-loan-need-field textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
}

.smart-loan-autofilled {
  outline: 3px solid rgba(20, 99, 217, 0.24);
  outline-offset: 2px;
  transition: outline-color 300ms ease;
}

@media (max-width: 620px) {
  #smart-support-widget-root {
    right: 16px;
    bottom: 76px;
  }

  .smart-support-panel {
    right: 12px;
    left: 12px;
    bottom: 142px;
    width: auto;
    max-height: calc(100dvh - 158px);
  }

  .smart-support-form {
    grid-template-columns: auto 1fr;
  }

  .smart-support-form > button[type="submit"] {
    grid-column: 1 / -1;
    min-height: 42px;
  }
}
