/* Stickers, custom emoji, GIFs: composer panel, messages, pack dialogs. Monochrome like the rest of the site. */
.vgs-toggle { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--fg-2, var(--fg));
    font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s, transform .15s; }
.vgs-toggle:hover { background: var(--ink-3); transform: scale(1.06); }
.vgs-toggle:disabled { opacity: .4; cursor: default; }

.vgs-panel { height: 300px; display: flex; flex-direction: column; background: var(--ink-1); border-top: 1px solid var(--line); animation: vgsUp .2s ease; }
@keyframes vgsUp { from { transform: translateY(16px); opacity: 0; } }
.vgs-tabs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.vgs-tabs span { flex: 1; }
.vgs-tabs button { border: 0; border-radius: 99px; padding: 6px 14px; background: transparent; color: var(--fg-3); font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; }
.vgs-tabs button.on { background: var(--fg); color: var(--ink-0); }
.vgs-tabs button[data-manage] { font-size: 18px; padding: 4px 10px; }
.vgs-body { flex: 1; overflow-y: auto; padding: 4px 10px 12px; overscroll-behavior: contain; }
.vgs-body h4 { margin: 10px 4px 4px; font-weight: 600; font-size: 12px; line-height: 1.2; color: var(--fg-3); text-transform: uppercase; letter-spacing: .04em; }
.vgs-grid { display: grid; gap: 4px; }
.vgs-grid.emoji { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.vgs-grid.stickers { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
.vgs-grid.gifs { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; padding-top: 8px; }
.vgs-grid button, .vgs-grid > span, .vgs-add, .vgs-pick { border: 0; background: transparent; border-radius: 12px; padding: 4px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1; font-size: 26px; color: var(--fg); transition: background .12s, transform .12s; }
.vgs-grid button:hover { background: var(--ink-3); transform: scale(1.06); }
.vgs-grid img { width: 100%; height: 100%; object-fit: contain; }
.vgs-grid.gifs button, .vgs-pick { aspect-ratio: 4 / 3; padding: 0; overflow: hidden; }
.vgs-grid.gifs img { object-fit: cover; }
.vgs-pick, .vgs-add { background: var(--ink-3); font-weight: 500; font-size: 13px; line-height: 1.2; text-align: center; }
.vgs-add { font-size: 30px; }
.vgs-grid.edit button small { font-size: 10px; color: var(--fg-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vgs-grid.edit.emoji button img { height: 70%; }
.vgs-empty { display: grid; justify-items: center; gap: 6px; padding: 36px 12px; text-align: center; color: var(--fg-3); }
.vgs-empty b { color: var(--fg); }
.vgs-empty button, .vgs-dialog .primary { border: 0; border-radius: 14px; padding: 11px 18px; background: var(--fg); color: var(--ink-0); font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; }
.vgs-dialog .ghost { border: 1px solid var(--line-strong); border-radius: 14px; padding: 11px 18px; background: transparent; color: var(--fg); font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; }
.vgs-dialog .danger { color: #e5484d; }
.vgs-note { margin: 6px 4px; color: var(--fg-3); font-size: 13px; line-height: 1.4; }
.vgs-note.strong { color: var(--fg); font-weight: 600; }

/* In messages */
.message:has(> .vgs-sticker) { background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; }
.vgs-sticker { display: block; width: 170px; height: 170px; object-fit: contain; cursor: pointer; animation: vgsPop .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes vgsPop { from { transform: scale(.6); opacity: 0; } }
.vgs-gif { position: relative; max-width: 300px; border-radius: 14px; overflow: hidden; }
.vgs-gif img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.vgs-gif span { position: absolute; left: 8px; top: 8px; padding: 1px 6px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 700; font-size: 11px; line-height: 1.4; }
.vgs-inline { width: 1.4em; height: 1.4em; object-fit: contain; vertical-align: -0.35em; margin: 0 1px; }
.vgs-inline.big { width: 64px; height: 64px; vertical-align: middle; }
.vgs-card { display: flex; align-items: center; gap: 12px; min-width: 230px; padding: 10px; border: 0; border-radius: 14px; background: rgba(127, 127, 127, .14);
    color: inherit; font: inherit; text-align: left; cursor: pointer; }
.vgs-card-cover { flex: none; width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; background: rgba(127, 127, 127, .14); font-size: 26px; overflow: hidden; }
.vgs-card-cover img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.vgs-card-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.vgs-card-text b, .vgs-card-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vgs-card-text small { opacity: .7; font-size: 13px; }
.vgs-card-open { font-weight: 600; font-size: 14px; }

/* Dialogs */
.vgs-layer { position: fixed; inset: 0; z-index: 2700; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0); transition: background .18s; }
.vgs-layer.open { background: rgba(0, 0, 0, .45); }
.vgs-dialog { width: min(520px, 100%); max-height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; gap: 8px; padding: 14px;
    background: var(--ink-1); color: var(--fg); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-xl);
    transform: scale(.92); opacity: 0; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1), opacity .15s; }
.vgs-layer.open .vgs-dialog { transform: none; opacity: 1; }
.vgs-dialog header { display: flex; align-items: center; gap: 4px; }
.vgs-dialog header > div { flex: 1; display: grid; gap: 2px; min-width: 0; padding-left: 6px; }
.vgs-dialog header b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vgs-dialog header small { color: var(--fg-3); font-size: 13px; }
.vgs-dialog header button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: transparent; color: var(--fg); font-size: 17px; cursor: pointer; }
.vgs-dialog header button:hover { background: var(--ink-3); }
.vgs-dialog > .vgs-grid { overflow-y: auto; padding: 4px; }
.vgs-dialog footer, .vgs-create { display: flex; gap: 10px; }
.vgs-dialog footer button, .vgs-create button { flex: 1; }
.vgs-list { display: grid; gap: 6px; overflow-y: auto; }
.vgs-list button { display: flex; align-items: center; gap: 12px; padding: 10px; border: 0; border-radius: 16px; background: var(--ink-2, var(--ink-3)); color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.vgs-list button:hover { background: var(--ink-3); }
.vgs-toast { position: fixed; left: 50%; bottom: 96px; z-index: 2800; transform: translateX(-50%); padding: 10px 16px; border-radius: 14px;
    background: var(--fg); color: var(--ink-0); font-weight: 500; font-size: 14px; line-height: 1.3; box-shadow: var(--shadow-xl); animation: vgsUp .2s ease; transition: opacity .3s; }
.vgs-toast.out { opacity: 0; }
@media (max-width: 640px) { .vgs-panel { height: 260px; } .vgs-sticker { width: 140px; height: 140px; } }
.vgs-panel button, .vgs-panel label, .vgs-dialog button, .vgs-dialog label, .vgs-toast { font-family: inherit; }

.vgs-file { display: flex; align-items: center; gap: 12px; min-width: 230px; max-width: 320px; padding: 4px 2px; color: inherit !important; text-decoration: none !important; }
.vgs-file-ext { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(127, 127, 127, .18); font-weight: 700; font-size: 11px; }
.vgs-file-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.vgs-file-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vgs-file-text small { opacity: .7; font-size: 12px; }
.vgs-file-dl { font-size: 20px; opacity: .85; }
.vgs-upload { position: relative; height: 26px; margin: 0 16px 6px; border-radius: 99px; background: var(--ink-3); overflow: hidden; }
.vgs-upload span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--fg); opacity: .25; transition: width .2s; }
.vgs-upload b { position: relative; display: block; text-align: center; font-size: 12px; line-height: 26px; }

/* Folder chips (folders.js) */
.vgf-chips { display: flex; gap: 6px; padding: 6px 16px 8px; overflow-x: auto; scrollbar-width: none; }
.vgf-chips::-webkit-scrollbar { display: none; }
.vgf-chips button { flex: none; border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; background: transparent; color: var(--fg-2, var(--fg));
    font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.vgf-chips button.on { background: var(--fg); color: var(--ink-0); border-color: var(--fg); }
.vgf-chips button.add { padding: 6px 10px; }
.vgf-row .contact-name { display: flex; align-items: center; gap: 8px; }
.vgf-row .vgf-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vgf-row .vgf-time { margin-left: auto; flex: none; }
.vgf-pick label { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; }
.vgf-pick label:hover { background: var(--ink-3); }
.vgf-pick input { width: 18px; height: 18px; accent-color: var(--fg); }

.vgs-search { width: calc(100% - 8px); margin: 8px 4px 4px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2, var(--ink-3)); color: var(--fg); font: inherit; }
.vgs-tgs { display: block; }
.vgs-grid .vgs-tgs, .vgs-grid video { width: 100%; height: 100%; object-fit: contain; }
video.vgs-sticker, span.vgs-sticker { display: block; width: 170px; height: 170px; object-fit: contain; cursor: pointer; }
video.vgs-inline, span.vgs-inline { display: inline-block; width: 1.4em; height: 1.4em; vertical-align: -0.35em; }
video.vgs-inline.big, span.vgs-inline.big { width: 64px; height: 64px; }
.vgs-h { margin: 10px 4px 4px; font-size: 12px; color: var(--fg-3); text-transform: uppercase; }
.message .vgs-sticker { width: 170px !important; height: 170px !important; }
@media (max-width: 640px) { .message .vgs-sticker { width: 140px !important; height: 140px !important; } }
