/* Scoped to .bex-comments so it cannot leak into the theme. Inherits the theme's font and text color. */
.bex-comments { --bex-accent: #0069d6; --bex-line: rgba(127, 127, 127, .28); --bex-muted: #666; margin: 2.5rem 0; font: inherit; color: inherit; }
.bex-comments *, .bex-comments *::before, .bex-comments *::after { box-sizing: border-box; }
.bex-title { font-size: 1.25rem; margin: 0 0 1rem; }
.bex-c { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: .8rem 0; }
.bex-item + .bex-item { border-top: 1px solid var(--bex-line); }
.bex-thread { margin-left: 22px; padding-left: 14px; border-left: 2px solid var(--bex-line); }
.bex-flat { margin-left: 0; }
.bex-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 600 .8rem system-ui, sans-serif; color: #fff; }
.bex-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.bex-when { color: var(--bex-muted); font-size: .85em; }
.bex-badge { font: 600 .72rem system-ui, sans-serif; color: #8f5a00; border: 1px solid currentColor; border-radius: 99px; padding: 1px 8px; }
.bex-body { overflow-wrap: anywhere; margin: .25rem 0 .35rem; }
.bex-body p { margin: 0 0 .6em; }
.bex-body p:last-child { margin-bottom: 0; }
.bex-body a { color: var(--bex-accent); }
.bex-link { font: inherit; font-size: .88em; color: var(--bex-accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.bex-more { font: inherit; margin: .8rem 0; padding: .5rem 1rem; border: 1px solid var(--bex-line); border-radius: 6px; background: transparent; color: inherit; cursor: pointer; }
.bex-empty { color: var(--bex-muted); }
.bex-form { display: grid; gap: .8rem; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--bex-line); }
.bex-main .bex-form { margin-top: .6rem; border-top: 0; padding-top: 0; }
.bex-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 520px) { .bex-row { grid-template-columns: 1fr; } .bex-c { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; } .bex-thread { margin-left: 10px; padding-left: 10px; } }
.bex-field label { display: block; font: 500 .85rem system-ui, sans-serif; margin-bottom: 3px; }
.bex-field input, .bex-field textarea { width: 100%; font: inherit; color: inherit; background: transparent; border: 1px solid var(--bex-line); border-radius: 6px; padding: .5rem .6rem; }
.bex-field input:focus-visible, .bex-field textarea:focus-visible, .bex-btn:focus-visible, .bex-link:focus-visible, .bex-more:focus-visible { outline: 2px solid var(--bex-accent); outline-offset: 2px; }
.bex-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.bex-check { display: flex; gap: .5rem; align-items: center; font-size: .92em; cursor: pointer; }
.bex-btn { justify-self: start; font: 600 1rem system-ui, sans-serif; background: var(--bex-accent); color: #fff; border: 0; border-radius: 6px; padding: .55rem 1.2rem; cursor: pointer; }
.bex-btn:disabled { opacity: .6; cursor: default; }
.bex-msg { min-height: 1.2em; font-size: .92em; }
.bex-err { color: #b3261e; } .bex-ok { color: #1b7a4b; }
.bex-replying { display: none; gap: .6rem; align-items: center; padding: .35rem .6rem; border: 1px solid var(--bex-line); border-radius: 6px; font-size: .9em; }
.bex-replying.bex-on { display: flex; }
.bex-sort { margin: -.4rem 0 .6rem; font-size: .9em; color: var(--bex-muted); }
.bex-sort b { color: inherit; }
.bex-replyto { color: var(--bex-muted); font-size: .8em; }
.bex-moreswrap, .bex-moreWrap { margin: 0; }
.bex-body .katex { font-size: 1.05em; }
.bex-body .katex-display { margin: .7em 0; overflow-x: auto; overflow-y: hidden; }

/* while the first page loads: keep the space, and keep the form out of the way so nothing jumps */
.bex-comments.bex-loading .bex-list { min-height: 14rem; }
.bex-comments.bex-loading .bex-slot { visibility: hidden; }

.bex-editform { margin-top: .6rem; border-top: 0; padding-top: 0; }
.bex-editbtns { display: flex; gap: 1rem; align-items: center; }
.bex-editlink:focus-visible, .bex-editform .bex-link:focus-visible { outline: 2px solid var(--bex-accent); outline-offset: 2px; }
