#wlc-widget,
#wlc-widget * {
  box-sizing: border-box;
}

#wlc-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111827;
  line-height: 1.35;
}

#wlc-widget button,
#wlc-widget input,
#wlc-widget textarea {
  font-family: inherit;
  line-height: 1.35;
  box-shadow: none;
  outline: none;
}

#wlc-bubble {
  position: relative;
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  max-width: 54px;
  max-height: 54px;
  padding: 0;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 0;
  box-shadow: 0 10px 26px rgba(164, 70, 68, .28);
  background: #a44644;
  color: #fff;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  display: grid;
  place-items: center;
}

#wlc-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(164, 70, 68, .34);
  background: #963e3c;
}

#wlc-bubble:focus-visible {
  box-shadow: 0 0 0 4px rgba(164, 70, 68, .20), 0 12px 28px rgba(164, 70, 68, .30);
}

.wlc-bubble-icon {
  width: 28px;
  height: 28px;
  display: block;
  color: #fff;
}

.wlc-bubble-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  border: 2px solid #a44644;
  background: #ef4444;
}

#wlc-panel {
  display: none;
  width: 390px;
  max-width: calc(100vw - 24px);
  height: 590px;
  max-height: calc(100vh - 34px);
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(17, 24, 39, .30);
  border: 1px solid rgba(17, 24, 39, .08);
}

#wlc-widget.open #wlc-bubble {
  display: none;
}

#wlc-widget.open #wlc-panel {
  display: flex;
  flex-direction: column;
}

#wlc-panel .wlc-panel-header {
  flex: 0 0 auto;
  min-height: 72px;
  padding: 14px 16px;
  background: #a44644;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#wlc-panel .wlc-panel-header strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  margin: 0;
}

#wlc-panel .wlc-panel-header span {
  display: block;
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

#wlc-close {
  appearance: none;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff;
  border: 0;
  font-size: 26px;
  line-height: 30px;
  cursor: pointer;
}

#wlc-close:hover {
  background: rgba(255,255,255,.18);
}

#wlc-body {
  padding: 14px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.wlc-intro {
  color: #4b5563;
  font-size: 14px;
  margin: 2px 0 14px;
}

.wlc-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.wlc-form label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: #374151;
  margin: 0;
}

#wlc-widget .wlc-form input,
#wlc-widget .wlc-message-form textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 12px;
  padding: 11px 12px;
  margin: 6px 0 0;
  font-size: 14px;
}

#wlc-widget .wlc-form input {
  height: 44px;
}

#wlc-widget .wlc-form input:focus,
#wlc-widget .wlc-message-form textarea:focus {
  border-color: #a44644;
  box-shadow: 0 0 0 3px rgba(164, 70, 68, .12);
}

#wlc-widget .wlc-primary,
#wlc-widget .wlc-message-form button {
  appearance: none;
  border: 0;
  border-radius: 14px;
  background: #a44644;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
}


#wlc-widget .wlc-primary:hover,
#wlc-widget .wlc-message-form button:hover {
  background: #963e3c;
}

#wlc-widget .wlc-primary {
  height: 46px;
  width: 100%;
  padding: 0 16px;
  margin-top: 2px;
}

#wlc-widget button:disabled,
#wlc-widget textarea:disabled {
  opacity: .62;
  cursor: not-allowed;
}

.wlc-status {
  flex: 0 0 auto;
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
}

.wlc-status.is-error {
  background: #fef2f2;
  color: #991b1b;
}

.wlc-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 4px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
}

.wlc-message {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}

.wlc-message span {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.38;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.wlc-message small {
  display: block;
  font-size: 10px;
  color: #6b7280;
  margin-top: 3px;
}

.wlc-message.mine {
  align-self: flex-end;
  align-items: flex-end;
}

.wlc-message.mine span {
  background: #a44644;
  color: #fff;
  border-bottom-right-radius: 5px;
}

.wlc-message.theirs {
  align-self: flex-start;
  align-items: flex-start;
}

.wlc-message.theirs span {
  background: #f3f4f6;
  color: #111827;
  border-bottom-left-radius: 5px;
}

.wlc-message.is-pending {
  opacity: .72;
}

.wlc-typing {
  flex: 0 0 auto;
  align-self: flex-start;
  margin: 0 0 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
}

.wlc-message-form {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  gap: 8px;
  align-items: end;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid #eef0f3;
}

#wlc-widget .wlc-message-form textarea {
  display: block;
  height: 44px;
  min-height: 44px !important;
  max-height: 110px;
  resize: none;
  overflow-y: auto;
  margin: 0;
  border-radius: 16px;
}

#wlc-widget .wlc-message-form button {
  display: block;
  height: 44px;
  min-height: 44px;
  width: 78px;
  padding: 0;
  margin: 0;
}

.wlc-link-button {
  appearance: none;
  flex: 0 0 auto;
  width: 100%;
  min-height: 44px;
  margin: 10px 0 0;
  padding: 0 16px;
  border: 1px solid rgba(164, 70, 68, .38);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff 0%, #fff8f8 100%);
  color: #a44644;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.wlc-link-button::before {
  content: "＋";
  display: inline-block;
  margin-right: 6px;
  font-size: 16px;
  line-height: 1;
  vertical-align: -1px;
}

.wlc-link-button:hover {
  background: #a44644;
  border-color: #a44644;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(164, 70, 68, .18);
}

.wlc-link-button:focus-visible {
  box-shadow: 0 0 0 4px rgba(164, 70, 68, .14);
}

.wlc-muted {
  color: #6b7280;
  text-align: center;
  padding: 18px 12px;
  font-size: 14px;
  margin: auto;
}

@media (max-width: 480px) {
  #wlc-widget {
    right: 12px;
    bottom: 12px;
  }

  #wlc-bubble {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    max-width: 52px;
    max-height: 52px;
  }

  #wlc-panel {
    width: calc(100vw - 20px);
    height: min(620px, calc(100vh - 20px));
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .wlc-message-form {
    grid-template-columns: minmax(0, 1fr) 72px;
  }

  #wlc-widget .wlc-message-form button {
    width: 72px;
  }
}
