.ayta,
.ayta * {
  box-sizing: border-box;
}

.ayta {
  --ayta-bg: #060912;
  --ayta-panel: #0e121d;
  --ayta-panel-2: #141925;
  --ayta-ink: #f5f7fb;
  --ayta-muted: #9098aa;
  --ayta-line: rgba(164, 179, 211, 0.18);
  --ayta-cyan: #2ed9ed;
  --ayta-cyan-dark: #0c8090;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999998;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ayta-ink);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.ayta button,
.ayta input {
  font: inherit;
}

.ayta button,
.ayta a {
  -webkit-tap-highlight-color: transparent;
}

.ayta [hidden] {
  display: none !important;
}

.ayta .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ayta__launcher {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  min-width: 60px;
  height: 60px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgba(46, 217, 237, 0.42);
  border-radius: 20px;
  background: linear-gradient(145deg, #133140, #0c1827);
  color: var(--ayta-ink);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.42), 0 0 35px rgba(46, 217, 237, 0.13);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ayta__launcher:hover {
  transform: translateY(-3px);
  border-color: var(--ayta-cyan);
  box-shadow: 0 22px 65px rgba(0, 0, 0, 0.48), 0 0 40px rgba(46, 217, 237, 0.22);
}

.ayta__launcher-avatar,
.ayta__avatar {
  display: grid;
  place-items: center;
  color: #061016;
  background: linear-gradient(145deg, #64e9ff, #39a8ff);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.ayta__launcher-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 13px;
}

.ayta__launcher-dot,
.ayta__presence {
  position: absolute;
  border-radius: 50%;
  background: #23d381;
  border: 2px solid var(--ayta-bg);
  box-shadow: 0 0 12px rgba(35, 211, 129, 0.65);
}

.ayta__launcher-dot {
  right: 5px;
  bottom: 5px;
  width: 12px;
  height: 12px;
}

.ayta__nudge {
  position: absolute;
  right: 70px;
  bottom: 10px;
  width: max-content;
  max-width: 210px;
  padding: 10px 14px;
  border: 1px solid var(--ayta-line);
  border-radius: 13px;
  color: var(--ayta-ink);
  background: rgba(14, 18, 29, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  font-weight: 750;
  animation: ayta-nudge-in 0.28s ease both;
}

.ayta__panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(420px, calc(100vw - 28px));
  height: min(670px, calc(100dvh - 112px));
  min-height: 480px;
  overflow: hidden;
  border: 1px solid rgba(119, 150, 198, 0.28);
  border-radius: 30px;
  color: var(--ayta-ink);
  background:
    radial-gradient(circle at 8% 0, rgba(46, 217, 237, 0.11), transparent 28%),
    var(--ayta-bg);
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.58), inset 0 0 0 7px rgba(14, 20, 34, 0.72);
  opacity: 0;
  transform: translateY(18px) scale(0.975);
  transform-origin: right bottom;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.ayta.is-open .ayta__panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ayta__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 16px 18px 15px;
  border-bottom: 1px solid var(--ayta-line);
  background: rgba(6, 9, 18, 0.88);
}

.ayta__identity {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ayta__avatar {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;
  border: 3px solid #112639;
  border-radius: 50%;
  font-size: 12px;
  box-shadow: 0 0 0 1px rgba(46, 217, 237, 0.35);
}

.ayta__presence {
  left: 35px;
  top: 32px;
  width: 11px;
  height: 11px;
}

.ayta__identity div {
  display: grid;
  min-width: 0;
}

.ayta__identity strong {
  overflow: hidden;
  color: var(--ayta-ink);
  font-size: 15px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ayta__identity span:last-child {
  overflow: hidden;
  color: var(--ayta-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ayta__close {
  position: relative;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ayta-muted);
  background: transparent;
  cursor: pointer;
}

.ayta__close:hover {
  color: var(--ayta-ink);
  border-color: var(--ayta-line);
  background: var(--ayta-panel);
}

.ayta__close::before,
.ayta__close::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 1.5px;
  border-radius: 3px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.ayta__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ayta__messages {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 18px 8px;
  scrollbar-color: rgba(119, 150, 198, 0.48) transparent;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.ayta__messages::-webkit-scrollbar {
  width: 6px;
}

.ayta__messages::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(119, 150, 198, 0.42);
}

.ayta__message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 12px;
  animation: ayta-message-in 0.22s ease both;
}

.ayta__message.is-user {
  align-items: flex-end;
}

.ayta__bubble {
  max-width: 87%;
  padding: 13px 15px;
  border: 1px solid var(--ayta-line);
  border-radius: 18px 18px 18px 7px;
  color: var(--ayta-ink);
  background: var(--ayta-panel-2);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
}

.ayta__message.is-user .ayta__bubble {
  border-color: var(--ayta-cyan);
  border-radius: 18px 18px 7px 18px;
  color: #041014;
  background: var(--ayta-cyan);
}

.ayta__actions {
  display: grid;
  width: min(100%, 340px);
  gap: 9px;
  margin-top: 10px;
}

.ayta__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--ayta-line);
  border-radius: 15px;
  color: var(--ayta-ink) !important;
  background: var(--ayta-panel-2);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.ayta__action::after {
  content: "↗";
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 12px;
  border-radius: 50%;
  color: var(--ayta-muted);
  background: rgba(255, 255, 255, 0.04);
}

.ayta__action:hover {
  transform: translateY(-1px);
  border-color: rgba(46, 217, 237, 0.48);
  background: #171e2c;
}

.ayta__action.is-primary {
  color: #041014 !important;
  border-color: var(--ayta-cyan);
  background: var(--ayta-cyan);
}

.ayta__action.is-primary::after {
  color: #041014;
  background: rgba(4, 16, 20, 0.1);
}

.ayta__typing {
  flex-direction: row;
  gap: 5px;
  width: 58px;
  padding: 14px 15px;
  border: 1px solid var(--ayta-line);
  border-radius: 17px 17px 17px 7px;
  background: var(--ayta-panel-2);
}

.ayta__typing i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ayta-muted);
  animation: ayta-typing 1s ease-in-out infinite;
}

.ayta__typing i:nth-child(2) {
  animation-delay: 0.14s;
}

.ayta__typing i:nth-child(3) {
  animation-delay: 0.28s;
}

.ayta__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 116px;
  overflow-y: auto;
  padding: 8px 18px 13px;
}

