:root {
  --htai-chat-midnight: #071116;
  --htai-chat-navy: #0b2a4a;
  --htai-chat-ink: #172026;
  --htai-chat-muted: #4b5b63;
  --htai-chat-copper: #c4975c;
  --htai-chat-copper-light: #d7ad72;
  --htai-chat-bg: #f4f6f7;
  --htai-chat-line: #d5dde1;
  --htai-chat-white: #fff;
  --htai-chat-shadow: 0 22px 64px rgba(7, 17, 22, .26);
}

.htai-chat {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 999999 !important;
  isolation: isolate;
  color: var(--htai-chat-ink);
  font-family: "Be Vietnam Pro", Inter, Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.htai-chat *,
.htai-chat *::before,
.htai-chat *::after { box-sizing: border-box; }

.htai-chat button,
.htai-chat textarea,
.htai-chat a { font-family: inherit !important; }

.htai-chat__panel[hidden],
.htai-chat[data-state="closed"] .htai-chat__panel { display: none !important; }

/* Launcher compact: icon only, label appears as a tooltip. High specificity defeats Flatsome button rules. */
.htai-chat.htai-chat--floating .htai-chat__launcher {
  -webkit-appearance: none !important;
  appearance: none !important;
  position: relative !important;
  display: grid !important;
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  place-items: center !important;
  overflow: visible !important;
  margin: 0 !important;
  border: 1px solid rgba(215, 173, 114, .95) !important;
  border-radius: 50% !important;
  padding: 4px !important;
  background: linear-gradient(145deg, var(--htai-chat-midnight), var(--htai-chat-navy)) !important;
  color: var(--htai-chat-white) !important;
  box-shadow: 0 14px 34px rgba(7, 17, 22, .34), 0 0 0 4px rgba(196, 151, 92, .10) !important;
  cursor: pointer !important;
  opacity: 1 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transform: translateZ(0);
  transition: transform .18s ease, box-shadow .18s ease !important;
}

.htai-chat.htai-chat--floating .htai-chat__launcher:hover,
.htai-chat.htai-chat--floating .htai-chat__launcher:focus-visible {
  transform: translateY(-2px) scale(1.025) !important;
  box-shadow: 0 18px 42px rgba(7, 17, 22, .40), 0 0 0 5px rgba(196, 151, 92, .16) !important;
}

.htai-chat__launcher:focus-visible,
.htai-chat button:focus-visible,
.htai-chat textarea:focus-visible,
.htai-chat a:focus-visible {
  outline: 3px solid #4aa3d4 !important;
  outline-offset: 3px !important;
}

.htai-chat__launcher-media,
.htai-chat__identity-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 42% 28%, #fff 0, #f5e5cb 42%, #d7ad72 100%);
}

.htai-chat__launcher-media {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(7, 17, 22, .12);
}

.htai-chat__launcher-media img,
.htai-chat__identity-media img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  border: 0 !important;
  object-fit: contain !important;
  object-position: 50% 54% !important;
  transform-origin: 50% 54%;
}

/* Transparent avatar files often contain generous empty padding. Scale inside the clipped frame. */
.htai-chat__launcher-media img { transform: scale(1.48); }
.htai-chat__identity-media img { transform: scale(1.22); }

.htai-chat__monogram {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--htai-chat-midnight);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -.03em;
}

.htai-chat__launcher-label {
  position: absolute !important;
  top: 50% !important;
  right: calc(100% + 11px) !important;
  display: block !important;
  width: max-content !important;
  max-width: 220px !important;
  padding: 8px 12px !important;
  border: 1px solid rgba(196, 151, 92, .55) !important;
  border-radius: 999px !important;
  background: rgba(7, 17, 22, .96) !important;
  color: #fff !important;
  box-shadow: 0 10px 28px rgba(7, 17, 22, .24) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%);
  transition: opacity .16s ease, transform .16s ease;
}

.htai-chat__launcher:hover .htai-chat__launcher-label,
.htai-chat__launcher:focus-visible .htai-chat__launcher-label {
  opacity: 1;
  transform: translate(0, -50%);
}

.htai-chat__status-dot {
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--htai-chat-midnight);
  border-radius: 50%;
  background: #35b36f;
  box-shadow: 0 0 0 2px rgba(53, 179, 111, .18);
}

.htai-chat[data-state="open"] .htai-chat__launcher {
  opacity: 0 !important;
  pointer-events: none !important;
  transform: scale(.92) !important;
}

.htai-chat__panel {
  position: absolute !important;
  right: 0 !important;
  bottom: 0 !important;
  display: grid;
  width: min(370px, calc(100vw - 20px));
  height: min(560px, calc(100dvh - 24px));
  max-height: 620px;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(196, 151, 92, .72);
  border-radius: 16px;
  background: #fff;
  color: var(--htai-chat-ink);
  box-shadow: var(--htai-chat-shadow);
  transform-origin: 100% 100%;
  animation: htai-chat-in .18s ease-out both;
}

