/* The entire UI is namespaced to avoid Elementor/theme collisions. */
#smael-chatbot-root {
  --smael-chat-accent: #f58220;
  --smael-chat-accent-contrast: #171717;
  --smael-chat-header: #191919;
  --smael-chat-header-contrast: #ffffff;
  --smael-chat-ink: #262626;
  --smael-chat-muted: #646464;
  --smael-chat-line: #e6e6e6;
  --smael-chat-surface: #fff;
  --smael-chat-faint: #f7f7f7;
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  right: 22px;
  z-index: 2147480000;
  width: 0;
  height: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--smael-chat-ink);
  -webkit-font-smoothing: antialiased;
}
#smael-chatbot-root.smael-left { right: auto; left: 22px; }
#smael-chatbot-root *, #smael-chatbot-root *::before, #smael-chatbot-root *::after { box-sizing: border-box; }
#smael-chatbot-root button, #smael-chatbot-root input, #smael-chatbot-root textarea {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}
#smael-chatbot-root button { appearance: none; -webkit-appearance: none; cursor: pointer; }
#smael-chatbot-root button:disabled { cursor: wait; opacity: .65; }
#smael-chatbot-root a { text-decoration: none; }
#smael-chatbot-root .smael-icon { width: 20px; height: 20px; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; }
#smael-chatbot-root .smael-icon svg { width: 100%; height: 100%; display: block; }
#smael-chatbot-root :is(button, a, input, textarea):focus-visible { outline: 3px solid #f58220; outline-offset: 3px; }

/* Compact launcher and visitor-controlled hide option. */
#smael-chatbot-root .smael-launcher-wrap {
  position: absolute; bottom: 0; right: 0; display: flex; align-items: center;
  filter: drop-shadow(0 7px 17px rgba(0,0,0,.22));
}
#smael-chatbot-root.smael-left .smael-launcher-wrap { right: auto; left: 0; }
#smael-chatbot-root .smael-launcher {
  display: inline-flex; gap: 10px; align-items: center; justify-content: center;
  min-height: 52px; border: 0; border-radius: 100px; padding: 12px 47px 12px 19px;
  background: var(--smael-chat-accent); color: var(--smael-chat-accent-contrast); white-space: nowrap;
  font-size: 14px; font-weight: 700; line-height: 1.2;
  transition: transform .15s ease, filter .15s ease;
}
#smael-chatbot-root .smael-launcher:hover { transform: translateY(-2px); filter: brightness(.95); }
#smael-chatbot-root .smael-launcher-hide {
  display: inline-flex; align-items: center; justify-content: center;
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 27px; height: 27px; border: 0; border-radius: 50%; padding: 4px;
  background: rgba(0,0,0,.1); color: var(--smael-chat-accent-contrast);
}
#smael-chatbot-root .smael-launcher-hide .smael-icon { width: 15px; height: 15px; }
#smael-chatbot-root .smael-launcher-hide:hover { background: rgba(0,0,0,.18); }
#smael-chatbot-root .smael-edge-tab {
  display: none; position: absolute; right: -22px; bottom: 10px;
  border: 0; border-radius: 12px 0 0 12px; padding: 13px 9px;
  background: var(--smael-chat-accent); color: var(--smael-chat-accent-contrast);
  box-shadow: 0 5px 20px rgba(0,0,0,.18);
}
#smael-chatbot-root.smael-left .smael-edge-tab { right: auto; left: -22px; border-radius: 0 12px 12px 0; }
#smael-chatbot-root.smael-is-minimal .smael-launcher-wrap,
#smael-chatbot-root.smael-is-open .smael-launcher-wrap { display: none; }
#smael-chatbot-root.smael-is-minimal:not(.smael-is-open) .smael-edge-tab { display: inline-flex; }
#smael-chatbot-root.smael-is-open .smael-edge-tab { display: none; }

