/* Message actions: menu, reactions, pinned bar, editing bar, activity status, connection pill. */
.message[data-id] { -webkit-touch-callout: none; }
.vg-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.message.is-circle .vg-reactions { margin-left: 6px; }
.vg-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-strong);
    background: var(--ink-1); color: var(--fg); font: 500 14px/1.2 inherit; cursor: pointer; animation: vgPop .28s cubic-bezier(.3, 1.6, .5, 1); }
.vg-chip b { font-size: 12px; }
.vg-chip.mine { background: var(--fg); color: var(--ink-0); border-color: var(--fg); }
.outgoing .vg-chip:not(.mine) { background: rgba(127, 127, 127, .18); border-color: transparent; color: inherit; }
@keyframes vgPop { from { transform: scale(.4); opacity: 0; } }
.vg-edited { opacity: .75; }
.message.vg-bump { animation: vgBump .3s ease; }
@keyframes vgBump { 50% { transform: scale(1.02); } }
.message.vg-removing { transition: opacity .2s, transform .2s; opacity: 0; transform: scale(.94); }
.message.vg-flash { animation: vgFlash 1.4s ease; }
@keyframes vgFlash { 0%, 40% { box-shadow: 0 0 0 3px var(--fg); } 100% { box-shadow: 0 0 0 0 transparent; } }

.vg-menu-layer { position: fixed; inset: 0; z-index: 2500; background: rgba(0, 0, 0, .25); }
.vg-menu { position: fixed; min-width: 240px; max-width: min(360px, calc(100vw - 16px)); background: var(--ink-1); border: 1px solid var(--line);
    border-radius: 18px; box-shadow: var(--shadow-xl); padding: 8px; transform: scale(.88); opacity: 0; transform-origin: top left;
    transition: transform .18s cubic-bezier(.3, 1.5, .5, 1), opacity .12s; }
.vg-menu.open { transform: none; opacity: 1; }
.vg-emoji-row { display: flex; gap: 2px; padding: 2px 2px 8px; border-bottom: 1px solid var(--line); }
.vg-emoji-row button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; position: relative;
    animation: vgPop .3s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--i) * 25ms); transition: transform .12s; }
.vg-emoji-row button:hover { transform: scale(1.25); background: var(--ink-3); }
.vg-emoji-row button.on { background: var(--ink-3); }
.vg-emoji-row button.quick::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); }
.vg-actions { display: grid; padding-top: 6px; }
.vg-actions button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent;
    color: var(--fg); font: 500 15px/1.2 inherit; text-align: left; cursor: pointer; }
.vg-actions button span { width: 20px; text-align: center; opacity: .8; }
.vg-actions button:hover { background: var(--ink-3); }
.vg-actions button.danger { color: #e5484d; }
.vg-hint { margin: 6px 10px 2px; color: var(--fg-3); font-size: 12px; }
.vg-burst { position: fixed; z-index: 2600; font-size: 34px; pointer-events: none; transform: translate(-50%, -50%); animation: vgBurst .7s ease-out forwards; }
@keyframes vgBurst { 0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; } 30% { transform: translate(-50%, -70%) scale(1.25); opacity: 1; } 100% { transform: translate(-50%, -140%) scale(1); opacity: 0; } }

.vg-pinned { display: flex; align-items: center; gap: 12px; padding: 8px 18px; background: var(--ink-1); border-bottom: 1px solid var(--line); cursor: pointer; animation: vgSlide .22s ease; }
.vg-pinned i { width: 3px; align-self: stretch; border-radius: 3px; background: var(--fg); }
.vg-pinned div { flex: 1; min-width: 0; display: grid; }
.vg-pinned b { font-size: 13px; color: var(--fg); }
.vg-pinned span { font-size: 14px; color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vg-pinned button { border: 0; background: transparent; color: var(--fg-2); font-size: 16px; cursor: pointer; padding: 6px; }
.vg-pinned em { font-style: normal; opacity: .6; }
@keyframes vgSlide { from { transform: translateY(-8px); opacity: 0; } }

.vg-editbar { display: flex; align-items: center; gap: 12px; padding: 8px 18px; background: var(--ink-1); border-top: 1px solid var(--line); animation: vgSlide .2s ease; }
.vg-editbar > span { font-size: 18px; }
.vg-editbar div { flex: 1; min-width: 0; display: grid; }
.vg-editbar b { font-size: 13px; }
.vg-editbar small { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vg-editbar button { border: 0; background: transparent; color: var(--fg-2); font-size: 16px; cursor: pointer; }

.vg-activity { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #3dbe7a; animation: vgSlide .18s ease; }
.vg-dots { display: inline-flex; gap: 3px; }
.vg-dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: vgBlink 1.1s infinite; }
.vg-dots i:nth-child(2) { animation-delay: .15s; }
.vg-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes vgBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.vg-connection { position: fixed; z-index: 2400; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; border-radius: 99px; background: var(--ink-1); border: 1px solid var(--line-strong); color: var(--fg); font-size: 14px;
    box-shadow: var(--shadow-lg); animation: vgSlide .2s ease; }
.vg-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--fg); animation: vgSpin .8s linear infinite; }
@keyframes vgSpin { to { transform: rotate(360deg); } }

.vg-toast { position: fixed; z-index: 2700; left: 50%; bottom: 90px; transform: translate(-50%, 12px); opacity: 0; padding: 10px 16px; border-radius: 12px;
    background: var(--fg); color: var(--ink-0); font-size: 14px; transition: opacity .2s, transform .2s; pointer-events: none; }
.vg-toast.show { opacity: 1; transform: translate(-50%, 0); }
.vg-quick-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vg-quick-picker button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; font-size: 20px; cursor: pointer; }
.vg-quick-picker button.on { border-color: var(--fg); background: var(--ink-3); }
@media (prefers-reduced-motion: reduce) {
    .vg-chip, .vg-emoji-row button, .vg-pinned, .vg-editbar, .vg-activity, .vg-connection, .message.vg-bump, .message.vg-flash { animation: none; }
}

.vg-ticks { margin-left: 4px; letter-spacing: -3px; font-size: 12px; opacity: .75; }
.vg-ticks.read { opacity: 1; font-weight: 700; }

.vg-quote { display: grid; gap: 1px; width: 100%; min-width: 180px; margin: 0 0 6px; padding: 5px 9px; border: 0; border-left: 3px solid currentColor;
    border-radius: 8px; background: rgba(127, 127, 127, .14); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vg-quote b { font-size: 13px; }
.vg-quote span { font-size: 13px; opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vg-replybar { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); background: var(--ink-1); }
.vg-replybar > span { font-size: 18px; opacity: .8; }
.vg-replybar div { flex: 1; display: grid; min-width: 0; }
.vg-replybar small { color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vg-replybar button { border: 0; background: transparent; color: var(--fg); font-size: 16px; cursor: pointer; }
.message.vg-swipe-ready { box-shadow: 4px 0 0 0 var(--fg) !important; }
.vg-chip-img { width: 18px; height: 18px; object-fit: contain; }
