/*
 * Emoji reactions (public/v2/reactions.js). Light by default, html.dark
 * overrides, like the rest of v2. Contrast (docs/reactions-client-spec.md):
 * pill borders and icons >= 3:1 against the page, text >= 4.5:1, and the
 * selected state is a 2px border plus a bold count, never colour alone.
 * The pill is ~34px to look at; every control's hit area is 44px, grown
 * with a pseudo-element rather than a bigger visual.
 */
:root {
    --dfr-fill: #FFFFFF;
    --dfr-border: #767B84;
    --dfr-text: #1B1F24;
    --dfr-icon: #5C626B;
    --dfr-on-fill: #E3EAF7;
    --dfr-on-border: #3468C8;
    --dfr-pop-bg: #FFFFFF;
    --dfr-pop-border: #D6CEC1;
    --dfr-hover: #F2EEE7;
    --dfr-focus: #3468C8;
}
html.dark {
    --dfr-fill: #1C2129;
    --dfr-border: #646B77;
    --dfr-text: #EAEFF6;
    --dfr-icon: #A7AFBB;
    --dfr-on-fill: rgba(111, 155, 242, .28);
    --dfr-on-border: #6F9BF2;
    --dfr-pop-bg: #1C2129;
    --dfr-pop-border: #3A414D;
    --dfr-hover: #262C36;
    --dfr-focus: #6F9BF2;
}

.dfr-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 6px; min-width: 0; }
.dfr-row[data-dfr-target="comment"] { flex: 0 1 auto; }

