/* =========================================================
   WRAPPER — theme .mh-wrapper is the outer box; this is inner content only
   ========================================================= */

body.bwb-community-page .mh-wrapper {
    max-width: 1380px;
    margin-left: auto;
    margin-right: auto;
    padding: 32px;
    background: #181a1b !important;
    /* Same radius as child theme .mh-wrapper — must repeat here: this selector beats .mh-wrapper */
    border-radius: 6px 6px 0 0;
}

body.bwb-community-page .mh-wrapper .mh-main {
    float: none;
    width: 100%;
    max-width: none;
    margin: 0;
}

body.bwb-community-page .mh-wrapper .mh-content,
body.bwb-community-page.mh-right-sb .mh-wrapper .mh-content,
body.bwb-community-page.mh-disable-sb .mh-wrapper .mh-content {
    width: 100% !important;
    float: none;
    margin: 0;
    padding: 0;
}

/* Theme child uses asymmetric % margins on #main-content for sidebar pages — not for forum */
body.bwb-community-page #main-content,
body.bwb-community-page.mh-right-sb #main-content,
body.bwb-community-page.mh-left-sb #main-content,
body.bwb-community-page.mh-disable-sb #main-content {
    float: none !important;
    width: 100% !important;
    max-width: none;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

.bwb-community-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    color: #f0f0f0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.bwb-community-wrapper.bwb-maintenance {
    text-align: center;
    padding: 28px 0;
    color: #fff;
}
.bwb-maintenance-message h1 {
    margin: 0 0 12px;
    font-size: 1.75rem;
    color: #fff;
}
.bwb-maintenance-message p {
    margin: 0;
    color: #e0e0e0;
}

.bwb-community-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.bwb-community-top-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
}

/* ----- Search form ----- */
.bwb-search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.bwb-community-top-actions .bwb-search-form {
    margin-bottom: 0;
}
.bwb-community-top-actions .bwb-search-form input[type="search"] {
    min-width: 160px;
    padding: 6px 10px;
    font-size: 14px;
}
.bwb-community-top-actions .bwb-search-form .bwb-btn {
    padding: 6px 12px;
}
.bwb-search-form input[type="search"] {
    min-width: 220px;
    padding: 8px 12px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #1a1a1a;
    color: #f0f0f0;
    font-size: 1rem;
}
.bwb-search-form input[type="search"]::placeholder {
    color: #888;
}
.bwb-search-form input[type="search"]:focus {
    outline: none;
    border-color: #555;
}
.bwb-search-message {
    margin-bottom: 16px;
    color: #aaa;
}

/* ----- Notification bell ----- */
.bwb-notif-wrap {
    position: relative;
}
/* When bell is inside the main nav menu item, prevent theme's li:hover from showing in corners */
.mh-main-nav li.bwb-notif-menu-item:hover,
.mh-main-nav .bwb-notif-menu-item:hover {
    background: transparent !important;
}
/* Bell in menu: no border, white icon, red background on hover, no radius, restore divider, match menu item height */
.mh-main-nav .bwb-notif-menu-item .bwb-notif-wrap {
    display: block;
    height: 100%;
}
.mh-main-nav .bwb-notif-menu-item .bwb-notif-bell-btn {
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    background: transparent;
    color: #fff;
    padding: 7px 8px;
    width: 100%;
    height: 35px;
    min-height: 35px;
    box-sizing: border-box;
}
.mh-main-nav .bwb-notif-menu-item .bwb-notif-bell-btn:hover {
    background: #e64946;
    color: #fff;
    border-radius: 0;
}
/* Desktop menu: keep notification badge round (not squashed) */
.mh-main-nav .bwb-notif-menu-item .bwb-notif-count {
    box-sizing: border-box !important;
    min-width: 16px !important;
    min-height: 16px !important;
    width: max(16px, 1.4em) !important;
    height: max(16px, 1.4em) !important;
    padding: 0 2px !important;
    border-radius: 50% !important;
    line-height: 1 !important;
}
.mh-main-nav .bwb-notif-menu-item .bwb-notif-count.bwb-notif-has {
    display: inline-flex !important;
}
.bwb-notif-bell-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #333;
    border-radius: 8px;
    background: #1a1a1a;
    color: #aaa;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.bwb-notif-bell-btn:hover {
    color: #fff;
    border-color: #444;
    background: #252525;
}
.bwb-notif-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 20px;
    line-height: 1;
}
.bwb-notif-icon svg,
.bwb-notif-icon .fa-bell {
    width: 1em;
    height: 1em;
}
.bwb-notif-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bwb-notif-count {
    position: absolute;
    top: -4px;
    right: -6px;
    left: auto;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    background: #e64946;
    background-color: #e64946;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.bwb-notif-count.bwb-notif-has {
    display: inline-flex;
}
.bwb-notif-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}
.bwb-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #252525;
    font-weight: 600;
    font-size: 13px;
}
.bwb-notif-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.bwb-notif-mark-read,
.bwb-notif-mark-all-read,
.bwb-notif-clear-all {
    font-size: 11px;
    font-weight: 500;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
}
.bwb-notif-mark-read:hover,
.bwb-notif-mark-all-read:hover,
.bwb-notif-clear-all:hover {
    color: #ccc;
}
.bwb-notif-mark-all-read:hover,
.bwb-notif-clear-all:hover {
    color: #e57373;
}
.bwb-notif-list {
    max-height: 320px;
    overflow-y: auto;
}
/* Mobile menu (#mmenu): bell dropdown flows inline so it scrolls with the panel */
#mmenu .bwb-notif-wrap,
#mmenu .bwb-notif-mobile-item {
    list-style: none;
}
/* Ensure bell list item is visible (Mmenu uses .mm-listitem for display:flex; we add it so this shows) */
#mmenu .bwb-notif-mobile-item.mm-listitem {
    display: flex !important;
    align-items: center;
    min-height: var(--mm-listitem-size, 50px);
}
#mmenu .bwb-notif-mobile-item .bwb-notif-wrap {
    display: block;
    padding: 0;
    border: none;
}
#mmenu .bwb-notif-bell-btn {
    width: 100%;
    min-height: 44px;
    height: auto;
    padding: 12px 16px;
    justify-content: flex-start;
    align-items: center;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    text-align: left;
}
#mmenu .bwb-notif-bell-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
/* Mobile top row: bell icon + badge match envelope (same size, round badge) */
#mmenu .bwb-mobile-top-row .bwb-notif-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
#mmenu .bwb-mobile-top-row .bwb-notif-icon {
    font-size: 22px;
    width: auto;
    height: auto;
}
#mmenu .bwb-mobile-top-row .bwb-notif-icon .fa-bell {
    width: 1em;
    height: 1em;
}
#mmenu .bwb-mobile-top-row .bwb-notif-count {
    top: -4px;
    right: -6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    border-radius: 50%;
    background: #e64946;
    background-color: #e64946;
}
#mmenu .bwb-mobile-top-row .bwb-notif-bell-btn {
    justify-content: center;
    text-align: center;
}
#mmenu .bwb-notif-bell-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}
#mmenu .bwb-notif-dropdown {
    position: static;
    width: 100%;
    max-width: none;
    margin-top: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: #252a2e;
}
#mmenu .bwb-notif-dropdown[hidden] {
    display: none !important;
}
#mmenu .bwb-notif-list {
    max-height: 50vh;
}
.bwb-notif-empty {
    padding: 24px 14px;
    text-align: center;
    color: #666;
    font-size: 13px;
}
.bwb-notif-list .bwb-notif-item {
    display: grid !important;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0 12px;
    align-items: start;
    padding: 6px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s ease;
}
.bwb-notif-list .bwb-notif-item.bwb-notif-item-has-icon {
    grid-template-columns: 32px 1fr;
}
.bwb-notif-list .bwb-notif-item:hover,
.bwb-notif-list a.bwb-notif-item:hover,
.bub-notif-list .bwb-notif-item:hover,
.bub-notif-list .bub-notif-item:hover,
.bub-notif-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #fff !important;
    text-decoration: none !important;
}
.bwb-notif-list .bwb-notif-item.bwb-notif-unread {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid #f5c518;
    padding-left: 11px;
}
.bwb-notif-list .bwb-notif-item-icon-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 32px;
    min-width: 32px;
}
.bwb-notif-list .bwb-notif-item.bwb-notif-item-has-icon .bwb-notif-item-right {
    grid-column: 2;
}
.bwb-notif-list .bwb-notif-item-right,
.bub-notif-list .bwb-notif-item-right {
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.bwb-notif-list .bwb-notif-item-text,
.bub-notif-list .bwb-notif-item-text {
    display: block;
    margin-bottom: 0;
    word-wrap: break-word;
    line-height: 1.2 !important;
}
.bwb-notif-list .bwb-notif-item-meta,
.bub-notif-list .bwb-notif-item-meta {
    display: block;
    width: 100%;
    font-size: 11px;
    line-height: 1;
    color: #777;
    padding-left: 0;
}
.bwb-notif-list .bwb-notif-item-date,
.bub-notif-list .bwb-notif-item-date {
    display: block;
    width: 100%;
    font-size: 11px;
    line-height: 1.3;
    color: #777;
    margin-top: 2px;
}
.bwb-notif-list .bwb-notif-item-icon {
    flex-shrink: 0;
}
.bwb-notif-list .bwb-notif-item-icon-level {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    display: block;
    vertical-align: middle;
}
.bwb-notif-list .bwb-notif-item-icon-like,
.bwb-notif-list .bwb-notif-item-icon-reply,
.bwb-notif-list .bwb-notif-item-icon-win-published,
.bwb-notif-list .bwb-notif-item-icon-badge-earned {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 16px;
}
.bwb-notif-list .bwb-notif-item-icon-like {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
}
.bwb-notif-list .bwb-notif-item-icon-like .fa-thumbs-up {
    color: inherit;
}
.bwb-notif-list .bwb-notif-item-icon-reply {
    background: rgba(33, 150, 243, 0.15);
    color: #2196f3;
}
.bwb-notif-list .bwb-notif-item-icon-reply .fa-comment {
    color: inherit;
}
.bwb-notif-list .bwb-notif-item-icon-win-published {
    background: rgba(255, 140, 0, 0.15);
    color: #ff8c00;
}
.bwb-notif-list .bwb-notif-item-icon-win-published .fa-fire {
    color: inherit;
}
.bwb-notif-list .bwb-notif-item-icon-badge-earned {
    background: rgba(218, 165, 32, 0.2);
    color: #d4a017;
}
.bwb-notif-list .bwb-notif-item-icon-badge-earned .fa-trophy {
    color: inherit;
}

/* Tournament ended: golden trophy */
.bwb-notif-list .bwb-notif-item-icon-tournament-ended {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(218, 165, 32, 0.25);
    color: #d4a017;
}
.bwb-notif-list .bwb-notif-item-icon-tournament-ended .fa-trophy {
    color: inherit;
}

/* Tournament winner: golden star */
.bwb-notif-list .bwb-notif-item-icon-tournament-winner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(218, 165, 32, 0.25);
    color: #d4a017;
}
.bwb-notif-list .bwb-notif-item-icon-tournament-winner .fa-star {
    color: inherit;
}

