#search-comments-btn,
#voice-comments-btn,
#attach-image-btn,
#cancel-edit-btn {
    float: right;
    margin-right: 0.5em;
}

.comment-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

#new-comment-form button[type="submit"] {
    float: right;
}

#search-comments-btn,
#voice-comments-btn,
#attach-image-btn,
#cancel-edit-btn,
#new-comment-form button[type="submit"],
.convert-comment-btn,
.delete-comment-btn,
.edit-comment-btn,
.review-comment-btn,
.copy-comment-link-btn {
    border: none;
    background: none;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-chat-btn-text);
}

/* Buttons inherit the body font globally; keep the per-message action strip at its prior size. */
.convert-comment-btn,
.delete-comment-btn,
.edit-comment-btn,
.review-comment-btn,
.copy-comment-link-btn {
    font-size: 0.8125rem;
}

.comment-approval-reason {
    width: 100%;
    margin-top: var(--space-2);
    margin-bottom: var(--space-2);
}

.comment-approval-reason label {
    display: block;
    margin-bottom: var(--space-1);
}

.comment-approval-reason textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    resize: vertical;
}

.comment-owner-only,
.comment-delete-hidden,
.comment-approve-hidden {
    display: none;
}

.comment-stop-btn {
    background: var(--surface-btn);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2);
    cursor: pointer;
    padding: var(--space-px-1) var(--space-px-2);
    font-size: var(--text-00);
    color: var(--color-danger);
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: var(--space-px-1);
    transition: background 0.15s, color 0.15s;
}

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

.comment-stop-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comment-copy-notice {
    position: absolute;
    right: 0.2em;
    bottom: 2.4em;
    background: var(--color-section-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2);
    padding: 0.2em 0.6em;
    font-size: 0.75em;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.agent-run-options-toggle .thinking-battery-segment {
    opacity: clamp(0.18, calc(var(--thinking-level, 0) - var(--segment) + 1), 1);
}

.agent-run-options-toggle.active .thinking-icon {
    color: var(--color-complete);
}

.agent-run-options-panel {
    overflow-y: auto;
    width: 300px;
    max-width: calc(100vw - 16px);
}

.agent-run-options-help {
    margin: 0;
    padding: 0.5em 0.75em;
    font-size: 0.85em;
    color: var(--color-muted);
}

.comment-attachment-list {
    clear: both;
    margin-top: 0.25em;
    font-size: 0.9em;
    color: var(--color-muted);
}

.comment-attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    background: var(--color-section-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-2);
    padding: 0.2em 0.4em;
    margin-right: 0.25em;
    margin-top: 0.2em;
}

.comment-attachment-remove {
    border: none;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    font-size: 1em;
    line-height: 1;
    padding: 0 0.1em;
}

.comment-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4em;
    margin-top: 0.5em;
}

.comment-attachment-link {
    display: inline-block;
    max-width: 100%;
}

.comment-attachment-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-2);
    border: 1px solid var(--color-border);
}

.comment-copy-notice.visible {
    opacity: 1;
    transform: translateY(0);
}

.send-icon {
    width: 28px;
    height: 28px;
    color: var(--color-text);
}

@media (max-width: 600px) {
    #comments-popup {
        position: fixed;
        right: 0;
        left: 0;
        top: auto;
        bottom: env(keyboard-inset-height, 0);
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0.5em;
        border-radius: 10px 10px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s;
    }

    #comments-popup.open {
        transform: none;
    }

    #comments-popup[data-fullscreen="true"] {
        transform: none;
    }
}

.comment-item.highlight-flash {
    animation: comment-flash 2s ease-out;
}

@keyframes comment-flash {
    from {
        background: var(--color-highlight);
    }

    to {
        background: transparent;
    }
}

.comment-participants-bar,
.comment-contexts-bar {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.comment-participants-bar #comment-participants,
.comment-contexts-bar .comment-contexts-list {
    flex: 1;
    min-width: 0;
}
