/* ===== Панель эмодзи / стикеров / GIF 2.0.7 ===== */
.composer-fun-panel.fp { display: flex; flex-direction: column; padding: 6px 10px 0 !important; max-height: min(52vh, 420px) !important; height: min(52vh, 420px); overflow: hidden !important; }
.composer-fun-panel.fp.hidden { display: none !important; }
.fp .composer-media-handle { flex: 0 0 auto; }
.fp .composer-fun-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.fp .fun-tab-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; }
.fp .fun-tab-panel.hidden { display: none; }
.fp #funPanelMusic, .fp #funPanelLocation { overflow: auto; padding-bottom: 8px; }
.fp .composer-fun-tabs { order: 3; flex: 0 0 auto; display: flex; gap: 2px; margin: 0 -10px; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg-elevated); overflow-x: auto; scrollbar-width: none; }
.fp .composer-fun-tab { flex: 1; min-width: 56px; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 4px !important; border: 0 !important; border-radius: 10px !important; background: transparent !important; color: var(--muted) !important; font-size: 10.5px !important; font-weight: 600; box-shadow: none !important; }
.fp .composer-fun-tab.active { color: var(--primary) !important; background: color-mix(in srgb, var(--primary) 10%, transparent) !important; }
.fp-tab-ico { font-size: 19px; line-height: 1.1; }
.fp-tab-gif { font-size: 11px; font-weight: 900; padding: 1px 4px; border: 2px solid currentColor; border-radius: 5px; margin: 2px 0; }
.fp-search input { width: 100%; box-sizing: border-box; height: 36px; padding: 0 12px 0 34px; border-radius: 10px; border: 0; background: var(--bg-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") 10px center / 16px no-repeat; color: var(--text); font: inherit; font-size: 14px; outline: none; }
.fp-search input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 40%, transparent); }
.fp-cats { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.fp-cats button { flex: 0 0 auto; width: 34px; height: 30px; border: 0; border-radius: 8px; background: transparent; font-size: 17px; cursor: pointer; opacity: .55; transition: opacity .15s, background .15s; }
.fp-cats button.is-on { opacity: 1; background: var(--bg-soft); }
.fp-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 8px; scrollbar-width: thin; }
.fp-sec-title { position: sticky; top: 0; z-index: 1; padding: 6px 2px 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--bg-elevated); text-transform: uppercase; letter-spacing: .03em; }
.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
.fp-emoji { aspect-ratio: 1; border: 0; border-radius: 10px; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; transition: background .12s, transform .12s; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.fp-emoji:hover { background: var(--bg-soft); transform: scale(1.12); }
.fp-emoji.is-pop { animation: fpPop .3s ease; }
@keyframes fpPop { 50% { transform: scale(1.35); } }
.fp-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.fp-packs { display: flex; gap: 4px; flex: 0 0 auto; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.fp-packs button { flex: 0 0 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.fp-packs button img { width: 30px; height: 30px; }
.fp-packs button.is-on { background: var(--bg-soft); box-shadow: inset 0 -2px 0 var(--primary); }
.fp-pack-add { color: var(--primary); font-weight: 700; }
.fp-stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; padding-top: 6px; }
.fp-sticker { position: relative; aspect-ratio: 1; border: 0; border-radius: 14px; background: transparent; padding: 6px; cursor: pointer; transition: transform .15s cubic-bezier(.3,1.5,.5,1), background .15s; }
.fp-sticker:hover { background: var(--bg-soft); transform: scale(1.06); }
.fp-sticker:active { transform: scale(.94); }
.fp-sticker img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.fp-sticker-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 20px; text-align: center; }
.fp-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.fp-chips button { flex: 0 0 auto; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 12.5px; cursor: pointer; }
.fp-chips button:hover { border-color: var(--primary); color: var(--primary); }
.fp-gifs { columns: 3 120px; column-gap: 4px; }
.fp-span { column-span: all; }
.fp-gif { display: block; width: 100%; margin: 0 0 4px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--bg-soft); cursor: pointer; break-inside: avoid; aspect-ratio: 1 / var(--r, 1); }
.fp-gif img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.fp-gif:hover img { transform: scale(1.04); }
.fp-more { text-align: center; font-size: 12px; color: var(--muted); padding: 6px; }
html.layout-desktop .composer-fun-panel.fp { height: 380px; }