/* =========================================================
   TABLE
   ========================================================= */

.bwb-forum-table {
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    background: #0a0a0a;
}

.bwb-forum-header,
.bwb-forum-row {
    display: grid;
    gap: 16px;
    padding: 16px 22px;
    align-items: center;
    font-size: 14px;
}

.bwb-forum-header,
.bwb-forum-row {
    grid-template-columns: 3fr 110px 110px 2fr;
}

.tax-bwb_topic_cat .bwb-forum-header,
.tax-bwb_topic_cat .bwb-forum-row {
    grid-template-columns: 3fr 150px 90px 90px 160px;
}

.bwb-search-page .bwb-forum-header,
.bwb-search-page .bwb-forum-row {
    grid-template-columns: 2fr 120px 120px 80px 80px 140px;
}

.bwb-forum-header {
    background: #1a1a1a;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    border-bottom: 1px solid #2a2a2a;
}

.bwb-forum-row {
    background: #111;
    border-bottom: 1px solid #222;
    transition: background 0.2s ease;
}

.bwb-forum-row:hover {
    background: #181818;
}

.bwb-forum-row:last-child {
    border-bottom: none;
}

.bwb-row-pinned {
    border-left: 3px solid #2e7d32;
    background: #0f130f;
}

.bwb-row-locked {
    border-left: 3px solid #9e7b2e;
    background: #151410;
}

.bwb-pinned-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6a9f6e;
    margin-right: 6px;
}

.bwb-locked-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #b0a060;
    margin-right: 6px;
}

.bwb-category-hidden-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #94a3b8;
    background: #2a2f38;
    border: 1px solid #3d4654;
    border-radius: 4px;
    vertical-align: middle;
}

.bwb-forum-row--hidden-cat {
    opacity: 0.72;
}

.bwb-forum-header > div:not(:first-child),
.bwb-forum-row > div:not(:first-child) {
    text-align: center;
}

.bwb-align-center {
    text-align: center;
}

.bwb-last-activity-link {
    color: inherit;
    text-decoration: none;
    font-weight: normal;
    font-size: inherit;
}
.bwb-last-activity-link:hover {
    color: #81c784;
    text-decoration: underline;
}

.bwb-forum-category a,
.bwb-thread-title a {
    font-weight: 600;
}

.bwb-forum-lastpost {
    text-align: center;
    font-size: 13px;
    min-width: 0;
}

.bwb-forum-lastpost > a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}
.bwb-forum-lastpost .bwb-lastpost-meta {
    display: block;
    margin-top: 4px;
}
.bwb-forum-lastpost small {
    font-size: 11px;
    color: #777;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.bwb-archive-actions {
    margin-top: 22px;
    margin-bottom: 0;
    text-align: left;
}

.bwb-category-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}
.bwb-category-bottom-row .bwb-archive-actions {
    margin-top: 0;
}
.bwb-category-bottom-row .bwb-comments-pagination {
    margin-top: 0;
    margin-bottom: 0;
    order: -1;
}

