:root {
  --aria-gold: #c9a84c;
  --aria-cream: #f5f0e6;
  --aria-muted: rgba(245, 240, 230, .68);
  --aria-bg: #050b16;
  --aria-panel: #091427;
  --aria-line: rgba(201, 168, 76, .2);
}

.aria-chat-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2147483000;
  font-family: Inter, Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--aria-cream);
}

.aria-chat-root * {
  box-sizing: border-box;
}

.aria-chat-toggle {
  position: relative;
  width: 66px;
  height: 66px;
  border: 1px solid rgba(226, 196, 108, .72);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #ead47a, var(--aria-gold) 48%, #866d2a);
  color: #050b16;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .42), 0 0 0 8px rgba(201, 168, 76, .12);
  font-weight: 900;
  letter-spacing: .08em;
  transition: transform .2s ease, box-shadow .2s ease;
}

.aria-chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(0, 0, 0, .48), 0 0 0 10px rgba(201, 168, 76, .14);
}

.aria-chat-nudge {
  position: absolute;
  right: 76px;
  bottom: 8px;
  display: none;
  width: min(260px, calc(100vw - 108px));
  border: 1px solid rgba(226, 196, 108, .48);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(9, 20, 39, .96), rgba(5, 11, 22, .96)),
    radial-gradient(circle at 12% 18%, rgba(226, 196, 108, .22), transparent 44%);
  color: rgba(245, 240, 230, .9);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .4);
  cursor: pointer;
  font: 800 .76rem/1.25 Montserrat, Inter, sans-serif;
  letter-spacing: .04em;
  padding: 12px 14px;
  text-align: left;
  text-transform: uppercase;
}

.aria-chat-root[data-nudge="true"][data-open="false"] .aria-chat-nudge {
  display: block;
  animation: aria-nudge-rise .24s ease both;
}

.aria-chat-nudge:hover {
  border-color: rgba(226, 196, 108, .78);
  color: #fff;
}

.aria-chat-toggle::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 1px solid rgba(226, 196, 108, .18);
  opacity: .75;
  animation: aria-soft-pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

.aria-chat-root[data-open="true"] .aria-chat-toggle {
  opacity: 0;
  pointer-events: none;
  transform: scale(.88);
}

.aria-chat-panel {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: min(420px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 120px));
  min-height: 520px;
  border: 1px solid var(--aria-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(9, 20, 39, .98), rgba(5, 11, 22, .98));
  box-shadow: 0 28px 70px rgba(0, 0, 0, .58);
  overflow: hidden;
  display: none;
  grid-template-rows: auto auto 1fr auto;
}

.aria-chat-root[data-open="true"] .aria-chat-panel {
  display: grid;
}

.aria-chat-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--aria-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(5, 11, 22, .78);
}

.aria-chat-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.aria-chat-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(201, 168, 76, .45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--aria-gold);
  font-family: Georgia, serif;
  font-weight: 700;
  background: #050b16;
}

.aria-chat-title {
  min-width: 0;
}

.aria-chat-title strong {
  display: block;
  font-family: Montserrat, Inter, sans-serif;
  font-size: .82rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #fff;
}

.aria-chat-title span {
  display: block;
  color: var(--aria-muted);
  font-size: .82rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aria-chat-close,
.aria-chat-reset {
  border: 1px solid rgba(201, 168, 76, .2);
  background: rgba(5, 11, 22, .62);
  color: rgba(245, 240, 230, .78);
  border-radius: 4px;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  cursor: pointer;
  font-size: .78rem;
}

.aria-chat-close:hover,
.aria-chat-reset:hover {
  color: #fff;
  border-color: rgba(201, 168, 76, .5);
}

.aria-chat-avatar {
  position: relative;
  height: 210px;
  margin: 14px 14px 0;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, .2);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 40%, rgba(201, 168, 76, .15), transparent 32%),
    linear-gradient(135deg, #050b16, #091427 58%, #03070e);
}

.aria-chat-avatar::before,
.aria-chat-avatar::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: .7rem;
  z-index: 2;
  width: 1px;
  height: 42%;
  background: linear-gradient(180deg, transparent, rgba(201, 168, 76, .48), transparent);
  box-shadow:
    -34px 0 0 rgba(201, 168, 76, .16),
    34px 0 0 rgba(201, 168, 76, .16),
    -68px 0 0 rgba(201, 168, 76, .08),
    68px 0 0 rgba(201, 168, 76, .08);
  pointer-events: none;
}

.aria-chat-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.aria-chat-avatar-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(circle at 50% 42%, transparent 0%, rgba(5, 11, 22, .06) 42%, rgba(5, 11, 22, .52) 100%),
    linear-gradient(180deg, transparent 38%, rgba(5, 11, 22, .34) 76%, rgba(5, 11, 22, .9) 100%);
}

