/* NAONDE · Seletor de GIFs da KLIPY no bate-papo (nd-klipy.js) — 04/12/2026
   Computador: painel acima da caixa de mensagem. Celular: folha que sobe de baixo, com a altura da maior parte da tela. */
.kly { --kly-fundo: #fff; --kly-tx: #111b21; --kly-tx2: #667781; --kly-linha: rgba(0, 0, 0, .08); --kly-campo: #f0f2f5; --kly-on: #111b21; --kly-on-tx: #fff;
  position: absolute; left: 10px; right: 10px; bottom: 74px; z-index: 30; height: min(470px, calc(100% - 140px)); min-height: 300px;
  display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: var(--kly-fundo); color: var(--kly-tx);
  border: 1px solid var(--kly-linha); box-shadow: 0 18px 48px rgba(11, 20, 26, .18), 0 2px 6px rgba(11, 20, 26, .06);
  font-size: 14px; animation: klyEntra .18s ease-out both; }
html.nd-escuro .kly { --kly-fundo: #1f2c33; --kly-tx: #e9edef; --kly-tx2: #8696a0; --kly-linha: rgba(255, 255, 255, .08); --kly-campo: #2a3942; --kly-on: #e9edef; --kly-on-tx: #111b21; }
.kly.sai { animation: klySai .15s ease-in forwards; }
@keyframes klyEntra { from { opacity: 0; transform: translateY(8px); } }
@keyframes klySai { to { opacity: 0; transform: translateY(6px); } }
.kly svg { width: 20px; height: 20px; display: block; flex: none; }
.kly button { font: inherit; color: inherit; cursor: pointer; }
.kly button:focus-visible { outline: 2px solid #008069; outline-offset: 2px; }

.kly-top { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px 12px; }
.kly-busca { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--kly-campo); color: var(--kly-tx2); }
.kly-busca input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--kly-tx); font: inherit; font-size: 15px; }
.kly-busca input::placeholder { color: var(--kly-tx2); }
.kly-busca input::-webkit-search-cancel-button { cursor: pointer; }
.kly-x { width: 38px; height: 38px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--kly-tx2) !important; }
.kly-x:hover { background: var(--kly-campo); }

.kly-cats { flex: none; display: flex; gap: 6px; padding: 2px 12px 8px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.kly-cats::-webkit-scrollbar { display: none; }
.kly-cat { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--kly-linha); border-radius: 16px; background: none; font-size: 13px; font-weight: 600; white-space: nowrap; text-transform: capitalize; transition: background .15s, color .15s; }
.kly-cat img { width: 22px; height: 22px; margin-left: -7px; border-radius: 50%; object-fit: cover; background: var(--kly-campo); }
.kly-cat:hover { background: var(--kly-campo); }
.kly-cat.on { background: var(--kly-on); color: var(--kly-on-tx) !important; border-color: var(--kly-on); }

.kly-grade { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 10px 8px; scrollbar-width: thin; }
.kly-cols { display: flex; gap: 6px; align-items: flex-start; }
.kly-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.kly-it { display: block; width: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--kly-campo) center / cover no-repeat; transition: transform .12s ease, filter .12s ease; }
.kly-it:hover { filter: brightness(.94); }
.kly-it:active { transform: scale(.97); }
.kly-it img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kly-msg { margin: 28px 16px; text-align: center; color: var(--kly-tx2); line-height: 1.5; }
.kly-tenta { margin-left: 4px; padding: 0; border: 0; background: none; color: #008069 !important; font-weight: 700; text-decoration: underline; }
.kly-fim { height: 1px; }

.kly-rodape { flex: none; display: flex; justify-content: flex-end; padding: 6px 14px 8px; border-top: 1px solid var(--kly-linha); color: var(--kly-tx2); font-size: 11.5px; letter-spacing: .01em; }
.kly-rodape b { font-weight: 800; letter-spacing: .04em; color: var(--kly-tx); }

/* prévia antes de enviar */
.kly-prev { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; background: var(--kly-fundo); animation: klyEntra .16s ease-out both; }
.kly-prev[hidden] { display: none; }
.kly-prev-top { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 14px 6px 8px; }
.kly-prev-top b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.kly-prev-m { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 16px; }
.kly-prev-m picture { display: contents; }
.kly-prev-m img { display: block; width: min(100%, 340px); max-height: 100%; height: auto; border-radius: 12px; object-fit: contain; background: var(--kly-campo); }
.kly-prev-bts { flex: none; display: flex; gap: 8px; padding: 10px 14px 14px; }
.kly-prev-bts button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.kly-cancela { border: 1px solid var(--kly-linha); background: none; }
.kly-cancela:hover { background: var(--kly-campo); }
.kly-envia { border: 0; background: #00a884; color: #fff !important; }
.kly-envia:hover { background: #008f72; }
.kly-envia:disabled { opacity: .6; cursor: default; }

/* celular: folha que sobe de baixo, por cima da caixa de mensagem */
@media (max-width: 899px) {
  .kly { position: absolute; left: 0; right: 0; bottom: 0; height: min(72dvh, 560px); min-height: 0; border-radius: 18px 18px 0 0; border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom); animation-name: klySobe; }
  .kly.sai { animation-name: klyDesce; }
  @keyframes klySobe { from { transform: translateY(24px); opacity: 0; } }
  @keyframes klyDesce { to { transform: translateY(24px); opacity: 0; } }
  .kly-busca input { font-size: 16px; } /* sem zoom automático no iPhone */
}
@media (prefers-reduced-motion: reduce) { .kly, .kly.sai, .kly-prev { animation-duration: .01ms !important; } }

/* GIF dentro do balão da conversa */
.zap-gif { position: relative; display: block; max-width: min(280px, 100%); border-radius: 6px; overflow: hidden; background: rgba(0, 0, 0, .06); }
.zap-gif img { display: block; width: 100%; height: auto; max-height: 320px; object-fit: cover; }
.zap-gif-tag { position: absolute; left: 7px; bottom: 7px; padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; pointer-events: none; }
.zap-b:not(.so-midia) .zap-gif { margin-bottom: 4px; }
.zap-gifbt .zap-gif-ic { display: grid; place-items: center; width: 26px; height: 20px; border: 1.8px solid currentColor; border-radius: 5px; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; line-height: 1; }