/* Archive layout: main + sidebar (latest posts) — desktop: equal height (grid, high specificity) */
@media (min-width: 901px) {
    /* Single topic: hide search in top bar; it's shown after topic-actions in the header row */
    .single-bwb_topic .bwb-community-top .bwb-community-top-actions {
        display: none;
    }
    body.bwb-community-page .bwb-community-wrapper.bwb-archive-page .bwb-archive-layout {
        display: grid !important;
        grid-template-columns: 1fr 290px !important;
        grid-template-rows: 1fr !important;
        gap: 24px !important;
        align-items: stretch !important;
        margin-top: 20px;
    }
    body.bwb-community-page .bwb-community-wrapper.bwb-archive-page .bwb-archive-main {
        min-width: 0;
        align-self: stretch !important;
    }
    body.bwb-community-page .bwb-community-wrapper.bwb-archive-page .bwb-archive-sidebar {
        width: 290px !important;
        min-width: 290px !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        align-self: stretch !important;
    }
    body.bwb-community-page .bwb-community-wrapper.bwb-archive-page .bwb-latest-posts-card {
        display: flex !important;
        flex-direction: column !important;
        flex: 0 0 auto !important;
        align-self: flex-start !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
    }
    body.bwb-community-page .bwb-community-wrapper.bwb-archive-page .bwb-latest-posts-list {
        flex: none !important;
        flex-grow: 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        overflow-y: visible !important;
    }
    .bwb-archive-page .bwb-latest-posts-list .bwb-latest-posts-item:nth-child(n+8) {
        display: none;
    }
}
.bwb-archive-page .bwb-archive-layout {
    display: flex;
    gap: 24px;
    margin-top: 20px;
}
.bwb-archive-page .bwb-archive-main {
    flex: 1 1 0;
    min-width: 0;
}
.bwb-archive-page .bwb-archive-sidebar {
    flex-shrink: 0;
    width: 290px;
}
.bwb-community-search-below-posts {
    display: none;
}

.bwb-archive-page .bwb-latest-posts-card {
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}
.bwb-latest-posts-title {
    margin: 0;
    padding: 18px 14px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    background: #141414;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}
.bwb-archive-page .bwb-latest-posts-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.bwb-latest-posts-item {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    transition: background 0.15s;
}
.bwb-latest-posts-item:hover {
    background: #1a1a1a;
}
.bwb-latest-posts-avatar {
    flex-shrink: 0;
}
.bwb-latest-posts-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: block;
    vertical-align: middle;
}
.bwb-latest-posts-avatar-link {
    display: block;
    text-decoration: none;
    line-height: 0;
    padding: 0;
    margin: 0;
}
.bwb-latest-posts-avatar-link:hover {
    text-decoration: none;
    opacity: 0.9;
}
.bwb-latest-posts-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bwb-latest-posts-topic-link {
    font-size: 13px;
    font-weight: 500;
    color: #e0e0e0;
    line-height: 1.35;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bwb-latest-posts-topic-link:hover {
    color: #fff;
}
.bwb-latest-posts-meta {
    font-size: 11px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bwb-latest-posts-author {
    color: #9a9a9a;
    text-decoration: none;
}
.bwb-latest-posts-author:hover {
    color: #81c784;
    text-decoration: underline;
}
.bwb-latest-posts-author-name {
    color: #777;
}
.bwb-latest-posts-time {
    color: #777;
}

/* =========================================================
   LINKS
   ========================================================= */

/* Blue links only inside post/comment body content */
.bwb-topic-content .bwb-comment-content a {
    color: #6eb3e8;
    text-decoration: none;
}
.bwb-topic-content .bwb-comment-content a:hover {
    color: #6eb3e8;
    text-decoration: underline;
}

/* Everywhere in community: hover = underline only, no color change (override theme red) */
.bwb-community-wrapper a:hover {
    color: inherit;
    text-decoration: underline;
}

/* =========================================================
   BREADCRUMB
   ========================================================= */

.bwb-breadcrumb {
    margin-bottom: 12px;
    font-size: 13px;
    color: #888;
}

.bwb-breadcrumb span {
    margin: 0 6px;
    color: #555;
}

.bwb-community-wrapper > h1 {
    font-size: 26px;
    margin: 0 0 18px;
    font-weight: 700;
    color: #d6d6d6;
}

.bwb-category-description {
    margin: 0 0 18px;
    color: #555;
    font-size: 15px;
    line-height: 1.5;
}

.bwb-forum-category .bwb-category-description {
    margin: 4px 0 0;
    font-size: 13px;
    font-weight: 400;
}

/* =========================================================
   TOPIC PAGE
   ========================================================= */

.bwb-topic-header {
    margin-bottom: 14px;
}

.bwb-topic-header .bwb-pagination-top {
    width: 100%;
    margin-top: 8px;
    margin-bottom: 4px;
}

/* Row: pagination (left) + topic actions (right) */
.bwb-topic-header-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}
.bwb-topic-header-actions-row .bwb-pagination-top {
    margin-top: 0;
    margin-bottom: 0;
    width: auto;
    display: flex;
    align-items: center;
}
.bwb-topic-header-actions-row .bwb-pagination-top .bwb-comments-pagination {
    align-items: center;
}
.bwb-topic-header-actions-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.bwb-topic-header-top-actions {
    display: flex;
    align-items: center;
    gap: 18px;
}
.bwb-topic-header-top-actions .bwb-search-form {
    margin-bottom: 0;
    display: flex;
    align-items: center;
}
.bwb-topic-header-top-actions .bwb-search-form input[type="search"] {
    padding: 6px 10px;
    font-size: 14px;
}
.bwb-topic-header-top-actions .bwb-search-form .bwb-btn {
    padding: 6px 12px;
}

.bwb-topic-header-actions-right .bwb-topic-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bwb-topic-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.bwb-topic-meta-row-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
}

.bwb-topic-meta-row .bwb-topic-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bwb-topic-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.bwb-topic-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #d6d6d6;
}

.bwb-topic-title-input {
    display: block;
    width: 100%;
    margin: 0;
    padding: 4px 8px;
    font-size: 24px;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    box-sizing: border-box;
}
.bwb-topic-title-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}
.bwb-topic-title-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.bwb-topic-meta {
    font-size: 13px;
    color: #aaa;
}

.bwb-topic-content {
    margin: 20px 0;
    line-height: 1.65;
}

.bwb-topic-content .bwb-topic-post.bwb-comment-box {
    margin: 0;
}

.bwb-topic-content .bwb-topic-post .bwb-comment-avatar {
    line-height: 1;
}

/* Beat theme span/line-height overrides for pills in first post */
.bwb-topic-content .bwb-user-label {
    line-height: 1 !important;
}

.bwb-topic-content .bwb-topic-post .bwb-comment-avatar .bwb-user-label {
    margin-top: 6px;
}

/* High-specificity fallback for first-post pills (if theme overrides span) */
div.bwb-community-wrapper div.bwb-topic-content div.bwb-topic-post.bwb-comment-box div.bwb-comment-avatar span.bwb-user-label {
    line-height: 1 !important;
}

.bwb-topic-actions-row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #252525;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.bwb-locked-badge {
    background: #b02a2a;
    color: #fff;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    margin-left: 8px;
}

.bwb-pinned-badge {
    background: rgba(255, 255, 255, 0.12);
    color: #c0c0c0;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 4px;
    margin-left: 8px;
}

.bwb-topic-edit-textarea {
    width: 100%;
    min-height: 180px;
    background: #141414 !important;
    border: 1px solid #2c2c2c !important;
    color: #e0e0e0 !important;
    padding: 10px 14px 10px 10px;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}
.bwb-reply-edit-textarea {
    font-size: 14px;
    padding: 8px 14px 8px 8px;
    box-sizing: border-box;
}

/* =========================================================
   REPLIES
   ========================================================= */

.bwb-replies {
    margin-top: 20px;
}

