/* ARTIZS.SAY v0.5.16 — 0.8s hover + actions fitted inside message bubble */

/*
 * Position is calculated by app.js from the actual bubble/media bounds.
 * This layer only refines the visual treatment so the controls feel like part
 * of the message instead of a detached toolbar. The rail remains an overlay,
 * so revealing it never changes message height or pushes the next row.
 */
.msg-actions,
.msg-actions.no-persistent-actions{
  gap:3px!important;
  transform:translateY(0) scale(.985)!important;
  transform-origin:right center!important;
}
.message.actions-visible .msg-actions,
.message.actions-open .msg-actions,
.message:focus-within .msg-actions{
  transform:translateY(0) scale(1)!important;
}

/* Slightly tighter controls fit comfortably inside normal text bubbles. */
.msg-actions .message-secondary-action{
  min-height:22px!important;
  padding:2px 8px!important;
}
.message-reaction-trigger{
  width:26px!important;
  min-width:26px!important;
  height:22px!important;
}
.msg-actions .message-more-btn{
  min-height:22px!important;
}

/* A narrow bubble can be smaller than the three controls combined. Keep the
 * rail readable while still aligning its right edge with the bubble. */
.msg-actions[data-anchor-narrow="1"]{
  transform-origin:right center!important;
}

/* Popovers remain outside the bubble and are never clipped. */
.message-content,
.msg-actions,
.message-reaction-wrap,
.message-more{overflow:visible!important}
.message-reaction-picker,.message-more-menu{z-index:120!important}

@media (hover:hover) and (pointer:fine){
  /* Never let an old plain :hover rule bypass the JavaScript 0.8s timer. */
  .message:not(.actions-visible):not(.actions-open):hover .msg-actions:not(:focus-within){
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
  }
  .message.actions-visible:hover .msg-actions,
  .message.actions-open:hover .msg-actions,
  .message:focus-within .msg-actions{
    opacity:1!important;
    visibility:visible!important;
    pointer-events:auto!important;
  }
}
