/* cv-emoji-input.css — the panel that types an emoji into what you are writing.
   Tokens only: it renders inside the dashboard, the smart-note popup and the chat window,
   which all define their own --bg-* / --text-* / --border, and it has to follow whichever
   theme it lands in. */

/* Only the colour and the open state live here. NO size, no padding, no radius: this file is
   injected after every page's own stylesheet, so a size here would silently override whatever
   the composer already gives its buttons — and the smart-note toolbar button collapsed to its
   icon the moment it did. Each composer sizes its own button, next to its send and its mic. */
.cvemoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted, #8a8a8a);
    cursor: pointer;
    transition: background .12s, color .12s, border-color .12s;
}
.cvemoji-btn:hover,
.cvemoji-btn--open { color: var(--accent, #f5a623); }

.cvemoji-panel {
    position: fixed;
    width: 288px;
    max-width: calc(100vw - 16px);
    padding: 8px;
    border: 1px solid var(--border, rgba(127,127,127,.35));
    border-radius: 14px;
    background: var(--bg-panel, #1b1b1b);
    box-shadow: 0 14px 40px rgba(0,0,0,0.38);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.cvemoji-panel__search {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    height: 32px;
    border: 1px solid var(--border, rgba(127,127,127,.35));
    border-radius: 9px;
    color: var(--text-muted, #8a8a8a);
    background: var(--bg-item, rgba(127,127,127,.10));
}
.cvemoji-search {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary, #f0f0f0);
    font-size: 13px;
    font-family: inherit;
}

.cvemoji-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border, rgba(127,127,127,.25));
}
.cvemoji-tab {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #8a8a8a);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.cvemoji-tab:hover { background: var(--bg-item, rgba(127,127,127,.14)); color: var(--text-primary, #f0f0f0); }
.cvemoji-tab.is-active { background: var(--bg-item, rgba(127,127,127,.18)); color: var(--accent, #f5a623); }

.cvemoji-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    max-height: 208px;
    overflow-y: auto;
    overflow-x: hidden;
}
.cvemoji-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: transparent;
    /* The glyph is the content, so it is sized like content and not like an icon. */
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: background .1s, transform .1s;
}
.cvemoji-cell:hover { background: var(--bg-item, rgba(127,127,127,.18)); transform: scale(1.18); }

.cvemoji-none {
    grid-column: 1 / -1;
    padding: 22px 6px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted, #8a8a8a);
}

/* The strip on top: the Emoji / Stickers tabs (or just the title, when the composer has no
   stickers) and the close button. The panel never closes on a click beside it, so the close
   button is the way out that is always on screen. */
.cvemoji-modes {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border, rgba(127,127,127,.25));
}
.cvemoji-mode {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted, #8a8a8a);
    font: 600 12.5px var(--font, inherit);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.cvemoji-mode:hover { background: var(--bg-item, rgba(127,127,127,.14)); color: var(--text-primary, #f0f0f0); }
/* The chosen tab is a tint and a colour, never a size change: a strip that grows when pressed
   moves the grid under the finger that is about to press it. */
.cvemoji-mode.is-active { background-color: var(--bg-item, rgba(127,127,127,.18)); color: var(--accent, #f5a623); }
.cvemoji-modes__title {
    flex: 1;
    padding: 0 6px;
    font: 600 12.5px var(--font, inherit);
    color: var(--text-secondary, #b0b0b0);
}
.cvemoji-close {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted, #8a8a8a);
    cursor: pointer;
}
.cvemoji-close:hover { background: var(--bg-item, rgba(127,127,127,.14)); color: var(--text-primary, #f0f0f0); }

.cvemoji-pane {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.cvemoji-pane[hidden] { display: none; }

/* With a sticker grid in it the panel is a little wider than an emoji grid needs. */
.cvemoji-panel--picker { width: 336px; }

/* A phone has less room and fatter fingers: fewer columns, bigger cells. */
@media (max-width: 640px) {
    .cvemoji-panel { width: 264px; }
    .cvemoji-panel--picker { width: 320px; }
    .cvemoji-grid { grid-template-columns: repeat(6, 1fr); max-height: 172px; }
    .cvemoji-cell { height: 38px; font-size: 23px; }
}
