/* Forum reactions (ISOA-445) */
.forum-reactions {
    display: inline-block;
    vertical-align: middle;
    white-space: nowrap;
}

/* Keeps view-only reaction slots observable by IntersectionObserver (not :empty / display:none). */
.forum-reactions-lazy-sentinel {
    display: inline-block;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    vertical-align: middle;
}

.forum-reactions-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}

/* Summary pill: emoji | count */
.forum-reactions-chip {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #ccd0d5;
    font-size: 0.85em;
    line-height: 1.2;
    touch-action: manipulation;
    vertical-align: middle;
}

/* Thread rollup on parent title row — subtle tint, no add button */
.forum-reactions-thread .forum-reactions-chip {
    background: #eef2f6;
    border-color: #c5cdd8;
    cursor: default;
}

.forum-reactions-divider {
    display: inline-block;
    width: 1px;
    height: 14px;
    margin: 0 6px;
    background: #ccd0d5;
    flex-shrink: 0;
}

.forum-reactions-icons {
    display: inline-flex;
    align-items: center;
    gap: 1px;
}

.forum-reactions-icon {
    font-size: 1.05em;
    line-height: 1;
}

.forum-reactions-count {
    color: #65676b;
    font-weight: 600;
    font-size: 0.95em;
    min-width: 1em;
    line-height: 1;
}

/* Separate grey smiley+plus add button */
.forum-reactions-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #ccd0d5;
    background: #fff;
    color: #65676b;
    cursor: pointer;
    border-radius: 50%;
    touch-action: manipulation;
    flex-shrink: 0;
}

.forum-reactions-add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.forum-reactions-add:hover,
.forum-reactions-add:focus-visible {
    background: #f0f2f5;
    color: #050505;
    outline: 2px solid #649b41;
    outline-offset: 1px;
}

/* Expanded message: reactions float left, buttons stay on the same row (RTL right) */
.MsgBody .forum-msg-actions {
    display: block;
    overflow: auto;
    clear: both;
    margin-top: 6px;
    margin-bottom: 4px;
}

.MsgBody .forum-reactions {
    float: left;
    width: auto;
    max-width: none;
    flex: none;
    margin-inline-end: 12px;
}

.MsgBody .forum-reactions:empty {
    display: none;
}

.MsgBody .forum-msg-actions-buttons {
    white-space: nowrap;
}

.forum-reactions-popover {
    position: fixed;
    z-index: 10050;
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.forum-reactions-popover[hidden],
.forum-reactions-backdrop[hidden],
.forum-reactions-sheet[hidden] {
    display: none !important;
}

/* Collapsed title row: compact inline with IP/date (base .forum-msg-meta in Default.aspx) */
.forum-msg-meta .forum-reactions {
    display: inline-block;
    vertical-align: middle;
    margin-inline-end: 6px;
}

.forum-msg-meta .forum-reactions:empty,
.forum-msg-meta .forum-reactions-thread:empty {
    display: none;
}

.forum-msg-meta .forum-reactions-chip {
    padding: 1px 6px 1px 4px;
    font-size: 0.78em;
}

.forum-msg-meta .forum-reactions-divider {
    height: 12px;
    margin: 0 4px;
}

.forum-msg-meta .forum-reactions-add {
    width: 24px;
    height: 24px;
}

.forum-msg-meta .forum-reactions-add-icon svg {
    width: 16px;
    height: 16px;
}

.forum-msg-meta .forum-reactions-icon {
    font-size: 0.95em;
}

.forum-reactions-picker-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 4px;
    border: none;
    background: transparent;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 50%;
    touch-action: manipulation;
}

.forum-reactions-picker-btn:hover,
.forum-reactions-picker-btn:focus-visible {
    background: #f0f2f5;
    outline: 2px solid #649b41;
    outline-offset: 1px;
}

.forum-reactions-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10049;
    background: rgba(0, 0, 0, 0.4);
}

.forum-reactions-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    background: #fff;
    border-radius: 16px 16px 0 0;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.forum-reactions-sheet-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 12px;
}

.forum-reactions-sheet-cancel {
    display: block;
    width: 100%;
    min-height: 44px;
    border: none;
    background: #f0f2f5;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    touch-action: manipulation;
}

body.forum-reactions-sheet-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .forum-reactions-chip {
        max-width: 100%;
    }

    .forum-reactions-sheet-row .forum-reactions-picker-btn {
        font-size: 2em;
    }
}

@media (max-width: 360px) {
    .forum-reactions-icons .forum-reactions-icon:nth-child(n+3) {
        display: none;
    }
}
