/* Lanivo mascot shell: Rive-first canvas with real-art fallback. */
.lanivo-layer{
  position:fixed;
  left:0;
  top:0;
  z-index:82;
  pointer-events:auto;
  cursor:pointer;
  outline:none;
  -webkit-tap-highlight-color:transparent;
  will-change:left,top,opacity;
  transition:opacity .22s ease,filter .22s ease;
  filter:drop-shadow(0 10px 18px rgba(40,20,80,.18));
}
.lanivo-layer:hover .lanivo-stage{
  transform:translateY(-2px) scale(1.018);
}
.lanivo-layer:focus-visible .lanivo-stage::after{
  content:'';
  position:absolute;
  inset:18px;
  border-radius:999px;
  box-shadow:0 0 0 3px rgba(78,205,196,.34);
  pointer-events:none;
}
.lanivo-layer.is-hidden,
.lanivo-layer.is-chat-open{
  opacity:0;
  pointer-events:none;
}
.lanivo-layer.is-center{
  z-index:300;
  filter:drop-shadow(0 18px 38px rgba(40,20,80,.22));
}
.lanivo-layer.is-focus{
  cursor:default;
}
.lanivo-layer.is-focus:hover .lanivo-stage{
  transform:none;
}
.lanivo-stage{
  position:relative;
  width:100%;
  height:100%;
  overflow:visible;
  transform-origin:50% 58%;
  transition:transform .18s cubic-bezier(.16,1,.3,1);
}
.lanivo-rive-canvas,
.lanivo-sprite-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  background:transparent;
  pointer-events:none;
}
.lanivo-rive-canvas{
  opacity:0;
  transition:opacity .24s ease;
}
.lanivo-rive-canvas.is-ready{
  opacity:1;
}
.lanivo-sprite-canvas{
  opacity:1;
  transition:opacity .24s ease;
}
.lanivo-layer.lanivo-has-rive .lanivo-sprite-canvas{
  opacity:0;
}
.lanivo-fx-canvas{
  position:fixed;
  inset:0;
  z-index:81;
  pointer-events:none;
}
body.lanivo-panel-open .lanivo-layer{
  opacity:0;
  pointer-events:none;
}

.lanivo-bubble{
  position:absolute;
  bottom:calc(100% - 12px);
  right:8px;
  min-width:180px;
  max-width:260px;
  padding:12px 14px;
  background:#fdfdfc;
  border:1px solid rgba(15,23,38,.08);
  border-radius:14px;
  box-shadow:0 8px 28px rgba(15,23,38,.13);
  font:500 13px/1.45 'Inter',system-ui,sans-serif;
  color:#0f1726;
  opacity:0;
  transform:translateY(6px) scale(.96);
  transform-origin:100% 100%;
  transition:opacity .2s ease,transform .22s cubic-bezier(.16,1,.3,1);
  pointer-events:none;
}
.lanivo-bubble::after{
  content:'';
  position:absolute;
  bottom:-6px;
  right:32px;
  width:12px;
  height:12px;
  background:#fdfdfc;
  border-right:1px solid rgba(15,23,38,.08);
  border-bottom:1px solid rgba(15,23,38,.08);
  transform:rotate(45deg);
}
.lanivo-bubble.is-open{
  opacity:1;
  transform:translateY(0) scale(1);
}
.lanivo-layer.lanivo-below .lanivo-bubble{
  bottom:auto;
  top:calc(100% - 4px);
  right:auto;
  left:50%;
  transform:translate(-50%,-6px) scale(.96);
  transform-origin:50% 0;
}
.lanivo-layer.lanivo-below .lanivo-bubble.is-open{
  transform:translate(-50%,0) scale(1);
}
.lanivo-layer.lanivo-below .lanivo-bubble::after{
  bottom:auto;
  top:-6px;
  right:auto;
  left:calc(50% - 6px);
  border:none;
  border-left:1px solid rgba(15,23,38,.08);
  border-top:1px solid rgba(15,23,38,.08);
}
html.dark .lanivo-bubble,
html.dark .lanivo-bubble::after{
  background:#1a2640;
  border-color:rgba(255,255,255,.08);
  color:#e8edf5;
}

.lanivo-scrim{
  position:fixed;
  inset:0;
  z-index:290;
  background:rgba(15,23,38,.24);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
  opacity:0;
  pointer-events:none;
  transition:opacity .24s ease;
}
.lanivo-scrim.is-open{
  opacity:1;
  pointer-events:auto;
}

