/* The comment and reply boxes (comments/partials/commentForm.php,
   replyForm.php; behaviour in assets/js/comment_box.js): your picture, a pill
   that grows as you type with emoji, photo and voice inside it, a round Send
   that lights up once there's something to send; quick emoji above while it
   has focus; the emoji panel and the @ list float above the box. */
.box-footer.sbc-wrap { padding: 10px 12px 12px; background: transparent; border-top: 1px solid var(--sb-border, #e4e6eb); }
.sbc-form { position: relative; margin: 0; }
.sbc-row { display: flex; align-items: flex-end; gap: 8px; }
.sbc-me { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; object-fit: cover; margin-bottom: 3px; }

.sbc-pill {
    flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 0;
    padding: 2px 4px 2px 14px; border: 1px solid transparent; border-radius: 20px;
    background: #f0f2f5;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.sbc-form.is-focused .sbc-pill {
    background: var(--sb-surface, #fff);
    border-color: var(--sb-primary, #1877f2);
    box-shadow: 0 0 0 3px rgba(24, 119, 242, .12);
}
.sbc-input {
    flex: 1; min-width: 0; height: 36px; max-height: 132px; margin: 0; padding: 8px 0;
    border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important;
    resize: none; overflow-y: hidden;
    font: inherit; font-size: 14px; line-height: 20px; color: var(--sb-text, #050505);
}
.sbc-input::placeholder { color: var(--sb-text-muted, #65676b); }
/* The pill draws the focus ring around the whole box; the site-wide one
   (sb_theme.css, every textarea:focus-visible) would draw a second inside it. */
.sbc-form .sbc-input:focus, .sbc-form .sbc-input:focus-visible { outline: none !important; box-shadow: none !important; }

.sbc-icon, .sbc-pill .cm-tool {
    flex: 0 0 auto; width: 32px; height: 32px; margin: 0 0 2px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; background: transparent; cursor: pointer;
    color: var(--sb-text-muted, #65676b); font-size: 17px;
    transition: background .12s ease, color .12s ease;
}
.sbc-icon:hover, .sbc-pill .cm-tool:hover { background: rgba(0, 0, 0, .06); color: var(--sb-primary, #1877f2); }
.sbc-pill .cm-tools { display: inline-flex; align-items: flex-end; }

.sbc-send {
    flex: 0 0 36px; width: 36px; height: 36px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; cursor: pointer; font-size: 16px;
    background: rgba(0, 0, 0, .06); color: var(--sb-text-muted, #65676b);
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sbc-form.has-text .sbc-send { background: var(--sb-primary, #1877f2); color: #fff; }
.sbc-form.has-text .sbc-send:hover { transform: scale(1.06); }

/* Quick emoji, while the box has focus. */
.sbc-quick { display: none; gap: 2px; padding: 0 0 6px 40px; }
.sbc-form.is-reply .sbc-quick { padding-left: 0; }
.sbc-form.is-focused .sbc-quick { display: flex; animation: sbcIn .16s ease-out; }
.sbc-emo {
    border: 0; background: transparent; cursor: pointer;
    padding: 4px 6px; border-radius: 10px; font-size: 20px; line-height: 1;
    transition: transform .12s ease, background .12s ease;
}
.sbc-emo:hover { background: rgba(0, 0, 0, .06); transform: translateY(-2px) scale(1.15); }

/* The @ list (the emoji picker is assets/css/sb_emoji.css). */
.sbc-pop {
    position: absolute; bottom: 46px; left: 40px; z-index: 40;
    max-width: 320px; width: calc(100% - 40px);
    padding: 6px; border-radius: 14px;
    background: var(--sb-surface, #fff); border: 1px solid var(--sb-border, #e4e6eb);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
    animation: sbcIn .14s ease-out;
}
.sbc-form.is-reply .sbc-pop { left: 0; width: 100%; }
.sbc-pop[hidden] { display: none; }
/* In the post box (assets/js/post_mentions.js) the list opens below the text. */
.sbpm-list { top: 100%; bottom: auto; left: 12px; margin-top: 4px; }

.sbc-mentions { max-height: 240px; overflow-y: auto; }
.sbc-person {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 6px 8px; border: 0; border-radius: 10px; background: transparent;
    text-align: left; cursor: pointer;
}
.sbc-person img { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; object-fit: cover; }
.sbc-person span { display: flex; flex-direction: column; min-width: 0; }
.sbc-person b { font-size: 14px; font-weight: 700; color: var(--sb-text, #050505); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbc-person small { font-size: 12px; color: var(--sb-text-muted, #65676b); }
.sbc-person.is-on, .sbc-person:hover { background: rgba(24, 119, 242, .08); }

/* A name picked with @ in a shown comment (library/CommentMentions.php). */
a.sb-mention { font-weight: 700; color: var(--sb-primary, #1877f2); }

@keyframes sbcIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

body.theme-dark .sbc-pill { background: var(--sb-surface-2, #262b3a); }
body.theme-dark .sbc-form.is-focused .sbc-pill { background: var(--sb-surface-2, #262b3a); }
/* sb_theme.css paints every dark textarea with the input colour; inside the pill it must stay clear. */
body.theme-dark .sbc-form .sbc-input { background: transparent !important; border: 0 !important; box-shadow: none !important; }
body.theme-dark .sbc-send, body.theme-dark .sbc-icon:hover, body.theme-dark .sbc-pill .cm-tool:hover,
body.theme-dark .sbc-emo:hover { background: rgba(255, 255, 255, .08); }
body.theme-dark .sbc-pop { background: #242526; border-color: #3e4042; }
body.theme-dark .sbc-person b { color: #e4e6eb; }