.bwb-replies > h2 {
    font-size: 20px;
    margin-bottom: 14px;
    font-weight: 600;
    color: #d6d6d6;
}

.bwb-comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bwb-comment-box {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    border: 1px solid #2a2a2a;
    padding: 14px 16px;
    background: #111;
    border-radius: 8px;
    position: relative;
}

.bwb-comment-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.bwb-comment-body {
    min-width: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 18px;
    position: relative;
}

.bwb-comment-header-line {
    display: flex;
    justify-content: flex-start;
    align-items: baseline;
    margin-bottom: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bwb-comment-header-left {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.bwb-comment-header-right {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-left: auto;
}

.bwb-post-num {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-decoration: none;
    flex-shrink: 0;
}
.bwb-post-num:hover {
    color: #999;
    text-decoration: none;
}
.bwb-comment-header-line .bwb-post-num-corner {
    position: static;
}
.bwb-post-num-corner .bwb-post-num {
    color: #555;
    opacity: 0.65;
}
.bwb-post-num-corner .bwb-post-num:hover {
    color: #888;
    opacity: 0.9;
}
.bwb-topic-meta .bwb-post-num {
    margin-right: 4px;
}

.bwb-comment-author {
    font-weight: 600;
    font-size: 14px;
}

.bwb-user-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0px;
    padding: 0 8px;
    min-height: 20px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 6px;
    box-sizing: border-box;
    border: none;
}
.bwb-user-label--admin {
    background: #a90000;
}
.bwb-user-label--banned {
    background: #353535;
    color: #9a9a9a;
}
.bwb-user-label--official-rep {
    background: #35455c;
    color: #b8cce0;
}
.bwb-user-label--gamification {
    background: #5c0064;
}

.bwb-tournament-winner-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 0 8px;
    min-height: 20px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1 !important;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border-radius: 6px;
    box-sizing: border-box;
    border: none;
    background: #b8860b;
    color: #fff;
}

.bwb-comment-avatar .bwb-tournament-winner-badge {
    margin-top: 4px;
}

.bwb-comment-time {
    font-size: 12px;
    color: #888;
    margin-left: 0;
}

.bwb-comment-content {
    line-height: 1.4;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Contain images in posts/replies – max width, keep aspect ratio; clickable to open full size.
   Target only .bwb-comment-content so avatars in .bwb-comment-avatar are not affected. */
.bwb-comment-content img {
    max-width: min(100%, 640px);
    width: auto;
    height: auto;
    display: block;
    margin: 0.75em 0;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}
.bwb-comment-content img:first-child {
    margin-top: 0;
}
.bwb-comment-content img:last-child {
    margin-bottom: 0;
}
.bwb-comment-content a img {
    cursor: pointer;
}

.bwb-comment-content p,
.bwb-topic-content p {
    margin: 1em 0;
}
.bwb-comment-content p:first-child,
.bwb-topic-content p:first-child {
    margin-top: 0;
}
.bwb-comment-content p:last-child,
.bwb-topic-content p:last-child {
    margin-bottom: 0;
}

.bwb-comment-content blockquote:not(.bwb-quote-box) {
    margin: 12px 0;
    padding: 12px 16px;
    border-left: 4px solid #444;
    background: #0d0d0d;
    border-radius: 0 6px 6px 0;
    color: #bbb;
    font-size: 13px;
    line-height: 1.55;
}
.bwb-comment-content blockquote:not(.bwb-quote-box) + blockquote {
    margin-top: 8px;
}
.bwb-comment-content blockquote:not(.bwb-quote-box) p:first-child {
    margin-top: 0;
}
.bwb-comment-content blockquote:not(.bwb-quote-box) p:last-child {
    margin-bottom: 0;
}

/* Forum quote box */
.bwb-comment-content .bwb-quote-box {
    display: block !important;
    margin: 1.25em 0 !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: 3px solid #e85d04 !important;
    border-radius: 6px !important;
    background: rgba(0, 0, 0, 0.28) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-head {
    display: block !important;
    padding: 10px 16px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #e85d04 !important;
    background: rgba(0, 0, 0, 0.15) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-head cite {
    font-style: normal !important;
    font-weight: 700 !important;
    color: #f48c06 !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-inner {
    position: relative !important;
    padding: 0 !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-body {
    display: block !important;
    margin: 0 0 0.65em 0 !important;
    padding: 12px 16px 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 14px !important;
    line-height: 1.55 !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    white-space: pre-wrap !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-body:first-of-type {
    padding-top: 14px !important;
    margin-top: 0 !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-body:last-of-type {
    margin-bottom: 0 !important;
    padding-bottom: 14px !important;
}
.bwb-comment-content .bwb-quote-box .bwb-quote-inner > .bwb-quote-box {
    margin: 0 16px 14px !important;
}
.bwb-comment-content .bwb-quote-box + .bwb-quote-box {
    margin-top: 1em !important;
}
.bwb-comment-content .bwb-quote-box + p {
    margin-top: 0.65em !important;
}

.bwb-comment-content ul,
.bwb-comment-content ol,
.bwb-topic-content ul,
.bwb-topic-content ol {
    margin: 0.6em 0;
    padding-left: 1.5em;
}
.bwb-comment-content ul { list-style-type: disc; }
.bwb-comment-content ol { list-style-type: decimal; }
.bwb-topic-content ul { list-style-type: disc; }
.bwb-topic-content ol { list-style-type: decimal; }
.bwb-comment-content li,
.bwb-topic-content li {
    margin: 0;
}

.bwb-comment-actions {
    margin-top: 10px;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.bwb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2e7d32;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    color: #fff !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease;
}

.bwb-btn:hover {
    background: #388e3c;
    color: #fff !important;
    text-decoration: none;
}

.bwb-btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    min-height: 26px;
    box-sizing: border-box;
}

.bwb-topic-meta-row .bwb-topic-actions .bwb-topic-pin,
.bwb-topic-actions .bwb-topic-pin {
    min-width: 4.6em;
}

.bwb-btn-danger {
    background: #c0392b;
}

.bwb-btn-danger:hover {
    background: #e74c3c;
}

.bwb-move-thread-wrap {
    display: inline-block;
}
.bwb-move-thread-select {
    height: 26px;
    min-height: 26px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: #e0e0e0;
    background: #252525;
    border: 1px solid #333;
    border-radius: 6px;
    cursor: pointer;
    min-width: 100px;
}
.bwb-move-thread-select:hover,
.bwb-move-thread-select:focus {
    border-color: #444;
    outline: none;
}
.bwb-move-thread-select:disabled {
    opacity: 0.7;
    cursor: wait;
}

.bwb-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #aaa;
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.bwb-link-button:hover {
    color: #fff;
    background: #333;
    border-color: #444;
    text-decoration: none;
}
.bwb-link-button.bwb-comment-reply:hover {
    border-color: #2e7d32;
    background: rgba(46, 125, 50, 0.25);
    color: #81c784;
}
.bwb-link-button.bwb-comment-quote:hover {
    border-color: #1976d2;
    background: rgba(25, 118, 210, 0.2);
    color: #64b5f6;
}
.bwb-link-button.bwb-comment-edit:hover {
    border-color: #f57c00;
    background: rgba(245, 124, 0, 0.2);
    color: #ffb74d;
}
.bwb-link-button.bwb-topic-edit:hover {
    border-color: #f57c00;
    background: rgba(245, 124, 0, 0.2);
    color: #ffb74d;
}
.bwb-link-button.bwb-comment-delete:hover {
    border-color: #c62828;
    background: rgba(198, 40, 40, 0.2);
    color: #ef9a9a;
}
.bwb-link-button.bwb-report-post:hover {
    border-color: #e65100;
    background: rgba(230, 81, 0, 0.15);
    color: #ffb74d;
}

/* ----- Report modal ----- */
.bwb-report-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.bwb-report-overlay.bwb-report-visible {
    opacity: 1;
    visibility: visible;
}
.bwb-report-modal {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 24px 28px;
}
.bwb-report-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    color: #888;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}
.bwb-report-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.bwb-report-title {
    margin: 0 32px 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f0;
}
.bwb-report-desc {
    margin: 0 0 14px;
    font-size: 13px;
    color: #999;
    line-height: 1.45;
}
.bwb-report-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
    background: #141414;
    border: 1px solid #333;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
}
.bwb-report-textarea::placeholder {
    color: #666;
}
.bwb-report-textarea:focus {
    outline: none;
    border-color: #555;
}
.bwb-report-status {
    min-height: 20px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.4;
}
.bwb-report-status-success {
    color: #81c784;
}
.bwb-report-status-error {
    color: #ef9a9a;
}
.bwb-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.bwb-report-actions .bwb-report-cancel {
    background: #333;
    color: #ccc;
}
.bwb-report-actions .bwb-report-cancel:hover {
    background: #444;
    color: #fff;
}
.bwb-report-actions .bwb-report-submit {
    background: #e65100;
    color: #fff;
}
.bwb-report-actions .bwb-report-submit:hover {
    background: #f57c00;
    color: #fff;
}
.bwb-report-actions .bwb-report-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ----- Likes bar (bottom of topic / reply) ----- */
.bwb-likes-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 0;
    padding-top: 12px;
}
.bwb-topic-content .bwb-likes-bar {
    margin-top: 0;
    padding-top: 14px;
}
.bwb-likes-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.bwb-react-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}
.bwb-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    background: transparent;
    border: 1px solid #333;
    border-radius: 20px;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.bwb-like-btn:hover {
    color: #aaa;
    border-color: #444;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}
.bwb-like-btn .bwb-like-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    color: currentColor;
}
.bwb-like-btn .bwb-like-icon-filled {
    display: none;
}
.bwb-like-btn.bwb-liked .bwb-like-icon {
    display: none;
}
.bwb-like-btn.bwb-liked .bwb-like-icon-filled {
    display: inline-flex;
    color: #66bb6a;
}
.bwb-like-btn.bwb-liked,
.bwb-like-btn.bwb-liked:hover {
    border-color: rgba(102, 187, 106, 0.5);
    background: rgba(46, 125, 50, 0.12);
    color: #81c784;
}
.bwb-like-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}
.bwb-react-wrap {
    position: relative;
    display: inline-block;
}
.bwb-react-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #888;
    background: transparent;
    border: 1px solid #333;
    border-radius: 20px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.bwb-react-trigger:hover {
    color: #aaa;
    border-color: #444;
    background: rgba(255, 255, 255, 0.04);
}
.bwb-react-trigger:disabled {
    opacity: 0.6;
    cursor: wait;
}
.bwb-react-chevron {
    font-size: 10px;
    opacity: 0.8;
}
.bwb-react-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 120px;
    padding: 4px 0;
    background: #252525;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 100;
}
.bwb-react-dropdown[hidden] {
    display: none !important;
}
.bwb-react-option {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    text-align: left;
    color: #ccc;
    background: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
}
.bwb-react-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.bwb-reaction-counts {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.bwb-reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 13px;
    color: #999;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}
.bwb-reaction-pill-count {
    font-weight: 600;
    font-size: 12px;
}
.bwb-likers {
    font-size: 12px;
    color: #777;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.bwb-likers::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 11H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* =========================================================
   PAGINATION
   ========================================================= */

.bwb-comments-pagination {
    margin-top: 18px;
    margin-bottom: 18px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
}
.bwb-pagination-top .bwb-comments-pagination {
    margin-top: 0;
    margin-bottom: 0;
}

/* Horizontal bar pagination: Prev | 1 2 3 ... N | Next */
.bwb-comments-pagination.bwb-pagination-bar {
    justify-content: flex-start;
    gap: 6px;
}
.bwb-pagination-bar .bwb-page-nav,
.bwb-pagination-bar .bwb-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    cursor: pointer;
    min-width: 2.5em;
    box-sizing: border-box;
}
.bwb-pagination-bar .bwb-page-nav:hover,
.bwb-pagination-bar .bwb-page-num:hover {
    background: #f5f5f5;
    border-color: #999;
}
.bwb-pagination-bar .bwb-page-num.bwb-page-current {
    background: #f5c518;
    border-color: #d4a80a;
    color: #1a1a1a;
    font-weight: 600;
    pointer-events: none;
}
.bwb-pagination-bar .bwb-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    background: transparent;
    color: #666;
    font-size: 13px;
    border: none;
    min-width: 1.5em;
}

