*{
    box-sizing:border-box;
    font-family:system-ui,-apple-system,"Segoe UI",sans-serif
}
body{
    margin:0;
    background:#0b1220;
    color:#e7eefc;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:18px
}
.wrap{
    width:min(980px,100%);
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.12);
    border-radius:16px;
    overflow:hidden
}
.top{
    padding:16px 18px;
    border-bottom:1px solid rgba(255,255,255,.12);
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start
}
.title{
    font-weight:800;
    font-size:16px
}
.subtitle{
    opacity:.85;
    font-size:12px;
    margin-top:6px
}
.nav a{
    color:#bcd1ff;
    text-decoration:none
}
.chat{
    padding:18px;
    display:flex;
    flex-direction:column;
    gap:10px;
    max-height:65vh;
    overflow:auto
}
.msg{
    max-width:78%;
    padding:10px 12px;
    border-radius:14px;
    line-height:1.35;
    white-space:pre-wrap
}
.bot{
    background:rgba(115,167,255,.18);
    border:1px solid rgba(115,167,255,.25);
    align-self:flex-start
}
.user{
    background:rgba(255,255,255,.12);
    border:1px solid rgba(255,255,255,.18);
    align-self:flex-end
}
.bottom{
    border-top:1px solid rgba(255,255,255,.12);
    padding:14px 18px
}
form{
    display:flex;
    gap:10px
}
input{
    flex:1;
    border-radius:12px;
    border:1px solid rgba(255,255,255,.18);
    background:rgba(0,0,0,.2);
    color:#e7eefc;
    padding:10px 12px
}
input:focus{
    outline:2px solid rgba(43,99,255,.6);
    outline-offset:2px
}
form button{
    border:none;
    border-radius:12px;
    padding:10px 14px;
    background:#2b63ff;
    color:#fff;
    cursor:pointer
}
form button:hover{
    filter:brightness(1.05)
}
.quick{display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:12px
}
.qbtn{
    cursor:pointer;
    border:none;
    border-radius:12px;
    padding:8px 12px;
    background:rgba(255,255,255,.10);
    color:#e7eefc
}
.qbtn:hover{
    background:rgba(255,255,255,.16)
}
.qbtn:disabled{
    opacity:.55;
    cursor:not-allowed
}
code{background:rgba(0,0,0,.25);
    padding:2px 6px;
    border-radius:8px
}

.learn{
  margin-top:14px;
  padding:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  border-radius:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.learn-title{font-weight:700;
    opacity:.95
}
.learn-row{
    display:flex;
    flex-direction:column;
    gap:6px
}
.learn-row span{
    font-size:12px;
    opacity:.9
}
.learn-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap
}
.learn-actions button{
  cursor:pointer;
  border:none;
  border-radius:12px;
  padding:9px 12px;
  background:rgba(255,255,255,.12);
  color:#e7eefc
}
.learn-actions button:hover{
    background:rgba(255,255,255,.18)
}
.tree{
  margin-top:12px;
  padding:14px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  border-radius:14px;
}

.tree-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.tree-title{
    font-weight:700;
    opacity:.95
}

.tree-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap
}

.tree-actions button{
  cursor:pointer;border:none;
  border-radius:12px;
  padding:8px 12px;
  background:rgba(255,255,255,.12);
  color:#e7eefc
}
.tree-actions button:hover{
    background:rgba(255,255,255,.18)
}

.tree-body{
  margin:0;
  white-space:pre;
  overflow:auto;
  max-height:240px;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
}
.aki{
  display:flex;
  justify-content:center;
  padding:12px 18px;
  border-bottom:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.08);
}

.aki img{
  width:140px;
  height:140px;
  object-fit:contain;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.35));
  transform-origin: 50% 70%;
}

/* Базовая “живая” анимация */
.aki-calm{
  animation: akiFloat 2.4s ease-in-out infinite;
}

/* Злость: лёгкая тряска */
.aki-angry{
  animation: akiShake .45s linear infinite;
}

/* Радость: подпрыгивание */
.aki-happy{
  animation: akiBounce .8s ease-in-out infinite;
}

/* Одноразовый “поп” при смене эмоции */
.aki-pop{
  animation: akiPop .22s ease-out 1;
}

@keyframes akiFloat{
  0%,100%{ transform: translateY(0) scale(1); }
  50%{ transform: translateY(-6px) scale(1.01); }
}

@keyframes akiShake{
  0%{ transform: translateX(0) rotate(0); }
  25%{ transform: translateX(-2px) rotate(-1deg); }
  50%{ transform: translateX(2px) rotate(1deg); }
  75%{ transform: translateX(-2px) rotate(-1deg); }
  100%{ transform: translateX(0) rotate(0); }
}

@keyframes akiBounce{
  0%,100%{ transform: translateY(0) scale(1); }
  50%{ transform: translateY(-10px) scale(1.02); }
}

@keyframes akiPop{
  0%{ transform: scale(.96); }
  100%{ transform: scale(1); }
}
