.tiers-ai {
  --tiers-ai-ink: #0d0d0d;
  --tiers-ai-olive: #556b2f;
  --tiers-ai-sage: #a6ae79;
  --tiers-ai-paper: #f5f4ef;
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 99990;
  font-family: inherit;
}

.tiers-ai__launcher,
.tiers-ai__send,
.tiers-ai__submit-lead,
.tiers-ai__lead-toggle {
  border: 1px solid var(--tiers-ai-sage);
  border-radius: 999px;
  background: var(--tiers-ai-olive);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  letter-spacing: .02em;
}

.tiers-ai__launcher {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 11px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .26);
}

.tiers-ai__launcher:hover,
.tiers-ai__launcher:focus-visible,
.tiers-ai__send:hover,
.tiers-ai__send:focus-visible,
.tiers-ai__submit-lead:hover,
.tiers-ai__submit-lead:focus-visible,
.tiers-ai__lead-toggle:hover,
.tiers-ai__lead-toggle:focus-visible {
  background: #3f5122;
  outline: 3px solid rgba(166, 174, 121, .42);
  outline-offset: 2px;
}

.tiers-ai__dialog {
  position: absolute;
  right: 0;
  bottom: 62px;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid rgba(166, 174, 121, .6);
  border-radius: 18px;
  background: #fff;
  color: var(--tiers-ai-ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}

.tiers-ai__dialog[hidden],
.tiers-ai__lead[hidden] { display: none; }

.tiers-ai__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 15px;
  background: var(--tiers-ai-ink);
  color: #fff;
}

.tiers-ai__header h2,
.tiers-ai__lead h3 { margin: 0; color: inherit; font-size: 1.2rem; line-height: 1.2; }
.tiers-ai__eyebrow { color: var(--tiers-ai-sage); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.tiers-ai__close { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 1.8rem; line-height: 1; }
.tiers-ai__close:focus-visible { outline: 2px solid var(--tiers-ai-sage); outline-offset: 3px; }

.tiers-ai__notice,
.tiers-ai__footer {
  padding: 10px 16px;
  background: var(--tiers-ai-paper);
  color: #303522;
  font-size: .76rem;
  line-height: 1.42;
}

.tiers-ai__notice { border-bottom: 1px solid #deddd4; }
.tiers-ai__footer { border-top: 1px solid #deddd4; }

.tiers-ai__messages {
  min-height: 170px;
  overflow-y: auto;
  padding: 15px;
  background: #fff;
}

.tiers-ai__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 3px;
  background: var(--tiers-ai-paper);
  white-space: pre-wrap;
  font-size: .9rem;
  line-height: 1.48;
}

.tiers-ai__message--user { margin-left: auto; border-radius: 12px 12px 3px 12px; background: var(--tiers-ai-olive); color: #fff; }
.tiers-ai__message--error { border: 1px solid #9d2c2c; background: #fff3f2; color: #7a1f1f; }
.tiers-ai__message-action { display: block; min-height: 40px; margin-top: 10px; padding: 8px 13px; border: 1px solid var(--tiers-ai-olive); border-radius: 999px; background: #fff; color: #34421f; cursor: pointer; font: inherit; font-weight: 700; }
.tiers-ai__message-action:hover,
.tiers-ai__message-action:focus-visible { background: #edf0e2; outline: 3px solid rgba(85, 107, 47, .2); outline-offset: 2px; }

.tiers-ai__chat-form,
.tiers-ai__lead { padding: 14px 15px; border-top: 1px solid #deddd4; }
.tiers-ai__chat-form textarea,
.tiers-ai__lead input,
.tiers-ai__lead select,
.tiers-ai__lead textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #73766c;
  border-radius: 8px;
  background: #fff;
  color: var(--tiers-ai-ink);
  font: inherit;
}
.tiers-ai__chat-form textarea { min-height: 58px; padding: 10px; resize: vertical; }
.tiers-ai__lead input,
.tiers-ai__lead select,
.tiers-ai__lead textarea { margin-top: 4px; padding: 8px; }
.tiers-ai__chat-form textarea:focus,
.tiers-ai__lead input:focus,
.tiers-ai__lead select:focus,
.tiers-ai__lead textarea:focus { border-color: var(--tiers-ai-olive); outline: 3px solid rgba(85, 107, 47, .2); }

.tiers-ai__actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; }
.tiers-ai__send,
.tiers-ai__submit-lead { min-height: 40px; padding: 8px 17px; }
.tiers-ai__voice { min-height: 40px; padding: 7px 12px; border: 1px solid #73766c; border-radius: 999px; background: #fff; color: var(--tiers-ai-ink); cursor: pointer; font: inherit; font-size: .82rem; }
.tiers-ai__voice[aria-pressed="true"] { border-color: var(--tiers-ai-olive); background: var(--tiers-ai-paper); }
.tiers-ai__lead-toggle { width: calc(100% - 30px); margin: 0 15px 14px; padding: 10px 16px; }
.tiers-ai__lead { max-height: 390px; overflow-y: auto; background: var(--tiers-ai-paper); }
.tiers-ai__lead h3 { margin-bottom: 12px; }
.tiers-ai__field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiers-ai__field--wide { grid-column: 1 / -1; }
.tiers-ai__lead label { display: block; margin-bottom: 10px; font-size: .78rem; font-weight: 700; }
.tiers-ai__consent { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 400 !important; line-height: 1.4; }
.tiers-ai__consent input { width: auto; margin-top: 3px; }
.tiers-ai__lead-status { margin: 10px 0 0; font-size: .84rem; font-weight: 700; }
.tiers-ai__honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
.tiers-ai button:disabled { cursor: wait; opacity: .62; }

@media (max-width: 520px) {
  .tiers-ai { right: 10px; bottom: 10px; }
  .tiers-ai__dialog { right: -2px; bottom: 58px; width: calc(100vw - 16px); max-height: calc(100dvh - 84px); }
  .tiers-ai__field-grid { grid-template-columns: 1fr; }
  .tiers-ai__field--wide { grid-column: auto; }
  .tiers-ai--lead-open .tiers-ai__messages,
  .tiers-ai--lead-open .tiers-ai__chat-form { display: none; }
  .tiers-ai--lead-open .tiers-ai__lead { flex: 1 1 auto; min-height: 0; max-height: none; padding-bottom: max(18px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
}

@media (prefers-reduced-motion: reduce) {
  .tiers-ai * { scroll-behavior: auto !important; }
}