/* Dark theme: bar inside community */
.bwb-community-wrapper .bwb-pagination-bar .bwb-page-nav,
.bwb-community-wrapper .bwb-pagination-bar .bwb-page-num {
    border-color: #2a2a2a;
    background: #252525;
    color: #bbb;
}
.bwb-community-wrapper .bwb-pagination-bar .bwb-page-nav:hover,
.bwb-community-wrapper .bwb-pagination-bar .bwb-page-num:hover {
    background: #333;
    border-color: #444;
    color: #fff;
}
.bwb-community-wrapper .bwb-pagination-bar .bwb-page-num.bwb-page-current {
    background: #f5c518;
    border-color: #d4a80a;
    color: #1a1a1a;
}
.bwb-community-wrapper .bwb-pagination-bar .bwb-page-ellipsis {
    background: transparent;
    color: #888;
    border: none;
}

.bwb-comments-pagination .bwb-pagination-label,
.bwb-comments-pagination .bwb-pagination-of {
    color: #888;
}

.bwb-comments-pagination .bwb-page-select {
    min-width: 48px;
    padding: 5px 24px 5px 8px;
    border: 1px solid #2a2a2a;
    border-radius: 5px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 6.5L1 2.5h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
}

.bwb-comments-pagination .bwb-page-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #333;
    background: #252525;
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.bwb-comments-pagination .bwb-page-nav:hover {
    background: #333;
    color: #fff;
}

