.jb-live-chat-wrap h1 {
  margin-bottom: 16px;
}

.jb-live-chat-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  min-height: 600px;
}

.jb-queue-panel {
  flex: 0 0 320px;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.jb-queue-panel__header {
  padding: 12px 16px;
  border-bottom: 1px solid #c3c4c7;
  background: #f6f7f7;
}
.jb-queue-panel__header h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.jb-queue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #d63638;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.jb-queue-empty {
  padding: 16px;
  color: #646970;
  font-style: italic;
  margin: 0;
}

.jb-queue-card {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  border-left: 3px solid transparent;
  transition: background 0.15s;
}
.jb-queue-card:last-child {
  border-bottom: none;
}
.jb-queue-card:hover {
  background: #f9f9f9;
}
.jb-queue-card--waiting {
  border-left-color: #d63638;
}
.jb-queue-card--active {
  border-left-color: #00a32a;
}
.jb-queue-card--selected {
  background: #f0f7ff;
  border-left-color: #2271b1;
}
.jb-queue-card__info {
  margin-bottom: 8px;
}
.jb-queue-card__name {
  display: block;
  font-size: 13px;
  color: #1d2327;
}
.jb-queue-card__email {
  display: block;
  font-size: 12px;
  color: #646970;
  margin-top: 2px;
}
.jb-queue-card__footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.jb-queue-card__time {
  font-size: 11px;
  color: #8c8f94;
  margin-left: auto;
}

.jb-status-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.jb-status-chip--waiting {
  background: #fce9e9;
  color: #8a1010;
}
.jb-status-chip--active {
  background: #edfaef;
  color: #0a5c1e;
}
.jb-status-chip--closed {
  background: #f0f0f1;
  color: #50575e;
}

.jb-chat-panel {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 80vh;
  max-height: 720px;
}
.jb-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #c3c4c7;
  background: #f6f7f7;
  flex-shrink: 0;
}

.jb-chat-visitor-info strong {
  display: block;
  font-size: 14px;
  color: #1d2327;
}
.jb-chat-visitor-info span {
  font-size: 12px;
  color: #646970;
}

.jb-chat-messages {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f6f7f7;
}

.jb-prior-label,
.jb-live-divider {
  text-align: center;
  font-size: 11px;
  color: #8c8f94;
  margin: 4px 0;
}
.jb-prior-label::before, .jb-prior-label::after,
.jb-live-divider::before,
.jb-live-divider::after {
  content: "";
  display: inline-block;
  width: 20%;
  height: 1px;
  background: #c3c4c7;
  vertical-align: middle;
  margin: 0 8px;
}

.jb-msg {
  display: flex;
  flex-direction: column;
  max-width: 72%;
}
.jb-msg span {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}
.jb-msg time.jb-msg__time {
  font-size: 10px;
  color: #8c8f94;
  margin-top: 3px;
  padding: 0 4px;
}
.jb-msg--visitor {
  align-self: flex-start;
  align-items: flex-start;
}
.jb-msg--visitor span {
  background: #fff;
  border: 1px solid #dcdcde;
  color: #1d2327;
  border-bottom-left-radius: 4px;
}
.jb-msg--operator {
  align-self: flex-end;
  align-items: flex-end;
}
.jb-msg--operator span {
  background: #2271b1;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.jb-msg--operator .jb-msg__time {
  text-align: right;
}
.jb-msg--prior span {
  opacity: 0.6;
  font-size: 12px;
}
.jb-msg--prior.jb-msg--bot span {
  background: #e8e8e8;
  color: #50575e;
  border: none;
}

.jb-chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #c3c4c7;
  background: #fff;
  flex-shrink: 0;
  align-items: flex-end;
}
.jb-chat-input-area textarea {
  flex: 1 1 0;
  resize: none;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  min-height: 38px;
  max-height: 120px;
}
.jb-chat-input-area textarea:focus {
  border-color: #2271b1;
  box-shadow: 0 0 0 1px #2271b1;
  outline: none;
}
.jb-chat-input-area .button {
  flex-shrink: 0;
}

.jb-menu-badge {
  display: inline-block;
  vertical-align: text-bottom;
  margin-left: 4px;
}
.jb-menu-badge .plugin-count {
  padding: 0 5px;
  min-width: 16px;
}

@media screen and (max-width: 960px) {
  .jb-live-chat-layout {
    flex-direction: column;
  }
  .jb-queue-panel {
    flex: none;
    width: 100%;
  }
  .jb-chat-panel {
    height: 560px;
  }
}
.message-agent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.message-agent .message-agent__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2271b1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.message-agent .message-agent__avatar::after {
  content: "A";
}
.message-agent > :not(figure) {
  background: #eaf3fb;
  color: #1d2327;
  border: 1px solid #c4ddf3;
  border-radius: 0 14px 14px 14px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  max-width: 80%;
  word-break: break-word;
}

.message-live-status {
  text-align: center;
  font-size: 12px;
  color: #646970;
  font-style: italic;
  padding: 6px 12px;
  margin: 4px auto;
  background: #f6f7f7;
  border-radius: 20px;
  max-width: 90%;
}