.twc-widget {
  bottom: 24px;
  font-family: Arial, sans-serif;
  position: fixed;
  z-index: 99999;
}

.twc-widget--right {
  right: 24px;
}

.twc-widget--left {
  left: 24px;
}

.twc-widget--inline {
  bottom: auto;
  left: auto;
  max-width: 420px;
  position: relative;
  right: auto;
  z-index: 1;
}

.twc-launcher,
.twc-send {
  background: var(--twc-accent, #6264a7);
  border: 0;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font: inherit;
  min-height: 42px;
  padding: 0 16px;
}

.twc-launcher {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.twc-panel {
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  bottom: 56px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  position: absolute;
  width: min(360px, calc(100vw - 32px));
}

.twc-widget--inline .twc-panel {
  bottom: auto;
  left: auto;
  position: relative;
  right: auto;
  width: 100%;
}

.twc-widget--right .twc-panel {
  right: 0;
}

.twc-widget--left .twc-panel {
  left: 0;
}

.twc-header {
  align-items: center;
  background: var(--twc-accent, #6264a7);
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.twc-close {
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.twc-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 240px;
  overflow-y: auto;
  padding: 14px;
}

.twc-bubble {
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
  padding: 9px 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.twc-bubble--agent {
  align-self: flex-start;
  background: #f1f1f1;
  color: #1f1f1f;
}

.twc-bubble--visitor {
  align-self: flex-end;
  background: var(--twc-accent, #6264a7);
  color: #fff;
}

.twc-form {
  border-top: 1px solid #e6e6e6;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.twc-form input,
.twc-form textarea {
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  box-sizing: border-box;
  font: inherit;
  padding: 9px 10px;
  width: 100%;
}

.twc-form textarea {
  resize: vertical;
}

.twc-send:disabled {
  cursor: progress;
  opacity: 0.7;
}

@media (max-width: 480px) {
  .twc-widget {
    bottom: 16px;
    left: 16px;
    right: 16px;
  }

  .twc-panel {
    bottom: 56px;
    left: 0;
    right: 0;
    width: 100%;
  }

  .twc-widget--inline {
    left: auto;
    right: auto;
  }
}
