.comment-reactions {
    margin-top: 0.4em;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4em;
    position: relative;
    min-height: 26px;
    /* Reserve space for one row of reactions */
}

.comment-reaction-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
}

.comment-reaction {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
    border: 1px solid var(--color-border);
    background: var(--color-secondary-background);
    border-radius: 999px;
    padding: 0 0.5em;
    /* Use line-height/height for vertical centering */
    font-size: 0.9em;
    cursor: pointer;
    height: 26px;
    /* Fixed height */
    box-sizing: border-box;
    position: relative;
    /* For badge positioning */
    overflow: visible;
    /* Allow badge to overflow */
}

.comment-reaction.reacted {
    border-color: var(--color-secondary-active);
    background: color-mix(in srgb, var(--color-secondary-active) 15%, var(--color-secondary-background));
}

.comment-reaction-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--color-section-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 0 var(--space-1);
    font-size: 0.7em;
    color: var(--color-muted);
    min-width: 14px;
    text-align: center;
    line-height: 1.4;
    visibility: hidden;
    z-index: 2;
    box-shadow: var(--shadow-1);
}

.comment-reaction-count.is-visible {
    visibility: visible;
}

.add-reaction-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 0.3em;
    color: var(--color-chat-btn-text);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.add-reaction-btn .grayscale-emoji {
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.2s;
}

.add-reaction-btn:hover .grayscale-emoji {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.add-reaction-btn:hover {
    color: var(--color-text);
}

.comment-reaction-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
    padding: 0.4em;
    background: var(--color-section-bg);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-3);
    z-index: var(--layer-fullscreen);
}

#global-reaction-picker {
    position: fixed;
    /* top/left set by JS */
}

/* Legacy style: .comment-reaction-picker previously had absolute positioning here. 
   We keep the class for visual styling but override/reset positioning for the global ID. 
   The original rule was:
   .comment-reaction-picker { position: absolute; bottom: 2em; left: 0; ... }
   We replaced it above with shared visual styles.
*/

.comment-reaction-picker[hidden] {
    display: none;
}

.comment-reaction-picker-emoji {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1em;
}

.comment-topic-link {
    margin-top: 0.25em;
    font-size: 0.9em;
}

.comment-topic-switch {
    color: var(--color-active);
    text-decoration: none;
    font-weight: 600;
}

.comment-topic-switch:hover {
    text-decoration: underline;
}

.comment-action-block {
    margin-top: 0.6em;
}


.read-receipt-wrapper {
    display: inline-flex;
    align-items: center;
    /* margin-left: 0.5em; -- handled by gap */
    vertical-align: middle;
    height: 16px;
    /* Explicit height to match avatar */
}

.read-receipt-container {

    /* Reset absolute positioning */
    position: static;
    width: auto;
    display: flex;
    pointer-events: auto;
    z-index: auto;
    padding: 0;
    margin: 0;
}

.read-receipt-avatars {
    display: flex;
    align-items: center;
    gap: -4px;
    /* Slight overlap for compactness? Or keep standard gap */
    gap: 2px;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}



.comment-action-summary {
    cursor: pointer;
    font-weight: 600;
}

.comment-action-json {
    background: var(--color-section-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2);
    margin-top: 0.4em;
    padding: 0.5em;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
    font-family: var(--font-family-monospace, 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace);
    font-size: 0.9em;
}

.comment-action-edit-form {
    margin-top: 0.6em;
}

.comment-action-edit-textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2);
    padding: 0.5em;
    font-family: var(--font-family-monospace, 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace);
    font-size: 0.9em;
    min-height: 160px;
    resize: vertical;
}

.comment-action-edit-buttons {
    margin-top: 0.4em;
    display: flex;
    justify-content: flex-end;
    gap: 0.5em;
}

.edit-comment-action-btn,
.approve-comment-btn,
.deny-comment-btn {
    padding: 0.15em 0.4em;
    border-radius: var(--radius-2);
    font-size: 0.75rem;
    line-height: 1.3;
    cursor: pointer;
}

.edit-comment-action-btn {
    border: 1px solid var(--border-color);
    background: var(--surface-btn);
    color: var(--text-on-btn);
}

.edit-comment-action-btn:hover {
    filter: brightness(var(--hover-brightness, 0.95));
}

.approve-comment-btn {
    border: 1px solid color-mix(in srgb, var(--color-success) 35%, transparent);
    background: color-mix(in srgb, var(--color-success) 15%, transparent);
    color: var(--color-success);
}

.approve-comment-btn:hover {
    background: var(--color-success);
    color: var(--text-on-badge);
    border-color: var(--color-success);
}

.deny-comment-btn {
    border: 1px solid color-mix(in srgb, var(--color-danger) 35%, transparent);
    background: color-mix(in srgb, var(--color-danger) 15%, transparent);
    color: var(--color-danger);
}

.deny-comment-btn:hover {
    background: var(--color-danger);
    color: var(--text-on-badge);
    border-color: var(--color-danger);
}

.comment-status-label {
    margin-left: 0.4em;
    font-size: 0.75em;
    padding: 0.15em 0.5em;
    border-radius: 0.8em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    vertical-align: middle;
}

.comment-status-label.private-label {
    background-color: color-mix(in srgb, var(--color-badge-bg) 20%, transparent);
    color: var(--color-badge-bg);
}

.comment-status-label.agent-run-options-label {
    background-color: color-mix(in srgb, var(--color-muted) 15%, transparent);
    color: var(--color-muted);
}

.comment-status-label.approved-label {
    background-color: color-mix(in srgb, var(--color-complete) 20%, transparent);
    color: var(--color-complete);
}

.comment-status-label.denied-label {
    background-color: color-mix(in srgb, var(--color-danger) 20%, transparent);
    color: var(--color-danger);
}

.comment-action-container {
    position: absolute;
    bottom: 0.2em;
    right: 0.2em;
    display: flex;
    gap: 0.2em;
}