/* Floating conversation panel, without affecting the existing site layout. */
#smael-chatbot-root .smael-chat-panel {
  position: absolute; bottom: 0; right: 0; overflow: hidden;
  display: none; flex-direction: column; width: 388px; max-width: calc(100vw - 20px);
  height: 600px; max-height: calc(100dvh - 95px); min-height: 310px;
  background: var(--smael-chat-surface); border: 1px solid rgba(0,0,0,.12);
  border-radius: 19px; box-shadow: 0 16px 55px rgba(0,0,0,.22);
  color: var(--smael-chat-ink); isolation: isolate;
}
#smael-chatbot-root.smael-left .smael-chat-panel { right: auto; left: 0; }
#smael-chatbot-root.smael-is-open .smael-chat-panel { display: flex; animation: smael-chat-in .18s ease-out both; }
@keyframes smael-chat-in { from { opacity: .4; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
#smael-chatbot-root .smael-chat-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  min-height: 80px; padding: 13px 14px 13px 16px;
  background: var(--smael-chat-header); color: var(--smael-chat-header-contrast);
  border-bottom: 3px solid var(--smael-chat-accent);
}
#smael-chatbot-root .smael-brand { display: flex; min-width: 0; align-items: center; gap: 11px; }
#smael-chatbot-root .smael-avatar {
  width: 40px; height: 40px; display: flex; justify-content: center; align-items: center;
  border-radius: 12px; background: rgba(255,255,255,.11); color: var(--smael-chat-accent); flex-shrink: 0;
}
#smael-chatbot-root .smael-avatar .smael-icon { width: 23px; height: 23px; }
#smael-chatbot-root .smael-header-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#smael-chatbot-root .smael-header-text strong { font-weight: 700; color: var(--smael-chat-header-contrast); font-size: 15px; line-height: 1.25; }
#smael-chatbot-root .smael-header-text small { font-weight: 400; font-size: 11px; line-height: 1.3; color: var(--smael-chat-header-contrast); opacity: .8; }
#smael-chatbot-root .smael-header-controls { display: flex; flex: 0 0 auto; gap: 4px; }
#smael-chatbot-root .smael-header-phone,
#smael-chatbot-root .smael-header-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 33px; height: 33px; background: rgba(255,255,255,.13); border: 0;
  border-radius: 9px; color: var(--smael-chat-header-contrast); padding: 5px;
}
#smael-chatbot-root .smael-header-phone:hover,
#smael-chatbot-root .smael-header-close:hover { background: rgba(255,255,255,.25); color: #fff; }
#smael-chatbot-root .smael-header-controls .smael-icon { width: 17px; height: 17px; }

#smael-chatbot-root .smael-chat-messages {
  flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto;
  padding: 17px 12px 19px; background: #f7f7f7; overscroll-behavior: contain;
  scrollbar-color: #cacaca transparent;
}
#smael-chatbot-root .smael-msg-row { display: flex; align-items: flex-end; gap: 7px; margin-bottom: 13px; }
#smael-chatbot-root .smael-msg-bot { align-items: flex-start; }
#smael-chatbot-root .smael-msg-avatar {
  display: flex; justify-content: center; align-items: center;
  flex: 0 0 26px; height: 26px; border-radius: 50%;
  background: #fff0e1; color: #a95300; margin-top: 3px;
}
#smael-chatbot-root .smael-msg-avatar .smael-icon { width: 15px; height: 15px; }
#smael-chatbot-root .smael-bot-wrap { min-width: 0; max-width: calc(100% - 33px); }
#smael-chatbot-root .smael-msg-bubble {
  display: inline-block; padding: 11px 12px; border-radius: 4px 14px 14px 14px;
  background: #fff; color: var(--smael-chat-ink); border: 1px solid #eaeaea;
  font-size: 13px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere;
}
#smael-chatbot-root .smael-msg-user { justify-content: flex-end; }
#smael-chatbot-root .smael-msg-user .smael-msg-bubble {
  max-width: 85%; border-radius: 14px 14px 4px 14px;
  background: var(--smael-chat-accent); border-color: var(--smael-chat-accent); color: var(--smael-chat-accent-contrast);
}
#smael-chatbot-root .smael-chat-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
#smael-chatbot-root .smael-chat-action {
  display: inline-flex; align-items: center; justify-content: center; max-width: 100%; min-height: 32px;
  border: 1px solid #edc6a6; border-radius: 11px; padding: 7px 10px;
  color: #8c3f00; background: white;
  font-size: 12px; font-weight: 650; line-height: 1.3; text-align: left; white-space: normal;
  transition: background .15s ease, transform .15s ease;
}
#smael-chatbot-root .smael-chat-action:hover { color: #562800; background: #fff2e8; transform: translateY(-1px); }
#smael-chatbot-root .smael-chat-action.smael-action-primary { color: var(--smael-chat-accent-contrast); background: var(--smael-chat-accent); border-color: var(--smael-chat-accent); }
#smael-chatbot-root .smael-chat-action.smael-action-primary:hover { filter: brightness(.92); }

