.sm-support,
.sm-support * {
  box-sizing: border-box;
}

.sm-support {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  width: min(390px, calc(100vw - 24px));
  color: #102a43;
  font-family: Manrope, "Segoe UI", sans-serif;
}

.sm-support-launcher {
  display: flex;
  min-height: 52px;
  margin-left: auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: #0b3655;
  padding: 0 17px;
  color: #fff;
  box-shadow: 0 22px 55px -24px rgba(3, 25, 45, 0.62);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.sm-support-launcher-dot,
.sm-support-status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #a8b7c4;
}

.sm-support[data-online="true"] .sm-support-launcher-dot,
.sm-support[data-online="true"] .sm-support-status-dot {
  background: #62e6bd;
  box-shadow: 0 0 0 4px rgba(98, 230, 189, 0.16);
}

.sm-support-panel {
  overflow: hidden;
  border: 1px solid #c9dce7;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 80px -32px rgba(3, 25, 45, 0.68);
}

.sm-support[hidden],
.sm-support-panel[hidden],
.sm-support-launcher[hidden] {
  display: none !important;
}

.sm-support-header {
  display: flex;
  min-height: 76px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, #0b3655, #0f7f78);
  padding: 16px;
  color: #fff;
}

.sm-support-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
}

.sm-support-subtitle {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  line-height: 1.45;
}

.sm-support-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 21px;
  line-height: 1;
}

.sm-support-body {
  max-height: min(620px, calc(100vh - 130px));
  overflow-y: auto;
  background: #fff;
}

.sm-support-form,
.sm-support-success {
  display: grid;
  gap: 11px;
  padding: 16px;
}

.sm-support-notice {
  border: 1px solid #dbe8ef;
  border-radius: 13px;
  background: #f5fafc;
  padding: 11px 12px;
  color: #3f5a6f;
  font-size: 12px;
  line-height: 1.55;
}

.sm-support-notice strong {
  display: block;
  margin-bottom: 2px;
  color: #102a43;
  font-size: 13px;
}

.sm-support-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.sm-support-challenge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  align-items: end;
  gap: 8px;
  border: 1px solid #dbe8ef;
  border-radius: 13px;
  background: #f5fafc;
  padding: 10px;
}

.sm-support-challenge-label,
.sm-support-challenge-entry span {
  display: block;
  margin-bottom: 5px;
  color: #60788a;
  font-size: 10px;
  font-weight: 700;
}

.sm-support-challenge-code {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid #bcd6e3;
  border-radius: 10px;
  background: #fff;
  color: #0b3655;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.sm-support-challenge-entry {
  min-width: 0;
}

.sm-support-challenge-entry input {
  height: 40px;
  border-color: #bcd6e3;
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 900;
  letter-spacing: 0;
}

.sm-support-refresh {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid #bcd6e3;
  border-radius: 10px;
  background: #fff;
  color: #0f6b8f;
  cursor: pointer;
  font: inherit;
  font-size: 19px;
  font-weight: 800;
}

.sm-support-refresh:hover {
  background: #eef8f8;
}

.sm-support input,
.sm-support textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d2e0e8;
  border-radius: 12px;
  background: #fff;
  padding: 11px 12px;
  color: #102a43;
  outline: none;
  font: inherit;
  font-size: 13px;
}

.sm-support textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}

.sm-support input:focus,
.sm-support textarea:focus {
  border-color: #1b9f8b;
  box-shadow: 0 0 0 3px rgba(27, 159, 139, 0.1);
}

.sm-support-submit {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: #0b3655;
  padding: 0 16px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.sm-support-submit:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.sm-support-error {
  border: 1px solid #fecaca;
  border-radius: 11px;
  background: #fff1f2;
  padding: 9px 11px;
  color: #b42318;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
}

.sm-support-chat-meta {
  border-bottom: 1px solid #e7eef3;
  padding: 9px 14px;
  color: #61788a;
  font-size: 11px;
  font-weight: 700;
}

.sm-support-messages {
  min-height: 270px;
  max-height: min(390px, calc(100vh - 310px));
  overflow-y: auto;
  background: #f5f9fb;
  padding: 13px;
}

.sm-support-message {
  display: flex;
  margin-bottom: 9px;
}

.sm-support-message[data-from="visitor"] {
  justify-content: flex-end;
}

.sm-support-bubble {
  max-width: 84%;
  border: 1px solid #dbe6ed;
  border-radius: 14px;
  background: #fff;
  padding: 9px 11px;
  color: #193a50;
  box-shadow: 0 8px 20px -18px rgba(3, 25, 45, 0.5);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.sm-support-message[data-from="visitor"] .sm-support-bubble {
  border-color: #0b3655;
  background: #0b3655;
  color: #fff;
}

.sm-support-message-label {
  margin-bottom: 4px;
  color: #0f7f78;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.sm-support-message-time {
  margin-top: 4px;
  color: rgba(72, 92, 108, 0.55);
  font-size: 9px;
}

.sm-support-message[data-from="visitor"] .sm-support-message-time {
  color: rgba(255, 255, 255, 0.56);
}

.sm-support-composer {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 9px;
  border-top: 1px solid #e7eef3;
  background: #fff;
  padding: 11px;
}

.sm-support-composer textarea {
  min-height: 46px;
  max-height: 96px;
  resize: none;
}

.sm-support-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 12px;
  background: #15967f;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.sm-support-success {
  justify-items: center;
  padding: 28px 20px;
  text-align: center;
}

.sm-support-success-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 50%;
  background: #14866f;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.sm-support-success strong {
  font-size: 17px;
}

.sm-support-success p {
  margin: 0;
  color: #60788a;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .sm-support {
    right: 12px;
    bottom: 12px;
  }

  .sm-support-panel {
    border-radius: 17px;
  }

  .sm-support-body {
    max-height: calc(100vh - 104px);
  }

  .sm-support-grid {
    grid-template-columns: 1fr;
  }
}
