.ai-assistant {
  --assistant-blue: #075cb8;
  --assistant-navy: #071a35;
  --assistant-text: #18304b;
  --assistant-muted: #60758c;
  --assistant-border: rgba(81, 126, 171, 0.22);
  --assistant-safe-bottom: 20px;
  position: fixed;
  z-index: 14020;
  right: 22px;
  bottom: var(--assistant-safe-bottom);
  width: 168px;
  height: 170px;
  font-family: "Manrope Local", "Manrope", Arial, sans-serif;
  color: var(--assistant-text);
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.8,.2,1), bottom 0.25s ease;
}

.ai-assistant,
.ai-assistant * {
  font-family: "Manrope Local", Arial, sans-serif !important;
}

.ai-assistant.is-ready {
  opacity: 1;
  transform: translateY(0);
}

body.mob-drawer-open .ai-assistant {
  opacity: 0;
  pointer-events: none;
}

body.mob-drawer-open .ai-assistant * {
  pointer-events: none !important;
}

.ai-assistant button,
.ai-assistant input {
  font: inherit !important;
}

.ai-assistant .visually-hidden {
  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;
}

.ai-assistant__mascot-button {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 150px;
  height: 150px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 15px 18px rgba(17, 73, 127, 0.22));
}

.ai-assistant__mascot-button::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 8px;
  width: 92px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(24, 130, 214, 0.18), rgba(24, 130, 214, 0));
  transform: translateX(-50%);
}

.ai-assistant__mascot-button:focus-visible {
  outline: 3px solid rgba(7, 92, 184, 0.38);
  outline-offset: 3px;
}

.ai-assistant__mascot-stage {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  animation: assistant-float 4.8s ease-in-out infinite;
}

.ai-assistant__mascot,
.ai-assistant__arm {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.ai-assistant__arm--left {
  clip-path: polygon(0 46%, 45% 43%, 54% 73%, 2% 75%);
  transform-origin: 36% 52%;
  animation: assistant-left-hand 6.5s ease-in-out infinite;
}

.ai-assistant__arm--right {
  clip-path: polygon(66% 38%, 94% 39%, 95% 86%, 66% 86%);
  transform-origin: 72% 46%;
  animation: assistant-right-hand 8s ease-in-out 1.2s infinite;
}

.ai-assistant__eyelid {
  position: absolute;
  z-index: 4;
  top: 24.7%;
  width: 6.5%;
  height: 9%;
  border-radius: 55% 55% 48% 48%;
  background: linear-gradient(180deg, #0b2348 0%, #061936 100%);
  transform: scaleY(0);
  transform-origin: center;
  animation: assistant-blink 6.2s linear infinite;
}

.ai-assistant__eyelid--left { left: 39.1%; }
.ai-assistant__eyelid--right { left: 54.1%; animation-delay: 0.035s; }

.ai-assistant__invite {
  position: absolute;
  right: 112px;
  bottom: 116px;
  width: 272px;
  padding: 16px 42px 15px 17px;
  border: 1px solid rgba(94, 139, 184, 0.2);
  border-radius: 15px 15px 4px 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(21, 60, 97, 0.16);
  backdrop-filter: blur(15px);
  pointer-events: auto;
  transform-origin: right bottom;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.ai-assistant.is-open .ai-assistant__invite,
.ai-assistant.is-invite-dismissed .ai-assistant__invite {
  opacity: 0;
  transform: translateY(7px) scale(0.96);
  pointer-events: none;
}

.ai-assistant__invite-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--assistant-blue);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ai-assistant__invite-text {
  margin: 0;
  color: var(--assistant-text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.4;
}

.ai-assistant__invite-dismiss {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #708398;
  cursor: pointer;
}

.ai-assistant__invite-dismiss:hover { background: #eef5fb; color: var(--assistant-navy); }

.ai-assistant__panel {
  position: absolute;
  right: 4px;
  bottom: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(370px, calc(100vw - 32px));
  height: min(540px, calc(100vh - 52px));
  overflow: hidden;
  border: 1px solid var(--assistant-border);
  border-radius: 18px;
  background: rgba(249, 252, 255, 0.98);
  box-shadow: 0 24px 70px rgba(8, 40, 75, 0.24);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: right bottom;
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.28s cubic-bezier(.2,.8,.2,1);
}

.ai-assistant.is-open {
  width: min(390px, calc(100vw - 24px));
  height: min(558px, calc(100vh - 36px));
}

.ai-assistant.is-open .ai-assistant__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ai-assistant.is-open .ai-assistant__mascot-button { opacity: 0; pointer-events: none; }

.ai-assistant__header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 12px 12px 12px 15px;
  border-bottom: 1px solid rgba(91, 131, 168, 0.16);
  background: linear-gradient(135deg, rgba(237, 247, 255, 0.96), rgba(255, 255, 255, 0.97));
}

.ai-assistant__header-avatar {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(17, 73, 127, 0.14));
}

.ai-assistant__heading { min-width: 0; flex: 1; }
.ai-assistant .ai-assistant__title {
  margin: 0;
  color: var(--assistant-navy);
  font-family: "Manrope Local", "Manrope", Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  letter-spacing: 0 !important;
}
.ai-assistant__status { display: flex; align-items: center; gap: 6px; margin: 3px 0 0; color: var(--assistant-muted); font-size: 11px; }
.ai-assistant__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #26a66f; box-shadow: 0 0 0 3px rgba(38, 166, 111, 0.12); }

.ai-assistant__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.72);
  color: #536b83;
  cursor: pointer;
}