#smael-chatbot-root .smael-composer {
  display: flex; align-items: center; gap: 8px; padding: 12px 11px 6px;
  margin: 0; border-top: 1px solid var(--smael-chat-line); background: white;
}
#smael-chatbot-root .smael-message-input {
  flex: 1 1 auto; min-width: 0; height: 41px; min-height: 41px; max-height: 41px;
  border: 1px solid #d9d9d9; border-radius: 12px; outline: 0;
  background: #fafafa; color: #262626; font-size: 13px; padding: 9px 11px;
  box-shadow: none; margin: 0;
}
#smael-chatbot-root .smael-message-input:focus { border-color: var(--smael-chat-accent); background: #fff; }
#smael-chatbot-root .smael-message-input::placeholder { color: #767676; opacity: 1; }
#smael-chatbot-root .smael-send {
  height: 41px; width: 43px; border: 0; padding: 11px;
  border-radius: 12px; display: flex; justify-content: center; align-items: center;
  background: var(--smael-chat-accent); color: var(--smael-chat-accent-contrast); flex: 0 0 auto;
}
#smael-chatbot-root .smael-send:hover { filter: brightness(.91); }
#smael-chatbot-root .smael-chat-under {
  flex: 0 0 auto; min-height: 33px; display: flex; align-items: center;
  justify-content: space-between; gap: 5px; padding: 4px 14px 9px;
  background: white; color: var(--smael-chat-muted); font-size: 11px;
}
#smael-chatbot-root .smael-chat-under .smael-footer-call {
  color: #954200; font-size: 11px; font-weight: 700;
  display: inline-flex; gap: 5px; align-items: center; white-space: nowrap;
}
#smael-chatbot-root .smael-chat-under .smael-footer-call:hover { text-decoration: underline; }
#smael-chatbot-root .smael-footer-call .smael-icon { width: 13px; height: 13px; }

/* Inline contact form – appears only after explicit request. */
#smael-chatbot-root .smael-form-row { padding-left: 33px; }
#smael-chatbot-root .smael-lead-form {
  width: 100%; padding: 13px 12px 12px; margin: 0; border: 1px solid #e7e7e7;
  border-radius: 13px; background: white; display: flex; flex-direction: column; gap: 9px;
  box-shadow: 0 3px 12px rgba(0,0,0,.04);
}
#smael-chatbot-root .smael-form-title { font-size: 14px; line-height: 1.3; color: var(--smael-chat-ink); }
#smael-chatbot-root .smael-form-context { font-size: 11px; color: var(--smael-chat-muted); margin-top: -5px; }
#smael-chatbot-root .smael-form-field { display: flex; flex-direction: column; gap: 4px; margin: 0; }
#smael-chatbot-root .smael-form-field > span { font-size: 11px; font-weight: 650; line-height: 1.4; }
#smael-chatbot-root .smael-form-field input,
#smael-chatbot-root .smael-form-field textarea {
  width: 100%; min-height: 36px; font-size: 12px; border: 1px solid #d9d9d9;
  border-radius: 8px; background: white; color: var(--smael-chat-ink);
  padding: 7px 9px; margin: 0; box-shadow: none;
}
#smael-chatbot-root .smael-form-field textarea { min-height: 80px; resize: vertical; }
#smael-chatbot-root .smael-form-field :is(input, textarea):focus { border-color: var(--smael-chat-accent); }
#smael-chatbot-root .smael-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#smael-chatbot-root .smael-consent { display: flex; align-items: flex-start; gap: 7px; font-size: 11px; line-height: 1.4; }
#smael-chatbot-root .smael-consent input { flex: 0 0 auto; width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--smael-chat-accent); }
#smael-chatbot-root .smael-consent a { color: #954200; text-decoration: underline; }
#smael-chatbot-root .smael-form-feedback { font-size: 11px; color: #af381f; line-height: 1.4; }
#smael-chatbot-root .smael-form-feedback:empty { display: none; }
#smael-chatbot-root .smael-form-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
#smael-chatbot-root .smael-form-submit,
#smael-chatbot-root .smael-form-cancel {
  min-height: 36px; border: 1px solid var(--smael-chat-accent); border-radius: 9px;
  padding: 8px 10px; font-size: 11px; font-weight: 700;
}
#smael-chatbot-root .smael-form-submit { color: var(--smael-chat-accent-contrast); background: var(--smael-chat-accent); }
#smael-chatbot-root .smael-form-cancel { color: #954200; background: white; }
#smael-chatbot-root .smael-form-submit:hover { filter: brightness(.93); }
#smael-chatbot-root .smael-form-cancel:hover { background: #fff2e8; }