@keyframes htai-chat-in {
  from { opacity: 0; transform: translateY(10px) scale(.975); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.htai-chat__header {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  background: linear-gradient(135deg, var(--htai-chat-midnight), #0b2232 58%, var(--htai-chat-navy));
  color: #fff;
}

.htai-chat__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.htai-chat__identity-media {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(215, 173, 114, .88);
  border-radius: 10px;
}

.htai-chat__identity-copy { min-width: 0; }

.htai-chat__identity h2 {
  display: block;
  overflow: hidden;
  margin: 0 !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 780 !important;
  line-height: 1.25 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.htai-chat__identity p {
  display: -webkit-box;
  overflow: hidden;
  margin: 2px 0 0 !important;
  color: rgba(255,255,255,.74) !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.htai-chat__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.htai-chat__actions button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: grid !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  padding: 0 !important;
  background: transparent !important;
  color: #fff !important;
  cursor: pointer !important;
  opacity: .82;
}

.htai-chat__actions button:hover { background: rgba(255,255,255,.10) !important; opacity: 1; }
.htai-chat__actions svg { width: 19px; height: 19px; }

.htai-chat__messages {
  min-height: 0;
  overflow: auto;
  padding: 11px 10px 6px;
  background: linear-gradient(180deg, #f7f8f9, var(--htai-chat-bg));
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.htai-chat__row { display: flex; margin: 0 0 9px; }
.htai-chat__row--user { justify-content: flex-end; }

.htai-chat__bubble {
  max-width: 88%;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 8px rgba(7, 17, 22, .035);
}

.htai-chat__bubble--assistant {
  border: 1px solid var(--htai-chat-line);
  border-top-left-radius: 5px;
  background: #fff;
  color: var(--htai-chat-ink);
}

.htai-chat__bubble--user {
  max-width: 82%;
  border-top-right-radius: 5px;
  background: var(--htai-chat-navy);
  color: #fff;
}

.htai-chat__bubble p {
  margin: 0 0 8px !important;
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  white-space: pre-line;
}
.htai-chat__bubble p:last-child { margin-bottom: 0 !important; }
.htai-chat__bubble ul { margin: 8px 0 0 !important; padding-left: 19px !important; }
.htai-chat__bubble li { margin: 4px 0 !important; color: inherit !important; }

.htai-chat__roi {
  margin: 9px 0 2px !important;
  border: 1px solid rgba(196, 151, 92, .48) !important;
  border-left: 3px solid var(--htai-chat-copper) !important;
  border-radius: 9px !important;
  padding: 8px 9px !important;
  background: linear-gradient(135deg, #fffaf2, #f7efe2) !important;
  color: #3e2f1f !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.htai-chat__roi--estimate {
  border-color: rgba(31, 95, 136, .36) !important;
  border-left-color: var(--htai-chat-accent, #1f5f88) !important;
  background: linear-gradient(135deg, #f4f9fc, #eaf3f8) !important;
  color: var(--htai-chat-ink) !important;
}

.htai-chat__roi-label {
  display: block !important;
  margin: 0 0 3px !important;
  color: #765127 !important;
  font-size: 10.5px !important;
  font-weight: 820 !important;
  line-height: 1.25 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase !important;
}

.htai-chat__roi--estimate .htai-chat__roi-label { color: var(--htai-chat-navy) !important; }

.htai-chat__roi-text {
  margin: 0 !important;
  color: inherit !important;
  font-size: 13px !important;
  font-weight: 580 !important;
  line-height: 1.42 !important;
}

.htai-chat__follow {
  margin-top: 9px !important;
  border-top: 1px solid var(--htai-chat-line);
  padding-top: 9px;
  font-weight: 720;
}

.htai-chat__cta-card {
  margin-top: 11px;
  border: 1px solid rgba(196, 151, 92, .78);
  border-radius: 12px;
  padding: 11px;
  background: linear-gradient(145deg, #fffdf9 0%, #f6efe5 100%);
  box-shadow: inset 3px 0 0 var(--htai-chat-copper);
}

.htai-chat__cta-title {
  display: block;
  margin: 0 0 5px;
  color: var(--htai-chat-midnight);
  font-size: 12.5px;
  font-weight: 820;
  line-height: 1.35;
  letter-spacing: .015em;
}

.htai-chat__cta-text {
  margin: 0 0 7px !important;
  color: #33444d !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
}

.htai-chat__cta-benefits {
  display: grid;
  gap: 4px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.htai-chat__cta-benefits li {
  position: relative;
  margin: 0 !important;
  padding: 0 0 0 18px !important;
  color: var(--htai-chat-ink) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

.htai-chat__cta-benefits li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: #18794e;
  content: "✓";
  font-weight: 850;
}

.htai-chat__cta-card .htai-chat__cta {
  margin-top: 9px !important;
  background: linear-gradient(135deg, var(--htai-chat-navy), #154f82) !important;
  box-shadow: 0 7px 18px rgba(11, 42, 74, .18) !important;
}

.htai-chat__cta-card .htai-chat__cta:hover,
.htai-chat__cta-card .htai-chat__cta:focus-visible {
  background: linear-gradient(135deg, #123d68, #1b639f) !important;
  transform: translateY(-1px);
}

.htai-chat__cta-note {
  display: block;
  margin-top: 6px;
  color: #5f6f77;
  font-size: 10.5px;
  line-height: 1.35;
  text-align: center;
}

.htai-chat__cta,
.htai-chat__cta:link,
.htai-chat__cta:visited {
  display: flex !important;
  width: 100% !important;
  min-height: 48px !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 11px !important;
  border: 1px solid var(--htai-chat-navy) !important;
  border-radius: 9px !important;
  padding: 9px 12px !important;
  background: var(--htai-chat-navy) !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 750 !important;
  text-decoration: none !important;
  -webkit-text-fill-color: #fff !important;
}
.htai-chat__cta:hover { background: #123d68 !important; }

.htai-chat__suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--htai-chat-line);
  background: #fff;
}
.htai-chat__suggestions[hidden] { display: none !important; }

.htai-chat__suggestions button {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: block !important;
  min-width: 0 !important;
  min-height: 36px !important;
  margin: 0 !important;
  border: 1px solid #d7dfe3 !important;
  border-radius: 9px !important;
  padding: 7px 9px !important;
  background: #fff !important;
  color: var(--htai-chat-navy) !important;
  cursor: pointer !important;
  font-size: 12.5px !important;
  font-weight: 650 !important;
  line-height: 1.3 !important;
  text-align: left !important;
  text-transform: none !important;
  white-space: normal !important;
}
.htai-chat__suggestions button:hover { border-color: var(--htai-chat-copper) !important; background: #fbf8f3 !important; }

.htai-chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 7px;
  padding: 7px 8px 5px;
  border-top: 1px solid var(--htai-chat-line);
  background: #fff;
}

.htai-chat__form textarea {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 72px !important;
  margin: 0 !important;
  resize: none !important;
  border: 1px solid #aebbc2 !important;
  border-radius: 11px !important;
  padding: 8px 10px !important;
  background: #fff !important;
  color: var(--htai-chat-ink) !important;
  box-shadow: none !important;
  font-size: 14px !important;
  line-height: 1.35 !important;
}

.htai-chat__form button[type="submit"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: grid !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  place-items: center !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 11px !important;
  padding: 0 !important;
  background: var(--htai-chat-navy) !important;
  color: #fff !important;
  cursor: pointer !important;
}
.htai-chat__form button[type="submit"]:hover { background: #123d68 !important; }
.htai-chat__form button:disabled { cursor: wait !important; opacity: .52 !important; }
.htai-chat__form button svg { width: 21px; height: 21px; }

.htai-chat__privacy {
  margin: 0 !important;
  padding: 0 11px 8px !important;
  background: #fff;
  color: var(--htai-chat-muted) !important;
  font-size: 10.5px !important;
  line-height: 1.35 !important;
}

.htai-chat__honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.htai-chat__thinking { display: flex; align-items: center; gap: 5px; }
.htai-chat__thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--htai-chat-muted); animation: htai-bounce 1.1s infinite ease-in-out; }
.htai-chat__thinking span:nth-child(2) { animation-delay: .12s; }
.htai-chat__thinking span:nth-child(3) { animation-delay: .24s; }
.htai-chat__thinking em { margin-left: 4px; color: var(--htai-chat-muted); font-size: 12px; font-style: normal; }
@keyframes htai-bounce { 0%,80%,100% { transform: translateY(0); opacity:.4 } 40% { transform: translateY(-4px); opacity:1 } }

.htai-chat--inline {
  position: relative !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 1 !important;
}
.htai-chat--inline .htai-chat__panel { position: relative !important; right: auto !important; bottom: auto !important; width: 100%; max-width: 720px; height: 620px; }

@media (max-width: 767px) {
  html.htai-chat-open,
  html.htai-chat-open body { overflow: hidden; }

  .htai-chat { right: 10px !important; bottom: 10px !important; }
  .htai-chat.htai-chat--floating .htai-chat__launcher {
    width: 58px !important;
    min-width: 58px !important;
    max-width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
    max-height: 58px !important;
    padding: 3px !important;
  }
  .htai-chat__launcher-media { width: 50px; height: 50px; }
  .htai-chat__launcher-label { display: none !important; }

  .htai-chat__panel {
    position: fixed !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    width: auto !important;
    height: min(560px, 78dvh);
    max-height: 78dvh;
    border-radius: 15px;
  }
  .htai-chat__header { min-height: 54px; padding: 6px 7px; }
  .htai-chat__identity-media { width: 34px; height: 34px; flex-basis: 34px; }
  .htai-chat__identity h2 { font-size: 14.5px !important; }
  .htai-chat__bubble { max-width: 91%; font-size: 15px; }
  .htai-chat__bubble--user { max-width: 86%; }
  .htai-chat__suggestions { gap: 5px; padding: 7px 8px; }
  .htai-chat__suggestions button { font-size: 11px !important; }
}

@media (max-width: 390px) {
  .htai-chat__suggestions { grid-template-columns: 1fr; max-height: 118px; overflow: auto; }
  .htai-chat__identity p { max-width: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  .htai-chat *,
  .htai-chat *::before,
  .htai-chat *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }
}


/* 1.1.5 — hard compact guard against Flatsome/theme textarea and heading rules. */
.htai-chat.htai-chat--floating .htai-chat__header {
  min-height: 54px !important;
  max-height: 58px !important;
  padding: 6px 7px !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity {
  min-width: 0 !important;
  gap: 8px !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity-media {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  flex: 0 0 34px !important;
  border-radius: 9px !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity-copy {
  min-width: 0 !important;
  max-width: calc(100% - 78px) !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity h2 {
  display: block !important;
  overflow: hidden !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #fff !important;
  font-size: 14.5px !important;
  font-weight: 780 !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity p {
  display: block !important;
  overflow: hidden !important;
  max-width: 100% !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  color: rgba(255,255,255,.72) !important;
  font-size: 10.5px !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.htai-chat.htai-chat--floating .htai-chat__actions button {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  padding: 0 !important;
}
.htai-chat.htai-chat--floating .htai-chat__form {
  grid-template-columns: minmax(0,1fr) 44px !important;
  gap: 6px !important;
  padding: 7px 8px 5px !important;
}
.htai-chat.htai-chat--floating .htai-chat__form textarea {
  display: block !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 72px !important;
  margin: 0 !important;
  padding: 8px 10px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
  line-height: 1.3 !important;
  overflow-y: hidden;
}
.htai-chat.htai-chat--floating .htai-chat__form button[type="submit"] {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  border-radius: 9px !important;
}
@media (max-width: 767px) {
  .htai-chat.htai-chat--floating .htai-chat__panel {
    height: min(560px, 78dvh) !important;
    max-height: 78dvh !important;
  }
}
@media (max-width: 350px) {
  .htai-chat.htai-chat--floating .htai-chat__identity p { display: none !important; }
}

/* 1.3.0 — conversation history UI uses the same compact public shell. */

/* 1.4.0 — temporary drawing upload and analysis UI. */
.htai-chat__panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto auto auto !important;
}

.htai-chat__attachment-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 7px 9px;
  border-top: 1px solid var(--htai-chat-line);
  background: #f8fafb;
  color: var(--htai-chat-ink);
  font-size: 12px;
  line-height: 1.32;
}
.htai-chat__attachment-status[hidden] { display: none !important; }
.htai-chat__attachment-status.is-uploading { background: #f3f7fa; }
.htai-chat__attachment-status.is-done { background: #f1f9f4; }
.htai-chat__attachment-status.is-error { background: #fff3f2; color: #8f241d; }
.htai-chat__attachment-icon {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border: 1px solid #aebcc4;
  border-radius: 50%;
  background: #fff;
  color: var(--htai-chat-navy);
  font-weight: 800;
}
.htai-chat__attachment-status.is-done .htai-chat__attachment-icon { border-color: #64ad7e; color: #1d7c43; }
.htai-chat__attachment-status.is-error .htai-chat__attachment-icon { border-color: #d79b96; color: #b42318; }
.htai-chat__attachment-status > span:last-child { min-width: 0; }
.htai-chat__attachment-status strong,
.htai-chat__attachment-status small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htai-chat__attachment-status strong { font-size: 12px; }
.htai-chat__attachment-status small { margin-top: 1px; color: var(--htai-chat-muted); font-size: 10.5px; }

.htai-chat__form,
.htai-chat.htai-chat--floating .htai-chat__form {
  grid-template-columns: 40px minmax(0, 1fr) 44px !important;
  gap: 6px !important;
}

.htai-chat__attach {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: grid !important;
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  max-height: 40px !important;
  place-items: center !important;
  margin: 0 !important;
  border: 1px solid #aebbc2 !important;
  border-radius: 9px !important;
  padding: 0 !important;
  background: #f7f9fa !important;
  color: var(--htai-chat-navy) !important;
  cursor: pointer !important;
}
.htai-chat__attach:hover,
.htai-chat__attach:focus-visible { border-color: var(--htai-chat-copper) !important; background: #fffaf2 !important; }
.htai-chat__attach:disabled { opacity: .45 !important; cursor: not-allowed !important; }
.htai-chat__attach svg { width: 20px; height: 20px; }
.htai-chat__drawing-input { display: none !important; }

.htai-chat__drawing-card {
  margin: 9px 0 2px;
  border: 1px solid rgba(31, 95, 136, .28);
  border-left: 3px solid var(--htai-chat-navy);
  border-radius: 10px;
  padding: 9px;
  background: linear-gradient(135deg, #f5f9fc, #edf4f8);
  color: var(--htai-chat-ink);
}
.htai-chat__drawing-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.htai-chat__drawing-heading strong { color: var(--htai-chat-navy); font-size: 12.5px; line-height: 1.25; }
.htai-chat__drawing-heading span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 6px;
  background: rgba(11, 42, 74, .09);
  color: var(--htai-chat-navy);
  font-size: 9.5px;
  font-weight: 750;
}
.htai-chat__drawing-summary { margin: 0 0 7px !important; font-size: 12.5px !important; line-height: 1.4 !important; }
.htai-chat__drawing-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 7px;
}
.htai-chat__drawing-metrics span {
  display: grid;
  min-width: 0;
  place-items: center;
  border: 1px solid rgba(11, 42, 74, .10);
  border-radius: 7px;
  padding: 5px 3px;
  background: rgba(255,255,255,.70);
  text-align: center;
}
.htai-chat__drawing-metrics b { color: var(--htai-chat-navy); font-size: 14px; line-height: 1; }
.htai-chat__drawing-metrics small { margin-top: 3px; color: var(--htai-chat-muted); font-size: 8.5px; line-height: 1.1; }
.htai-chat__drawing-findings { display: grid; gap: 4px; }
.htai-chat__drawing-findings p {
  margin: 0 !important;
  border-left: 2px solid #9ba9b1;
  padding-left: 7px;
  font-size: 11.5px !important;
  line-height: 1.35 !important;
}
.htai-chat__drawing-findings p.is-high { border-left-color: #b42318; }
.htai-chat__drawing-findings p.is-medium { border-left-color: #d17a00; }
.htai-chat__drawing-findings p.is-low { border-left-color: #2c78a8; }
.htai-chat__drawing-retention {
  margin: 7px 0 0 !important;
  border-top: 1px solid rgba(11, 42, 74, .12);
  padding-top: 6px;
  color: var(--htai-chat-muted) !important;
  font-size: 9.5px !important;
  line-height: 1.35 !important;
}

.htai-chat__privacy-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px 7px 11px;
  background: #fff;
}
.htai-chat__privacy-row .htai-chat__privacy {
  flex: 1 1 auto;
  margin: 0 !important;
  padding: 0 !important;
}
.htai-chat__end-session {
  -webkit-appearance: none !important;
  appearance: none !important;
  flex: 0 0 auto;
  margin: 0 !important;
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--htai-chat-muted) !important;
  cursor: pointer !important;
  font-size: 9.5px !important;
  font-weight: 650 !important;
  line-height: 1.3 !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}
.htai-chat__end-session:hover { color: #9b2c24 !important; }

@media (max-width: 390px) {
  .htai-chat__drawing-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .htai-chat__privacy-row { align-items: center; }
  .htai-chat__privacy-row .htai-chat__privacy { font-size: 9.5px !important; }
}


/* 1.4.1 — no native browser popup; inline progress for session ending. */
.htai-chat__end-session:disabled {
  cursor: wait !important;
  opacity: .62 !important;
  text-decoration: none !important;
}

/* 1.4.2 — 5px right safe gutter, readable long text and inline drawing retry. */
.htai-chat__panel,
.htai-chat__panel * {
  box-sizing: border-box;
}

.htai-chat__panel {
  max-width: calc(100vw - 10px) !important;
}

.htai-chat.htai-chat--floating .htai-chat__messages,
.htai-chat__messages {
  padding-right: 18px !important; /* scrollbar width + tối thiểu 5px lề an toàn */
  overflow-x: hidden !important;
  scrollbar-gutter: stable;
}

.htai-chat__messages::-webkit-scrollbar {
  width: 8px;
}

.htai-chat__row {
  width: 100%;
  min-width: 0 !important;
  padding-right: 5px;
}

.htai-chat__row--user {
  padding-left: 5px;
}

.htai-chat__bubble,
.htai-chat__drawing-card,
.htai-chat__drawing-summary,
.htai-chat__drawing-findings,
.htai-chat__follow,
.htai-chat__attachment-copy {
  min-width: 0 !important;
  max-width: 100% !important;
}

.htai-chat__bubble {
  max-width: calc(100% - 5px) !important;
  overflow: hidden;
}

.htai-chat__bubble--user {
  max-width: min(86%, calc(100% - 5px)) !important;
}

.htai-chat__bubble p,
.htai-chat__bubble li,
.htai-chat__drawing-summary,
.htai-chat__drawing-findings p,
.htai-chat__follow,
.htai-chat__attachment-status strong,
.htai-chat__attachment-status small {
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

.htai-chat__attachment-status {
  margin-right: 5px !important;
  padding-right: 10px !important;
}

.htai-chat__attachment-status strong,
.htai-chat__attachment-status small {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
}

.htai-chat__attachment-action {
  -webkit-appearance: none !important;
  appearance: none !important;
  flex: 0 0 auto;
  min-height: 34px !important;
  margin: 0 0 0 auto !important;
  border: 1px solid rgba(196, 151, 92, .9) !important;
  border-radius: 8px !important;
  padding: 6px 10px !important;
  background: #0b2a4a !important;
  color: #fff !important;
  cursor: pointer !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

.htai-chat__form,
.htai-chat.htai-chat--floating .htai-chat__form,
.htai-chat__privacy-row {
  padding-right: 13px !important; /* 8px cũ + 5px */
}

@media (max-width: 390px) {
  .htai-chat.htai-chat--floating .htai-chat__messages,
  .htai-chat__messages {
    padding-right: 16px !important;
  }
  .htai-chat__form,
  .htai-chat.htai-chat--floating .htai-chat__form,
  .htai-chat__privacy-row {
    padding-right: 11px !important;
  }
}


/* 1.4.3 — chống cắt chữ ở mép phải trên Flatsome, mobile và scrollbar phủ nội dung. */
.htai-chat__messages {
  padding-right: 16px !important;
  scrollbar-gutter: stable both-edges;
}
.htai-chat__row,
.htai-chat__bubble,
.htai-chat__bubble p,
.htai-chat__bubble li,
.htai-chat__drawing-card,
.htai-chat__drawing-summary,
.htai-chat__drawing-findings p,
.htai-chat__follow {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}
.htai-chat__bubble { width: fit-content; }
.htai-chat__bubble--assistant { margin-right: 5px !important; }
.htai-chat__attachment-status { padding-right: 14px !important; }
.htai-chat__attachment-copy { min-width: 0 !important; overflow: hidden !important; }
.htai-chat__attachment-copy strong,
.htai-chat__attachment-copy small { white-space: normal !important; overflow-wrap: anywhere !important; }
.htai-chat__form,
.htai-chat__privacy { padding-right: 12px !important; }


/* 1.5.0 — inline customer requirement form. */
.htai-chat__lead-row { justify-content: stretch; }
.htai-chat__lead-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(196,151,92,.72);
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(155deg,#fffdfa,#f6f1e9);
  box-shadow: 0 10px 28px rgba(7,17,22,.10), inset 3px 0 0 var(--htai-chat-copper);
  color: var(--htai-chat-ink);
}
.htai-chat__lead-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:5px; }
.htai-chat__lead-header > strong { color:var(--htai-chat-midnight); font-size:15px; line-height:1.3; }
.htai-chat__lead-close {
  display:grid !important; width:32px !important; height:32px !important; min-width:32px !important;
  place-items:center !important; margin:0 !important; border:1px solid #d8dee3 !important;
  border-radius:50% !important; padding:0 !important; background:#fff !important; color:#34444d !important;
  cursor:pointer !important; font-size:20px !important; line-height:1 !important;
}
.htai-chat__lead-intro { margin:0 0 10px !important; color:#53616a !important; font-size:12px !important; line-height:1.45 !important; }
.htai-chat__lead-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.htai-chat__lead-field { display:grid; min-width:0; gap:4px; margin:0 !important; }
.htai-chat__lead-field.is-wide,
.htai-chat__lead-consent.is-wide,
.htai-chat__lead-feedback.is-wide,
.htai-chat__lead-submit.is-wide { grid-column:1 / -1; }
.htai-chat__lead-field > span { color:#263943; font-size:11.5px; font-weight:720; line-height:1.3; }
.htai-chat__lead-field input,
.htai-chat__lead-field textarea {
  width:100% !important; min-width:0 !important; margin:0 !important; border:1px solid #b8c4ca !important;
  border-radius:9px !important; padding:8px 9px !important; background:#fff !important; color:#172026 !important;
  box-shadow:none !important; font:inherit !important; font-size:13px !important; line-height:1.35 !important;
}
.htai-chat__lead-field textarea { min-height:72px !important; resize:vertical !important; }
.htai-chat__lead-field input:focus,
.htai-chat__lead-field textarea:focus { border-color:#2c78a8 !important; outline:2px solid rgba(44,120,168,.18) !important; outline-offset:1px !important; }
.htai-chat__lead-consent { display:flex; align-items:flex-start; gap:7px; margin:2px 0 0 !important; color:#53616a; font-size:10.5px; line-height:1.4; }
.htai-chat__lead-consent input { flex:0 0 auto; margin:2px 0 0 !important; }
.htai-chat__lead-feedback { min-height:17px; margin:0 !important; color:#08743d; font-size:11.5px; font-weight:650; }
.htai-chat__lead-feedback.is-error { color:#b42318; }
.htai-chat__lead-submit,
.htai-chat button.htai-chat__lead-submit {
  min-height:46px !important; margin:0 !important; border:0 !important; border-radius:9px !important;
  padding:10px 14px !important; background:linear-gradient(135deg,var(--htai-chat-navy),#154f82) !important;
  color:#fff !important; cursor:pointer !important; font-size:14px !important; font-weight:780 !important;
  text-transform:none !important; -webkit-text-fill-color:#fff !important;
}
.htai-chat__lead-submit:disabled { cursor:wait !important; opacity:.65; }
.htai-chat__lead-card.is-success { border-color:#4f9b69; background:#f2fbf5; box-shadow:inset 3px 0 0 #23814c; }
.htai-chat__lead-card.is-success > strong { display:block; color:#08743d; font-size:15px; }
.htai-chat__lead-card.is-success > p { margin:6px 0 0 !important; color:#264d35 !important; font-size:13px !important; }
.htai-chat__lead-card.is-success > small { display:block; margin-top:7px; color:#4e6958; font-size:10.5px; }
.htai-chat button.htai-chat__cta { appearance:none !important; cursor:pointer !important; font-family:inherit !important; text-transform:none !important; }
@media (max-width:520px) {
  .htai-chat__lead-form { grid-template-columns:1fr; }
  .htai-chat__lead-field.is-wide,
  .htai-chat__lead-consent.is-wide,
  .htai-chat__lead-feedback.is-wide,
  .htai-chat__lead-submit.is-wide { grid-column:auto; }
}

/* 1.5.1 — Lead form dark-navy readability patch.
 * Flatsome and page-level styles sometimes force label text to white while
 * the 1.5.0 form card was nearly white. Keep the whole form consistently dark
 * and lock field-label contrast with scoped, high-specificity rules.
 */
.htai-chat .htai-chat__lead-card {
  border-color: rgba(214,170,109,.92) !important;
  background: linear-gradient(155deg, #0b2a4a 0%, #071923 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 34px rgba(7,17,22,.26), inset 3px 0 0 #d6aa6d !important;
}
.htai-chat .htai-chat__lead-header {
  min-width: 0 !important;
}
.htai-chat .htai-chat__lead-header > strong {
  min-width: 0 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  overflow-wrap: anywhere !important;
}
.htai-chat .htai-chat__lead-intro {
  color: #dce8ef !important;
  -webkit-text-fill-color: #dce8ef !important;
}
.htai-chat .htai-chat__lead-field > span {
  display: inline-flex !important;
  width: fit-content !important;
  max-width: 100% !important;
  align-items: center !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 6px !important;
  padding: 3px 7px !important;
  background: #123b60 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 760 !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere !important;
}
.htai-chat .htai-chat__lead-field input,
.htai-chat .htai-chat__lead-field textarea {
  border-color: #91a9b8 !important;
  background: #ffffff !important;
  color: #172026 !important;
  -webkit-text-fill-color: #172026 !important;
  caret-color: #172026 !important;
}
.htai-chat .htai-chat__lead-field input::placeholder,
.htai-chat .htai-chat__lead-field textarea::placeholder {
  color: #73828b !important;
  -webkit-text-fill-color: #73828b !important;
  opacity: 1 !important;
}
.htai-chat .htai-chat__lead-field input:focus,
.htai-chat .htai-chat__lead-field textarea:focus {
  border-color: #d6aa6d !important;
  outline: 2px solid rgba(214,170,109,.32) !important;
}
.htai-chat .htai-chat__lead-consent,
.htai-chat .htai-chat__lead-consent span {
  color: #eef5f8 !important;
  -webkit-text-fill-color: #eef5f8 !important;
}
.htai-chat .htai-chat__lead-feedback {
  color: #aee5c5 !important;
  -webkit-text-fill-color: #aee5c5 !important;
}
.htai-chat .htai-chat__lead-feedback.is-error {
  color: #ffd2cc !important;
  -webkit-text-fill-color: #ffd2cc !important;
}
.htai-chat .htai-chat__lead-close {
  border-color: rgba(214,170,109,.72) !important;
  background: #102f4a !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.htai-chat .htai-chat__lead-close:hover,
.htai-chat .htai-chat__lead-close:focus-visible {
  background: #d6aa6d !important;
  color: #071923 !important;
  -webkit-text-fill-color: #071923 !important;
}


/* ========================================================================
 * 1.5.2 — MOBILE EASY-READ / KHÁCH HÀNG 40+
 * Mục tiêu: chữ lớn, tương phản rõ, vùng bấm lớn và form một cột trên mobile.
 * Đây là lớp cuối cùng để thắng các rule compact cũ và CSS của Flatsome.
 * ====================================================================== */

.htai-chat.htai-chat--floating .htai-chat__identity {
  flex: 1 1 auto !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity-copy {
  flex: 1 1 auto !important;
  max-width: none !important;
}
.htai-chat.htai-chat--floating .htai-chat__header {
  min-height: 72px !important;
  max-height: 84px !important;
  padding: 10px 11px !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity-media {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  flex: 0 0 44px !important;
  border-radius: 11px !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity h2 {
  font-size: 18px !important;
  line-height: 1.2 !important;
}
.htai-chat.htai-chat--floating .htai-chat__identity p {
  display: -webkit-box !important;
  color: rgba(255,255,255,.86) !important;
  font-size: 13.5px !important;
  line-height: 1.3 !important;
  white-space: normal !important;
  text-overflow: clip !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}
.htai-chat.htai-chat--floating .htai-chat__actions button {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  border-radius: 11px !important;
}
.htai-chat.htai-chat--floating .htai-chat__actions svg {
  width: 22px !important;
  height: 22px !important;
}

.htai-chat .htai-chat__bubble {
  padding: 12px 14px !important;
  font-size: 17px !important;
  line-height: 1.55 !important;
}
.htai-chat .htai-chat__bubble p,
.htai-chat .htai-chat__bubble li,
.htai-chat .htai-chat__follow {
  font-size: inherit !important;
  line-height: inherit !important;
}
.htai-chat .htai-chat__bubble li {
  margin: 6px 0 !important;
}
.htai-chat .htai-chat__roi-label {
  font-size: 13px !important;
  line-height: 1.35 !important;
}
.htai-chat .htai-chat__roi-text {
  font-size: 16px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__thinking em {
  font-size: 15px !important;
}

.htai-chat .htai-chat__cta-card {
  padding: 15px !important;
  border-radius: 15px !important;
}
.htai-chat .htai-chat__cta-title {
  font-size: 18px !important;
  line-height: 1.35 !important;
}
.htai-chat .htai-chat__cta-text {
  font-size: 16.5px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__cta-benefits {
  gap: 7px !important;
}
.htai-chat .htai-chat__cta-benefits li {
  padding-left: 23px !important;
  font-size: 17px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__cta-benefits li::before {
  font-size: 18px !important;
}
.htai-chat .htai-chat__cta,
.htai-chat .htai-chat__cta:link,
.htai-chat .htai-chat__cta:visited,
.htai-chat button.htai-chat__cta {
  min-height: 60px !important;
  border-radius: 13px !important;
  padding: 14px 16px !important;
  font-size: 19px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  text-align: center !important;
  white-space: normal !important;
}
.htai-chat .htai-chat__cta-note {
  margin-top: 9px !important;
  color: #4b5b63 !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}

.htai-chat .htai-chat__suggestions button {
  min-height: 48px !important;
  padding: 10px 12px !important;
  font-size: 16px !important;
  line-height: 1.35 !important;
}

.htai-chat.htai-chat--floating .htai-chat__form,
.htai-chat .htai-chat__form {
  grid-template-columns: 54px minmax(0,1fr) 54px !important;
  gap: 8px !important;
  padding: 9px 11px 7px !important;
}
.htai-chat .htai-chat__attach,
.htai-chat.htai-chat--floating .htai-chat__attach,
.htai-chat .htai-chat__form button[type="submit"],
.htai-chat.htai-chat--floating .htai-chat__form button[type="submit"] {
  width: 54px !important;
  min-width: 54px !important;
  max-width: 54px !important;
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  border-radius: 13px !important;
}
.htai-chat .htai-chat__attach svg,
.htai-chat .htai-chat__form button[type="submit"] svg {
  width: 24px !important;
  height: 24px !important;
}
.htai-chat .htai-chat__form textarea,
.htai-chat.htai-chat--floating .htai-chat__form textarea {
  height: 54px !important;
  min-height: 54px !important;
  max-height: 116px !important;
  border-radius: 13px !important;
  padding: 13px 14px !important;
  font-size: 18px !important;
  line-height: 1.45 !important;
}
.htai-chat .htai-chat__form textarea::placeholder {
  color: #657681 !important;
  -webkit-text-fill-color: #657681 !important;
  font-size: 17px !important;
  opacity: 1 !important;
}

.htai-chat .htai-chat__attachment-status {
  min-height: 50px !important;
  padding: 9px 12px !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}
.htai-chat .htai-chat__attachment-status strong {
  font-size: 16px !important;
  line-height: 1.4 !important;
}
.htai-chat .htai-chat__attachment-status small,
.htai-chat .htai-chat__attachment-action {
  font-size: 14px !important;
  line-height: 1.4 !important;
}
.htai-chat .htai-chat__drawing-heading strong {
  font-size: 17px !important;
}
.htai-chat .htai-chat__drawing-heading span {
  font-size: 13px !important;
}
.htai-chat .htai-chat__drawing-summary {
  font-size: 17px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__drawing-metrics b {
  font-size: 18px !important;
}
.htai-chat .htai-chat__drawing-metrics small {
  font-size: 13px !important;
  line-height: 1.25 !important;
}
.htai-chat .htai-chat__drawing-findings p {
  padding-left: 9px !important;
  font-size: 16px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__drawing-retention {
  font-size: 14px !important;
  line-height: 1.45 !important;
}

.htai-chat .htai-chat__lead-card {
  padding: 18px !important;
  border-radius: 18px !important;
}
.htai-chat .htai-chat__lead-header {
  margin-bottom: 10px !important;
}
.htai-chat .htai-chat__lead-header > strong {
  font-size: 22px !important;
  line-height: 1.35 !important;
}
.htai-chat .htai-chat__lead-close {
  width: 48px !important;
  min-width: 48px !important;
  height: 48px !important;
  min-height: 48px !important;
  font-size: 28px !important;
}
.htai-chat .htai-chat__lead-intro {
  margin-bottom: 14px !important;
  color: #e5eef3 !important;
  font-size: 16.5px !important;
  line-height: 1.55 !important;
}
.htai-chat .htai-chat__lead-form {
  gap: 14px !important;
}
.htai-chat .htai-chat__lead-field {
  gap: 7px !important;
}
.htai-chat .htai-chat__lead-field > span {
  border-radius: 9px !important;
  padding: 6px 10px !important;
  font-size: 16px !important;
  line-height: 1.4 !important;
}
.htai-chat .htai-chat__lead-field input,
.htai-chat .htai-chat__lead-field textarea {
  min-height: 58px !important;
  border-radius: 13px !important;
  padding: 14px 15px !important;
  font-size: 18px !important;
  line-height: 1.45 !important;
}
.htai-chat .htai-chat__lead-field textarea {
  min-height: 126px !important;
}
.htai-chat .htai-chat__lead-field input::placeholder,
.htai-chat .htai-chat__lead-field textarea::placeholder {
  font-size: 17px !important;
  font-weight: 550 !important;
}
.htai-chat .htai-chat__lead-consent,
.htai-chat .htai-chat__lead-consent span {
  gap: 10px !important;
  font-size: 15.5px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__lead-consent input {
  width: 22px !important;
  min-width: 22px !important;
  height: 22px !important;
  margin-top: 1px !important;
}
.htai-chat .htai-chat__lead-feedback {
  min-height: 22px !important;
  font-size: 15px !important;
  line-height: 1.45 !important;
}
.htai-chat .htai-chat__lead-submit,
.htai-chat button.htai-chat__lead-submit {
  min-height: 60px !important;
  border-radius: 13px !important;
  padding: 14px 18px !important;
  font-size: 19px !important;
  line-height: 1.35 !important;
}

.htai-chat .htai-chat__privacy-row {
  gap: 10px !important;
  padding: 9px 12px 12px !important;
}
.htai-chat .htai-chat__privacy-row .htai-chat__privacy,
.htai-chat .htai-chat__privacy {
  color: #3f505a !important;
  font-size: 14.5px !important;
  line-height: 1.5 !important;
}
.htai-chat .htai-chat__end-session {
  min-height: 44px !important;
  padding: 8px 5px !important;
  font-size: 15px !important;
  font-weight: 760 !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}

@media (max-width: 767px) {
  .htai-chat {
    right: 4px !important;
    bottom: 4px !important;
  }
  .htai-chat.htai-chat--floating .htai-chat__panel,
  .htai-chat__panel {
    position: fixed !important;
    top: max(6px, env(safe-area-inset-top)) !important;
    right: max(6px, env(safe-area-inset-right)) !important;
    bottom: max(6px, env(safe-area-inset-bottom)) !important;
    left: max(6px, env(safe-area-inset-left)) !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 18px !important;
  }
  .htai-chat.htai-chat--floating .htai-chat__messages,
  .htai-chat__messages {
    padding: 14px 12px 10px !important;
  }
  .htai-chat .htai-chat__bubble {
    max-width: 94% !important;
    padding: 13px 14px !important;
    font-size: 18px !important;
    line-height: 1.58 !important;
  }
  .htai-chat .htai-chat__bubble--user {
    max-width: 90% !important;
  }
  .htai-chat .htai-chat__suggestions {
    grid-template-columns: 1fr !important;
    max-height: 168px !important;
    gap: 8px !important;
    overflow-y: auto !important;
    padding: 9px 11px !important;
  }
  .htai-chat .htai-chat__suggestions button {
    min-height: 50px !important;
    font-size: 16.5px !important;
  }
  .htai-chat .htai-chat__lead-form {
    grid-template-columns: 1fr !important;
  }
  .htai-chat .htai-chat__lead-field.is-wide,
  .htai-chat .htai-chat__lead-consent.is-wide,
  .htai-chat .htai-chat__lead-feedback.is-wide,
  .htai-chat .htai-chat__lead-submit.is-wide {
    grid-column: auto !important;
  }
  .htai-chat .htai-chat__privacy-row {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .htai-chat .htai-chat__end-session {
    align-self: flex-end !important;
  }
}

@media (max-width: 380px) {
  .htai-chat.htai-chat--floating .htai-chat__identity h2 {
    font-size: 17px !important;
  }
  .htai-chat.htai-chat--floating .htai-chat__identity p {
    display: -webkit-box !important;
    font-size: 12.5px !important;
  }
  .htai-chat.htai-chat--floating .htai-chat__actions button {
    width: 46px !important;
    min-width: 46px !important;
    max-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
    max-height: 46px !important;
  }
}


/* 1.5.3 — footer/privacy is collapsible to save mobile space. */
.htai-chat .htai-chat__privacy-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 7px 12px 9px !important;
  background: #fff !important;
  border-top: 1px solid rgba(11, 42, 74, .10) !important;
}
.htai-chat .htai-chat__privacy-toggle {
  -webkit-appearance: none !important;
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  border: 1px solid rgba(11, 42, 74, .18) !important;
  border-radius: 999px !important;
  padding: 8px 12px !important;
  background: #f4f7fa !important;
  color: #0b2a4a !important;
  cursor: pointer !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}
.htai-chat .htai-chat__privacy-toggle:hover,
.htai-chat .htai-chat__privacy-toggle:focus-visible {
  border-color: rgba(196,151,92,.75) !important;
  background: #fff8ec !important;
  color: #09233d !important;
}
.htai-chat .htai-chat__privacy-toggle svg {
  width: 18px !important;
  height: 18px !important;
  flex: 0 0 auto !important;
  transition: transform .16s ease !important;
}
.htai-chat .htai-chat__privacy-row[data-expanded="true"] .htai-chat__privacy-toggle svg {
  transform: rotate(180deg) !important;
}
.htai-chat .htai-chat__privacy-row .htai-chat__privacy {
  grid-column: 1 / -1 !important;
  margin: 2px 0 0 !important;
  padding: 9px 10px 0 !important;
  color: #3f505a !important;
  font-size: 14.5px !important;
  line-height: 1.5 !important;
  border-top: 1px dashed rgba(11,42,74,.16) !important;
}
.htai-chat .htai-chat__privacy-row .htai-chat__privacy[hidden],
.htai-chat .htai-chat__privacy-row[data-expanded="false"] .htai-chat__privacy {
  display: none !important;
}
.htai-chat .htai-chat__privacy-row .htai-chat__end-session {
  justify-self: end !important;
  min-width: 0 !important;
  min-height: 44px !important;
  margin: 0 !important;
  border: 1px solid rgba(11,42,74,.16) !important;
  border-radius: 999px !important;
  padding: 8px 10px !important;
  background: transparent !important;
  color: #3f505a !important;
  font-size: 14.5px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}
.htai-chat .htai-chat__privacy-row .htai-chat__end-session:hover,
.htai-chat .htai-chat__privacy-row .htai-chat__end-session:focus-visible {
  border-color: rgba(180,35,24,.38) !important;
  background: #fff3f1 !important;
  color: #9b2c24 !important;
}
@media (max-width: 767px) {
  .htai-chat .htai-chat__privacy-row {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding: 7px 10px 8px !important;
  }
  .htai-chat .htai-chat__privacy-toggle,
  .htai-chat .htai-chat__privacy-row .htai-chat__end-session {
    min-height: 44px !important;
    font-size: 14.5px !important;
    padding: 8px 10px !important;
  }
  .htai-chat .htai-chat__privacy-toggle-text { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 360px) {
  .htai-chat .htai-chat__privacy-toggle-text { max-width: 62px; }
  .htai-chat .htai-chat__privacy-row .htai-chat__end-session { font-size: 13.5px !important; padding-left: 8px !important; padding-right: 8px !important; }
}


/* 1.5.6 — trạng thái gửi email trong form lead */
.htai-lead-mail-status{display:block;margin-top:10px;font-size:14px;line-height:1.45;color:#334155}
.htai-lead-mail-status.is-ok{color:#166534}
.htai-lead-mail-status.is-warning{color:#9a3412;background:#fff7ed;border:1px solid #fed7aa;border-radius:10px;padding:8px 10px}


/* 1.6.1 — Chat lead form: every label and input occupies a full row. */
.htai-chat .htai-chat__lead-form {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  width: 100% !important;
  gap: 14px !important;
}
.htai-chat .htai-chat__lead-field,
.htai-chat .htai-chat__lead-field.is-wide {
  display: flex !important;
  flex-direction: column !important;
  grid-column: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  gap: 0 !important;
  box-sizing: border-box !important;
}
.htai-chat .htai-chat__lead-field > span {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  border: 1px solid rgba(214,170,109,.55) !important;
  border-bottom: 0 !important;
  border-radius: 12px 12px 0 0 !important;
  padding: 9px 13px !important;
  background: linear-gradient(135deg,#164d79,#0b3557) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 16.5px !important;
  line-height: 1.35 !important;
  font-weight: 780 !important;
}
.htai-chat .htai-chat__lead-field input,
.htai-chat .htai-chat__lead-field textarea {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  border-radius: 0 0 12px 12px !important;
  border: 1px solid #bfd0db !important;
  padding: 14px 15px !important;
  background: #fff !important;
  color: #17242d !important;
  -webkit-text-fill-color: #17242d !important;
}
.htai-chat .htai-chat__lead-consent,
.htai-chat .htai-chat__lead-feedback,
.htai-chat .htai-chat__lead-submit {
  width: 100% !important;
  max-width: none !important;
  grid-column: auto !important;
  box-sizing: border-box !important;
}
