.online-chat-widget {
  --chat-blue: #1769aa;
  --chat-ink: #172033;
  --chat-muted: #667085;
  --chat-border: #dfe6ef;
  color-scheme: only light;
  position: relative;
  z-index: 20;
}
.online-chat-panel,
.online-message-widget,
.online-message-panel { color-scheme: only light; }

.online-chat-launch {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 12px 17px;
  border: 1px solid #125589;
  border-radius: 999px;
  color: #fff;
  background: var(--chat-blue);
  box-shadow: 0 10px 25px rgba(23, 105, 170, .28);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.online-chat-launch:hover { background: #125589; }
.online-chat-launch-mark { letter-spacing: 2px; font-size: 14px; line-height: 1; }

.online-chat-panel {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 31;
  display: flex;
  flex-direction: column;
  width: min(370px, calc(100vw - 32px));
  box-sizing: border-box;
  height: min(620px, calc(100vh - 32px));
  height: min(620px, calc(100dvh - 32px));
  min-height: 0;
  max-height: none;
  overflow: hidden;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 32, 51, .2);
}

.online-chat-panel[hidden] { display: none; }

.online-chat-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 15px;
  color: #fff;
  background: #1769aa;
}

.online-chat-header h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.online-chat-header p { margin: 5px 0 0; color: rgba(255,255,255,.82); font-size: 12px; line-height: 1.45; }
.online-chat-header .online-chat-eyebrow { margin: 0 0 5px; color: rgba(255,255,255,.7); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.online-chat-close { flex: 0 0 auto; align-self: flex-start; border: 0; padding: 0 4px; color: #fff; background: transparent; font-size: 25px; line-height: 1; cursor: pointer; }

.online-chat-messages { flex: 1 1 0; min-height: 0; overflow-y: auto; padding: 16px; background: #f6f8fb; }
.online-chat-empty { margin: 50px 12px; color: var(--chat-muted); font-size: 13px; line-height: 1.5; text-align: center; }
.online-chat-message { display: flex; flex-direction: column; gap: 4px; margin: 0 0 13px; max-width: 86%; }
.online-chat-message-visitor { align-items: flex-end; margin-left: auto; }
.online-chat-message-agent { align-items: flex-start; }
.online-chat-bubble { padding: 10px 12px; border-radius: 10px; color: var(--chat-ink); background: #fff; box-shadow: 0 1px 2px rgba(23,32,51,.08); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.online-chat-message-visitor .online-chat-bubble { color: #fff; background: var(--chat-blue); }
.online-chat-meta { color: var(--chat-muted); font-size: 10px; }

.online-chat-form { flex: 0 0 auto; display: grid; gap: 9px; box-sizing: border-box; padding: 14px 16px 16px; border-top: 1px solid var(--chat-border); background: #fff; }
.online-chat-form label { display: grid; gap: 4px; color: #344056; font-size: 11px; font-weight: 600; }
.online-chat-form input, .online-chat-form textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 5px; padding: 9px 10px; color: var(--chat-ink); background: #fff; font: inherit; font-size: 13px; }
.online-chat-form textarea { min-height: 66px; resize: vertical; }
.online-chat-form input:focus, .online-chat-form textarea:focus { outline: 3px solid rgba(23,105,170,.15); border-color: var(--chat-blue); }
.online-chat-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 40px; }
.online-chat-status { flex: 1; min-height: 18px; margin: 0; color: var(--chat-muted); font-size: 11px; line-height: 1.4; }
.online-chat-status[data-state="success"] { color: #16704a; }
.online-chat-status[data-state="error"] { color: #b42318; }
.online-chat-status[data-state="pending"] { color: var(--chat-muted); }
.online-chat-send { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; box-sizing: border-box; border: 0; border-radius: 5px; padding: 10px 13px; color: #fff; background: var(--chat-blue); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.online-chat-send:hover { background: #125589; }
.online-chat-send:disabled { cursor: wait; opacity: .6; }

.online-message-widget { position: relative; z-index: 20; }
.online-message-launch {
  position: fixed;
  right: 171px;
  bottom: 24px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #0f766e;
  border-radius: 999px;
  color: #0f4f49;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 118, 110, .2);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.online-message-launch:hover { color: #fff; background: #0f766e; }
.online-message-launch-mark { font-size: 20px; font-weight: 400; line-height: .8; }

.online-message-panel {
  position: fixed;
  right: 24px;
  bottom: 84px;
  z-index: 31;
  width: min(370px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(23, 32, 51, .2);
}
.online-message-panel[hidden] { display: none; }
.online-message-header { display: flex; justify-content: space-between; gap: 14px; padding: 18px 18px 15px; color: #fff; background: #0f766e; }
.online-message-header h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.online-message-header p { margin: 5px 0 0; color: rgba(255,255,255,.86); font-size: 12px; line-height: 1.45; }
.online-message-header .online-message-eyebrow { margin: 0 0 5px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.online-message-close { flex: 0 0 auto; align-self: flex-start; border: 0; padding: 0 4px; color: #fff; background: transparent; font-size: 25px; line-height: 1; cursor: pointer; }
.online-message-form { display: grid; gap: 12px; padding: 16px; }
.online-message-form label { display: grid; gap: 5px; color: #344056; font-size: 12px; font-weight: 700; }
.online-message-form input, .online-message-form textarea { width: 100%; box-sizing: border-box; border: 1px solid #cbd5e1; border-radius: 5px; padding: 9px 10px; color: var(--chat-ink); background: #fff; font: inherit; font-size: 14px; }
.online-message-form textarea { min-height: 92px; resize: vertical; }
.online-message-form input:focus, .online-message-form textarea:focus { outline: 3px solid rgba(15,118,110,.16); border-color: #0f766e; }
.online-message-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.online-message-status { flex: 1; min-height: 18px; margin: 0; color: var(--chat-muted); font-size: 11px; line-height: 1.4; }
.online-message-status[data-state="success"] { color: #16704a; }
.online-message-status[data-state="error"] { color: #b42318; }
.online-message-submit { flex: 0 0 auto; border: 0; border-radius: 5px; padding: 10px 13px; color: #fff; background: #0f766e; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.online-message-submit:hover { background: #0b5d56; }
.online-message-submit:disabled { cursor: wait; opacity: .6; }

/* The host site's email shortcut uses an "E" placeholder. Replace it with a familiar mail icon. */
.main-floating-tools .main-floating-email .main-floating-icon { font-size: 0; }
.main-floating-tools .main-floating-email .main-floating-icon::after { content: "\2709"; font-size: 17px; line-height: 1; }
.main-floating-tools .main-floating-email:hover .main-floating-contact-text,
.main-floating-tools .main-floating-email:focus-visible .main-floating-contact-text { display: none; }

.main-floating-tools > .online-chat-widget,
.main-floating-tools > .online-message-widget { display: contents; }
.main-floating-tools .main-floating-whatsapp { order: 1; }
.main-floating-tools .main-floating-email { order: 2; }
.main-floating-tools .online-message-launch { order: 3; }
.main-floating-tools .online-chat-launch { order: 4; }
.main-floating-tools .main-floating-top { order: 5; }
.main-floating-tools .online-chat-launch,
.main-floating-tools .online-message-launch {
  position: static;
  z-index: auto;
  display: grid;
  width: 52px;
  min-height: 60px;
  padding: 5px 4px;
  border: 0;
  border-bottom: 1px solid var(--line, #dfe6ef);
  border-radius: 0;
  color: var(--brand, #0f4c81);
  background: transparent;
  box-shadow: none;
  place-items: center;
  align-content: center;
  gap: 3px;
  font: inherit;
  font-size: 11px;
  font-weight: 900;
}
.main-floating-tools .online-chat-launch:hover,
.main-floating-tools .online-message-launch:hover { color: var(--accent, #b64c14); background: #fff3e6; }
.main-floating-tools .online-chat-launch-mark,
.main-floating-tools .online-message-launch-mark { color: currentColor; font-size: 17px; line-height: 1; }
.main-floating-tools .online-chat-launch-label,
.main-floating-tools .online-message-launch-label { font-size: 0; line-height: 1; }
.main-floating-tools .online-chat-launch-label::after,
.main-floating-tools .online-message-launch-label::after { content: attr(data-tool-label); font-size: 11px; }

@media (min-width: 721px) {
  .online-chat-panel,
  .online-message-panel { right: 72px; bottom: 16px; max-height: calc(100dvh - 32px); }
}

@media (max-width: 720px) {
  .main-floating-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .main-floating-tools .online-chat-launch,
  .main-floating-tools .online-message-launch {
    width: auto;
    min-height: 58px;
    padding: 5px 3px;
    border-right: 1px solid #f3cfaa;
    font-size: 12px;
  }
  .main-floating-tools .online-chat-launch { order: 4; border-right: 0; }
  .main-floating-tools .online-chat-launch-label::after,
  .main-floating-tools .online-message-launch-label::after { content: attr(data-tool-label); font-size: 12px; }
  .main-floating-tools .main-floating-email { grid-template-columns: 1fr; gap: 3px; padding: 5px 3px; }
  .main-floating-tools .main-floating-email .main-floating-contact-text { display: block; font-size: 0; line-height: 1; }
  .main-floating-tools .main-floating-email .main-floating-contact-text::after { content: 'Email'; font-size: 12px; }
  .online-chat-panel,
  .online-message-panel { right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); max-height: calc(100vh - 94px); }
  .online-chat-panel { height: calc(100vh - 94px); height: calc(100dvh - 94px); max-height: none; }
.online-message-panel { overflow-y: auto; }
}

/* Keep the support controls legible when the device prefers a dark theme. */
@media (prefers-color-scheme: dark) {
  .online-chat-panel,
  .online-message-panel,
  .online-chat-form,
  .online-message-form { color: #172033; background-color: #ffffff; }
  .online-chat-messages { background-color: #f6f8fb; }
  .online-chat-message-visitor .online-chat-bubble { color: #ffffff !important; background-color: #1769aa !important; }
  .online-chat-message-agent .online-chat-bubble { color: #172033 !important; background-color: #ffffff !important; }
  .online-chat-form label,
  .online-message-form label { color: #344056 !important; }
  .online-chat-form input,
  .online-chat-form textarea,
  .online-message-form input,
  .online-message-form textarea { color: #172033 !important; background-color: #ffffff !important; border-color: #cbd5e1 !important; }
  .online-chat-form input::placeholder,
  .online-chat-form textarea::placeholder,
  .online-message-form input::placeholder,
  .online-message-form textarea::placeholder { color: #667085 !important; opacity: 1; }
  .online-chat-send { color: #ffffff !important; background-color: #1769aa !important; }
  .online-message-submit { color: #ffffff !important; background-color: #0f766e !important; }
  .main-floating-tools { color-scheme: only light; background-color: #ffffff !important; }
  .main-floating-tools .main-floating-tool,
  .main-floating-tools .online-chat-launch,
  .main-floating-tools .online-message-launch { color: #0f4c81 !important; background-color: transparent !important; }
  .main-floating-tools .main-floating-icon { color: #ffffff !important; background: #0f4c81 !important; }
}

/* Keep the chat action visible even when the host theme overrides native buttons. */
.online-chat-form .online-chat-send,
.online-chat-form .online-chat-send:focus,
.online-chat-form .online-chat-send:focus-visible,
.online-chat-form .online-chat-send:active {
  min-width: 112px;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #1769aa !important;
  background-color: #1769aa !important;
  background-image: none !important;
  border-color: #1769aa !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none !important;
  transform: translateZ(0);
}
.online-chat-form .online-chat-send:hover {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #125589 !important;
  background-color: #125589 !important;
  border-color: #125589 !important;
}

/* Align the host toolbar as a compact, readable contact stack. */
@media (min-width: 721px) {
  .main-floating-tools { width: 64px; }
  .main-floating-tools .main-floating-tool,
  .main-floating-tools .online-chat-launch,
  .main-floating-tools .online-message-launch {
    box-sizing: border-box;
    width: 64px;
    min-height: 64px;
    padding: 7px 5px;
    gap: 5px;
    font-size: 10px;
    line-height: 1.1;
    text-align: center;
  }
  .main-floating-tools .main-floating-icon { width: 32px; height: 32px; }
  .main-floating-tools .online-chat-launch-label::after,
  .main-floating-tools .online-message-launch-label::after { font-size: 10px; }
  .main-floating-tools .main-floating-whatsapp .main-floating-tool-label { font-size: 10px; white-space: nowrap; }
}

.main-floating-tools .main-floating-whatsapp .main-floating-icon {
  color: #ffffff !important;
  background: #1f9d55 !important;
  font-family: Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}
.main-floating-tools .main-floating-whatsapp:hover .main-floating-icon,
.main-floating-tools .main-floating-whatsapp:focus-visible .main-floating-icon { background: #167a42 !important; }
.main-floating-tools .main-floating-whatsapp .main-floating-tool-label { color: #0f4c81; font-weight: 900; white-space: nowrap; }

@media (max-width: 720px) {
  .main-floating-tools .main-floating-tool,
  .main-floating-tools .online-chat-launch,
  .main-floating-tools .online-message-launch {
    min-height: 60px;
    padding: 6px 4px;
    gap: 4px;
    line-height: 1.1;
  }
  .main-floating-tools .main-floating-icon { width: 30px; height: 30px; }
  .main-floating-tools .main-floating-whatsapp .main-floating-tool-label { font-size: 12px; }
}
