#atlas-live-chat-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: inherit;
  color: #102033;
  pointer-events: none;
}

#atlas-live-chat-root * {
  box-sizing: border-box;
}

.atlas-chat-bubble,
.atlas-chat-panel {
  pointer-events: auto;
}

.atlas-chat-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  max-width: calc(100vw - 24px);
  padding: 0 16px 0 13px;
  border: 1px solid rgba(92, 218, 229, 0.52);
  border-radius: 999px;
  background: #101722;
  color: #f8fbff;
  box-shadow: 0 18px 52px rgba(4, 13, 24, 0.36);
  cursor: pointer;
  font: inherit;
}

.atlas-chat-bubble:hover {
  transform: translateY(-1px);
}

.atlas-chat-bubble-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffffff, #67e3ef 34%, #6b7cff 65%, #101722 100%);
  box-shadow: 0 0 18px rgba(92, 218, 229, 0.78);
}

.atlas-chat-bubble-text {
  display: grid;
  gap: 1px;
  text-align: left;
}

.atlas-chat-bubble-title {
  font-weight: 800;
  line-height: 1.05;
}

.atlas-chat-bubble-badge {
  color: #a9e8ef;
  font-size: 0.76rem;
  line-height: 1.05;
}

.atlas-chat-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto auto;
  width: min(420px, calc(100vw - 24px));
  max-height: min(720px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid rgba(130, 150, 170, 0.34);
  border-radius: 14px;
  background: #f9fbff;
  color: #101722;
  box-shadow: 0 24px 78px rgba(4, 13, 24, 0.36);
}

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

.atlas-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #101722;
  color: #f8fbff;
}

.atlas-chat-head strong,
.atlas-chat-head span {
  display: block;
}

.atlas-chat-head span {
  margin-top: 3px;
  color: #a9e8ef;
  font-size: 0.82rem;
}

.atlas-chat-head button,
.atlas-chat-compose button,
.atlas-chat-chips button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.atlas-chat-head button {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.atlas-chat-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: #eef5f7;
}

.atlas-chat-meta input,
.atlas-chat-meta select,
.atlas-chat-compose textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #ccd8df;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
  background: #fff;
  color: #101722;
}

.atlas-chat-meta select {
  grid-column: 1 / -1;
}

.atlas-chat-chips {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
}

.atlas-chat-chips button {
  flex: 0 0 auto;
  padding: 8px 10px;
  background: #e7edf8;
  color: #182233;
}

.atlas-chat-messages {
  min-height: 180px;
  overflow-y: auto;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f4f8fb);
}

.atlas-chat-message {
  max-width: 86%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e8eff8;
}

.atlas-chat-message span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #516173;
}

.atlas-chat-message p {
  margin: 0;
  line-height: 1.45;
}

.atlas-chat-message.visitor {
  margin-left: auto;
  background: #102238;
  color: #fff;
}

.atlas-chat-message.visitor span {
  color: #bfe5ef;
}

.atlas-chat-safety {
  margin: 0;
  padding: 8px 12px;
  color: #657386;
  font-size: 0.82rem;
  line-height: 1.35;
}

.atlas-chat-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #dae4ec;
}

.atlas-chat-compose button {
  min-width: 72px;
  background: #1f6feb;
  color: #fff;
  font-weight: 800;
}

@media (max-width: 640px) {
  #atlas-live-chat-root {
    right: 12px;
    bottom: 12px;
  }

  .atlas-chat-panel {
    right: 0;
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 40px);
  }

  .atlas-chat-meta {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-chat-bubble {
    transition: none;
  }

  .atlas-chat-bubble:hover {
    transform: none;
  }
}
