.neuro-ai {
  --ai-ink: #08111f;
  --ai-deep: #0d1d34;
  --ai-electric: #3e63ff;
  --ai-cyan: #49d7ff;
  --ai-copper: #f2a65a;
  --ai-paper: #edf2f8;
  --ai-white: #ffffff;
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  color: var(--ai-white);
  font-family: Arial, sans-serif;
}

.neuro-ai *,
.neuro-ai *::before,
.neuro-ai *::after {
  box-sizing: border-box;
}

.neuro-ai__launcher {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 58px;
  padding: 9px 17px 9px 10px;
  border: 1px solid rgba(73, 215, 255, 0.54);
  border-radius: 17px;
  color: var(--ai-white);
  background: rgba(8, 17, 31, 0.94);
  box-shadow: 0 16px 48px rgba(3, 10, 24, 0.34);
  cursor: pointer;
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, border-color 180ms ease;
}

.neuro-ai__launcher:hover {
  transform: translateY(-2px);
  border-color: var(--ai-cyan);
}

.neuro-ai__launcher > span:last-child {
  display: grid;
  gap: 1px;
  text-align: left;
}

.neuro-ai__launcher b {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.neuro-ai__launcher small {
  color: #9aabc2;
  font-size: 11px;
}

.neuro-ai__spark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: var(--ai-ink);
  background: linear-gradient(145deg, var(--ai-cyan), var(--ai-copper));
  font-size: 19px;
}

.neuro-ai__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 32px));
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(73, 215, 255, 0.34);
  border-radius: 24px;
  color: var(--ai-white);
  background:
    radial-gradient(circle at 100% 0, rgba(62, 99, 255, 0.26), transparent 38%),
    var(--ai-ink);
  box-shadow: 0 28px 90px rgba(3, 10, 24, 0.48);
}

.neuro-ai__panel[hidden] {
  display: none;
}

.neuro-ai__signal {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ai-electric), var(--ai-cyan), var(--ai-copper), var(--ai-electric));
  background-size: 220% 100%;
  animation: neuro-ai-signal 5s linear infinite;
}

.neuro-ai__header {
  display: flex;
  min-height: 94px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 17px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
}

.neuro-ai__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--ai-cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.neuro-ai__header h2 {
  margin: 0;
  color: var(--ai-white);
  font: 600 22px/1.08 Georgia, serif;
}

.neuro-ai__close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: var(--ai-white);
  background: rgba(255, 255, 255, 0.06);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.neuro-ai__messages {
  display: flex;
  min-height: 160px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 18px 18px 24px;
  scrollbar-color: rgba(73, 215, 255, 0.42) transparent;
}

.neuro-ai__message {
  display: grid;
  max-width: 88%;
  gap: 8px;
}

.neuro-ai__message p {
  margin: 0;
  padding: 12px 14px;
  border-radius: 15px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.48;
}

.neuro-ai__message--assistant {
  align-self: flex-start;
}

.neuro-ai__message--assistant p {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom-left-radius: 4px;
  color: #eaf2fc;
  background: rgba(255, 255, 255, 0.07);
}

.neuro-ai__message--user {
  align-self: flex-end;
}

.neuro-ai__message--user p {
  border-bottom-right-radius: 4px;
  color: var(--ai-ink);
  background: var(--ai-cyan);
}

.neuro-ai__message--pending {
  opacity: 0.68;
}

.neuro-ai__action {
  justify-self: start;
  padding: 10px 13px;
  border-radius: 11px;
  color: var(--ai-white);
  background: var(--ai-electric);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.neuro-ai__consent {
  align-self: end;
  margin: 18px;
  padding: 18px;
  border: 1px solid rgba(242, 166, 90, 0.28);
  border-radius: 17px;
  background: rgba(13, 29, 52, 0.9);
}

.neuro-ai__consent[hidden],
.neuro-ai__form[hidden] {
  display: none;
}

.neuro-ai__consent p {
  margin: 0 0 11px;
  color: #d7e1ee;
  font-size: 13px;
  line-height: 1.48;
}

.neuro-ai__consent .neuro-ai__legal {
  color: #9aabc2;
  font-size: 11px;
}

.neuro-ai__legal a {
  color: var(--ai-cyan);
}

.neuro-ai__start {
  width: 100%;
  padding: 12px 15px;
  border: 0;
  border-radius: 12px;
  color: var(--ai-ink);
  background: linear-gradient(110deg, var(--ai-cyan), #8ce9ff);
  font-weight: 800;
  cursor: pointer;
}

.neuro-ai__form {
  padding: 12px 15px 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(8, 17, 31, 0.94);
}

.neuro-ai__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.neuro-ai__composer {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
  align-items: end;
}

.neuro-ai__composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 112px;
  resize: none;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  outline: none;
  color: var(--ai-white);
  background: rgba(255, 255, 255, 0.07);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}

.neuro-ai__composer textarea:focus {
  border-color: var(--ai-cyan);
  box-shadow: 0 0 0 3px rgba(73, 215, 255, 0.12);
}

.neuro-ai__composer textarea::placeholder {
  color: #8393a9;
}

.neuro-ai__composer button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  color: var(--ai-ink);
  background: var(--ai-cyan);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.neuro-ai__composer button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.neuro-ai__note {
  display: block;
  margin-top: 7px;
  color: #8393a9;
  font-size: 10px;
}

.neuro-ai button:focus-visible,
.neuro-ai a:focus-visible,
.neuro-ai textarea:focus-visible {
  outline: 3px solid var(--ai-copper);
  outline-offset: 2px;
}

.neuro-ai--open .neuro-ai__launcher {
  visibility: hidden;
}

@keyframes neuro-ai-signal {
  to { background-position: -220% 0; }
}

@media (max-width: 560px) {
  .neuro-ai {
    right: 12px;
    bottom: 12px;
  }

  .neuro-ai__panel {
    position: fixed;
    inset: 8px;
    width: auto;
    height: auto;
    border-radius: 20px;
  }

  .neuro-ai__launcher {
    min-height: 54px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .neuro-ai__signal {
    animation: none;
  }

  .neuro-ai__launcher {
    transition: none;
  }
}
