
/* VAL v2 — compact, bilingual, session-aware */
:root{
  --val-navy:#06184a;
  --val-blue:#1768ff;
  --val-bg:#ffffff;
  --val-soft:#f5f8ff;
  --val-line:#d8e4fb;
  --val-text:#172243;
  --val-muted:#68748f;
  --val-green:#20c77a;
  --val-shadow:0 20px 55px rgba(6,24,74,.22);
}

#val-launcher-wrap{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:9998;
  display:flex;
  align-items:center;
  gap:10px;
}

#val-launcher-label{
  border:1px solid #d6e3fb;
  background:#fff;
  color:var(--val-navy);
  border-radius:999px;
  padding:9px 13px;
  font-size:12px;
  font-weight:800;
  box-shadow:0 10px 28px rgba(6,24,74,.13);
  white-space:nowrap;
  transition:opacity .2s ease, transform .2s ease;
}

#val-launcher{
  position:relative;
  width:68px;
  height:68px;
  padding:0;
  border:3px solid #fff;
  border-radius:50%;
  overflow:hidden;
  background:var(--val-navy);
  box-shadow:0 14px 38px rgba(23,104,255,.30);
  cursor:pointer;
  transition:transform .2s ease, box-shadow .2s ease;
}
#val-launcher:hover{
  transform:translateY(-2px) scale(1.03);
  box-shadow:0 18px 44px rgba(23,104,255,.38);
}
#val-launcher img{width:100%;height:100%;object-fit:cover;display:block}
#val-launcher::after{
  content:"";
  position:absolute;
  right:3px;
  bottom:4px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:var(--val-green);
  border:2px solid #fff;
}

#val-panel{
  position:fixed;
  right:24px;
  bottom:104px;
  z-index:9999;
  width:min(380px,calc(100vw - 28px));
  height:min(520px,calc(100vh - 125px));
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--val-line);
  border-radius:20px;
  background:var(--val-bg);
  box-shadow:var(--val-shadow);
  opacity:0;
  transform:translateY(12px) scale(.985);
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
}
#val-panel.val-open{
  opacity:1;
  transform:translateY(0) scale(1);
  pointer-events:auto;
}

.val-header{
  display:flex;
  align-items:center;
  gap:11px;
  padding:13px 14px;
  color:#fff;
  background:linear-gradient(135deg,var(--val-navy),#0b3478);
}
.val-header-avatar{
  width:44px;height:44px;border-radius:50%;
  object-fit:cover;border:2px solid rgba(255,255,255,.9);
}
.val-header-copy{flex:1;min-width:0}
.val-header-copy strong{display:block;font-size:16px}
.val-header-copy small{
  display:flex;align-items:center;gap:6px;
  color:#dce8ff;font-size:11.5px;margin-top:2px
}
.val-online-dot{width:7px;height:7px;background:var(--val-green);border-radius:50%;display:inline-block}
.val-close{
  width:34px;height:34px;border:0;border-radius:9px;
  background:rgba(255,255,255,.10);color:#fff;
  font-size:20px;line-height:1;cursor:pointer
}
.val-close:hover{background:rgba(255,255,255,.18)}

.val-messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  padding:14px;
  background:linear-gradient(180deg,#f8fbff,#fff);
}
.val-message{
  max-width:86%;
  margin:0 0 10px;
  padding:10px 12px;
  border-radius:14px;
  font-size:13.5px;
  line-height:1.5;
  word-wrap:break-word;
}
.val-message.bot{
  margin-right:auto;
  background:#fff;
  color:var(--val-text);
  border:1px solid var(--val-line);
  border-bottom-left-radius:5px;
  box-shadow:0 4px 12px rgba(6,24,74,.05);
}
.val-message.user{
  margin-left:auto;
  background:linear-gradient(135deg,var(--val-blue),#0f59e9);
  color:#fff;
  border-bottom-right-radius:5px;
}
.val-message p{margin:0 0 7px}
.val-message p:last-child{margin-bottom:0}
.val-message ul{margin:6px 0;padding-left:17px}
.val-message strong{font-weight:800}

.val-typing{
  display:none;
  align-items:center;
  gap:5px;
  width:max-content;
  margin:0 0 10px;
  padding:9px 11px;
  border:1px solid var(--val-line);
  border-radius:14px 14px 14px 5px;
  background:#fff;
}
.val-typing.show{display:flex}
.val-typing i{
  width:6px;height:6px;border-radius:50%;background:#7a89a8;
  animation:val-bounce 1s infinite ease-in-out
}
.val-typing i:nth-child(2){animation-delay:.14s}
.val-typing i:nth-child(3){animation-delay:.28s}
@keyframes val-bounce{0%,60%,100%{transform:translateY(0)}30%{transform:translateY(-4px)}}

.val-quick{
  display:flex;
  gap:6px;
  overflow-x:auto;
  padding:9px 12px 8px;
  border-top:1px solid #edf2fb;
  background:#fff;
  scrollbar-width:none;
}
.val-quick::-webkit-scrollbar{display:none}
.val-chip{
  flex:0 0 auto;
  border:1px solid #bfd1f4;
  background:#fff;
  color:#164ba6;
  border-radius:999px;
  padding:7px 10px;
  font-size:11.5px;
  font-weight:800;
  cursor:pointer
}
.val-chip:hover{background:#eef5ff}

.val-demo-link{
  display:block;
  margin:0 12px 8px;
  padding:9px 12px;
  border-radius:10px;
  text-align:center;
  font-size:12.5px;
  font-weight:800;
  color:#fff;
  background:var(--val-navy);
  text-decoration:none;
}

.val-input-area{
  padding:8px 10px 10px;
  border-top:1px solid var(--val-line);
  background:#fff
}
.val-input-row{
  display:flex;
  align-items:flex-end;
  gap:7px;
  padding:6px 6px 6px 10px;
  border:1px solid #cfdcf3;
  border-radius:13px;
  background:#fff
}
#val-input{
  flex:1;
  min-height:34px;
  max-height:86px;
  resize:none;
  border:0;
  outline:none;
  padding:7px 0 3px;
  color:var(--val-text);
  background:transparent;
  font:inherit;
  font-size:13.5px
}
#val-send{
  width:38px;height:38px;flex:0 0 auto;
  border:0;border-radius:10px;
  background:linear-gradient(135deg,var(--val-blue),#0e58eb);
  color:#fff;cursor:pointer;font-size:17px;font-weight:800
}
#val-send:disabled{opacity:.55;cursor:not-allowed}
.val-footnote{
  margin:6px 0 0;
  text-align:center;
  color:var(--val-muted);
  font-size:9.5px
}

@media(max-width:600px){
  #val-launcher-wrap{right:14px;bottom:14px}
  #val-launcher{width:64px;height:64px}
  #val-launcher-label{display:none}
  #val-panel{
    right:8px;
    bottom:86px;
    width:calc(100vw - 16px);
    height:min(500px,calc(100vh - 98px));
    border-radius:18px
  }
}
