/* Atlas Guide chatbot */
#atlas-chat {
  position: fixed;
  z-index: 9999;
  inset: auto 1.1rem 1.1rem auto;
  font-family: var(--font-body);
  pointer-events: none;
}

#atlas-chat .atlas-chat__fab,
#atlas-chat .atlas-chat__panel {
  pointer-events: auto;
}

html[dir="rtl"] #atlas-chat {
  inset: auto auto 1.1rem 1.1rem;
}

.atlas-chat__fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 12px 32px rgba(28, 24, 20, 0.35);
  cursor: pointer;
  transition: transform 0.25s var(--ease, ease), box-shadow 0.25s ease;
}

.atlas-chat__fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 16px 40px rgba(28, 24, 20, 0.42);
}

.atlas-chat__fab-label {
  display: none !important;
}

.atlas-chat__fab-mark,
.atlas-chat__head-mark {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #f7f4ef;
  border: 2.5px solid #c9a227;
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.2);
  flex-shrink: 0;
  overflow: hidden;
}

.atlas-chat__fab-mark svg,
.atlas-chat__head-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.atlas-chat__head-mark {
  width: 2.6rem;
  height: 2.6rem;
  border-width: 2px;
  box-shadow: none;
}

.atlas-chat__panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  right: 0;
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(560px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid rgba(201, 162, 39, 0.35);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

html[dir="rtl"] .atlas-chat__panel {
  right: auto;
  left: 0;
}

.atlas-chat__panel.is-hidden {
  display: none;
}

.atlas-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1rem 0.85rem;
  background: linear-gradient(120deg, rgba(31, 77, 58, 0.92), rgba(26, 58, 107, 0.9));
  color: #f7f4ef;
}

.atlas-chat__head > div {
  flex: 1;
  min-width: 0;
}

.atlas-chat__head-avatar {
  display: none;
}

.atlas-chat__eyebrow {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.atlas-chat__head h2 {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.atlas-chat__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.atlas-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--paper-warm);
  min-height: 220px;
}

.atlas-chat__bubble {
  max-width: 92%;
  padding: 0.7rem 0.85rem;
  line-height: 1.55;
  font-size: 0.92rem;
  color: var(--ink);
}

.atlas-chat__bubble a {
  color: var(--cobalt-bright);
  text-decoration: underline;
}

.atlas-chat__bubble--user {
  align-self: flex-end;
  background: #fff;
  border: 1px solid rgba(201, 162, 39, 0.35);
}

.atlas-chat__bubble--assistant {
  align-self: flex-start;
  background: rgba(31, 77, 58, 0.08);
  border: 1px solid rgba(31, 77, 58, 0.18);
}

.atlas-chat__thinking {
  opacity: 0.7;
  font-style: italic;
}

.atlas-chat__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  background: var(--paper);
}

.atlas-chat__form input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(201, 162, 39, 0.35);
  background: #fff;
  padding: 0.65rem 0.75rem;
  font: inherit;
}

.atlas-chat__form .btn {
  flex-shrink: 0;
}

@media (max-width: 520px) {
  .atlas-chat__fab,
  .atlas-chat__fab-mark {
    width: 3.6rem;
    height: 3.6rem;
  }
}
