
.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  font-family: Inter, sans-serif;
}

.chat-label {
  padding: 8px 12px;
  border: 1px solid rgba(156, 124, 255, 0.3);
  border-radius: 10px;
  background: #11141c;
  color: #f5f7ff;
  font-size: 12px;
}

.chat-button {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #03be2c;
  color: white;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.chat-button:hover {
  transform: translateY(-2px);
}

.chat-button:focus-visible,
.chat-close:focus-visible,
.chat-send:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.nodecore-chat-panel {
  width: min(360px, calc(100vw - 32px));
  height: min(500px, 70vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #303645;
  border-radius: 18px;
  background: whitesmoke;
  color: #f5f7ff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.nodecore-chat-panel[hidden] {
  display: none;
}

.nodecore-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #04b922f8;
  border-bottom: 1px solid #303645;
}

.nodecore-chat-header h2 {
  margin: 0;
  font-size: 16px;
}

.nodecore-chat-subtitle {
  margin: 5px 0 0;
  color: #aab2c5;
  font-size: 12px;
}

.chat-close {
  width: 34px;
  height: 34px;
  border: 1px solid #394153;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.nodecore-chat-status {
  padding: 9px 14px;
  background: #03be2c;
  color: #b8a5ff;
  font-size: 11px;
  line-height: 1.5;
}

.nodecore-chat-messages {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 14px;
}

.nodecore-chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  overflow-wrap: anywhere;
}

.visitor-message {
  align-self: flex-end;
  background: #03be2c;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.admin-message {
  align-self: flex-start;
  background: black;
  border: 1px solid #30394b;
  color: #f5f7ff;
  border-bottom-left-radius: 4px;
}

.nodecore-chat-sender {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.8;
}

.nodecore-chat-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.5;
}

.nodecore-chat-empty {
  margin: auto 0;
  color: #aab2c5;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
}

.nodecore-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #03be2c;
  border-top: 1px solid #303645;
}

.nodecore-chat-input {
  min-width: 0;
  flex: 1;
  padding: 12px;
  border: 1px solid #394153;
  border-radius: 10px;
  background: whitesmoke;
  color: #0c0c0c;
  font: inherit;
  font-size: 13px;
}

.nodecore-chat-input:focus {
  outline: 2px solid #9c7cff;
  outline-offset: 1px;
}

.chat-send {
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #03be2c;
  color: #090b10;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .chat-widget {
    right: 14px;
    bottom: 14px;
  }

  .nodecore-chat-panel {
    width: calc(100vw - 28px);
    height: min(68vh, 500px);
  }
}
