/* Ассистент ProSpace: маскот из заголовка улетает в угол и раскрывается в помощника по сайту. */

.hero__pill .masc { width: 100%; height: 100%; }
.agent-ready .hero__pill { cursor: pointer; transition: background-color .3s ease; }
.agent-ready .hero__pill:hover { background: #6A24A3; --eh: 1.25; }
.agent-ready .hero__pill:hover .masc__eye { transition-duration: .25s; }

/* ───────── floating mascot ───────── */

.agent-fab {
  position: fixed; left: 0; top: 0; z-index: 70;
  display: block;
  border-radius: 999px;
  background: var(--brand-violet);
  opacity: 0;
  scale: 1;
  translate: calc(100% + 32px) 0;
  pointer-events: none;
  transition: opacity .3s ease, translate .65s cubic-bezier(.22,1,.36,1), background-color .3s ease, box-shadow .4s ease;
  will-change: transform, width, height;
}
.agent-fab.is-visible { opacity: 1; scale: 1; translate: 0 0; pointer-events: auto; }
.agent-fab.is-docked { box-shadow: 0 0 18px rgba(157, 109, 200, .14), 0 16px 48px rgba(88, 28, 135, .30); }
.agent-fab.is-docked:hover { background: var(--ink); }
body.agent-open .agent-fab { opacity: 0; pointer-events: none; }
body.menu-open :is(.agent-fab, .agent-hint, .agent) { display: none; }

/* ───────── mascot: only the eyes play ───────── */

.masc { display: block; width: 100%; height: 100%; overflow: visible; }
.masc__face { transform: translate(calc(var(--ex, 0) * 1px), calc(var(--ey, 0) * 1px)); }
.masc__eye {
  fill: var(--brand-lime);
  transform-box: fill-box;
  transform-origin: center;
  transform: scaleY(var(--eh, 1));
  transition: transform .12s ease;
}
.is-blink .masc__eye { transform: scaleY(.08); transition-duration: .07s; }
.agent-fab:hover { --eh: 1.25; }
.agent-fab:hover .masc__eye { transition-duration: .25s; }
.is-sleepy { --eh: .35; }
.is-sleepy .masc__eye { transition-duration: .9s; }
.agent.is-busy .agent__ava { --eh: .5; }
.agent.is-busy .agent__ava .masc__face { animation: mascScan 1.1s ease-in-out infinite; }

@keyframes mascScan { 0%, 100% { transform: translate(-7px, -2px); } 50% { transform: translate(7px, -2px); } }

/* ───────── hint bubble ───────── */

.agent-hint {
  position: fixed; z-index: 69;
  right: 24px; bottom: 96px;
  max-width: 270px;
  padding: 12px 16px;
  border-radius: 16px 16px 4px 16px;
  background: var(--ink); color: var(--white);
  font-size: 16px; line-height: 1.3;
  box-shadow: 0 14px 40px rgba(14, 12, 18, .25);
  opacity: 0; transform: translateY(10px) scale(.96); transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .5s var(--ease);
}
.agent-hint b { color: var(--lime); font-weight: 500; }
.agent-hint.is-on { opacity: 1; transform: none; }
body.agent-open .agent-hint { opacity: 0; }

/* ───────── panel ───────── */

.agent {
  --ap: 24px;
  position: fixed; z-index: 80;
  right: var(--ap); bottom: var(--ap);
  width: min(480px, calc(100vw - 32px));
  height: min(760px, calc(100svh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 28px;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 0 80px rgba(190, 176, 204, .065);
  clip-path: inset(calc(100% - 60px) 0 0 calc(100% - 104px) round 30px);
  opacity: 0;
  visibility: hidden;
  transition: clip-path .7s var(--ease), opacity .3s, visibility 0s .7s;
}
body.agent-open .agent {
  clip-path: inset(-128px round 28px);
  opacity: 1;
  visibility: visible;
  transition: clip-path .7s var(--ease), opacity .2s, visibility 0s;
}

.agent__hdr { display: flex; align-items: center; gap: 12px; padding: 18px 18px 12px; }
.agent__ava { width: 55px; height: 32px; flex-shrink: 0; border-radius: 999px; background: var(--brand-violet); }
.agent__who { flex: 1; min-width: 0; }
.agent__who b { display: block; font-size: 18px; font-weight: 500; letter-spacing: -.015em; }
.agent__who span { font-size: 14px; color: rgba(251, 250, 247, .55); }
.agent__x { width: 44px; height: 44px; border-radius: 12px; font-size: 24px; line-height: 1; color: rgba(251, 250, 247, .7); transition: background-color .25s, color .25s; }
.agent__x:hover { background: rgba(251, 250, 247, .08); color: var(--white); }

.agent__log {
  overflow-y: auto;
  padding: 6px 18px 18px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(251,250,247,.15) transparent;
  overscroll-behavior: contain;
}

.a-msg { font-size: 17px; line-height: 1.45; animation: aIn .5s var(--ease) both; }
.a-msg--bot { max-width: 96%; }
.a-msg--bot b { color: var(--lime); font-weight: 500; }
.a-msg--user { align-self: flex-end; max-width: 84%; padding: 11px 15px; border-radius: 18px 18px 4px 18px; background: var(--lime); color: var(--ink); }
.a-hello { font-size: clamp(22px, 1.9vw, 28px); font-weight: 500; letter-spacing: -.025em; line-height: 1.15; }
.a-hello em { font-style: normal; color: var(--lime); }
.a-sub { font-size: 15px; color: rgba(251, 250, 247, .5); margin-bottom: -6px; animation: aIn .5s var(--ease) both; }

/* product catalogue inside the chat */
.a-prods { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; animation: aIn .5s var(--ease) both; }
.a-prod {
  display: grid; gap: 4px; align-content: start;
  min-height: 82px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--ink-2);
  text-align: left;
  transition: background-color .2s ease, color .2s ease;
}
.a-prod b { font-size: 18px; font-weight: 500; letter-spacing: -.015em; }
.a-prod span { font-size: 14px; line-height: 1.25; color: rgba(251, 250, 247, .55); }
.a-prod:hover { background: var(--lime); color: var(--ink); }
.a-prod:hover span { color: rgba(14, 12, 18, .6); }
.a-prod.is-here { background: var(--violet); }

.a-think { display: grid; gap: 6px; font-size: 15px; animation: aIn .4s var(--ease) both; }
.a-think div { display: flex; gap: 10px; align-items: center; color: rgba(251, 250, 247, .4); }
.a-think div::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: currentColor; flex-shrink: 0; }
.a-think div.is-run {
  color: transparent;
  background: linear-gradient(90deg, rgba(251,250,247,.35) 0%, var(--white) 40%, rgba(251,250,247,.35) 80%) 0 0 / 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  animation: shimmer 1.2s linear infinite;
}
.a-think div.is-run::before { background: var(--lime); }
.a-think div.is-done { color: rgba(251, 250, 247, .55); }
.a-think div.is-done::before { background: var(--lime); }
.a-think div.is-done::after { content: "✓"; color: var(--lime); margin-left: auto; }
.a-meta { font-size: 14px; color: rgba(251, 250, 247, .45); }

.a-recs { display: grid; gap: 6px; }
.a-rec {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--ink-2);
  text-align: left;
  animation: aIn .5s var(--ease) both;
  transition: background-color .2s ease, color .2s ease;
}
.a-rec:hover { background: var(--lime); color: var(--ink); }
.a-rec__kind { grid-column: 1 / -1; font-size: 13px; color: rgba(251, 250, 247, .5); }
.a-rec__t { font-size: 19px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; }
.a-rec__s { grid-column: 1; font-size: 14px; line-height: 1.3; color: rgba(251, 250, 247, .6); }
.a-rec__f { grid-column: 2; grid-row: 2 / span 2; align-self: center; text-align: right; font-size: 15px; font-weight: 500; color: var(--lime); max-width: 9em; line-height: 1.15; }
.a-rec:hover .a-rec__kind, .a-rec:hover .a-rec__s { color: rgba(14, 12, 18, .6); }
.a-rec:hover .a-rec__f { color: var(--violet); }

