:root{
  --agent-brown:rgba(31,15,10,.86);
  --agent-brown-strong:rgba(23,10,7,.96);
  --agent-cream:#f7e7cf;
  --agent-muted:#bda28e;
  --agent-mint:#78d0c6;
}

[data-agent-open]{
  cursor:pointer!important;
}

.agent-launcher-wrap{
  position:fixed;
  left:max(18px,env(safe-area-inset-left));
  bottom:max(20px,env(safe-area-inset-bottom));
  z-index:260;
  display:grid;
  justify-items:start;
  opacity:1;
  visibility:visible;
}
.agent-launcher-wrap.animotion-fade-in-left-big{
  visibility:visible;
  pointer-events:auto;
  animation:animotion-fade-in-left-big .95s cubic-bezier(.22,1,.36,1) both;
}
.agent-launcher{
  position:relative;
  width:64px;
  height:64px;
  padding:0;
  border:1px solid rgba(255,255,255,.12);
  border-radius:50%;
  background:radial-gradient(circle at 42% 35%,rgba(120,208,198,.16),rgba(36,18,12,.92) 58%,rgba(0,0,0,.28));
  color:var(--agent-cream);
  box-shadow:0 24px 70px rgba(0,0,0,.34);
  backdrop-filter:blur(18px) saturate(125%);
  -webkit-backdrop-filter:blur(18px) saturate(125%);
  cursor:pointer;
}
.agent-launcher:hover,.agent-launcher:focus-visible{
  border-color:rgba(120,208,198,.34);
  outline:0;
  box-shadow:0 26px 80px rgba(0,0,0,.40),0 0 0 3px rgba(120,208,198,.14);
}
.agent-launcher[hidden]{display:none}
.agent-launcher[hidden] + .agent-launcher-bubble{display:none}
.agent-launcher-media{
  position:relative;
  width:100%;
  height:100%;
  border-radius:50%;
  display:grid;
  place-items:center;
  overflow:visible;
  transform-origin:50% 80%;
  animation:agentFloat 5.6s ease-in-out infinite;
}
.agent-launcher-media img{
  width:58px;
  height:58px;
  object-fit:contain;
  display:block;
}
.agent-status{
  position:absolute;
  right:-5px;
  bottom:3px;
  z-index:2;
  width:9px;
  height:9px;
  border-radius:50%;
  background:var(--agent-mint);
  box-shadow:0 0 0 4px rgba(120,208,198,.14),0 0 14px rgba(120,208,198,.9);
}
.agent-launcher-bubble{
  position:absolute;
  left:0;
  bottom:calc(100% + 12px);
  width:var(--launcher-bubble-width,max-content);
  max-width:min(320px,calc(100vw - 32px));
  padding:12px 13px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px 16px 16px 4px;
  isolation:isolate;
  background:transparent;
  color:var(--agent-cream);
  font-weight:800;
  line-height:1.35;
  white-space:nowrap;
  box-shadow:0 16px 35px rgba(0,0,0,.26);
  transition:width .8s cubic-bezier(.22,1,.36,1);
  backdrop-filter:blur(14px) saturate(125%);
  -webkit-backdrop-filter:blur(14px) saturate(125%);
}
.agent-launcher-bubble::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  border-radius:inherit;
  background:rgba(36,18,12,.92);
}
.agent-launcher-bubble::after{
  content:"";
  position:absolute;
  left:16px;
  bottom:-7px;
  z-index:-2;
  clip-path:polygon(100% 0,100% 100%,0 100%);
  width:12px;
  height:12px;
  background:rgba(36,18,12,.92);
  border-right:1px solid rgba(255,255,255,.12);
  border-bottom:1px solid rgba(255,255,255,.12);
  transform:rotate(45deg);
}

.agent-launcher-bubble-text{
  display:inline-block;
  width:100%;
  max-width:100%;
  overflow:hidden;
  white-space:nowrap;
  direction:rtl;
  text-align:right;
  line-height:1.35;
  border-left:2px solid var(--agent-mint);
  border-right:0;
  clip-path:polygon(100% 0,100% 0,100% 100%,100% 100%);
}
.agent-launcher-bubble{direction:rtl;text-align:right}
@keyframes animotion-textRevealMask{
  from{clip-path:polygon(100% 0,100% 0,100% 100%,100% 100%)}
  to{clip-path:polygon(0 0,100% 0,100% 100%,0 100%)}
}
.animotion-text-reveal-mask{animation:animotion-textRevealMask .8s ease-in-out both}
.animotion-text-reveal-mask.is-erasing{animation-direction:reverse}

