.assistant-box {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease, visibility .35s ease;
}

body.entered .assistant-box {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.assistant-box.is-open .assistant-launcher {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
}

.assistant-launcher {
  min-width: 78px;
  height: 54px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(88, 167, 218, 0.26);
  border-radius: 8px;
  background:
    radial-gradient(circle at top left, rgba(88, 167, 218, 0.18), transparent 42%),
    rgba(5, 5, 5, 0.92);
  color: #F2F3F4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  backdrop-filter: blur(10px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 22px rgba(88, 167, 218, 0.12);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.assistant-launcher::before {
  content: "";
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
  display: inline-block;
  position: relative;
  box-sizing: border-box;
}

.assistant-launcher::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 13px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(36deg);
  background: transparent;
}

.assistant-launcher:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 167, 218, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 26px rgba(88, 167, 218, 0.18);
}

.assistant-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(360px, calc(100vw - 32px));
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity .22s ease, transform .22s ease;
}

.assistant-box.is-open .assistant-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.assistant-shell {
  border: 1px solid rgba(88, 167, 218, 0.16);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(88, 167, 218, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(14, 20, 30, 0.96), rgba(6, 8, 12, 0.96));
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 16px 40px rgba(0, 0, 0, 0.32);
}

.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(88, 167, 218, 0.12);
}

.assistant-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.assistant-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #58A7DA;
  box-shadow: 0 0 12px rgba(88, 167, 218, 0.85);
  flex: 0 0 auto;
}

.assistant-meta {
  min-width: 0;
}

.assistant-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
  color: #F2F3F4;
  letter-spacing: 0.02em;
}

.assistant-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: rgba(242, 243, 244, 0.48);
}

.assistant-close {
  border: 1px solid rgba(88, 167, 218, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(242, 243, 244, 0.76);
  padding: 8px 10px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .25s ease, color .25s ease, transform .25s ease;
}

.assistant-close:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 167, 218, 0.42);
  color: #F2F3F4;
}

.chat-box {
  height: 240px;
  overflow-y: auto;
  padding: 18px;
  border: 1px solid rgba(88, 167, 218, 0.18);
  background:
    radial-gradient(circle at top left, rgba(88, 167, 218, 0.06), transparent 38%),
    rgba(255, 255, 255, 0.02);
  color: rgba(242, 243, 244, 0.86);
  font-size: 0.95rem;
  line-height: 1.7;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 0 18px rgba(88, 167, 218, 0.05);
}

.chat-placeholder {
  color: rgba(242, 243, 244, 0.34);
  font-style: italic;
}

.chat-box p {
  margin: 0 0 12px;
}

.chat-box b {
  color: #58A7DA;
  font-weight: 700;
}

.chat-input-row {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(88, 167, 218, 0.16);
  border-radius: 8px;
  padding: 14px 16px;
  color: #F2F3F4;
  font-size: 0.95rem;
  outline: none;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.chat-input-row input:focus {
  border-color: rgba(88, 167, 218, 0.45);
  box-shadow: 0 0 14px rgba(88, 167, 218, 0.14);
}

.chat-input-row input::placeholder {
  color: rgba(242, 243, 244, 0.34);
  text-transform: lowercase;
}

.chat-input-row button {
  padding: 0 22px;
  border-radius: 8px;
  border: 1px solid rgba(88, 167, 218, 0.22);
  background:
    radial-gradient(circle at top left, rgba(88, 167, 218, 0.16), transparent 40%),
    rgba(255, 255, 255, 0.03);
  color: #F2F3F4;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
}

.chat-input-row button:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 167, 218, 0.42);
  box-shadow: 0 0 14px rgba(88, 167, 218, 0.14);
}

@media (max-width: 640px) {
  .assistant-box {
    right: 16px;
    bottom: 20px;
  }

  .assistant-panel {
    width: min(340px, calc(100vw - 24px));
  }
}