.ayta__quick:empty {
  display: none;
}

.ayta__quick button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(46, 217, 237, 0.5);
  border-radius: 999px;
  color: var(--ayta-cyan);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.ayta__quick button:hover {
  color: #041014;
  background: var(--ayta-cyan);
}

.ayta__composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ayta-line);
  background: rgba(6, 9, 18, 0.96);
}

.ayta__composer input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 17px;
  outline: 0;
  color: var(--ayta-ink);
  background: var(--ayta-panel-2);
  box-shadow: none;
  font-size: 14px;
}

.ayta__composer input::placeholder {
  color: #6f778a;
}

.ayta__composer input:focus {
  border-color: rgba(46, 217, 237, 0.6);
  box-shadow: 0 0 0 3px rgba(46, 217, 237, 0.1);
}

.ayta__composer button {
  display: grid;
  place-items: center;
  width: 48px;
  min-width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(46, 217, 237, 0.4);
  border-radius: 17px;
  color: #041014;
  background: var(--ayta-cyan);
  cursor: pointer;
}

.ayta__composer button span {
  display: block;
  transform: rotate(-18deg) translate(1px, -1px);
  font-size: 17px;
  line-height: 1;
}

@keyframes ayta-message-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ayta-typing {
  0%, 70%, 100% { transform: translateY(0); opacity: 0.4; }
  35% { transform: translateY(-4px); opacity: 1; }
}

@keyframes ayta-nudge-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 560px) {
  .ayta {
    right: 10px;
    bottom: 10px;
  }

  .ayta__launcher {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .ayta__launcher-avatar {
    width: 39px;
    height: 39px;
    border-radius: 13px;
  }

  .ayta__panel {
    position: fixed;
    right: 7px;
    bottom: 74px;
    width: calc(100vw - 14px);
    height: min(680px, calc(100dvh - 82px));
    min-height: 430px;
    border-radius: 25px;
  }

  .ayta__header {
    min-height: 74px;
    padding: 13px 14px;
  }

  .ayta__messages {
    padding: 15px 14px 6px;
  }

  .ayta__quick {
    padding: 7px 14px 11px;
  }

  .ayta__composer {
    padding: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ayta *,
  .ayta *::before,
  .ayta *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