.lanivo-panel{
  position:fixed;
  right:28px;
  bottom:24px;
  z-index:85;
  width:380px;
  max-width:calc(100vw - 56px);
  max-height:calc(100vh - 80px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fdfdfc;
  border:1px solid rgba(15,23,38,.08);
  border-radius:18px;
  box-shadow:0 18px 54px rgba(15,23,38,.16),0 4px 14px rgba(15,23,38,.08);
  font-family:'Inter',system-ui,sans-serif;
  opacity:0;
  transform:translateY(12px) scale(.97);
  transform-origin:bottom right;
  transition:opacity .22s ease,transform .26s cubic-bezier(.16,1,.3,1);
  pointer-events:none;
}
.lanivo-panel.is-open{
  opacity:1;
  transform:none;
  pointer-events:auto;
}
.lanivo-panel-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  background:#f8f6ff;
  border-bottom:1px solid rgba(15,23,38,.06);
}
.lph-avatar{
  position:relative;
  width:38px;
  height:38px;
  border-radius:14px;
  flex:0 0 auto;
  background:linear-gradient(145deg,#7864d6 0%,#4b3ca2 100%);
  color:transparent;
  font-size:0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 6px 16px rgba(91,74,168,.24);
}
.lph-avatar::before,
.lph-avatar::after{
  content:'';
  position:absolute;
  top:12px;
  width:7px;
  height:7px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 2px rgba(20,15,54,.18);
}
.lph-avatar::before{left:10px}
.lph-avatar::after{right:10px}
.lph-name{
  font:800 15px/1.2 'Archivo','Inter',system-ui,sans-serif;
  color:#0f1726;
}
.lph-sub{
  margin-top:2px;
  font-size:11.5px;
  color:#6b7280;
}
.lph-close{
  margin-left:auto;
  width:28px;
  height:28px;
  border:0;
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:#6b7280;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  transition:background .15s,color .15s;
}
.lph-close:hover{
  background:rgba(0,0,0,.05);
  color:#0f1726;
}
.lanivo-panel-body{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px 16px;
  overflow-y:auto;
  scrollbar-width:thin;
}
.lanivo-panel-body::-webkit-scrollbar{width:5px}
.lanivo-panel-body::-webkit-scrollbar-thumb{
  background:rgba(0,0,0,.15);
  border-radius:3px;
}
.lpb-empty{
  padding:18px 8px 8px;
  text-align:center;
  color:#667085;
  font-size:13px;
  line-height:1.55;
}
.ex-chips{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:6px;
  margin-top:12px;
}
.ex-chip{
  border:1px solid rgba(15,23,38,.07);
  border-radius:999px;
  padding:6px 12px;
  background:#f4f6fb;
  color:#0f1726;
  font:500 12px/1.2 inherit;
  cursor:pointer;
  transition:background .15s,border-color .15s;
}
.ex-chip:hover{
  background:rgba(78,205,196,.12);
  border-color:rgba(78,205,196,.34);
}
.lpb-msg{
  max-width:90%;
  padding:10px 13px;
  border-radius:14px;
  font-size:13.5px;
  line-height:1.55;
  word-wrap:break-word;
}
.lpb-msg.q{
  align-self:flex-end;
  background:rgba(78,205,196,.12);
  color:#0f1726;
  border-bottom-right-radius:4px;
}
.lpb-msg.a{
  align-self:flex-start;
  background:#f4f6fb;
  color:#0f1726;
  border-bottom-left-radius:4px;
}
.lpb-msg.error{
  align-self:stretch;
  background:rgba(248,113,113,.12);
  color:#c81825;
}
.topic-pill{
  display:inline-block;
  margin-top:8px;
  padding:4px 10px;
  border:1px solid rgba(109,90,201,.3);
  border-radius:999px;
  background:#fdfdfc;
  color:#6d5ac9;
  font-size:11px;
  font-weight:700;
}
.lpb-thinking{
  align-self:flex-start;
  display:inline-flex;
  gap:4px;
  padding:10px 13px;
  background:#f4f6fb;
  border-radius:14px;
}
.lpb-thinking span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:#98a2b3;
  animation:lpb-dot 1.2s infinite;
}
.lpb-thinking span:nth-child(2){animation-delay:.2s}
.lpb-thinking span:nth-child(3){animation-delay:.4s}
@keyframes lpb-dot{
  0%,80%,100%{transform:scale(.7);opacity:.5}
  40%{transform:scale(1);opacity:1}
}
.lanivo-panel-foot{
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:10px 12px 12px;
  border-top:1px solid rgba(15,23,38,.06);
  background:#fdfdfc;
}
.lpf-input{
  flex:1;
  min-height:38px;
  max-height:120px;
  resize:none;
  padding:9px 12px;
  border:1px solid rgba(15,23,38,.11);
  border-radius:12px;
  background:#f9fafb;
  color:#0f1726;
  font:500 13.5px/1.45 inherit;
  transition:border-color .15s,box-shadow .15s,background .15s;
}
.lpf-input:focus{
  outline:none;
  border-color:#6d5ac9;
  background:#fff;
  box-shadow:0 0 0 3px rgba(109,90,201,.12);
}
.lpf-send{
  width:38px;
  height:38px;
  border:0;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  background:#6d5ac9;
  color:#f7f5ff;
  cursor:pointer;
  transition:background .15s,transform .1s;
}
.lpf-send:hover{background:#5a4ab0}
.lpf-send:active{transform:scale(.94)}
.lpf-send:disabled{opacity:.45;cursor:not-allowed}
.lpf-send svg{width:16px;height:16px}

html.dark .lanivo-panel{
  background:#141f33;
  border-color:rgba(255,255,255,.06);
}
html.dark .lanivo-panel-head{
  background:linear-gradient(135deg,#1d1a32 0%,#141328 100%);
  border-bottom-color:rgba(255,255,255,.06);
}
html.dark .lph-name,
html.dark .lpb-msg.q,
html.dark .lpb-msg.a,
html.dark .lpf-input{
  color:#e8edf5;
}
html.dark .lpb-msg.a,
html.dark .lpb-thinking,
html.dark .lpf-input{
  background:#1a2640;
}
html.dark .lanivo-panel-foot{
  background:#141f33;
  border-top-color:rgba(255,255,255,.06);
}
html.dark .lpf-input{
  border-color:rgba(255,255,255,.08);
}

.lanivo-sign{
  position:absolute;
  top:38%;
  right:calc(100% - 18px);
  max-width:174px;
  padding:8px 12px;
  background:#fdf9f0;
  color:#2a2440;
  border:2px solid #6d5ac9;
  border-radius:10px;
  box-shadow:0 6px 14px rgba(40,20,80,.18);
  font:800 12px/1.35 'Archivo','Inter',system-ui,sans-serif;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transform:rotate(-6deg) scale(.6);
  transform-origin:100% 60%;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease,transform .24s cubic-bezier(.16,1,.3,1);
}
.lanivo-sign.is-open{
  opacity:1;
  transform:rotate(-6deg) scale(1);
}
.lanivo-point-ring{
  position:fixed;
  z-index:94;
  border:2px solid rgba(109,90,201,.85);
  border-radius:12px;
  box-shadow:0 0 0 4px rgba(109,90,201,.14);
  pointer-events:none;
  animation:lanivo-ring 1.4s ease-in-out infinite;
}
@keyframes lanivo-ring{
  0%,100%{transform:scale(1);opacity:1}
  50%{transform:scale(1.05);opacity:.65}
}

.lanivo-particles{
  position:absolute;
  inset:-40px;
  z-index:79;
  overflow:visible;
  pointer-events:none;
}
.lanivo-particles span{
  position:absolute;
  top:-10%;
  opacity:0;
  will-change:transform,opacity;
}
@keyframes p-fall{
  0%{transform:translate3d(0,-20px,0) rotate(0);opacity:0}
  15%{opacity:.85}
  100%{transform:translate3d(var(--drift,10px),180px,0) rotate(360deg);opacity:0}
}
@keyframes p-rise{
  0%{transform:translate3d(0,160px,0) scale(.4);opacity:0}
  15%{opacity:1}
  100%{transform:translate3d(var(--drift,20px),-40px,0) scale(1.2);opacity:0}
}
@keyframes p-sway{
  0%{transform:translate3d(0,-10px,0);opacity:.5}
  50%{opacity:1}
  100%{transform:translate3d(var(--drift,30px),180px,0);opacity:0}
}
.lanivo-season-summer .lanivo-particles span,
.lanivo-season-newyear .lanivo-particles span{
  width:6px;
  height:6px;
  border-radius:50%;
  background:radial-gradient(circle,#ffd166 0%,rgba(255,209,102,0) 72%);
  animation:p-rise 4.5s linear infinite;
}
.lanivo-season-spring .lanivo-particles span{
  width:10px;
  height:10px;
  border-radius:50% 0 50% 0;
  background:radial-gradient(ellipse at 30% 30%,#ffd0e0 0%,#ff9fc4 70%,transparent 90%);
  animation:p-sway 6s linear infinite;
}
.lanivo-season-autumn .lanivo-particles span{
  width:12px;
  height:12px;
  border-radius:2px 10px 2px 10px;
  background:#d97706;
  animation:p-fall 7s linear infinite;
}
.lanivo-season-winter .lanivo-particles span,
.lanivo-season-exam .lanivo-particles span,
.lanivo-season-school .lanivo-particles span{
  width:8px;
  height:8px;
  border-radius:50%;
  background:radial-gradient(circle,#fbfdff 0%,rgba(220,235,255,.7) 54%,transparent 82%);
  box-shadow:0 0 4px rgba(255,255,255,.8);
  animation:p-fall 6s linear infinite;
}
.lanivo-particles span:nth-child(1){left:8%;animation-delay:0s;--drift:14px}
.lanivo-particles span:nth-child(2){left:22%;animation-delay:.8s;--drift:-12px}
.lanivo-particles span:nth-child(3){left:38%;animation-delay:1.6s;--drift:8px}
.lanivo-particles span:nth-child(4){left:55%;animation-delay:.4s;--drift:-18px}
.lanivo-particles span:nth-child(5){left:70%;animation-delay:2.2s;--drift:14px}
.lanivo-particles span:nth-child(6){left:84%;animation-delay:1.2s;--drift:-10px}
.lanivo-particles span:nth-child(7){left:14%;animation-delay:3s;--drift:22px}
.lanivo-particles span:nth-child(8){left:62%;animation-delay:2.6s;--drift:-16px}

.lanivo-handover{
  animation:lanivo-handover .7s cubic-bezier(.16,1,.3,1) both;
  animation-delay:calc(var(--i,0) * 90ms);
}
@keyframes lanivo-handover{
  0%{opacity:0;transform:translate(70px,52px) scale(.94) rotate(1.2deg)}
  100%{opacity:1;transform:translate(0,0) scale(1) rotate(0)}
}
.lanivo-presented{
  transition:transform .25s cubic-bezier(.16,1,.3,1),border-color .2s;
}
.lanivo-presented:hover{
  animation:lanivo-present 1.6s ease-in-out infinite;
}
@keyframes lanivo-present{
  0%,100%{transform:translateY(-2px) scale(1.008)}
  50%{transform:translateY(-4px) scale(1.016)}
}

@media(max-width:640px){
  /* The real animated character now stays visible on tabbar pages too —
     platform.js docks her small above the tab bar instead of swapping in a
     static icon. Nothing to hide here anymore. */
  body.has-tabbar .lanivo-layer.lanivo-rive-native{
    z-index:174;
  }
  .lanivo-bubble{
    min-width:140px;
    max-width:200px;
    padding:10px 12px;
    font-size:12px;
  }
  .lanivo-panel{
    left:0;
    right:0;
    bottom:0;
    width:auto;
    max-width:none;
    max-height:70vh;
    border-right:0;
    border-bottom:0;
    border-left:0;
    border-radius:20px 20px 0 0;
    transform-origin:bottom center;
    /* Sit above the bottom tab bar (z-index:180) — otherwise its input field
       is physically covered by the bar and can't be tapped or typed into. */
    z-index:400;
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  .lanivo-panel:not(.is-open){
    transform:translateY(24px);
  }
  .lanivo-sign{
    max-width:120px;
    padding:6px 9px;
    font-size:11px;
  }
}

@media(prefers-reduced-motion:reduce){
  .lanivo-layer,
  .lanivo-stage,
  .lanivo-rive-canvas,
  .lanivo-sprite-canvas,
  .lanivo-bubble,
  .lanivo-panel,
  .lanivo-sign,
  .lanivo-scrim{
    transition:none;
  }
  .lanivo-particles span,
  .lanivo-point-ring,
  .lanivo-handover,
  .lanivo-presented:hover{
    animation:none;
  }
}