.bwb-comments-pagination .bwb-page-current {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

/* =========================================================
   NOTICES
   ========================================================= */

.bwb-notice {
    margin: 16px 0 20px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
    color: #ddd;
}

.bwb-notice-error {
    border-color: #4a2a2a;
    background: #1a1010;
    color: #f0c0c0;
}

/* =========================================================
   FORMS – dark (override theme)
   ========================================================= */

.bwb-community-wrapper .bwb-new-topic-form input[type="text"],
.bwb-community-wrapper .bwb-new-topic-form textarea,
.bwb-community-wrapper .bwb-new-topic-form select:not(.bwb-tb-select),
.bwb-community-wrapper .comment-form textarea,
.bwb-community-wrapper .bwb-reply-form textarea,
.bwb-community-wrapper #bwb-reply-textarea,
.bwb-community-wrapper .bwb-new-topic-form .bwb-contenteditable,
.bwb-community-wrapper .bwb-reply-form .bwb-contenteditable,
.bwb-community-wrapper .bwb-topic-content-editable {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #141414 !important;
    border: 1px solid #2c2c2c !important;
    color: #e0e0e0 !important;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.bwb-content-hidden {
    display: none !important;
    position: absolute;
    left: -9999px;
}

.bwb-contenteditable {
    display: block;
    box-sizing: border-box;
    min-height: 120px;
    outline: none;
}
.bwb-contenteditable:empty::before,
.bwb-contenteditable[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #888;
}
.bwb-topic-content-editable.bwb-contenteditable {
    min-height: 180px;
}
/* Match the rendered comment paragraph spacing so single Enter reads as a proper paragraph
 * break (was browser-default ~1em with no override → felt close to a line break). */
.bwb-contenteditable p {
    margin: 1em 0;
}
.bwb-contenteditable p:first-child {
    margin-top: 0;
}
.bwb-contenteditable p:last-child {
    margin-bottom: 0;
}
.bwb-contenteditable ul,
.bwb-contenteditable ol {
    margin: 0.5em 0;
    padding-left: 1.4em;
}
.bwb-contenteditable ul {
    list-style-type: disc;
}
.bwb-contenteditable ol {
    list-style-type: decimal;
}
.bwb-contenteditable li {
    margin: 0.2em 0;
}

/* Compose-time quote preview in reply editor */
.bwb-contenteditable .bwb-compose-quote,
.bwb-reply-edit-textarea .bwb-compose-quote {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-left: 3px solid #dd3333;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    color: #c8c8c8;
    font-size: 13px;
    line-height: 1.45;
    user-select: none;
}
.bwb-contenteditable .bwb-compose-quote-head,
.bwb-reply-edit-textarea .bwb-compose-quote-head {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: #9aa0a6;
    text-transform: none;
}
.bwb-contenteditable .bwb-compose-quote-author,
.bwb-reply-edit-textarea .bwb-compose-quote-author {
    color: #e0e0e0;
}
.bwb-contenteditable .bwb-compose-quote-body,
.bwb-reply-edit-textarea .bwb-compose-quote-body {
    margin: 0;
    color: #d0d0d0;
}
.bwb-contenteditable .bwb-quote-end-marker,
.bwb-reply-edit-textarea .bwb-quote-end-marker {
    display: none !important;
}
.bwb-new-topic-form .bwb-format-toolbar-wrap + .bwb-topic-content-editable {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
}

/* @mention autocomplete (forum composers) */
.bwb-mention-suggest {
    position: fixed;
    z-index: 100002;
    min-width: 220px;
    max-width: min(320px, calc(100vw - 16px));
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    padding: 4px 0;
}
.bwb-mention-suggest[hidden] {
    display: none !important;
}
.bwb-mention-suggest__item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: #f0f0f0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.bwb-mention-suggest__item.is-active,
.bwb-mention-suggest__item:hover {
    background: #2a2a2a;
}
.bwb-mention-suggest__handle {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}
.bwb-mention-suggest__name {
    font-size: 12px;
    color: #aaa;
}

.bwb-community-wrapper .bwb-new-topic-form input:focus,
.bwb-community-wrapper .bwb-new-topic-form textarea:focus,
.bwb-community-wrapper .bwb-new-topic-form select:not(.bwb-tb-select):focus,
.bwb-community-wrapper .comment-form textarea:focus,
.bwb-community-wrapper .bwb-reply-form textarea:focus,
.bwb-community-wrapper .bwb-new-topic-form .bwb-contenteditable:focus,
.bwb-community-wrapper .bwb-reply-form .bwb-contenteditable:focus {
    outline: none;
    border-color: #2e7d32 !important;
    box-shadow: 0 0 0 1px rgba(46,125,50,0.25);
}

.bwb-community-wrapper .bwb-new-topic-form select option {
    background: #1a1a1a;
    color: #e0e0e0;
}

.bwb-reply-form {
    margin-top: 24px;
}

.bwb-community-wrapper .bwb-new-topic-form label,
.bwb-community-wrapper .comment-form label {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 4px;
}

.bwb-community-wrapper .bwb-new-topic-form > p {
    margin-bottom: 16px;
}

.bwb-posting-in {
    margin-bottom: 12px;
    font-size: 13px;
    color: #aaa;
}

.bwb-community-wrapper .bwb-new-topic-form button:not(.bwb-tb-btn),
.bwb-community-wrapper .comment-form input[type="submit"] {
    background: #2e7d32 !important;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    color: #fff !important;
    font-weight: 600;
    cursor: pointer;
}

.bwb-community-wrapper .bwb-new-topic-form button:not(.bwb-tb-btn):hover,
.bwb-community-wrapper .comment-form input[type="submit"]:hover {
    background: #388e3c !important;
    color: #fff !important;
}

/* =========================================================
   FORMATTING TOOLBAR
   ========================================================= */

.bwb-format-toolbar-wrap {
    width: 100%;
    margin-bottom: 0;
}

.bwb-format-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: #1a1a1a;
    border: 1px solid #2c2c2c;
    border-radius: 6px 6px 0 0;
    width: 100%;
    box-sizing: border-box;
}

.bwb-format-toolbar .bwb-tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.bwb-format-toolbar .bwb-tb-btn:hover {
    background: #333;
    color: #fff;
}
.bwb-format-toolbar .bwb-tb-btn .bwb-tb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bwb-format-toolbar .bwb-tb-btn .bwb-tb-icon svg {
    display: block;
    vertical-align: middle;
}

.bwb-format-toolbar .bwb-tb-select {
    height: 32px;
    min-width: 0;
    width: 72px;
    max-width: 96px;
    padding: 8px 28px 8px 10px !important;
    background-color: #252525 !important;
    border: 1px solid #333 !important;
    color: #e0e0e0 !important;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    box-sizing: border-box;
    line-height: 1.2 !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23aaa' d='M5 6.5L1 2.5h8z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
}
.bwb-format-toolbar .bwb-tb-select.bwb-tb-color {
    width: 86px;
    min-width: 86px;
}
.bwb-format-toolbar .bwb-tb-select option {
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 4px;
}

.bwb-format-toolbar .bwb-tb-divider {
    width: 1px;
    height: 18px;
    background: #333;
    margin: 0 4px;
}

.bwb-format-toolbar .bwb-tb-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.bwb-format-toolbar-wrap .bwb-upload-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #222;
    border: 1px solid #2c2c2c;
    border-top: none;
    color: #bbb;
    font-size: 13px;
    line-height: 1.3;
}

@keyframes bwb-upload-spin {
    to { transform: rotate(360deg); }
}

.bwb-upload-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #444;
    border-top-color: #8bc34a;
    border-radius: 50%;
    animation: bwb-upload-spin 0.75s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Smilie picker: lightweight grid, no images */
.bwb-smilie-picker {
    display: none;
    position: fixed;
    z-index: 100000;
    width: 280px;
    max-height: 240px;
    overflow: auto;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
}
.bwb-smilie-picker.bwb-smilie-picker-open {
    display: block;
}
.bwb-smilie-picker-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px;
}
.bwb-smilie-picker-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    font-size: 20px;
    line-height: 1;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background 0.1s ease;
}
.bwb-smilie-picker-btn:hover,
.bwb-smilie-picker-btn:focus {
    background: rgba(255, 255, 255, 0.12);
    outline: none;
}