.ai-assistant__close:hover { background: #e6f1fa; color: var(--assistant-navy); }
.ai-assistant__close:focus-visible,
.ai-assistant__invite-dismiss:focus-visible,
.ai-assistant__quick:focus-visible,
.ai-assistant__send:focus-visible,
.ai-assistant__input:focus-visible { outline: 2px solid rgba(7, 92, 184, 0.45); outline-offset: 2px; }

.ai-assistant__body {
  overflow-y: auto;
  padding: 18px 15px;
  scrollbar-width: thin;
  scrollbar-color: #bfd3e5 transparent;
}

.ai-assistant__message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 13px 13px 13px 4px;
  background: #eaf4fc;
  color: #233e59;
  font-size: 13px;
  line-height: 1.48;
}

.ai-assistant__message--user {
  margin-left: auto;
  border-radius: 13px 13px 4px 13px;
  background: #0b63b7;
  color: #fff;
}

.ai-assistant__message--typing { display: flex; gap: 4px; align-items: center; min-width: 46px; }
.ai-assistant__message--typing span { width: 5px; height: 5px; border-radius: 50%; background: #5d7994; animation: assistant-typing 1s ease-in-out infinite; }
.ai-assistant__message--typing span:nth-child(2) { animation-delay: 0.13s; }
.ai-assistant__message--typing span:nth-child(3) { animation-delay: 0.26s; }

.ai-assistant__quick-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.ai-assistant__quick {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(39, 105, 169, 0.22);
  border-radius: 9px;
  background: #fff;
  color: #1e568e;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.ai-assistant__quick:hover { border-color: rgba(7, 92, 184, 0.5); background: #f2f8fd; }

.ai-assistant__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid rgba(91, 131, 168, 0.16);
  background: #fff;
}

.ai-assistant__input {
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid #cbdbea;
  border-radius: 10px;
  background: #f8fbfe;
  color: var(--assistant-navy);
  font-size: 12px;
}
.ai-assistant__input::placeholder { color: #8294a6; }

.ai-assistant__send {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--assistant-blue);
  color: #fff;
  cursor: pointer;
}
.ai-assistant__send:hover { background: #064e9b; }

@keyframes assistant-float {
  0%, 100% { transform: translateY(0) rotate(-0.3deg); }
  50% { transform: translateY(-6px) rotate(0.5deg); }
}

@keyframes assistant-blink {
  0%, 45%, 48.4%, 100% { transform: scaleY(0); }
  46.2%, 47.2% { transform: scaleY(1); }
}

@keyframes assistant-left-hand {
  0%, 60%, 74%, 100% { transform: rotate(0); }
  64% { transform: rotate(-2.2deg); }
  69% { transform: rotate(1.4deg); }
}

@keyframes assistant-right-hand {
  0%, 72%, 88%, 100% { transform: rotate(0); }
  77% { transform: rotate(1.8deg); }
  82% { transform: rotate(-1.2deg); }
}

@keyframes assistant-typing {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(-3px); opacity: 1; }
}

@media (max-width: 1200px) {
  .ai-assistant,
  .ai-assistant.is-open {
    bottom: max(var(--assistant-safe-bottom), 78px);
  }
}

@media (max-width: 700px) {
  .ai-assistant {
    right: 10px;
    bottom: max(var(--assistant-safe-bottom), 78px);
    width: 124px;
    height: 126px;
  }
  .ai-assistant__mascot-button { width: 116px; height: 116px; }
  .ai-assistant__invite { right: 86px; bottom: 88px; width: 224px; padding: 13px 38px 13px 14px; }
  .ai-assistant__invite-text { font-size: 12px; }
  .ai-assistant.is-cookie-visible .ai-assistant__invite { opacity: 0; pointer-events: none; }
  .ai-assistant.is-open {
    right: 8px;
    bottom: max(var(--assistant-safe-bottom), 74px);
    width: calc(100vw - 16px);
    height: min(520px, calc(100svh - var(--assistant-safe-bottom) - 12px));
  }
  .ai-assistant__panel { right: 0; bottom: 0; width: 100%; height: 100%; border-radius: 16px; }
}

@media (max-width: 360px) {
  .ai-assistant__invite { width: 204px; }
  .ai-assistant__quick-list { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-assistant,
  .ai-assistant__panel,
  .ai-assistant__invite { transition-duration: 0.01ms; }
  .ai-assistant__mascot-stage,
  .ai-assistant__arm,
  .ai-assistant__eyelid,
  .ai-assistant__message--typing span { animation: none; }
}
