.ai-orb, .ai-orb *, .ai-chat, .ai-chat * {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}


.ai-orb-wrap {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-orb-label {
  padding: 10rem 16rem;
  border-radius: 999px;
  background: radial-gradient(120px 80px at 30% 20%, rgba(255, 255, 255, .10), transparent 60%),
  linear-gradient(135deg, rgba(18, 38, 62, .92), rgba(10, 22, 42, .92));
  border: 1px solid rgba(120, 180, 255, .22);
  box-shadow: 0 0 28px rgba(70, 140, 255, .25),
  inset 0 0 12px rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .92);
  font-weight: 700;
  font-size: 14em;
  letter-spacing: .25px;
  white-space: nowrap;
  opacity: .9;
  transform: translateX(0);
  transition: all .25s ease;
}

.ai-orb-wrap:hover .ai-orb-label {
  opacity: 1;
  transform: translateX(-4px);
  box-shadow: 0 0 40px rgba(90, 160, 255, .45),
  inset 0 0 14px rgba(255, 255, 255, .10);
}

.ai-orb {
  position: relative;
  width: 68rem;
  height: 68rem;
  border-radius: 50%;
  cursor: pointer;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 48%),
  radial-gradient(circle at 70% 78%, rgba(100, 210, 255, .14), rgba(60, 120, 255, 0) 58%),
  radial-gradient(circle at 50% 50%, rgba(60, 120, 255, .62), rgba(10, 18, 36, .94) 70%, rgba(6, 10, 20, .99) 100%);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 0 28px rgba(120, 180, 255, .42),
  0 18px 60px rgba(0, 0, 0, .55),
  inset 0 0 18px rgba(255, 255, 255, .12),
  inset 0 -16px 32px rgba(0, 0, 0, .30);
  animation: orbPulse 3.5s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-orb::before,
.ai-orb::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(120, 180, 255, .28);
  animation: orbRotate 6s linear infinite;
}

.ai-orb::after {
  inset: -18px;
  opacity: .45;
  animation-duration: 10s;
}

.ai-orb .ai-orb__scan {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: conic-gradient(from 180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .14), rgba(255, 255, 255, 0));
  mix-blend-mode: screen;
  opacity: .55;
  animation: orbScan 2.9s linear infinite;
  pointer-events: none;
}

@keyframes orbScan {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes orbRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.ai-orb svg {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, .35)) drop-shadow(0 0 18px rgba(120, 180, 255, .25));
}


.ai-chat {
  position: fixed;
  right: 22px;
  bottom: 104px;
  width: 404px;
  height: 580px;
  max-width: calc(100vw - 44px);
  max-height: calc(100vh - 140px);
  border-radius: 24px;
  z-index: 99999;

  display: none;
  flex-direction: column;
  overflow: hidden;

  background: radial-gradient(900px 520px at 12% 8%, rgb(110 170 255 / 10%), #00000000 55%), radial-gradient(680px 460px at 88% 14%, rgba(120, 255, 230, .07), transparent 60%), radial-gradient(900px 700px at 50% 120%, rgba(60, 120, 255, .10), transparent 55%), linear-gradient(180deg, rgb(10 16 30 / 64%), rgb(6 10 22 / 56%));

  border: 1px solid rgba(160, 200, 255, .14);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 110px rgba(0, 0, 0, .72),
  0 0 0 1px rgba(255, 255, 255, .03) inset;
}

.ai-chat.open {
  display: flex;
  animation: chatIn .22s ease-out;
}

@keyframes chatIn {
  from {
    transform: translateY(14px) scale(.975);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}


.ai-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg,
  rgba(120, 180, 255, .22),
  rgba(255, 255, 255, .06),
  rgba(120, 255, 230, .10),
  rgba(120, 180, 255, .18)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .9;
}

.ai-chat::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  pointer-events: none;
  background: radial-gradient(240px 120px at 20% 0%, rgba(110, 170, 255, .18), transparent 70%);
  filter: blur(10px);
  opacity: .9;
}

/* header */
.ai-chat__head {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  border-bottom: 1px solid rgba(160, 200, 255, .10);
  
}


.ai-chat__head-left {
  flex: 1 1 auto;
  min-width: 0;
}

.ai-chat__title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, .96);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-chat__title::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(0, 255, 140, .75);
  box-shadow: 0 0 14px rgba(0, 255, 140, .25);
  flex: 0 0 auto;
}

.ai-chat__subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(180, 255, 220, .62);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ai-chat__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}

.ai-chat__btn {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .90);
  border-radius: 30px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 550;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}

.ai-chat__btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .10);
  border-color: rgba(160, 200, 255, .20);
}

.ai-chat__btn:active {
  transform: translateY(0);
}

/* body */
.ai-chat__body {
  flex: 1 1 auto;
  position: relative;
  padding: 14px 14px 18px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


.ai-chat__body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .25) 0.6px, transparent 0.7px),
  radial-gradient(circle at 70% 65%, rgba(255, 255, 255, .18) 0.6px, transparent 0.7px);
  background-size: 24px 24px, 30px 30px;
  mix-blend-mode: overlay;
}

.ai-chat__body > * {
  position: relative;
  z-index: 1;
}

.ai-chat__body::-webkit-scrollbar {
  width: 10px;
}

.ai-chat__body::-webkit-scrollbar-thumb {
  background: rgba(160, 200, 255, .18);
  border-radius: 999px;
  border: 3px solid rgba(0, 0, 0, 0);
  background-clip: padding-box;
}

.ai-chat__body::-webkit-scrollbar-thumb:hover {
  background: rgba(160, 200, 255, .26);
}