.aria-chat-avatar-status {
  position: absolute;
  left: 15px;
  bottom: 15px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.aria-chat-avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3ed36a;
  box-shadow: 0 0 18px #3ed36a;
}

.aria-chat-avatar-name {
  position: absolute;
  right: 18px;
  bottom: 14px;
  z-index: 3;
  color: var(--aria-gold);
  font-family: Georgia, serif;
  font-size: 1.6rem;
  letter-spacing: .18em;
}

.aria-chat-log {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, .45) transparent;
}

.aria-chat-bubble {
  max-width: 88%;
  border: 1px solid rgba(201, 168, 76, .14);
  border-radius: 8px;
  padding: 10px 11px;
  font-size: .94rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.aria-chat-bubble[data-role="assistant"] {
  align-self: flex-start;
  background: rgba(9, 20, 39, .88);
  color: rgba(245, 240, 230, .86);
}

.aria-chat-bubble[data-role="user"] {
  align-self: flex-end;
  background: rgba(201, 168, 76, .16);
  color: #fff;
  border-color: rgba(201, 168, 76, .34);
}

.aria-chat-chips {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 2px;
}

.aria-chat-chip {
  width: 100%;
  border: 1px solid rgba(201, 168, 76, .2);
  background: rgba(5, 11, 22, .72);
  color: rgba(245, 240, 230, .78);
  border-radius: 4px;
  padding: 10px 11px;
  text-align: left;
  cursor: pointer;
  font-size: .86rem;
  line-height: 1.35;
}

.aria-chat-chip:hover {
  color: #fff;
  border-color: rgba(201, 168, 76, .48);
}

.aria-chat-status {
  padding: 9px 16px 0;
  color: rgba(245, 240, 230, .56);
  font-size: .78rem;
  line-height: 1.35;
  min-height: 24px;
}

.aria-chat-composer {
  border-top: 1px solid var(--aria-line);
  padding: 0 14px 14px;
  background: rgba(5, 11, 22, .82);
}

.aria-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
}

.aria-chat-input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  border: 1px solid rgba(201, 168, 76, .22);
  border-radius: 4px;
  resize: none;
  background: #050b16;
  color: #fff;
  padding: 11px 12px;
  outline: none;
  font: 500 .94rem/1.45 Inter, system-ui, sans-serif;
}

.aria-chat-input:focus {
  border-color: rgba(226, 196, 108, .78);
  box-shadow: 0 0 0 3px rgba(201, 168, 76, .12);
}

.aria-chat-send {
  border: 0;
  border-radius: 4px;
  min-height: 44px;
  padding: 0 16px;
  background: linear-gradient(135deg, #c9a84c, #e2c46c);
  color: #050b16;
  font-family: Montserrat, Inter, sans-serif;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

.aria-chat-send:disabled {
  opacity: .55;
  cursor: progress;
}

.aria-chat-footnote {
  margin: 9px 0 0;
  color: rgba(245, 240, 230, .42);
  font-size: .72rem;
  line-height: 1.4;
}

.aria-scroll-top {
  position: fixed;
  right: 104px;
  bottom: 32px;
  z-index: 2147482999;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(226, 196, 108, .62);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(9, 20, 39, .94), rgba(5, 11, 22, .96)),
    radial-gradient(circle at 30% 18%, rgba(226, 196, 108, .32), transparent 48%);
  color: #e2c46c;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .36), inset 0 0 0 1px rgba(255, 255, 255, .04);
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.94);
  transition: opacity .22s ease, transform .22s ease, border-color .22s ease, color .22s ease;
}

.aria-scroll-top[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.aria-scroll-top:hover {
  color: #050b16;
  border-color: rgba(226, 196, 108, .9);
  background: linear-gradient(135deg, #c9a84c, #e2c46c);
}

@keyframes aria-soft-pulse {
  0%, 100% {
    transform: scale(.92);
    opacity: .12;
  }
  50% {
    transform: scale(1.06);
    opacity: .48;
  }
}

@keyframes aria-nudge-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .aria-chat-root {
    right: 10px;
    bottom: 10px;
  }

  .aria-chat-toggle {
    width: 52px;
    height: 52px;
    font-size: .82rem;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .4), 0 0 0 6px rgba(201, 168, 76, .1);
  }

  .aria-chat-nudge {
    display: none !important;
  }

  .aria-scroll-top {
    right: 84px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }

  .aria-chat-panel {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
    min-height: 0;
    bottom: 82px;
  }

  .aria-chat-avatar {
    height: 150px;
  }

  .aria-chat-avatar-name {
    display: none;
  }
}