.agent-shell{
  position:fixed;
  left:18px;
  bottom:96px;
  z-index:270;
  width:min(420px,calc(100vw - 28px));
  max-height:min(720px,calc(100svh - 118px));
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  isolation:isolate;
  border:1px solid rgba(255,250,242,.30);
  border-radius:34px;
  background:
    radial-gradient(circle at 18% 7%,rgba(255,250,242,.20),transparent 34%),
    radial-gradient(circle at 86% 10%,rgba(120,208,198,.10),transparent 30%),
    linear-gradient(150deg,rgba(45,25,17,.58),rgba(24,11,8,.46) 52%,rgba(15,7,5,.64));
  color:var(--agent-cream);
  box-shadow:
    0 34px 95px rgba(0,0,0,.54),
    0 16px 46px rgba(43,26,14,.32),
    inset 0 1px 0 rgba(255,250,242,.30),
    inset 0 -1px 0 rgba(255,255,255,.06);
  backdrop-filter:blur(34px) saturate(145%) contrast(1.04);
  -webkit-backdrop-filter:blur(34px) saturate(145%) contrast(1.04);
  overflow:hidden;
  transform:translateY(14px) scale(.98);
  opacity:0;
  pointer-events:none;
  transition:opacity .28s var(--ease),transform .34s var(--ease);
}
.agent-shell::before,
.agent-shell::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
  border-radius:inherit;
}
.agent-shell::before{
  background:
    linear-gradient(90deg,rgba(255,250,242,.18),transparent 18%,transparent 82%,rgba(255,250,242,.10)),
    linear-gradient(180deg,rgba(255,250,242,.16),transparent 24%,transparent 74%,rgba(0,0,0,.18));
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.10),
    inset 0 20px 42px rgba(255,250,242,.07),
    inset 0 -28px 46px rgba(0,0,0,.16);
}
.agent-shell::after{
  inset:-42% -60%;
  background:linear-gradient(115deg,transparent 37%,rgba(255,250,242,.16) 46%,rgba(255,250,242,.055) 51%,transparent 61%);
  opacity:.72;
  transform:translateX(-14%) rotate(1deg);
  mix-blend-mode:screen;
}
.agent-shell.is-open{
  opacity:1;
  transform:none;
  pointer-events:auto;
}
.agent-shell > *{
  position:relative;
  z-index:1;
}
.agent-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) 40px;
  gap:12px;
  align-items:center;
  padding:14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.agent-title{min-width:0;display:grid;gap:4px;text-align:center}
.agent-title strong{
  font-size:15px;
  line-height:1.2;
}
.agent-title span{
  color:var(--agent-muted);
  font-size:11px;
  line-height:1.35;
}
.agent-close{
  width:40px;
  height:40px;
  border:0;
  border-radius:14px;
  color:var(--agent-cream);
  background:rgba(255,255,255,.07);
  cursor:pointer;
}
.agent-close:focus-visible,.agent-form button:focus-visible,.agent-option:focus-visible,.agent-card a:focus-visible{
  outline:0;
  box-shadow:0 0 0 3px rgba(120,208,198,.2);
}

.agent-feed{
  min-height:260px;
  overflow:auto;
  padding:16px 14px 12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  overscroll-behavior:contain;
}
.agent-message{
  width:fit-content;
  max-width:92%;
  padding:11px 13px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  color:var(--agent-cream);
  line-height:1.65;
  font-size:13px;
}
.agent-message.agent{
  align-self:flex-start;
  background:rgba(255,255,255,.055);
  border-top-left-radius:8px;
}
.agent-message.user{
  align-self:flex-end;
  background:rgba(120,208,198,.14);
  border-color:rgba(120,208,198,.18);
  border-top-right-radius:8px;
}
.agent-message[dir="ltr"]{
  direction:ltr;
  text-align:left;
  font-family:Arial,"Segoe UI",sans-serif;
}
.agent-options{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-start;
  margin-top:2px;
}
.agent-option{
  min-height:40px;
  border:1px solid rgba(120,208,198,.22);
  border-radius:999px;
  padding:10px 14px;
  color:var(--agent-cream);
  background:rgba(120,208,198,.08);
  font-weight:800;
  cursor:pointer;
}
.agent-option:hover{background:rgba(120,208,198,.15)}
.agent-option[disabled]{opacity:.55;cursor:not-allowed}
.agent-typing{
  display:flex;
  gap:5px;
  align-items:center;
  padding:8px 10px;
}
.agent-typing i{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--agent-mint);
  opacity:.4;
  animation:agentDot 1s ease-in-out infinite;
}
.agent-typing i:nth-child(2){animation-delay:.14s}
.agent-typing i:nth-child(3){animation-delay:.28s}

