.support-chat {
  --chat-bg: #f8fafc;
  --chat-panel: #ffffff;
  --chat-panel-soft: #f1f5f9;
  --chat-border: #cbd5e1;
  --chat-border-strong: #94a3b8;
  --chat-text: #111827;
  --chat-muted: #64748b;
  --chat-accent: #ff6b18;
  --chat-accent-dark: #d84a00;
  --chat-blue: #2563eb;
  --chat-peer: #eef2f7;
  --chat-own: #fff0e6;
  --chat-shadow: 0 24px 70px rgba(15, 23, 42, .25);
  color: var(--chat-text);
  font-family: inherit;
  position: relative;
  z-index: 2147482000;
}

html[data-ponto-theme="operations"] .support-chat,
html[data-ponto-theme="midnight"] .support-chat,
html[data-ponto-theme="cobalt"] .support-chat,
html[data-ponto-theme="copper"] .support-chat,
.coding-body .support-chat {
  --chat-bg: #080f1c;
  --chat-panel: #101a29;
  --chat-panel-soft: #162235;
  --chat-border: #33465f;
  --chat-border-strong: #516884;
  --chat-text: #f4f7fb;
  --chat-muted: #a9b8ca;
  --chat-peer: #1b2a3e;
  --chat-own: #352318;
  --chat-shadow: 0 28px 80px rgba(0, 0, 0, .58);
}

.support-chat-hidden {
  display: none !important;
}

.support-chat-launcher {
  align-items: center;
  background: linear-gradient(135deg, #ff7a21, var(--chat-accent-dark));
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  bottom: 22px;
  box-shadow: 0 12px 34px rgba(216, 74, 0, .35);
  color: #fff;
  cursor: pointer;
  display: flex;
  font: 800 14px/1 inherit;
  gap: 9px;
  min-height: 48px;
  padding: 0 17px;
  position: fixed;
  right: 22px;
  transition: transform .16s ease, box-shadow .16s ease;
  z-index: 2147482001;
}

.support-chat-launcher:hover,
.support-chat-launcher:focus-visible {
  box-shadow: 0 15px 38px rgba(216, 74, 0, .46);
  transform: translateY(-2px);
}

.support-chat-launcher:focus-visible,
.support-chat-close:focus-visible,
.support-chat-customer:focus-visible,
.support-chat-send:focus-visible,
.support-chat textarea:focus-visible,
.support-chat input:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .45);
  outline-offset: 2px;
}

.support-chat-launcher-icon {
  display: block;
  height: 18px;
  position: relative;
  width: 20px;
}

.support-chat-launcher-icon::before {
  background: currentColor;
  border-radius: 5px;
  content: "";
  inset: 1px 0 4px;
  position: absolute;
}

.support-chat-launcher-icon::after {
  border-left: 6px solid currentColor;
  border-top: 5px solid transparent;
  bottom: 0;
  content: "";
  left: 3px;
  position: absolute;
}

.support-chat-launcher-count,
.support-chat-customer-count {
  align-items: center;
  background: #dc2626;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 10px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 5px;
}

.support-chat-launcher-count {
  position: absolute;
  right: -4px;
  top: -7px;
}

.support-chat-panel {
  background: var(--chat-panel);
  border: 1px solid var(--chat-border);
  border-radius: 16px;
  bottom: 82px;
  box-shadow: var(--chat-shadow);
  color: var(--chat-text);
  display: flex;
  flex-direction: column;
  height: min(690px, calc(100vh - 110px));
  overflow: hidden;
  position: fixed;
  right: 22px;
  width: min(430px, calc(100vw - 32px));
}

.support-chat[data-role="admin"] .support-chat-panel {
  width: min(780px, calc(100vw - 32px));
}

.support-chat-header {
  align-items: center;
  background: var(--chat-bg);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 16px;
}

.support-chat-header > div,
.support-chat-conversation-head > div {
  display: grid;
  min-width: 0;
}