/* Link insert popup */
.bwb-link-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.bwb-link-popup-overlay.bwb-link-popup-open {
    display: flex;
}
.bwb-link-popup {
    width: 100%;
    max-width: 420px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    padding: 20px 24px;
    color: #e0e0e0;
}
.bwb-link-popup-title {
    margin: 0 0 16px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
}
.bwb-link-popup-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
}
.bwb-link-popup-row:last-of-type {
    margin-bottom: 6px;
}
.bwb-link-popup-label {
    flex-shrink: 0;
    width: 72px;
    font-size: 0.9rem;
    color: #aaa;
}
.bwb-link-popup-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 10px 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #fff;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    box-sizing: border-box;
}
.bwb-link-popup-input::placeholder {
    color: #777;
}
.bwb-link-popup-input:focus {
    outline: none;
    border-color: #5a9fd4;
    box-shadow: 0 0 0 2px rgba(90, 159, 212, 0.25);
}
.bwb-link-popup-hint {
    display: block;
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: #888;
    line-height: 1.35;
}
.bwb-link-popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.bwb-link-popup-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease, color 0.15s ease;
}
.bwb-link-popup-cancel {
    background: #333;
    color: #ccc;
}
.bwb-link-popup-cancel:hover {
    background: #444;
    color: #fff;
}
.bwb-link-popup-insert {
    background: #5a9fd4;
    color: #fff;
}
.bwb-link-popup-insert:hover {
    background: #4a8fc4;
}

/* New topic form: toolbar + textarea same width, flush */
.bwb-community-wrapper .bwb-new-topic-form .bwb-format-toolbar-wrap {
    margin-bottom: 0;
}

.bwb-community-wrapper .bwb-new-topic-form .bwb-format-toolbar + textarea,
.bwb-community-wrapper .bwb-new-topic-form .bwb-format-toolbar-wrap + p textarea {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/* Reply form: toolbar above textarea; align widths (custom form, no wp comment_form) */
.bwb-reply-form .bwb-reply-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: #d6d6d6;
}
.bwb-reply-form .bwb-reply-form-fields .bwb-format-toolbar-wrap {
    margin-bottom: 0;
}
.bwb-reply-form .bwb-reply-form-fields .bwb-format-toolbar-wrap + p {
    margin-top: 0;
    margin-bottom: 16px;
}
.bwb-reply-form .bwb-reply-form-fields textarea#bwb-reply-textarea,
.bwb-reply-form .bwb-reply-form-fields .bwb-reply-textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
    min-height: 120px;
}
.bwb-reply-form .bwb-reply-form-fields .comment-form-comment label {
    display: none;
}
.bwb-reply-form .bwb-reply-form-fields .form-submit {
    margin-top: 12px;
}

/* Legacy: reply form when using comment_form (kept for reference) */
.bwb-reply-form .comment-form p {
    margin-bottom: 16px;
}
.bwb-reply-form .comment-form .bwb-format-toolbar-wrap {
    margin-bottom: 0;
}
.bwb-reply-form .comment-form .bwb-format-toolbar-wrap + label {
    display: none;
}
.bwb-reply-form .comment-form textarea#bwb-reply-textarea,
.bwb-community-wrapper .bwb-reply-form .comment-form textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    margin-top: 0;
    min-height: 120px;
}
.bwb-reply-form .comment-form p:has(.bwb-format-toolbar-wrap) {
    margin-bottom: 0;
}
.bwb-reply-form .comment-form p:has(textarea#bwb-reply-textarea) {
    margin-top: 0;
}
.bwb-reply-form .comment-form-comment label {
    display: none;
}
.bwb-reply-form .comment-form .comment-form-comment {
    margin-top: 0;
    margin-bottom: 16px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Avatar column layout (desktop); mobile overrides in @media below */
.bwb-comment-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: start;
    width: 145px;
    min-width: 145px;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 12px;
}

.bwb-comment-avatar .bwb-user-label {
    margin-top: 6px;
}

/* Desktop only: icon + labels on one row, points below */
@media (min-width: 901px) {
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 6px;
    }
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row .bwb-user-label {
        margin-top: 0;
    }
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row .bwb-gamification-level-icon {
        display: block;
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row + .bwb-comment-avatar-level-points {
        display: block;
        margin-top: 2px;
        font-size: 10px;
        color: #999;
        line-height: 1.2;
    }
}

