/* ----------------------------------------------------------
   Scopus Publishers AI + human support widget
   ---------------------------------------------------------- */
.acad-chat-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1100;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy, #2d3142), var(--gold, #ef8354));
  color: #fff;
  box-shadow: 0 16px 38px rgba(32, 37, 34, 0.34);
  font: 700 24px/1 Arial, sans-serif;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.acad-chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(32, 37, 34, 0.4);
}

.acad-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 1100;
  width: min(380px, calc(100vw - 28px));
  height: min(590px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line, #d7cfbf);
  border-radius: 20px;
  background: #fffdf8;
  color: #202522;
  box-shadow: 0 26px 70px rgba(32, 37, 34, 0.28);
  font-family: Arial, Helvetica, sans-serif;
}

.acad-chat-panel[hidden] {
  display: none;
}

.acad-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 17px;
  background: linear-gradient(135deg, var(--navy, #2d3142), var(--gold, #ef8354));
  color: #fff;
}

.acad-chat-header strong {
  display: block;
  font-size: 15px;
}

.acad-chat-status {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.82;
}

.acad-chat-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.acad-chat-start {
  overflow: auto;
  padding: 22px;
}

.acad-chat-start h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.acad-chat-start p {
  margin: 0 0 18px;
  color: #66746b;
  font-size: 14px;
}

.acad-chat-start label {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
  font-size: 13px;
  font-weight: 700;
}

.acad-chat-start input {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #b8aa8e;
  border-radius: 10px;
  font: inherit;
}

.acad-chat-start button,
.acad-chat-send,
.acad-chat-human {
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: var(--navy, #2d3142);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.acad-chat-start button {
  width: 100%;
  margin-top: 4px;
}

.acad-chat-error {
  min-height: 18px;
  margin-top: 10px;
  color: #a23232;
  font-size: 12px;
}

.acad-chat-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.acad-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: var(--cream, #fff4ef);
}

.acad-chat-message {
  max-width: 82%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.42;
}

.acad-chat-message.assistant,
.acad-chat-message.agent {
  border: 1px solid var(--line, #d7cfbf);
  border-bottom-left-radius: 4px;
  background: #fff;
}

.acad-chat-message.agent {
  border-color: #d6b39f;
  background: #fff4ee;
}

.acad-chat-message.visitor {
  margin-left: auto;
  border-bottom-right-radius: 4px;
  background: var(--navy, #2d3142);
  color: #fff;
}

.acad-chat-message small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  opacity: 0.65;
}

.acad-chat-actions {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 0;
  background: #fffdf8;
}

.acad-chat-human {
  padding: 7px 10px;
  background: #e8e0cd;
  color: #202522;
  font-size: 12px;
}

.acad-chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #d7cfbf;
  background: #fffdf8;
}

.acad-chat-composer textarea {
  min-height: 42px;
  max-height: 100px;
  padding: 10px;
  border: 1px solid #b8aa8e;
  border-radius: 10px;
  color: #202522;
  font: inherit;
  resize: none;
}

.acad-chat-send {
  align-self: end;
}

.acad-chat-note {
  padding: 0 12px 10px;
  background: #fffdf8;
  color: #66746b;
  font-size: 11px;
}

.acad-chat-disabled {
  opacity: 0.55;
  pointer-events: none;
}

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

  .acad-chat-panel {
    right: 14px;
    bottom: 82px;
    height: calc(100vh - 100px);
  }
}