.support-chat-eyebrow {
  color: var(--chat-accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.support-chat-title {
  color: var(--chat-text);
  font-size: 20px;
  line-height: 1.25;
}

.support-chat-subtitle,
.support-chat-peer-meta {
  color: var(--chat-muted);
  font-size: 12px;
  line-height: 1.4;
}

.support-chat-close {
  align-items: center;
  background: var(--chat-panel-soft);
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  color: var(--chat-text);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font: 500 24px/1 inherit;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.support-chat-admin-layout {
  display: grid;
  flex: 1;
  min-height: 0;
}

.support-chat-admin-layout.is-admin {
  grid-template-columns: 285px minmax(0, 1fr);
}

.support-chat-customers {
  background: var(--chat-bg);
  border-right: 1px solid var(--chat-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 13px 10px 10px;
}

.support-chat-search-label,
.support-chat-form > label {
  color: var(--chat-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.support-chat-search,
.support-chat textarea {
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: 9px;
  color: var(--chat-text);
  font: 600 13px/1.45 inherit;
}

.support-chat-search {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 9px 11px;
  width: 100%;
}

.support-chat-search::placeholder,
.support-chat textarea::placeholder {
  color: var(--chat-muted);
  opacity: .85;
}

.support-chat-customer-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
}

.support-chat-customer {
  background: var(--chat-panel);
  border: 1px solid var(--chat-border);
  border-radius: 10px;
  color: var(--chat-text);
  cursor: pointer;
  display: grid;
  gap: 5px;
  height: auto !important;
  min-height: 82px;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  text-align: left;
}

.support-chat-customer:hover,
.support-chat-customer.active {
  border-color: var(--chat-accent);
}

.support-chat-customer.active {
  box-shadow: inset 3px 0 var(--chat-accent);
}

.support-chat-customer-row {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: space-between;
  min-width: 0;
}

.support-chat-customer-row strong,
.support-chat-customer small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-customer-row strong {
  flex: 1 1 auto;
  font-size: 13px;
}

.support-chat-presence {
  align-items: center;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .36);
  border-radius: 999px;
  color: #10b981;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
}

.support-chat-presence.offline {
  background: rgba(148, 163, 184, .08);
  border-color: rgba(148, 163, 184, .3);
  color: var(--chat-muted);
}

.support-chat-customer small,
.support-chat-customer-last-seen {
  color: var(--chat-muted);
  font-size: 10px;
  line-height: 1.35;
}

.support-chat-customer-last-seen {
  font-size: 11px;
  font-weight: 750;
  white-space: normal;
}

.support-chat-customer-last-seen.online {
  color: #10b981;
}

.support-chat-customer-count {
  border-width: 0;
  flex: 0 0 auto;
  height: 19px;
  min-width: 19px;
}

.support-chat-customer-empty,
.support-chat-message-empty {
  color: var(--chat-muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 18px 12px;
  text-align: center;
}

.support-chat-conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.support-chat-conversation-head {
  align-items: center;
  background: var(--chat-panel);
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 63px;
  padding: 10px 14px;
}

.support-chat-peer {
  color: var(--chat-text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-chat-online {
  align-items: center;
  color: #059669;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  gap: 5px;
}

.support-chat-online i {
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .14);
  height: 7px;
  width: 7px;
}

.support-chat-online.offline {
  color: var(--chat-muted);
}

.support-chat-online.offline i {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .12);
}

.support-chat-status {
  background: #fff1f0;
  border-bottom: 1px solid #fecaca;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 14px;
}

.support-chat-messages {
  background:
    radial-gradient(circle at 10% 10%, rgba(37, 99, 235, .04), transparent 25%),
    var(--chat-bg);
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  scrollbar-color: var(--chat-border-strong) transparent;
}

.support-chat-message {
  border: 1px solid var(--chat-border);
  border-radius: 13px;
  max-width: 86%;
  padding: 9px 11px;
}

.support-chat-message.is-peer {
  align-self: flex-start;
  background: var(--chat-peer);
  border-bottom-left-radius: 4px;
}

.support-chat-message.is-own {
  align-self: flex-end;
  background: var(--chat-own);
  border-color: color-mix(in srgb, var(--chat-accent), var(--chat-border) 55%);
  border-bottom-right-radius: 4px;
}

.support-chat-message-meta {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 4px;
}

.support-chat-message-meta strong {
  color: var(--chat-text);
  font-size: 11px;
}

.support-chat-message-meta time {
  color: var(--chat-muted);
  font-size: 9px;
  white-space: nowrap;
}

.support-chat-message p {
  color: var(--chat-text);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.support-chat-message-empty {
  display: grid;
  gap: 6px;
  margin: auto;
  max-width: 300px;
}

.support-chat-message-empty strong {
  color: var(--chat-text);
  font-size: 15px;
}

.support-chat-form {
  background: var(--chat-panel);
  border-top: 1px solid var(--chat-border);
  display: grid;
  padding: 11px 14px 13px;
}

.support-chat textarea {
  max-height: 130px;
  min-height: 68px;
  padding: 9px 11px;
  resize: vertical;
  width: 100%;
}

.support-chat-form-footer {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 8px;
}

.support-chat-form-footer small {
  color: var(--chat-muted);
  font-size: 9px;
}

.support-chat-send {
  background: var(--chat-accent);
  border: 1px solid var(--chat-accent);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font: 900 12px/1 inherit;
  min-height: 38px;
  padding: 0 15px;
}

.support-chat-send:hover:not(:disabled) {
  background: var(--chat-accent-dark);
}

.support-chat-send:disabled,
.support-chat textarea:disabled {
  cursor: not-allowed;
  opacity: .55;
}

@media (max-width: 760px) {
  .support-chat-launcher {
    bottom: 14px;
    right: 14px;
  }

  .support-chat-panel,
  .support-chat[data-role="admin"] .support-chat-panel {
    border-radius: 14px;
    bottom: 72px;
    height: calc(100dvh - 88px);
    left: 10px;
    max-width: none;
    right: 10px;
    width: auto;
  }

  .support-chat-admin-layout.is-admin {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .support-chat-customers {
    border-bottom: 1px solid var(--chat-border);
    border-right: 0;
    max-height: 178px;
  }

  .support-chat-customer-list {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .support-chat-customer {
    flex: 0 0 210px;
  }

  .support-chat-header {
    min-height: 67px;
  }
}

@media (max-width: 420px) {
  .support-chat-launcher-label,
  .support-chat-form-footer small {
    display: none;
  }

  .support-chat-launcher {
    height: 48px;
    justify-content: center;
    padding: 0;
    width: 48px;
  }

  .support-chat-message {
    max-width: 93%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-chat-launcher {
    transition: none;
  }
}