.bwb-comment-avatar .bwb-comment-avatar-level-icon {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.bwb-comment-avatar .bwb-comment-avatar-level-icon .bwb-gamification-level-icon {
    display: block;
    width: 28px;
    height: 28px;
}

.bwb-comment-avatar .bwb-comment-avatar-level-icon .bwb-comment-avatar-level-points {
    font-size: 10px;
    color: #999;
    line-height: 1.2;
}

.bwb-comment-avatar .bwb-comment-author {
    margin-top: 8px;
    text-align: center;
    display: block;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    word-break: break-word;
}

/* =========================================================
   RESPONSIVE – mobile forum cards
   ========================================================= */

@media (max-width: 900px) {
    /* Hide search form on mobile except community homepage (archive); archive shows search below posts */
    .bwb-community-wrapper:not(.bwb-archive-page) .bwb-community-top-actions .bwb-search-form {
        display: none !important;
    }
    body.bwb-community-page .mh-wrapper {
        padding: 20px 16px;
    }
    .bwb-community-wrapper {
        margin-top: 0;
    }
    .bwb-community-wrapper > h1,
    .bwb-topic-title {
        font-size: 20px;
    }
    .bwb-search-form {
        margin-bottom: 0;
        margin-top: 30px;
    }
    /* Prevent iOS zoom on focus: inputs/textarea need font-size >= 16px */
    .bwb-search-form input[type="search"],
    .bwb-community-top-actions .bwb-search-form input[type="search"] {
        font-size: 16px !important;
    }
    .bwb-community-top-actions .bwb-search-form {
        min-width: 0;
        flex: 1 1 auto;
    }
    .bwb-community-top-actions .bwb-search-form input[type="search"] {
        min-width: 0;
        width: 100%;
        max-width: 160px;
    }
    .bwb-community-wrapper .bwb-new-topic-form input[type="text"],
    .bwb-community-wrapper .bwb-new-topic-form textarea,
    .bwb-community-wrapper #bwb-reply-textarea,
    .bwb-community-wrapper .bwb-reply-form textarea {
        font-size: 16px !important;
    }
    .bwb-topic-edit-textarea,
    .bwb-reply-edit-textarea {
        font-size: 16px !important;
    }
    /* Editing: larger text field on mobile (height + width) */
    .bwb-topic-edit-textarea {
        min-height: 280px;
    }
    .bwb-reply-edit-textarea {
        min-height: 200px;
    }
    .bwb-comment-box[data-editing="1"] {
        padding-left: 10px;
        padding-right: 10px;
    }
    .bwb-topic-content[data-editing="1"] .bwb-comment-box {
        padding-left: 10px;
        padding-right: 10px;
    }
    .bwb-topic-content[data-editing="1"] .bwb-comment-content {
        margin-left: 0;
        margin-right: 0;
    }
    /* Format toolbar: allow wrap on small screens so buttons stay inside the card */
    .bwb-format-toolbar {
        flex-wrap: wrap;
        gap: 6px 8px;
    }
    /* Pagination: more compact on mobile */
    .bwb-comments-pagination {
        gap: 6px;
        font-size: 12px;
        margin-top: 12px;
        margin-bottom: 12px;
    }
    .bwb-comments-pagination.bwb-pagination-bar {
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
    }
    .bwb-pagination-bar .bwb-page-nav,
    .bwb-pagination-bar .bwb-page-num {
        padding: 5px 8px;
        font-size: 12px;
        min-width: 2em;
        flex-shrink: 0;
    }
    .bwb-pagination-bar .bwb-page-ellipsis {
        padding: 5px 4px;
        font-size: 12px;
        min-width: 1.2em;
        flex-shrink: 0;
    }
    .bwb-comments-pagination .bwb-page-select {
        min-width: 44px;
        padding: 4px 20px 4px 6px;
        font-size: 12px;
        border-radius: 4px;
        background-position: right 4px center;
    }
    .bwb-comments-pagination .bwb-page-nav {
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 4px;
    }
    .bwb-topic-meta-row-right {
        gap: 8px;
    }
    .bwb-pagination-top .bwb-comments-pagination {
        margin-top: 0;
        margin-bottom: 0;
    }
    /* Archive: sidebar (latest posts) at top on mobile */
    .bwb-archive-layout {
        flex-direction: column;
        gap: 20px;
    }
    .bwb-archive-page .bwb-archive-sidebar {
        width: 100% !important;
        max-width: 100%;
        order: -1;
        display: block;
    }
    .bwb-archive-page .bwb-community-top .bwb-community-top-actions {
        display: none;
    }
    .bwb-community-search-below-posts {
        display: block;
        margin-top: 12px;
        text-align: center;
    }
    .bwb-community-search-below-posts .bwb-search-form {
        justify-content: center;
    }
    .bwb-latest-posts-list .bwb-latest-posts-item:nth-child(n+6) {
        display: none;
    }
    .bwb-archive-page .bwb-latest-posts-card {
        flex: none;
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    .bwb-archive-page .bwb-latest-posts-list {
        flex: none;
        min-height: 0;
        overflow: visible;
    }
    .bwb-archive-main {
        order: 0;
    }
    .bwb-community-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .bwb-community-top-actions {
        justify-content: center;
    }
    .bwb-notif-dropdown {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(360px, calc(100vw - 40px));
        max-width: min(360px, calc(100vw - 40px));
    }

    .bwb-forum-table {
        border: none;
        background: transparent;
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding: 0;
    }

    .bwb-forum-header {
        display: none;
    }

    .bwb-forum-row {
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 12px 20px;
        padding: 0;
        border: 1px solid #333;
        border-radius: 12px;
        background: #0c0c0c;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        overflow: hidden;
        text-align: left;
    }
    .bwb-forum-row:last-child {
        border: 1px solid #333;
    }

    /* Card title: full-width row */
    .bwb-forum-row > div:first-child {
        flex: 1 1 100%;
        display: block;
        font-weight: 600;
        font-size: 16px;
        line-height: 1.35;
        padding: 16px 18px;
        margin: 0;
        border-bottom: 1px solid #252525;
        background: #111;
    }
    .bwb-forum-row > div:first-child::before {
        display: none;
    }
    .bwb-forum-row > div:first-child a {
        color: #eee;
        text-decoration: none;
    }
    .bwb-forum-row > div:first-child a:hover {
        color: #eee;
        text-decoration: underline;
    }

    /* Stats: one horizontal row (flex) so "Topics 3 · Replies 5 · Last: …" */
    .bwb-forum-row > div:nth-child(n+2) {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 4px 6px;
        padding: 0 18px 0;
        margin: 0;
        flex: 0 0 auto;
        font-size: 13px;
        color: #aaa;
        grid-template-columns: unset;
    }
    .bwb-forum-row > div:nth-child(n+2)::before {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #666;
        margin-right: 4px;
    }
    .bwb-archive-page .bwb-forum-row > div:nth-child(2)::before { content: "Topics"; }
    .bwb-archive-page .bwb-forum-row > div:nth-child(3)::before { content: "Replies"; }
    .bwb-archive-page .bwb-forum-row > div:nth-child(4)::before { content: "Last post"; }

    .tax-bwb_topic_cat .bwb-forum-row > div:nth-child(2)::before { content: "Created by"; }
    .tax-bwb_topic_cat .bwb-forum-row > div:nth-child(3)::before { content: "Replies"; }
    .tax-bwb_topic_cat .bwb-forum-row > div:nth-child(4)::before { content: "Views"; }
    .tax-bwb_topic_cat .bwb-forum-row > div:nth-child(5)::before { content: "Activity"; }

    .bwb-search-page .bwb-forum-row > div:nth-child(2)::before { content: "Category"; }
    .bwb-search-page .bwb-forum-row > div:nth-child(3)::before { content: "Created by"; }
    .bwb-search-page .bwb-forum-row > div:nth-child(4)::before { content: "Replies"; }
    .bwb-search-page .bwb-forum-row > div:nth-child(5)::before { content: "Views"; }
    .bwb-search-page .bwb-forum-row > div:nth-child(6)::before { content: "Activity"; }

    .bwb-forum-row > div:last-child {
        padding-bottom: 16px;
    }
    /* Archive: give Last post full width so it wraps instead of overflowing */
    .bwb-archive-page .bwb-forum-row > div:last-child {
        flex: 1 1 100%;
        min-width: 0;
    }
    .bwb-align-center {
        text-align: left;
    }
    .bwb-forum-lastpost {
        text-align: left;
        font-size: 13px;
        min-width: 0;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }
    .bwb-forum-lastpost a {
        font-weight: 600;
    }

    .bwb-topic-meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
    /* Topic header: keep meta and actions on same row even on mobile */
    .bwb-topic-header .bwb-topic-meta-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .bwb-topic-header .bwb-topic-meta-row-right {
        margin-left: auto;
    }

    .bwb-comment-box {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .bwb-comment-body {
        border-left: none;
        padding-left: 0;
    }
    .bwb-comment-avatar {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
        min-height: 40px;
        width: 100%;
        box-sizing: border-box;
    }
    .bwb-comment-avatar > img {
        width: 40px;
        height: 40px;
        order: 1;
    }
    .bwb-comment-avatar > .bwb-comment-author {
        order: 2;
        margin: 0;
        padding: 0;
        text-align: center;
        font-weight: 600;
        font-size: 13px;
        line-height: 1.25;
    }
    .bwb-comment-avatar > .bwb-comment-author a {
        margin: 0;
        padding: 0;
    }
    /* Icon, label(s) and points on one row: use display:contents so row’s children join the grid */
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row {
        display: contents;
    }
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row .bwb-user-label {
        margin: 0;
        order: 3;
    }
    .bwb-comment-avatar .bwb-comment-avatar-icon-labels-row .bwb-gamification-level-icon {
        order: 3;
        width: 30px;
        height: 30px;
    }
    .bwb-comment-avatar > .bwb-comment-avatar-level-points {
        order: 3;
        margin: 0;
        font-size: 10px;
        color: #999;
    }
    .bwb-comment-avatar > .bwb-tournament-winner-badge {
        order: 4;
        margin: 0;
        margin-top: 2px;
    }
    .bwb-topic-content .bwb-topic-post .bwb-comment-avatar .bwb-user-label {
        margin: 0;
    }
    .bwb-comment-author a {
        color: #fff;
        text-decoration: none;
    }
    .bwb-comment-author a:hover {
        color: #fff;
        text-decoration: underline;
    }
}