.ai-chat__body::-webkit-scrollbar-track {
  background: transparent;
}

/* chips */
.ai-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.ai-chip {
  border: 1px solid rgba(160, 200, 255, .14);
  background: radial-gradient(120px 70px at 20% 20%, rgba(120, 180, 255, .12), transparent 60%),
  rgba(255, 255, 255, .04);
  color: rgba(255, 255, 255, .90);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}

.ai-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(160, 200, 255, .22);
  background: radial-gradient(120px 70px at 20% 20%, rgba(120, 180, 255, .18), transparent 60%),
  rgba(255, 255, 255, .07);
}

.ai-chip:active {
  transform: translateY(0);
}

/* messages */
.ai-msg {
  max-width: 78%;
  width: fit-content;
  padding: 10px 12px 12px;
  border-radius: 18px;
  position: relative;
  z-index: 1;
  animation: msgIn .14s ease-out;
}

@keyframes msgIn {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.ai-msg.user {
  align-self: flex-end;
  border-bottom-right-radius: 8px;
}

.ai-msg.bot {
  align-self: flex-start;
  border-bottom-left-radius: 8px;
}


.ai-msg.user {
  background: radial-gradient(140px 110px at 20% 15%, rgba(255, 255, 255, .55), transparent 65%),
  linear-gradient(180deg, #d7e7f7 0%, #bcd2ea 100%);
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .18),
  inset 0 0 0 1px rgba(255, 255, 255, .35);
  color: rgba(14, 22, 38, .92);
}


.ai-msg.bot {
  background: radial-gradient(140px 110px at 20% 15%, rgba(255, 255, 255, .06), transparent 70%),
  linear-gradient(135deg, rgba(18, 27, 45, .92), rgba(14, 22, 38, .92));
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22),
  inset 0 0 0 1px rgba(255, 255, 255, .03);
  color: rgba(235, 240, 255, .95);
}


.ai-msg.user::after,
.ai-msg.bot::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  opacity: .9;
}

.ai-msg.user::after {
  right: -4px;
  transform: rotate(45deg);
  background: rgba(210, 228, 245, .95);
}

.ai-msg.bot::after {
  left: -4px;
  transform: rotate(45deg);
  background: rgba(20, 30, 48, .92);
}

/* from */
.ai-from {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  user-select: none;
  opacity: .92;
}

.ai-from__name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .42px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}

.ai-msg.user .ai-from__name {
  color: rgba(60, 80, 110, .70);
}

.ai-from__time {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .42);
}

.ai-msg.user .ai-from__time {
  color: rgba(60, 80, 110, .45);
}


.ai-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  color: inherit;
}


/* footer */
.ai-chat__foot {
  flex: 0 0 auto;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: stretch;
  border-top: 1px solid rgba(160, 200, 255, .12);
  background: radial-gradient(520px 140px at 18% 0%, rgba(120, 180, 255, .12), transparent 60%),
  radial-gradient(420px 140px at 90% 30%, rgba(120, 255, 230, .06), transparent 62%),
  rgba(255, 255, 255, .03);
  border-radius: 0 0 24px 24px;
}

.ai-input {
  flex: 1;
  height: 50px;
  min-height: 50px;
  max-height: 120px;
  resize: none;
  background: radial-gradient(160px 110px at 20% 20%, rgba(120, 180, 255, .12), transparent 65%),
  rgba(6, 10, 22, .68);
  border: 1px solid rgba(160, 200, 255, .14);
  border-radius: 18px;
  padding: 15px 18px 13px 14px;
  color: rgba(255, 255, 255, .92);
  outline: none;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
  overflow-y: auto;
  overflow-x: hidden;
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
  scrollbar-width: thin;
  scrollbar-color: rgba(160, 200, 255, .28) transparent;
}

.ai-input::placeholder {
  color: rgba(255, 255, 255, .38);
}

.ai-input:focus {
  border-color: rgba(120, 180, 255, .28);
}

.ai-input::-webkit-scrollbar {
  width: 10px;
}

.ai-input::-webkit-scrollbar-track {
  background: transparent;
}

.ai-input::-webkit-scrollbar-thumb {
  background: rgba(160, 200, 255, .22);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.ai-input::-webkit-scrollbar-thumb:hover {
  background: rgba(160, 200, 255, .32);
}

.ai-input::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.ai-send {
  height: 50px;
  width: 52px;
  flex: 0 0 52px;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, .10);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(120px 80px at 30% 20%, rgba(255, 255, 255, .22), transparent 60%),
  linear-gradient(135deg, rgba(120, 255, 230, .92), rgba(60, 140, 255, .92));
  color: #041224;
  font-size: 18px;
  font-weight: 500;
  box-shadow: 0 18px 46px rgba(60, 120, 255, .22),
  0 10px 26px rgba(0, 0, 0, .25),
  inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}

.ai-send:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.ai-send:active {
  transform: translateY(0);
}

/* typing */
.ai-typing {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ai-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  opacity: .35;
  animation: blink 1.2s infinite both;
}

.ai-typing span:nth-child(2) {
  animation-delay: .14s
}

.ai-typing span:nth-child(3) {
  animation-delay: .28s
}

@keyframes blink {
  0%, 100% {
    opacity: .25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

/* toast */
.ai-toast {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 98px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .52);
  border: 1px solid rgba(255, 255, 255, .10);
  color: rgba(255, 255, 255, .90);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all .18s ease;
  z-index: 2;
}

.ai-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* mobile */
@media (max-width: 480px) {
  .ai-chat {
    right: 12px;
    bottom: 96px;
    width: calc(100vw - 24px);
    height: 72vh;
  }

  .ai-msg {
    max-width: 86%;
  }
}