/* cv-reactions.css — the emoji reaction bar and its picker, shared by every screen that
   carries /js/cv-reactions.js. Colours come from the page's own theme tokens, never from
   a hardcoded hex, so the chips look at home in the chat, under a smart note and on a card. */

.cvre-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

/* Nothing on the message yet: the bar stays in the DOM (the next reaction lands in it) but
   takes no room at all, so a conversation of plain messages is not spaced out by empty rows. */
.cvre-bar:empty {
    display: none;
}

.cvre-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px 1px 5px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
    border-radius: 999px;
    background: var(--bg-item, rgba(255, 255, 255, 0.06));
    color: var(--text-secondary, inherit);
    font: 500 11px/1.7 var(--font, inherit);
    cursor: pointer;
    transition: transform .12s ease, border-color .18s ease, background .18s ease;
}

.cvre-chip:hover {
    border-color: var(--accent, #f5a623);
    transform: translateY(-1px);
}

/* A reaction the surface already shows somewhere else — the heart on a journey chat bubble's
   time line — is not drawn a second time under the message. The chip stays in the markup so the
   count read back for an optimistic toggle is still right; it is only never seen.
   (user, 2026-09-03: "i see two hearts on the journey chat ... remove the new line heart") */
.cvre-chip--mirrored { display: none !important; }

/* The ones I put there myself read as mine at a glance. */
.cvre-chip--mine {
    border-color: var(--accent, #f5a623);
    background: color-mix(in srgb, var(--accent, #f5a623) 16%, transparent);
    color: var(--text-primary, inherit);
}

.cvre-chip__emoji {
    font-size: 12px;
    line-height: 1;
}

.cvre-chip__count {
    font-variant-numeric: tabular-nums;
    opacity: .8;
}

/* A count of one says nothing the emoji does not already say. */
.cvre-chip__count:empty {
    display: none;
}

.cvre-picker {
    position: fixed;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px 6px;
    border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.2));
    border-radius: 999px;
    background: var(--bg-panel, #1b1b22);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    z-index: 100000;
    animation: cvrePickerIn .13s ease-out;
}

@keyframes cvrePickerIn {
    from { opacity: 0; transform: translateY(4px) scale(.96); }
    to   { opacity: 1; transform: none; }
}

.cvre-picker__emoji {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
}

.cvre-picker__emoji:hover,
.cvre-picker__emoji:focus-visible {
    background: var(--bg-item, rgba(255, 255, 255, 0.08));
    transform: scale(1.22);
    outline: none;
}

/* The button that opened the picker stays lit while it is open, so it is obvious what the
   row of emoji belongs to. */
.cvre-add--open {
    opacity: 1 !important;
    color: var(--accent, #f5a623);
}

@media (prefers-reduced-motion: reduce) {
    .cvre-picker { animation: none; }
    .cvre-chip:hover,
    .cvre-picker__emoji:hover { transform: none; }
}