.agent-recommendations{
  display:grid;
  gap:10px;
}
.agent-card{
  padding:13px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  background:linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,.035));
}
.agent-card h3{
  margin:0 0 6px;
  font:800 17px/1.15 Arial,sans-serif;
  letter-spacing:0;
  direction:ltr;
  text-align:left;
}
.agent-card strong{
  display:block;
  color:var(--agent-mint);
  font:800 13px/1 Arial,sans-serif;
  margin-bottom:9px;
}
.agent-card p{
  margin:0 0 12px;
  color:#d7c3b2;
  line-height:1.55;
  font-size:12px;
}
.agent-card a{
  display:inline-flex;
  min-height:36px;
  align-items:center;
  justify-content:center;
  padding:9px 12px;
  border-radius:999px;
  background:var(--agent-mint);
  color:#17342f;
  font-weight:900;
  font-size:11px;
}

.agent-footer{
  padding:12px 14px 14px;
  border-top:1px solid rgba(255,255,255,.08);
}
.agent-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) 44px;
  gap:8px;
  align-items:center;
}
.agent-form input{
  width:100%;
  height:44px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:999px;
  padding:0 14px;
  color:var(--agent-cream);
  background:rgba(255,255,255,.055);
}
.agent-form input::placeholder{color:#9f8878}
.agent-form input:focus{
  outline:0;
  border-color:rgba(120,208,198,.38);
  box-shadow:0 0 0 3px rgba(120,208,198,.12);
}
.agent-form button{
  width:44px;
  height:44px;
  border:0;
  border-radius:50%;
  color:#17342f;
  background:var(--agent-mint);
  font-weight:900;
  cursor:pointer;
}
.agent-reset{
  margin-top:8px;
  border:0;
  background:transparent;
  color:#9f8878;
  font-size:11px;
  cursor:pointer;
}

@keyframes agentFloat{
  0%,100%{transform:translateY(0) scale(1)}
  50%{transform:translateY(-6px) scale(1.015)}
}
@keyframes animotion-fade-in-left-big{
  from{opacity:0;transform:translate3d(-90px,0,0) scale(.82)}
  to{opacity:1;transform:translate3d(0,0,0) scale(1)}
}
@keyframes agentDot{
  50%{opacity:1;transform:translateY(-2px)}
}

@media(max-width:640px){
  .agent-launcher-wrap{
    left:14px;
    bottom:max(14px,env(safe-area-inset-bottom));
  }
  .agent-launcher{
    width:58px;
    height:58px;
  }
  .agent-launcher-bubble{
    font-size:13px;
    left:0;
  }
  body.menu-page .agent-launcher-wrap{
    bottom:max(76px,calc(env(safe-area-inset-bottom) + 76px));
  }
  .agent-shell{
    left:8px;
    right:8px;
    bottom:calc(var(--agent-viewport-bottom,0px) + max(8px,env(safe-area-inset-bottom)));
    width:auto;
    height:min(88svh,760px);
    max-height:min(88svh,calc(var(--agent-viewport-height,100dvh) - max(8px,env(safe-area-inset-top)) - max(8px,env(safe-area-inset-bottom))));
    border-radius:26px 26px 20px 20px;
  }
  .agent-feed{
    min-height:0;
  }
  .agent-feed > *{
    flex-shrink:0;
  }
  .agent-form input{
    font-size:16px;
  }
  .agent-options{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .agent-option{
    width:100%;
  }
}

@media(prefers-reduced-motion:reduce){
  .agent-launcher-media,.agent-typing i{
    animation:none!important;
  }
  .agent-launcher-wrap.animotion-fade-in-left-big{
    animation:none!important;
    opacity:1;
  }
  .agent-shell{
    transition:none!important;
  }
}

/* Only the existing character is visible while it travels into its launcher. */
.agent-launcher-wrap.is-introducing { z-index:10001; pointer-events:none; }
.is-introducing .agent-launcher { background:transparent; border-color:transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
.is-introducing .agent-launcher-media { animation:none; }
.is-introducing .agent-launcher-bubble, .is-introducing .agent-status { visibility:hidden; }
@media(prefers-reduced-motion:reduce) {
  .agent-launcher-bubble { transition:none; }
  .agent-launcher-bubble-text { animation:none; clip-path:none; }
}
