#tira-open{position:fixed;right:22px;bottom:22px;z-index:30;display:flex;align-items:center;gap:10px;border:0;border-radius:28px;padding:9px 18px 9px 10px;background:#fff;color:#24308f;font-weight:600;box-shadow:0 6px 24px rgba(36,8,80,.24)}
#tira-open:hover{box-shadow:0 8px 30px rgba(36,8,80,.34)}
.tira-mark{width:34px;height:34px;flex:none;display:block}
#tira{position:fixed;right:22px;bottom:22px;z-index:40;width:400px;max-width:calc(100% - 32px);height:min(620px,calc((100dvh / var(--z,1)) - 44px));display:flex;flex-direction:column;background:#fff;color:#1f2042;border-radius:14px;overflow:hidden;box-shadow:0 16px 60px rgba(36,8,80,.34);font-size:15px;line-height:1.45}
#tira[hidden]{display:none}
.tira-on #tira-open{visibility:hidden}
#tira header{position:static;display:flex;align-items:center;gap:10px;padding:12px 14px;background:linear-gradient(120deg,#eef3ff,#f3edff);border:0;box-shadow:none}
#tira header div{flex:1;line-height:1.2}
#tira header b{display:block;font-size:17px;color:#24308f}
#tira header small{color:#5d5f86}
#tira header button{border:0;background:none;color:#4250e0;font-weight:600;padding:6px 8px;border-radius:6px}
#tira header button:hover{background:#fff}
#tira-log{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;overscroll-behavior:contain}
.tira-msg{max-width:90%}
.tira-msg p{margin:0;padding:10px 13px;border-radius:12px;background:#f3f3fa;white-space:pre-wrap;overflow-wrap:anywhere}
.tira-msg.user{align-self:flex-end}
.tira-msg.user p{background:#5b3fd6;color:#fff}
.tira-msg.error p{background:#fdeaee;color:#a3203a}
.tira-msg.wait p{color:#8486a6}
.tira-card{display:flex;align-items:center;gap:8px;margin-top:8px;border:1px solid #e7e7f2;border-radius:10px;padding:6px 8px}
.tira-card a{display:flex;align-items:center;gap:10px;flex:1;min-width:0;text-decoration:none;color:inherit;font-weight:500;line-height:1.25}
.tira-card img{width:48px;height:48px;object-fit:contain;flex:none}
.tira-card button{flex:none;border:1px solid #5b3fd6;border-radius:6px;background:#fff;color:#4a2fc4;padding:6px 9px;font-size:13px;font-weight:600}
.tira-card button.in,.tira-card button:hover{background:#5b3fd6;color:#fff}
.tira-chips{display:flex;flex-wrap:wrap;gap:7px}
.tira-chips button{border:1px solid #cfd2f5;border-radius:16px;background:#fff;color:#3a3fb0;padding:6px 12px;font-size:14px;text-align:left}
.tira-chips button:hover{background:#eef0ff}
#tira-form{display:flex;gap:8px;padding:10px 12px;border-top:1px solid #ececf6}
#tira-text{flex:1;resize:none;border:1px solid #d5d6e8;border-radius:10px;padding:10px 12px;max-height:110px;font-size:16px;field-sizing:content}
#tira-form button{border:0;border-radius:10px;width:44px;background:linear-gradient(135deg,#4d8bff,#8a5cff);color:#fff;font-size:17px}
#tira-form.busy button{opacity:.5}
.tira-note{margin:0;padding:0 14px 10px;font-size:12px;line-height:1.35;color:#6d6f92}
@media(max-width:560px){
  #tira-open{right:14px;bottom:66px;padding:7px}
  #tira-open span{display:none}
  #tira{inset:0;width:auto;max-width:none;height:auto;border-radius:0}
  .tira-on body{overflow:hidden}
}

#tira-open[hidden]{display:none!important}
