/* Shared community UI - tintuc + baiviet */
.community-subnav {
    display: flex; flex-direction: column; align-items: stretch;
    border-bottom: 1px solid #d0d7de; margin-bottom: 24px; width: 100%;
    max-width: 100%; overflow: hidden; position: relative; box-sizing: border-box;
}
.community-subnav--single { align-items: flex-start; }
.community-subnav--single .subnav-inner { justify-content: flex-start; }

.subnav-inner {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 0;
    width: 100%; max-width: 100%; min-width: 0; justify-content: center;
    overflow-x: auto; overflow-y: hidden;
    overscroll-behavior-x: contain; scrollbar-width: none;
    box-sizing: border-box; touch-action: pan-x;
    -webkit-user-drag: none; user-select: none;
}
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav-tab, .subnav-more { flex-shrink: 0; }
.subnav-tab {
    padding: 12px 16px; font-size: 14px; font-weight: 500; color: #57606a;
    background: none; border: none; border-bottom: 2px solid transparent;
    margin-bottom: -1px; cursor: pointer; font-family: inherit;
    white-space: nowrap; transition: color .15s, border-color .15s;
}
.subnav-tab:hover { color: #24292f; }
.subnav-tab.active {
    color: #24292f; font-weight: 600; border-bottom-color: #fd8c73;
}
.subnav-tab--static {
    cursor: default; pointer-events: none;
}
.subnav-tab--static.active {
    pointer-events: none;
    border-bottom-color: #fd8c73;
}
.subnav-more {
    padding: 12px 16px; font-size: 14px; font-weight: 500; color: #57606a;
    background: none; border: none; border-bottom: 2px solid transparent;
    margin-bottom: -1px; cursor: pointer; font-family: inherit;
    display: inline-flex; align-items: center; gap: 4px;
}
.subnav-more:hover { color: #0969da; }
.subnav-more.open { color: #0969da; font-weight: 600; }

.subnav-expand {
    display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease;
    overflow: hidden; width: 100%;
}
.subnav-expand.open { grid-template-rows: 1fr; }
.subnav-expand-inner {
    min-height: 0; overflow: hidden;
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 0 4px; border-top: 0 solid #eaeef2;
    transition: padding .28s ease, border-width .28s ease;
}
.subnav-expand.open .subnav-expand-inner {
    padding: 12px 4px 14px; border-top-width: 1px;
}
.subnav-expand-pill {
    padding: 6px 14px; font-size: 13px; font-weight: 500; color: #57606a;
    background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 20px;
    cursor: pointer; font-family: inherit; transition: all .15s;
}
.subnav-expand-pill:hover { background: #eaeef2; color: #24292f; }
.subnav-expand-pill.active {
    background: #0969da; color: #fff; border-color: #0969da;
}

.community-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    grid-template-areas: "main sidebar";
    gap: 24px;
    width: 100%; max-width: 1280px; align-items: start;
}
.community-main { min-width: 0; grid-area: main; }
.community-sidebar-column {
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
    align-self: start;
}
.community-sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-post-actions {
    display: flex; gap: 8px; width: 100%;
}
.btn-create-post, .btn-manage-post {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    flex: 1; min-width: 0; padding: 12px 14px; border: none; border-radius: 8px;
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: opacity .15s, transform .15s; white-space: nowrap;
}
.btn-create-post {
    background: linear-gradient(135deg, #5B5FF8, #6323ec); color: #fff;
}
.btn-manage-post {
    background: #fff; color: #5b5ff8; border: 1px solid #5b5ff8;
}
.btn-create-post:hover { opacity: .92; transform: translateY(-1px); color: #fff; }
.btn-manage-post:hover { background: #f0f0ff; }

.sidebar-card {
    background: #fff; border: 1px solid #d0d7de; border-radius: 12px;
    padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.sidebar-card h3,
.sidebar-card-title {
    font-size: 14px; font-weight: 600; color: #24292f; margin: 0 0 12px;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px;
}
.sidebar-card-icon svg { width: 17px; height: 17px; display: block; }
.sidebar-card-icon--trend {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #ea580c;
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.12);
}
.sidebar-card-icon--members {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #6323ec;
    box-shadow: inset 0 0 0 1px rgba(99, 35, 236, 0.12);
}
.sidebar-card + .sidebar-card { margin-top: 16px; }
.sidebar-card-desc {
    font-size: 12px; color: #57606a; margin: -6px 0 10px; line-height: 1.4;
}
.sidebar-member-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 0; border-bottom: 1px solid #eaeef2;
}
.sidebar-member-row:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-member-row:first-child { padding-top: 0; }
.sidebar-member-avatar {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
    flex-shrink: 0; border: 1px solid #d0d7de; background: #f6f8fa;
}
.sidebar-member-info { min-width: 0; flex: 1; }
.sidebar-member-name {
    font-size: 14px; font-weight: 600; color: #0969da; line-height: 1.35;
    word-break: break-word;
}
.sidebar-member-username {
    font-size: 12px; color: #57606a; line-height: 1.35; margin-top: 2px;
    word-break: break-word;
}

.sidebar-latest-item {
    display: block; padding: 12px 0; border-bottom: 1px solid #eaeef2;
    text-decoration: none; color: inherit;
}
.sidebar-latest-item:last-child { border-bottom: none; }
.sl-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 10px; margin-bottom: 6px;
}
.sl-title {
    font-size: 13px; font-weight: 600; color: #24292f; line-height: 1.45;
    flex: 1; min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.sl-views {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; color: #6e7781; flex-shrink: 0; white-space: nowrap;
}
.sl-views svg { width: 14px; height: 14px; stroke-width: 1.75; }
.sl-more {
    font-size: 12px; font-weight: 500; color: #5b5ff8; text-decoration: none;
    display: inline-flex; align-items: center; gap: 2px;
}
.sl-more:hover { text-decoration: underline; color: #4a4ed6; }

/* Feed post card */
.feed-card {
    background: #fff; border: 1px solid #d0d7de; border-radius: 12px;
    overflow: hidden; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.04);
    transition: box-shadow .2s;
}
.feed-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.feed-card-image {
    width: 100%; aspect-ratio: 2/1; object-fit: cover; background: #0d1117; display: block;
}
.feed-card-image-placeholder {
    width: 100%; aspect-ratio: 2/1; background: linear-gradient(135deg, #0d1117, #161b22);
    display: flex; align-items: center; justify-content: center; color: #57606a; font-size: 14px;
    padding: 16px; box-sizing: border-box; text-align: center;
}
.feed-card-image-link { display: block; text-decoration: none; color: inherit; }
.feed-trending {
    padding: 12px 20px 0; font-size: 12px; color: #57606a;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feed-stats-row {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 20px;
}
.feed-stat-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border: 1px solid #d0d7de; border-radius: 20px;
    background: #f6f8fa; font-size: 12px; color: #24292f; cursor: default;
    font-family: inherit;
}
.feed-like-btn { cursor: pointer; transition: background .15s, border-color .15s; }
.feed-like-btn:hover { background: #eaeef2; }
.feed-like-btn.liked { color: #5b5ff8; border-color: #5b5ff8; background: #f0f0ff; }
.feed-stat-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.feed-card-body { padding: 4px 20px 20px; }
.feed-card-title {
    font-size: 20px; font-weight: 700; line-height: 1.35; margin: 8px 0;
    min-width: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}
.feed-card-title a {
    color: #5b5ff8; text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.feed-card-title a:hover { text-decoration: underline; color: #4a4ed6; }
.feed-card-desc {
    font-size: 14px; color: #57606a; line-height: 1.6; margin: 0 0 12px;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.feed-card-footer {
    display: flex; align-items: center; gap: 6px; font-size: 12px; color: #57606a;
    padding-top: 10px; border-top: 1px solid #eaeef2; flex-wrap: wrap;
}
.feed-admin-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 10px; border-top: 1px dashed #e5e7eb; width: 100%; }
.feed-admin-btn {
    padding: 5px 10px; font-size: 11px; font-weight: 600; border-radius: 6px;
    border: 1px solid #d0d7de; background: #f6f8fa; color: #24292f; cursor: pointer; font-family: inherit;
}
.feed-admin-btn.feed-admin-danger { color: #cf222e; border-color: #ffccc7; background: #fff5f5; }
.feed-admin-btn:hover { background: #eef0f4; }
.feed-cat-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 500; color: #24292f;
}
.feed-role-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Baiviet detail */
.bv-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; width: 100%; max-width: 1280px; min-width: 0; }
.bv-main-col { min-width: 0; width: 100%; }
.bv-sidebar { min-width: 0; }
.bv-content-card {
    background: #fff; border: 1px solid #d0d7de; border-radius: 12px;
    overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.bv-content-inner {
    padding: 0 0 36px; font-size: 15px; line-height: 1.8; color: #24292f;
    word-break: break-word; overflow-wrap: anywhere;
}
.bv-content-featured-img {
    width: 100%; aspect-ratio: 2/1; object-fit: cover; display: block;
    margin: 0; border-radius: 0; vertical-align: top;
}
.bv-content-placeholder {
    margin: 0 0 28px; border-radius: 12px 12px 0 0;
}
.bv-content-body {
    padding: 28px 32px 0;
}
.bv-content-inner > .bv-content-placeholder + .bv-content-body { padding-top: 28px; }
.bv-content-inner > :not(.bv-content-featured-img):not(.bv-content-placeholder):not(.bv-content-loading):not(.bv-content-body) {
    padding-left: 32px; padding-right: 32px;
}
.bv-content-inner > .bv-content-placeholder + *,
.bv-content-inner > .bv-content-featured-img + .bv-content-body { margin-top: 0; }
.bv-content-inner > .bv-content-featured-img + *:not(.bv-content-body) { margin-top: 28px; }
.bv-content-inner > :first-child:not(.bv-content-featured-img):not(.bv-content-placeholder) { padding-top: 28px; }
.bv-content-inner > p:last-child, .bv-content-inner > div:last-child { padding-bottom: 0; }
.bv-content-inner :where(a) { color: #0969da; text-decoration: none; }
.bv-content-inner :where(a:hover) { text-decoration: underline; }
.bv-content-inner :where(p) { margin: 0 0 1em; }
.bv-content-inner :where(h1,h2,h3,h4) { margin: 1.4em 0 .6em; line-height: 1.3; color: #24292f; font-weight: 600; }
.bv-content-inner :where(h1) { font-size: 1.75em; }
.bv-content-inner :where(h2) { font-size: 1.4em; }
.bv-content-inner :where(h3) { font-size: 1.15em; }
.bv-content-inner :where(ul,ol) { margin: 0 0 1em; padding-left: 1.5em; }
.bv-content-inner :where(li) { margin-bottom: .35em; }
.bv-content-inner :where(blockquote) {
    margin: 1em 0; padding: 12px 16px; border-left: 3px solid #d0d7de;
    background: #f6f8fa; color: #57606a; border-radius: 0 6px 6px 0;
}
.bv-content-inner :where(pre) {
    background: #f6f8fa; border: 1px solid #d0d7de; border-radius: 6px;
    padding: 14px; overflow-x: auto; font-size: 13px; line-height: 1.5;
}
.bv-content-inner :where(code) { font-family: ui-monospace, monospace; font-size: .9em; }
.bv-content-inner :where(img:not(.bv-content-featured-img)) { max-width: 100%; height: auto; border-radius: 8px; margin: 1em 0; }
.bv-content-inner :where(hr) { border: none; border-top: 1px solid #eaeef2; margin: 1.5em 0; }
.bv-content-loading { color: #57606a; text-align: center; padding: 48px 20px; }

.bv-sidebar-section { margin-bottom: 20px; }
.bv-sidebar-section h4 { font-size: 14px; font-weight: 600; color: #24292f; margin: 0 0 8px; }
.bv-sidebar-post-title {
    font-size: 16px; font-weight: 700; color: #24292f; line-height: 1.45;
    margin: 0; word-break: break-word;
}
.bv-sidebar-desc { font-size: 13px; color: #57606a; line-height: 1.6; word-break: break-word; }
.bv-stat-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    font-size: 13px; color: #24292f; border-bottom: 1px solid #eaeef2;
    width: 100%; text-align: left; background: none; border-left: none; border-right: none; border-top: none;
    font-family: inherit;
}
.bv-stat-row:last-child { border-bottom: none; }
.bv-stat-clickable { cursor: pointer; transition: background .15s; }
.bv-stat-clickable:hover { background: #f6f8fa; }
.bv-stat-clickable.bv-liked .bv-stat-value, .bv-stat-clickable.bv-liked svg { color: #5b5ff8; }
.bv-stat-row svg { width: 16px; height: 16px; color: #57606a; flex-shrink: 0; }
.bv-stat-label { flex: 1; color: #57606a; }
.bv-stat-value { font-weight: 600; }
.bv-avatar-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.bv-avatar-grid img {
    width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid #d0d7de;
    flex-shrink: 0; cursor: pointer;
}
.bv-avatar-grid img.comment-profile-trigger:hover { box-shadow: 0 0 0 2px rgba(91, 95, 248, 0.35); }
.bv-view-all-comments {
    display: block; text-align: center; font-size: 13px; color: #0969da;
    text-decoration: none; padding: 8px; border-top: 1px solid #eaeef2; margin-top: 8px;
}
.bv-view-all-comments:hover { text-decoration: underline; }
.bv-author-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; width: 100%; }
.bv-author-actions:empty { display: none; }
.bv-author-actions .btn-create-post.bv-act-row1,
.bv-author-actions .bv-author-row2 { width: 100%; box-sizing: border-box; }
.bv-author-actions .btn-create-post.bv-act-row1 {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: linear-gradient(135deg, #5B5FF8, #6323ec);
    color: #ffffff;
    border: 1px solid #5b5ff8;
}
.bv-author-row2 { display: flex; gap: 8px; width: 100%; }
.bv-act-half {
    flex: 1; min-width: 0; padding: 10px 12px; font-size: 12px; font-weight: 500;
    border-radius: 8px; cursor: pointer; border: 1px solid #d0d7de;
    background: #f6f8fa; color: #24292f; font-family: inherit;
}
.bv-author-actions button {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #6ee7b7;
    background: #ecfdf5;
    color: #059669;
    font-family: inherit;
}
.bv-author-post-actions {
    display: flex; gap: 8px; width: 100%; flex: 1 1 100%;
}
.bv-author-post-actions .btn-create-post,
.bv-author-post-actions .btn-manage-post { flex: 1; padding: 10px 12px; font-size: 12px; }
.bv-author-actions .bv-delete { color: #cf222e; border-color: #ffccc7; background: #fff5f5; }

/* Comments panel */
.comments-panel {
    background: #fff; border: 1px solid #d0d7de; border-radius: 12px;
    margin-top: 24px; overflow: visible;
}
.comments-panel-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid #eaeef2;
}
.comments-panel-title {
    margin: 0; font-size: 16px; font-weight: 600; color: #24292f; flex-shrink: 0;
}
.comment-sort-wrap { position: relative; flex-shrink: 0; margin-left: auto; }
.comment-sort-btn {
    display: inline-flex; align-items: center; gap: 4px;
    border: none; background: none; padding: 4px 2px; cursor: pointer;
    font-size: 14px; font-weight: 600; color: #050505; font-family: inherit;
}
.comment-sort-btn:hover { opacity: 0.85; }
.comment-sort-chevron { flex-shrink: 0; color: #050505; transition: transform .15s; }
.comment-sort-wrap.is-open .comment-sort-chevron { transform: rotate(180deg); }
.comment-sort-menu {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
    min-width: min(320px, calc(100vw - 32px)); max-width: 340px;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.14); padding: 6px 0;
}
.comment-sort-menu[hidden] { display: none !important; }
.comment-sort-menu::before {
    content: ''; position: absolute; top: -6px; right: 18px;
    width: 12px; height: 12px; background: #fff;
    border-left: 1px solid #e5e7eb; border-top: 1px solid #e5e7eb;
    transform: rotate(45deg);
}
.comment-sort-option {
    display: block; width: 100%; text-align: left; border: none; background: none;
    padding: 10px 14px; cursor: pointer; font-family: inherit;
}
.comment-sort-option:hover { background: #f3f4f6; }
.comment-sort-option.is-active { background: #f0f2f5; }
.comment-sort-option-title {
    display: block; font-size: 14px; font-weight: 600; color: #050505; line-height: 1.35;
}
.comment-sort-option-desc {
    display: block; margin-top: 2px; font-size: 12px; font-weight: 400;
    color: #65676b; line-height: 1.45;
}
.comments-list { padding: 12px 16px 8px; overflow: visible; }
.comment-thread { margin-bottom: 4px; }
.comment-item { display: flex; gap: 8px; padding: 6px 0; border-bottom: none; align-items: flex-start; }
.comment-item--highlight {
    background: rgba(99, 35, 236, 0.08);
    border-radius: 8px;
    box-shadow: inset 0 0 0 2px rgba(99, 35, 236, 0.35);
    animation: commentHighlightPulse 1.2s ease 2;
}
@keyframes commentHighlightPulse {
    0%, 100% { background: rgba(99, 35, 236, 0.08); }
    50% { background: rgba(99, 35, 236, 0.16); }
}
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-avatar--sm { width: 28px; height: 28px; }
.comment-body { flex: 1; min-width: 0; }
.comment-bubble-row {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    max-width: 100%;
}
.comment-bubble {
    display: inline-block;
    width: max-content;
    max-width: 85%;
    background: #f8fafc;
    border-radius: 16px;
    padding: 10px 16px;
    margin-top: 4px;
    box-sizing: border-box;
}
.comment-more-wrap { position: relative; flex-shrink: 0; align-self: flex-start; margin-top: 4px; }
.comment-more-btn {
    width: 28px; height: 28px; border: none; background: transparent; color: #65676b;
    border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.comment-more-btn:hover { background: #e4e6eb; }
.comment-more-menu {
    min-width: 220px;
    display: flex; flex-direction: column;
    background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 6px 0;
}
.comment-more-menu[hidden],
.comment-report-submenu[hidden] { display: none !important; }
.comment-more-menu-portal,
.comment-more-menu.is-floating {
    position: fixed !important; z-index: 10050 !important;
    max-width: min(280px, calc(100vw - 16px));
}
.comment-more-report-toggle { flex-shrink: 0; }
.comment-more-report-toggle.is-open { background: #f3f4f6; font-weight: 600; }
.comment-more-item, .comment-report-reason {
    display: block; width: 100%; text-align: left; border: none; background: none;
    padding: 10px 14px; font-size: 13px; color: #111827; cursor: pointer; font-family: inherit;
}
.comment-more-item:hover, .comment-report-reason:hover { background: #f3f4f6; }
.comment-report-submenu {
    border-bottom: 1px solid #f1f5f9; padding-bottom: 4px; margin-bottom: 0;
}
.comment-report-reason { font-size: 12px; color: #374151; padding: 8px 14px 8px 22px; }
.comment-report-other-toggle { border-top: 1px solid #f1f5f9; margin-top: 2px; }
.comment-report-other-wrap {
    padding: 8px 12px 10px 22px;
    border-top: 1px dashed #e5e7eb;
}
.comment-report-other-input {
    width: 100%; box-sizing: border-box; min-height: 72px; resize: vertical;
    border: 1px solid #d0d7de; border-radius: 8px; padding: 8px 10px;
    font-size: 12px; line-height: 1.45; color: #24292f; font-family: inherit;
}
.comment-report-other-input:focus {
    outline: none; border-color: #5b5ff8; box-shadow: 0 0 0 2px rgba(91, 95, 248, 0.15);
}
.comment-report-other-submit {
    display: block; width: 100%; margin-top: 8px; padding: 8px 10px;
    border: none; border-radius: 8px; background: #5b5ff8; color: #fff;
    font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.comment-report-other-submit:hover { background: #4a4ed6; }
.comment-profile-trigger { cursor: pointer; }
.comment-profile-trigger:hover { opacity: 0.88; }
.comment-author.comment-profile-trigger:hover { text-decoration: underline; }
.comment-avatar.comment-profile-trigger:hover { box-shadow: 0 0 0 2px rgba(91, 95, 248, 0.35); }
.comment-admin-del { color: #cf222e !important; }
.comment-header { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.comment-author { font-size: 13px; font-weight: 600; color: #050505; }
.comment-text { font-size: 14px; color: #050505; line-height: 1.45; word-break: break-word; }
.comment-meta-row { display: flex; align-items: center; gap: 12px; padding: 6px 0 4px 12px; flex-wrap: wrap; }
.comment-date { font-size: 12px; color: #65676b; }
.comment-meta-btn {
    background: none; border: none; font-size: 13px; font-weight: 600; color: #65676b;
    cursor: pointer; padding: 4px 6px; display: inline-block; vertical-align: middle;
}
.comment-meta-btn[data-action="vote"] { display: inline-flex; align-items: center; gap: 4px; }
.comment-expand-replies { color: #5B5FF8 !important; font-weight: 600; }
.comment-replies.collapsed { display: none; }
.comment-replies:not(.collapsed) { display: block; }
.comment-meta-btn svg {width: 14px;height: 14px;}
.comment-meta-btn.comment-reply-btn:hover,
.comment-meta-btn.comment-expand-replies:hover { text-decoration: underline; }
.comment-meta-btn[data-action="vote"]:hover { text-decoration: none; color: #050505; }
.comment-meta-btn.active-like,
.comment-meta-btn.active-like .vote-count { color: #ef4444 !important; }
.comment-meta-btn.active-like svg { color: #ef4444; fill: #ef4444; stroke: #ef4444; }
.comment-meta-btn.comment-expand-replies { color: #5B5FF8 !important; }
.comment-item--reply {
    padding: 4px 0;
    padding-left: 2.5rem;
    position: relative;
}
.comment-mention { font-weight: 700; color: #24292f; }
.comment-replies {
    position: relative;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}
.comment-replies::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 0;
    bottom: 1rem;
    border-left: 1px solid #e2e8f0;
    pointer-events: none;
}
.comment-reply-composer { display: flex; gap: 8px; align-items: center; margin: 6px 0 8px 2.5rem; }
.reply-input-shell {
    flex: 1; display: flex; align-items: center; gap: 6px; min-height: 36px;
    background: #f0f2f5; border-radius: 999px; padding: 4px 6px 4px 12px;
}
.reply-tag-chip {
    flex-shrink: 0; font-size: 13px; font-weight: 600; color: #1877f2;
    background: rgba(24,119,242,.12); border-radius: 6px; padding: 2px 8px; max-width: 140px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.reply-inline-input {
    flex: 1; border: none; background: transparent; font-size: 14px; color: #050505;
    outline: none; min-width: 0; font-family: inherit;
}
.reply-send-btn {
    width: 32px; height: 32px; border: none; border-radius: 50%; background: transparent;
    color: #1877f2; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.reply-send-btn svg { width: 18px; height: 18px; }
.reply-send-btn:hover { background: rgba(24,119,242,.1); }
.comments-empty { padding: 20px; color: #57606a; text-align: center; font-size: 14px; }
.comment-form { padding: 12px 16px 16px; border-top: 1px solid #eaeef2; display: none; }
.comment-form.is-open { display: block; }
.comment-form-row {
    display: flex; align-items: flex-end; gap: 10px; width: 100%; box-sizing: border-box;
}
.comment-form textarea {
    flex: 1; border: 1px solid #5B5FF8; border-radius: 12px; padding: 0 14px;
    font-size: 14px; line-height: 40px; resize: none; min-height: 40px; max-height: 160px;
    font-family: inherit; min-width: 0; overflow-y: hidden;
    background: #f0f2f5; width: 100%; box-sizing: border-box;
}
.comment-form textarea:not(:placeholder-shown) {
    line-height: 1.45;
    padding: 10px 14px;
}
.comment-form textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(91,95,248,.12); }
.comment-submit-btn { flex-shrink: 0; }
@media (min-width: 768px) {
    .comment-item--reply {
        padding-left: 3rem;
    }
    .comment-replies::before {
        left: 1.25rem;
    }
    .comment-reply-composer {
        margin-left: 3rem;
    }
}
.sidebar-hot-empty { font-size: 12px; color: #57606a; padding: 8px 0; }

/* Desktop: sidebar phải — nút action + thịnh hành xếp dọc, không dùng layout mobile */
@media (min-width: 1024px) {
    .community-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 340px !important;
        grid-template-areas: "main sidebar" !important;
        align-items: start !important;
    }
    .bv-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 300px !important;
        grid-template-areas: "main sidebar" !important;
        align-items: start !important;
        width: 100% !important;
    }
    .community-main,
    .bv-main-col {
        grid-area: main !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    .bv-sidebar {
        grid-area: sidebar !important;
        min-width: 280px !important;
        max-width: 300px !important;
        width: 300px !important;
    }
    .community-sidebar-column {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px !important;
        grid-area: sidebar !important;
        align-self: start !important;
        min-width: 0 !important;
        width: 100% !important;
    }
    .community-layout-actions,
    .community-layout-trending {
        grid-area: unset !important;
        order: unset !important;
        width: 100% !important;
    }
    .bv-sidebar .sidebar-card {
        display: block !important;
    }
}

@media (max-width: 1023px) {
    .community-layout, .bv-layout { grid-template-columns: 1fr; gap: 20px; width: 100%; max-width: 100%; min-width: 0; }
    .community-sidebar-column { display: contents; }
    .community-layout {
        grid-template-areas:
            "actions"
            "main"
            "trending";
    }
    .community-layout-actions { grid-area: actions; }
    .community-layout-trending { grid-area: trending; }
    .community-main, .bv-main-col, .community-sidebar, .bv-sidebar { min-width: 0; width: 100%; max-width: 100%; }
    .bv-content-body,
    .bv-content-inner > :not(.bv-content-featured-img):not(.bv-content-placeholder):not(.bv-content-loading):not(.bv-content-body) {
        padding-left: 16px; padding-right: 16px;
    }
    .feed-card-body { padding: 4px 16px 16px; }
    .feed-trending, .feed-stats-row { padding-left: 16px; padding-right: 16px; }
    .feed-card-title { font-size: 17px; }
    .feed-stats-row { flex-wrap: wrap; }
    .sidebar-post-actions { flex-direction: column; }
    .community-subnav { max-width: 100%; overflow: hidden; }
    .subnav-inner { justify-content: flex-start; flex-wrap: nowrap; }
    .sidebar-card, .feed-card, .bv-content-card, .comments-panel { max-width: 100%; box-sizing: border-box; }
    .comment-replies {
        margin-left: 0;
        padding-left: 0;
    }
    .comment-item--reply {
        padding-left: 2.5rem;
    }
    .bv-content-inner :where(pre) { max-width: 100%; }
    .bv-content-inner :where(img) { max-width: 100% !important; height: auto !important; }
}

/* Compact-only tweaks (post detail) — giữ layout mobile cho cả tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .news-page,
    .post-page {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
    .news-main.main-container,
    .post-main.main-container {
        padding: 20px 20px 48px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .community-layout,
    .bv-layout {
        gap: 22px;
        padding: 0;
    }
    .community-sidebar {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .sidebar-latest-item {
        padding: 10px 0;
    }
    .sl-head {
        flex-direction: column;
        gap: 4px;
    }
    .sl-views { align-self: flex-start; }
    .feed-card {
        margin-bottom: 18px;
        border-radius: 10px;
    }
    .feed-card-title { font-size: 18px; }
    .feed-stats-row { gap: 6px; }
    .feed-stat-btn { font-size: 12px; }
    .bv-layout {
        gap: 22px;
    }
    .bv-sidebar .sidebar-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px 20px;
        padding: 18px;
    }
    .bv-sidebar .bv-sidebar-section:first-child,
    .bv-sidebar .bv-sidebar-section:nth-child(2) {
        grid-column: 1 / -1;
    }
    .bv-sidebar .bv-sidebar-section:nth-child(3) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-bottom: 0;
    }
    .bv-sidebar .bv-sidebar-section:nth-child(3) .bv-stat-row,
    .bv-sidebar .bv-sidebar-section:nth-child(3) .bv-stat-clickable {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px;
        padding: 12px 8px;
        border: 1px solid #eaeef2;
        border-radius: 10px;
        background: #f6f8fa;
    }
    .bv-sidebar .bv-sidebar-section:nth-child(3) .bv-stat-label {
        flex: none;
        font-size: 11px;
    }
    .bv-sidebar .bv-sidebar-section:nth-child(3) .bv-stat-value {
        font-size: 15px;
    }
    .bv-sidebar .bv-sidebar-section:nth-child(4) {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }
    .bv-sidebar .bv-author-actions {
        grid-column: 1 / -1;
        margin-top: 0;
    }
    .bv-author-post-actions {
        flex-direction: row;
    }
    .comments-panel {
        border-radius: 10px;
    }
    .comments-panel-header,
    .comments-list,
    .comment-form {
        padding-left: 18px;
        padding-right: 18px;
    }
    .comment-replies {
        margin-left: 0;
        padding-left: 0;
    }
    .comment-item--reply {
        padding-left: 2.5rem;
    }
    .comment-item { gap: 10px; }
    .comment-avatar { width: 36px; height: 36px; }
    .bv-content-inner :where(h1) { font-size: 1.55em; }
    .bv-content-inner :where(h2) { font-size: 1.3em; }
    .pagination-flex-wrap {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 0 4px;
    }
}
@media (max-width: 767px) {
    .comments-panel { width: 100%; max-width: 100%; box-sizing: border-box; }
    .comment-form-row { width: 100%; }
    .comments-list { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 480px) {
    .comment-form-row { flex-direction: column; align-items: stretch; }
    .comment-submit-btn { align-self: flex-end; width: auto; }
    .comments-panel, .comment-form, .comments-list { width: 100%; box-sizing: border-box; }
    .comment-form { padding-left: 12px !important; padding-right: 12px !important; }
    .feed-stat-btn { font-size: 11px; padding: 4px 8px; }
    .bv-author-actions button { flex: 1 1 auto; min-width: 0; }
    .main-container { padding-left: 10px !important; padding-right: 10px !important; }
}