.dfr-pill, .dfr-add {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 34px; padding: 0 10px;
    border: 1px solid var(--dfr-border); border-radius: 10px;
    background: var(--dfr-fill); color: var(--dfr-text);
    font: inherit; font-size: 13px; font-weight: 600; line-height: 1;
    font-variant-numeric: tabular-nums; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
/* The 44px target, drawn nowhere. */
.dfr-pill::before, .dfr-add::before { content: ''; position: absolute; inset: -5px -1px; }
.dfr-add { min-width: 34px; padding: 0 7px; color: var(--dfr-icon); border-color: transparent; background: transparent; }
/* A plain icon like Reply beside it: a bordered box under every comment
   read as a form control waiting to be filled in. The icon keeps >= 3:1. */
.dfr-add::before { inset: -5px; }
.dfr-pill:hover, .dfr-add:hover { background: var(--dfr-hover); }
.dfr-pill.is-on { background: var(--dfr-on-fill); border: 2px solid var(--dfr-on-border); padding: 0 9px; }
.dfr-pill.is-on .dfr-n { font-weight: 800; }
.dfr-pill.is-static { cursor: default; }
.dfr-pill.is-static:hover { background: var(--dfr-fill); }
.dfr-pill:focus-visible, .dfr-add:focus-visible, .dfr-pop__item:focus-visible {
    outline: 2px solid var(--dfr-focus); outline-offset: 2px;
}
.dfr-add[hidden] { display: none; }

.dfr-emoji { font-size: 17px; line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif; }
.dfr-emote { width: 18px; height: 18px; object-fit: contain; }
.dfr-n { min-width: 7px; }

@media (prefers-reduced-motion: no-preference) {
    .dfr-pill.is-pop { animation: dfr-pop .18s ease-out; }
    @keyframes dfr-pop { 50% { transform: scale(1.08); } }
}

/* A deal card's summary: top three emoji and the total, beside the comment
   count. Reads as the neighbouring text buttons do. */
.dfr-summary {
    position: relative; display: inline-flex; align-items: center; gap: 5px;
    min-height: 36px; padding: 0 6px; border: 0; border-radius: 8px;
    background: transparent; color: var(--dfr-text); font: inherit; font-size: 13.5px; font-weight: 600;
    font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap;
}
.dfr-summary[hidden] { display: none; }
.dfr-summary::before { content: ''; position: absolute; inset: -4px 0; }
.dfr-summary:hover { background: var(--dfr-hover); }
.dfr-summary:focus-visible { outline: 2px solid var(--dfr-focus); outline-offset: 2px; }
.dfr-summary { gap: 12px; margin-left: -6px; flex: 0 1 auto; min-width: 0; overflow: hidden; }
/* Never wider than the room beside the comment count: reactions.js drops
   items from the end (and counts them in +N) until it fits; without the
   script it clips rather than pushing past the card. */
.dfr-summary__item, .dfr-summary__more { flex-shrink: 0; }
.dfr-summary__item { display: inline-flex; align-items: center; gap: 4px; }
.dfr-summary__more { color: var(--dfr-icon); font-weight: 600; }
.dfr-summary .dfr-emoji { font-size: 15px; }
.dfr-summary .dfr-emote { width: 16px; height: 16px; }

/* The comments drawer's deal header: the full row under the buy button. */
.dfc-deal__reactions { padding: 10px 0 2px; }
.dfc-c-actions { flex-wrap: wrap; row-gap: 10px; }
/* The actions line starts 10px left to align the heart's glyph; a bordered
   pill aligns with the words above it instead. */
.dfc-c-actions > .dfr-row:first-child { margin-left: 10px; margin-right: 4px; }

/* The popover (2026-10-09): one row of big emoji, then the full picker.
   On a phone it is a bottom sheet over a dimmed page. */
.dfr-pop {
    position: fixed; z-index: 2147483000;
    width: 360px; max-width: calc(100vw - 16px);
    padding: 10px; border: 1px solid var(--dfr-pop-border); border-radius: 18px;
    background: var(--dfr-pop-bg); color: var(--dfr-text);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .12);
    transform-origin: top left;
}
@media (prefers-reduced-motion: no-preference) {
    .dfr-pop { animation: dfr-pop-in .16s cubic-bezier(.2, .9, .3, 1.2); }
    .dfr-pop.is-sheet { animation: dfr-sheet-in .24s cubic-bezier(.2, .8, .2, 1); }
    .dfr-pop-shade { animation: dfr-fade .2s ease-out; }
}
@keyframes dfr-pop-in { from { opacity: 0; transform: scale(.94); } }
@keyframes dfr-sheet-in { from { transform: translateY(100%); } }
@keyframes dfr-fade { from { opacity: 0; } }
.dfr-pop.is-sheet {
    left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
    border-radius: 22px 22px 0 0; border-bottom: 0;
    padding: 6px 12px calc(12px + env(safe-area-inset-bottom, 0px));
}
.dfr-pop-shade { position: fixed; inset: 0; z-index: 2147482999; background: rgba(0, 0, 0, .45); }
.dfr-pop__grab { display: none; }
.dfr-pop.is-sheet .dfr-pop__grab { display: block; width: 40px; height: 5px; border-radius: 3px; margin: 4px auto 10px; background: var(--dfr-pop-border); }
.dfr-pop__quick { display: flex; justify-content: space-between; gap: 4px; padding: 2px 2px 10px; border-bottom: 1px solid var(--dfr-pop-border); }
.dfr-pop__item {
    flex: 0 0 auto; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--dfr-hover);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 24px; color: var(--dfr-icon); cursor: pointer; transition: transform .12s ease;
}
.dfr-pop__item .dfr-emoji { font-size: 24px; line-height: 1; }
.dfr-pop__item .dfr-emote { width: 26px; height: 26px; }
.dfr-pop__item:hover { transform: scale(1.12); }
.dfr-pop__item:active { transform: scale(.94); }
.dfr-pop__item.is-on { background: var(--dfr-on-fill); box-shadow: inset 0 0 0 2px var(--dfr-on-border); }
.dfr-pop.is-sheet .dfr-pop__item { width: 44px; height: 44px; }
.dfr-pop__picker { margin-top: 8px; min-height: 120px; }
.dfr-pop__loading { margin: 16px 8px; font-size: 13px; color: var(--dfr-icon); }
.dfr-pop__picker em-emoji-picker {
    height: 340px; width: 100%; max-width: 100%;
    --rgb-background: transparent; --shadow: none; --border-radius: 0;
}
.dfr-pop.is-sheet .dfr-pop__picker em-emoji-picker { height: min(52vh, 420px); }

/* A comment with no reactions yet: the lone add icon lines up with the words. */
.dfc-c-actions > .dfr-row:first-child > .dfr-add:first-child { margin-left: -7px; }

/* Comments (2026-10-09): "React" as a quiet word when there are no reactions,
   and a smaller + after the pills when there are. */
.dfr-add.dfr-add--text { min-width: 0; padding: 0 6px; font: inherit; font-size: 12px; font-weight: 600; color: var(--dfr-icon); }
.dfr-row[data-dfr-target="comment"] .dfr-add:not(.dfr-add--text) svg { width: 15px; height: 15px; }
.dfr-row[data-dfr-target="comment"] .dfr-add:not(.dfr-add--text) { min-width: 28px; opacity: .75; }

/* Your own reaction rising off its pill (2026-10-09). */
.dfr-lift { position: fixed; z-index: 2147483001; pointer-events: none; font-size: 22px; line-height: 1; animation: dfr-lift .9s cubic-bezier(.2, .7, .3, 1) forwards; }
.dfr-lift img { width: 22px; height: 22px; }
@keyframes dfr-lift { 0% { opacity: 0; transform: translateY(0) scale(.6); } 20% { opacity: 1; transform: translateY(-10px) scale(1.25); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }
@media (prefers-reduced-motion: reduce) { .dfr-lift { display: none; } }
