/* Telegram-like emoji picker */
.tg-emoji-root {
    position: relative;
    z-index: 5;
}

.mud-popover.tg-emoji-popover,
.mud-popover.tg-emoji-popover.mud-popover-open {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    pointer-events: auto !important;
    z-index: 1500 !important;
}

.tg-emoji-panel {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 12px;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, .06),
        0 2px 8px rgba(15, 23, 42, .1),
        0 8px 24px rgba(15, 23, 42, .12);
    display: flex;
    flex-direction: column;
    font-family: Samim, Vazirmatn, Tahoma, sans-serif;
    height: 392px;
    overflow: hidden;
    pointer-events: auto;
    position: relative;
    width: 352px;
}

.tg-emoji-search {
    align-items: center;
    background: #f4f4f5;
    border-radius: 10px;
    color: #707579;
    display: flex;
    gap: 6px;
    margin: 10px 10px 6px;
    padding: 6px 10px;
}

.tg-emoji-search-input {
    background: transparent;
    border: none;
    color: #111;
    flex: 1;
    font-family: inherit;
    font-size: .82rem;
    min-width: 0;
    outline: none;
}

.tg-emoji-search-input::placeholder {
    color: #a0a5ab;
}

.tg-emoji-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 8px 8px;
    scroll-behavior: smooth;
    text-align: right;
}

.tg-emoji-section {
    margin-bottom: 6px;
}

.tg-emoji-section-title {
    background: rgba(255, 255, 255, .92);
    color: #707579;
    font-family: Samim, Vazirmatn, Tahoma, sans-serif;
    font-size: .72rem;
    font-weight: 700;
    padding: 8px 4px 6px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tg-emoji-grid {
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(8, 1fr);
}

.tg-emoji-cell {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", Samim, sans-serif;
    font-size: 1.35rem;
    height: 36px;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background .12s ease, transform .12s ease;
}

.tg-emoji-cell:hover {
    background: rgba(51, 144, 236, .12);
    transform: scale(1.12);
}

.tg-emoji-empty {
    color: #95a0aa;
    font-size: .8rem;
    padding: 24px 8px;
    text-align: center;
}

.tg-emoji-footer {
    background: #fff;
    border-top: 1px solid #eef0f2;
    display: flex;
    justify-content: space-between;
    padding: 4px 6px 6px;
}

.tg-emoji-cat {
    align-items: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    flex: 1;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", Samim, sans-serif;
    font-size: 1.05rem;
    height: 34px;
    justify-content: center;
    opacity: .55;
    padding: 0;
    position: relative;
}

.tg-emoji-cat:hover {
    background: #f4f4f5;
    opacity: .85;
}

.tg-emoji-cat.is-active {
    opacity: 1;
}

.tg-emoji-cat.is-active::after {
    background: #3390ec;
    border-radius: 999px;
    bottom: 2px;
    content: "";
    height: 2px;
    left: 22%;
    position: absolute;
    right: 22%;
}

@media (max-width: 700px) {
    .tg-emoji-panel {
        height: 360px;
        width: min(340px, 92vw);
    }
}