@media (max-width: 600px) {
  #smael-chatbot-root.smael-no-mobile { display: none !important; }
  #smael-chatbot-root { right: 12px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  #smael-chatbot-root.smael-left { left: 12px; }
  #smael-chatbot-root .smael-chat-panel { width: min(390px, calc(100vw - 24px)); max-height: calc(100dvh - 84px); border-radius: 16px; }
  #smael-chatbot-root .smael-edge-tab { right: -12px; }
  #smael-chatbot-root.smael-left .smael-edge-tab { left: -12px; }
  #smael-chatbot-root .smael-launcher { padding: 12px 43px 12px 14px; min-height: 49px; }
}
@media (max-width: 360px) {
  #smael-chatbot-root .smael-chat-header { padding: 12px 9px; }
  #smael-chatbot-root .smael-avatar { display: none; }
  #smael-chatbot-root .smael-chat-under > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #smael-chatbot-root *, #smael-chatbot-root *::before, #smael-chatbot-root *::after { animation: none !important; transition: none !important; }
}

#smael-chatbot-root .smael-chat-action:disabled { opacity: .5; cursor: default; transform: none; background: #fff; color: #777; }

/* v1.1.0 – more comfortable controls and selectable service on the fast quote form. */
#smael-chatbot-root .smael-chat-action { min-height: 39px; padding: 9px 11px; font-size: 13px; }
#smael-chatbot-root .smael-msg-bubble { font-size: 13.5px; line-height: 1.52; }
#smael-chatbot-root .smael-message-input { font-size: 16px; }
#smael-chatbot-root .smael-form-field > span { font-size: 12px; }
#smael-chatbot-root .smael-form-field :is(input, textarea, select) {
  width: 100%; min-height: 40px; font-size: 14px; color: var(--smael-chat-ink);
  background: #fff; border: 1px solid #d9d9d9; border-radius: 8px; padding: 8px 10px;
  margin: 0; box-shadow: none;
}
#smael-chatbot-root .smael-form-field select { appearance: auto; }
#smael-chatbot-root .smael-form-field :is(input, textarea, select):focus { border-color: var(--smael-chat-accent); }
#smael-chatbot-root .smael-form-submit,
#smael-chatbot-root .smael-form-cancel { min-height: 41px; font-size: 13px; }
@media (max-width: 600px) {
  #smael-chatbot-root .smael-chat-action { min-height: 44px; padding: 10px 12px; font-size: 13px; }
  #smael-chatbot-root .smael-message-input,
  #smael-chatbot-root .smael-form-field :is(input, textarea, select) { font-size: 16px; }
  #smael-chatbot-root .smael-msg-bubble { font-size: 14px; }
  #smael-chatbot-root .smael-chat-under { min-height: 42px; font-size: 12px; }
  #smael-chatbot-root .smael-chat-under .smael-footer-call { font-size: 12px; }
  #smael-chatbot-root .smael-consent { font-size: 12px; }
}

/* v1.1.1 – understated, accessible writing rhythm. */
#smael-chatbot-root .smael-typing-bubble {
  display: inline-flex; align-items: center; gap: 9px; min-height: 37px;
  padding: 9px 12px; border: 1px solid #ebebeb; border-radius: 5px 14px 14px 14px;
  background: #fff; color: #666;
}
#smael-chatbot-root .smael-typing-label { font-size: 12px; line-height: 1.4; }
#smael-chatbot-root .smael-typing-dots { display: inline-flex; align-items: center; gap: 4px; }
#smael-chatbot-root .smael-typing-dot {
  display: block; width: 5px; height: 5px; border-radius: 50%;
  background: var(--smael-chat-accent); opacity: .45;
  animation: smael-typing-bounce 1s ease-in-out infinite;
}
#smael-chatbot-root .smael-typing-dot:nth-child(2) { animation-delay: .14s; }
#smael-chatbot-root .smael-typing-dot:nth-child(3) { animation-delay: .28s; }
#smael-chatbot-root .smael-msg-enter { animation: smael-msg-appear .22s ease-out both; }
@keyframes smael-typing-bounce {
  0%, 65%, 100% { transform: translateY(0); opacity: .45; }
  35% { transform: translateY(-4px); opacity: 1; }
}
@keyframes smael-msg-appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #smael-chatbot-root .smael-typing-dot,
  #smael-chatbot-root .smael-msg-enter { animation: none !important; }
}

