/* GIFs (gif.js): the GIF button in compose bars, the picker, and GIFs inside messages */
.gif-btn { flex: none; align-self: flex-end; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--color-field); color: var(--color-ink-2);
  font: inherit; font-size: 12.5px; font-weight: 800; letter-spacing: .04em; }
@media (hover: hover) { .gif-btn:hover { background: var(--color-hover); color: var(--color-ink); } }
@media (min-width: 1024px) { .tk__main .gif-btn, .ch__main .gif-btn { width: 48px; height: 48px; background: var(--color-surface); box-shadow: inset 0 0 0 var(--hairline) var(--color-line-strong); } }

.gif-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.gif-scrim .gif-panel { max-height: none; overflow: hidden; border-radius: 20px; }
.gif-sheet .gif-panel { height: min(72dvh, 620px); }
.gif-search { flex: none; }
.gif-label { flex: none; margin: 2px 4px 0; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--color-ink-muted); }
.gif-grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; columns: 2; column-gap: 6px; padding: 2px; }
.gif-tile { display: block; width: 100%; margin: 0 0 6px; padding: 0; border-radius: 12px; overflow: hidden; background: var(--color-field); break-inside: avoid; }
.gif-tile img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gif-tile:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-accent); }
@media (hover: hover) { .gif-tile:hover img { opacity: .85; } }
.gif-by { flex: none; margin: 0; text-align: right; font-size: 11px; color: var(--color-ink-muted); }
.gif-skel { columns: 2; column-gap: 6px; }
.gif-skel i { display: block; height: 110px; margin-bottom: 6px; border-radius: 12px; background: var(--color-field); animation: rd-pulse 1s ease-in-out infinite; }
.gif-skel i:nth-child(3n) { height: 150px; } .gif-skel i:nth-child(4n) { height: 90px; }
.gif-msg { column-span: all; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; text-align: center; }
.gif-msg > svg { width: 28px; height: 28px; color: var(--color-ink-muted); }
.gif-msg b { font-size: 15px; }
.gif-msg small { max-width: 34ch; font-size: 13px; line-height: 19px; color: var(--color-ink-muted); }
.gif-msg__bad { color: var(--color-danger) !important; }
.gif-key { display: flex; gap: 8px; width: 100%; max-width: 320px; margin-top: 6px; }
.gif-key input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 0; border-radius: 21px; background: var(--color-field); color: var(--color-ink); font: inherit; font-size: 14px; }
.gif-key .dx-btn { height: 42px; border-radius: 21px; padding: 0 16px; background: var(--color-accent); color: var(--color-on-accent); box-shadow: none; }

/* a GIF inside a message: no bubble padding around it, rounded like the bubble */
.msg-gif { display: block; overflow: hidden; border-radius: 14px; background: var(--color-field); margin: 0 0 4px; }
.msg-gif img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ob-bubble.has-gif, .ob-bubble.has-gif.is-mine, .ob-bubble.has-gif.is-crew { padding: 4px 4px 6px; background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
.ob-bubble.has-gif > small { padding: 0 6px; }
.ob-bubble.has-gif > .ob-bubble__who { padding: 2px 6px 4px; }
