/* Plávajúca Ella – launcher vpravo dole + chat dock (prototyp WB) */
.wb-ella-launch{
  position:relative;
  z-index:1;
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 16px 6px 6px;
  border:0;
  border-radius:999px;
  background:var(--tint);
  color:var(--crm-on-primary);
  box-shadow:0 12px 32px rgba(0,0,0,.22);
  cursor:pointer;
  font:inherit;
  text-align:left;
  max-width:min(320px,calc(100vw - 32px));
  transition:transform .2s ease,opacity .2s ease;
}
.wb-ella-launch:hover{filter:brightness(1.05)}
.wb-ella-launch:active{transform:scale(.98)}
.wb-ella-launch[hidden]{display:none!important}
.wb-ella-launch-av{
  position:relative;
  width:44px;
  height:44px;
  flex:none;
  overflow:visible;
}
.wb-ella-launch-av img{
  width:44px;
  height:44px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  box-shadow:0 0 0 2px rgba(255,255,255,.25);
}
.wb-ella-launch-av i{
  position:absolute;
  right:-1px;
  bottom:-1px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:#2f9e5b;
  border:2px solid var(--tint);
  box-sizing:border-box;
  z-index:2;
  pointer-events:none;
}
.wb-ella-launch-t{min-width:0;line-height:1.25}
.wb-ella-launch-t b{display:block;font-size:14px;font-weight:650}
.wb-ella-launch-t span{display:block;font-size:11px;opacity:.78;margin-top:1px}
.wb-ella-launch-x{
  position:absolute;
  top:-6px;
  right:-4px;
  width:26px;
  height:26px;
  border:0;
  border-radius:50%;
  background:var(--card);
  color:var(--muted);
  box-shadow:0 2px 8px rgba(0,0,0,.15);
  font-size:16px;
  line-height:1;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.wb-ella-launch-wrap{
  position:fixed;
  z-index:88;
  right:max(16px,env(safe-area-inset-right,0px));
  bottom:max(20px,env(safe-area-inset-bottom,0px));
  padding:10px 10px 0 0;
  overflow:visible;
}

.wb-ella-dock{
  position:fixed;
  z-index:89;
  right:max(16px,env(safe-area-inset-right,0px));
  bottom:max(20px,env(safe-area-inset-bottom,0px));
  width:min(400px,calc(100vw - 32px));
  height:min(680px,calc(100dvh - 40px));
  display:none;
  flex-direction:column;
  border-radius:20px;
  overflow:hidden;
  background:#f3f1f0;
  box-shadow:0 28px 64px rgba(0,0,0,.28);
}
.wb-ella-dock.on{display:flex}
body.ella-dock-open .wb-ella-launch-wrap{display:none}

.wb-ella-dock-hd{
  flex:none;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:var(--tint);
  color:var(--crm-on-primary);
}
.wb-ella-dock-hd-av-wrap{
  position:relative;
  width:40px;
  height:40px;
  flex:none;
  overflow:visible;
}
.wb-ella-dock-hd-av{
  width:40px;
  height:40px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  box-shadow:0 0 0 2px rgba(255,255,255,.2);
}
.wb-ella-dock-hd-av-wrap::after{
  content:"";
  position:absolute;
  right:-1px;
  bottom:-1px;
  width:11px;
  height:11px;
  border-radius:50%;
  background:#2f9e5b;
  border:2px solid var(--tint);
  box-sizing:border-box;
  z-index:2;
}
.wb-ella-dock-hd-t{min-width:0;flex:1}
.wb-ella-dock-hd-t b{display:block;font-size:16px;font-weight:650}
.wb-ella-dock-hd-t small{display:block;font-size:12px;opacity:.78;margin-top:2px}
.wb-ella-dock-hd .x{
  width:36px;
  height:36px;
  border:0;
  border-radius:10px;
  background:rgba(255,255,255,.14);
  color:inherit;
  cursor:pointer;
  display:grid;
  place-items:center;
  flex:none;
}
.wb-ella-dock-hd .x svg{width:18px;height:18px}

.wb-ella-dock-ctx{
  flex:none;
  margin:0;
  padding:10px 14px;
  font-size:12px;
  color:var(--muted);
  background:var(--fill);
  box-shadow:inset 0 -1px 0 var(--hair);
  display:flex;
  align-items:center;
  gap:8px;
  line-height:1.35;
}
.wb-ella-dock-ctx svg{width:15px;height:15px;flex:none;color:var(--crm-accent)}

.wb-ella-dock-body{
  position:relative;
  flex:1;
  min-height:0;
  background:#f3f1f0;
}
.wb-ella-dock-body .ov-load{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  background:#f3f1f0;
}
.wb-ella-dock-body iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
  opacity:0;
  transition:opacity .2s;
}
.wb-ella-dock-body.ready iframe{opacity:1}
.wb-ella-dock-body.ready .ov-load{display:none}

body.co .wb-ella-launch-wrap,
body.co .wb-ella-dock{display:none!important}

@media (max-width:799px){
  .wb-ella-dock{
    left:0;
    right:0;
    bottom:0;
    width:auto;
    height:min(92dvh,100dvh);
    border-radius:20px 20px 0 0;
  }
  .wb-ella-launch-wrap{
    right:max(12px,env(safe-area-inset-right,0px));
    bottom:max(16px,env(safe-area-inset-bottom,0px));
  }
  body.has-mbar .wb-ella-launch-wrap{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  body.has-mbar .wb-ella-launch{padding:4px}
  body.has-mbar .wb-ella-launch-t{display:none}
}