/* v1.1.2 – the service list opens only on request; no wall of seven chips. */
#smael-chatbot-root .smael-service-picker { display: block; width: 100%; max-width: 280px; }
#smael-chatbot-root .smael-service-select {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 9px 36px 9px 12px;
  margin: 0; background: #fff; color: #252525; border: 1px solid #e0b38e;
  border-radius: 10px; font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1.35; cursor: pointer;
}
#smael-chatbot-root .smael-service-select:focus-visible {
  outline: 2px solid var(--smael-chat-accent); outline-offset: 2px;
}
#smael-chatbot-root .smael-footer-quote {
  display: inline-flex; align-items: center; justify-content: center; min-height: 31px;
  padding: 5px 0; border: 0; border-radius: 3px; background: transparent;
  color: #954200; font-size: 12px; font-weight: 700; text-decoration: underline;
  cursor: pointer;
}
#smael-chatbot-root .smael-footer-quote:hover { color: #6f3100; }
#smael-chatbot-root .smael-footer-quote:focus-visible,
#smael-chatbot-root .smael-footer-call:focus-visible { outline: 2px solid var(--smael-chat-accent); outline-offset: 2px; }
#smael-chatbot-root .smael-form-help { font-size: 12px; line-height: 1.4; color: var(--smael-chat-muted); }
@media (max-width: 600px) {
  #smael-chatbot-root .smael-service-picker { max-width: 100%; }
  #smael-chatbot-root .smael-service-select { font-size: 16px; }
  #smael-chatbot-root .smael-footer-quote { font-size: 13px; min-height: 40px; }
}
#smael-chatbot-root.smael-has-form .smael-footer-quote { display: none; }

/* A single greeting should not occupy a full-height, mostly empty popup. */
#smael-chatbot-root.smael-is-home .smael-chat-panel {
  height: 385px; max-height: calc(100dvh - 95px);
  transition: height .18s ease;
}
@media (max-width: 600px) {
  #smael-chatbot-root.smael-is-home .smael-chat-panel { max-height: calc(100dvh - 84px); }
}

#smael-chatbot-root.smael-is-done .smael-footer-quote { display: none; }

/* v1.2.0 – deliberately no native dropdowns inside the conversation. */
#smael-chatbot-root .smael-service-actions { width: 100%; margin-top: 2px; }
#smael-chatbot-root .smael-service-actions .smael-service-grid {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px;
  width: 100%; max-width: 300px;
}
#smael-chatbot-root .smael-service-tile {
  min-width: 0; min-height: 45px; padding: 9px 10px; border: 1px solid #e2e0de;
  border-radius: 10px; background: #fff; color: #252525; text-align: left;
  font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.3;
  cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.03);
  transition: background .15s ease, border-color .15s ease;
}
#smael-chatbot-root .smael-service-tile:hover { background: #fff8f2; border-color: var(--smael-chat-accent); }
#smael-chatbot-root .smael-service-tile:focus-visible,
#smael-chatbot-root .smael-more-options:focus-visible { outline: 2px solid var(--smael-chat-accent); outline-offset: 2px; }
#smael-chatbot-root .smael-more-options {
  background: transparent; padding: 8px 3px; border: 0; font-size: 12px;
  color: #694020; text-decoration: underline; cursor: pointer;
}
#smael-chatbot-root .smael-ai-notice {
  flex: 1 0 100%; display: block; color: #777; font-size: 10px; line-height: 1.35;
  padding: 0 0 2px; order: 3;
}
#smael-chatbot-root .smael-ai-notice a { color: #924300; text-decoration: underline; }
#smael-chatbot-root .smael-message-input { font-size: 16px; }
@media(max-width:600px) {
  #smael-chatbot-root .smael-service-tile { min-height: 46px; font-size: 13px; }
}

#smael-chatbot-root .smael-chat-under.smael-has-ai-notice { flex-wrap: wrap; }
#smael-chatbot-root .smael-chat-under.smael-has-ai-notice .smael-ai-notice { flex: 1 0 100%; }
#smael-chatbot-root.smael-is-choose .smael-chat-panel { height: 465px; max-height: calc(100dvh - 84px); }
