/* ─── OpenMoji Emoji Picker ─────────────────────────────────── */
.emoji-picker-container { position: relative; display: inline-block; }

.emoji-panel {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    width: 340px;
    max-height: 380px;
    z-index: 100;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.95);
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.emoji-panel.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
}

/* Category tabs */
.ompicker-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 8px 0;
    border-bottom: 1px solid #f1f5f9;
    overflow-x: auto;
    flex-shrink: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.ompicker-tabs::-webkit-scrollbar { display: none; }

.ompicker-tab {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    padding: 4px;
    position: relative;
}
.ompicker-tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2.5px;
    border-radius: 2px;
    background: var(--color-primary, #16a34a);
    transition: transform 0.2s ease;
}
.ompicker-tab:hover { background: #f1f5f9; }
.ompicker-tab.active { background: #f0fdf4; }
.ompicker-tab.active::after { transform: translateX(-50%) scaleX(1); }
.ompicker-tab img { pointer-events: none; }

/* Search */
.ompicker-search-wrap {
    position: relative;
    padding: 8px 10px;
    flex-shrink: 0;
}
.ompicker-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
}
.ompicker-search {
    width: 100%;
    padding: 7px 12px 7px 32px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ompicker-search:focus {
    border-color: var(--color-primary, #16a34a);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
    background: #fff;
}
.ompicker-search::placeholder { color: #94a3b8; }

/* Emoji grid */
.ompicker-section {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding: 4px 6px 8px;
}
.ompicker-section.hidden { display: none; }

.ompicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ompicker-emoji {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.12s, transform 0.12s;
    padding: 5px;
}
.ompicker-emoji:hover {
    background: #f0fdf4;
    transform: scale(1.18);
}
.ompicker-emoji:active { transform: scale(0.95); }
.ompicker-emoji img {
    width: 30px;
    height: 30px;
    pointer-events: none;
}

/* No results */
.ompicker-no-results {
    text-align: center;
    padding: 24px 12px;
    color: #94a3b8;
    font-size: 13px;
}
.ompicker-no-results.hidden { display: none; }

/* Attribution */
.ompicker-attribution {
    padding: 6px 12px;
    text-align: center;
    font-size: 10px;
    color: #94a3b8;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: #fafbfc;
    border-radius: 0 0 16px 16px;
}
.ompicker-attribution a {
    color: #64748b;
    text-decoration: none;
}
.ompicker-attribution a:hover { text-decoration: underline; }

/* ─── Mobile adjustments ────────────────────────────────────── */
@media (max-width: 640px) {
    .emoji-panel {
        width: 300px;
        max-height: 320px;
        left: auto;
        right: -8px;
        transform: none;
    }
    .emoji-panel.active {
        transform: translateY(0) scale(1);
    }
    .ompicker-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .ompicker-emoji {
        width: 38px;
        height: 38px;
    }
    .ompicker-emoji img {
        width: 26px;
        height: 26px;
    }
}