.a-chips { display: flex; flex-wrap: wrap; gap: 6px; animation: aIn .5s var(--ease) both; }
.a-chip {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(251, 250, 247, .16);
  color: rgba(251, 250, 247, .85);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.a-chip:hover { background: var(--white); color: var(--ink); box-shadow: none; }

/* input + live search */
.agent__foot { position: relative; padding: 0 12px 12px; }
.agent__suggest {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px);
  display: grid; gap: 2px;
  padding: 6px;
  border-radius: 18px;
  background: #24202B;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .35);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .3s var(--ease);
}
.agent__suggest.is-on { opacity: 1; transform: none; pointer-events: auto; }
.a-sug { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: baseline; padding: 10px 12px; border-radius: 12px; text-align: left; font-size: 16px; }
.a-sug__t { min-width: 0; }
.a-sug__k { font-size: 13px; color: rgba(251, 250, 247, .45); white-space: nowrap; }
.a-sug mark { background: none; color: var(--lime); }
.a-sug.is-sel, .a-sug:hover { background: rgba(251, 250, 247, .08); }

.agent__form { display: flex; gap: 8px; padding: 12px; border-radius: 18px; background: var(--ink-2); }
.agent__in { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--white); font: inherit; font-size: 17px; padding: 0 8px; }
.agent__in::placeholder { color: rgba(251, 250, 247, .4); }
.agent__send { width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px; background: var(--lime); color: var(--ink); display: grid; place-items: center; transition: transform .3s var(--ease), opacity .3s; }
.agent__send svg { width: 18px; height: 18px; }
.agent__send:hover { transform: translateX(2px); }
.agent__send:disabled { opacity: .35; }

/* tile highlighted by the assistant */
.agent-flash { animation: aFlash 1.8s var(--ease); }

@keyframes aIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes aFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 243, 107, 0); }
  20%, 60% { box-shadow: 0 0 0 6px var(--lime); }
}

@media (max-width: 720px) {
  .agent { --ap: 8px; width: calc(100vw - 16px); height: calc(100svh - 16px); }
  .agent-hint { right: 16px; bottom: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .agent, body.agent-open .agent { transition: none; }
}
