[hidden] { display: none !important; }
/* ===== Cộng đồng TOEX — 3 cột theo trang mẫu, phong cách v3 (thẻ kem viền mực, bóng cứng, nền olive lưới) ===== */
body.v3.v3-community {
  background-color: var(--v3-olive) !important; background-image: var(--v3-grid) !important; background-size: 32px 32px !important;
  /* màu chấm kỹ năng */
  --sk-nghe: #4F7FCF; --sk-doc: #2E9E6A; --sk-viet: #E58344; --sk-noi: #D5507A; --sk-tu-vung: #8A63B8; --sk-ngu-phap: #5A5FD0; --sk-chung: #7A6A54;
}
.cm-wrap {
  width: min(1240px, 100% - 32px); margin: 0 auto; padding: 96px 0 80px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 290px; gap: 24px; align-items: start;
}
.cm-card { background: var(--v3-paper); border: 3px solid var(--v3-ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--v3-ink); color: var(--v3-ink); }
.cm-side, .cm-right { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; position: sticky; top: 92px; }
.cm-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.cm-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* tiêu đề cho SEO/đọc màn hình */
.cm-card h2 { margin: 0; font-size: 16px; font-weight: 800; color: var(--v3-ink); }

/* ----- tab ----- */
.cm-tabs { display: grid; gap: 4px; padding: 10px; }
.cm-tabs button { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 0; border-radius: 12px; background: none; color: var(--v3-ink); font: inherit; font-size: 14.5px; font-weight: 700; cursor: pointer; text-align: left; }
.cm-tabs button:hover { background: var(--v3-cream); }
.cm-tabs button.on { background: var(--v3-ink); color: var(--v3-paper); box-shadow: 3px 3px 0 var(--v3-olive); }

/* ----- chưa có câu trả lời ----- */
.cm-unans { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: 14px; font-weight: 700; cursor: pointer; }
.cm-unans span { flex: 1; }
.cm-unans small { font-size: 12px; color: var(--tx-muted, #6B5A44); }
.cm-unans input { width: 20px; height: 20px; accent-color: var(--v3-olive); cursor: pointer; }

/* ----- danh sách dạng bài / kỹ năng ----- */
.cm-filters { display: grid; gap: 18px; }
.cm-filter-toggle { display: none; }
.cm-list { display: grid; gap: 2px; padding: 16px 12px 12px; }
.cm-list h2 { margin: 0 6px 8px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--tx-muted, #6B5A44); }
.cm-list button { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 2px solid transparent; border-radius: 10px; background: none; color: var(--v3-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.cm-list button small { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tx-muted, #6B5A44); }
.cm-list button:hover { background: var(--v3-cream); }
.cm-list button.on { background: var(--v3-green-t); border-color: var(--v3-ink); font-weight: 800; }
.cm-list button.on::after { content: "✓"; margin-left: 8px; font-weight: 800; }
.cm-list button.on small { display: none; }
.cm-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--sk, #7A6A54); }

/* ----- ô đăng bài ----- */
.cm-compose { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: center; padding: 18px 20px; }
.cm-open { width: 100%; min-height: 78px; padding: 14px 18px; border: 2px dashed var(--v3-ink); border-radius: 14px; background: var(--v3-cream); color: var(--tx-muted, #6B5A44); font: inherit; font-size: 15.5px; font-weight: 600; text-align: left; cursor: text; }
.cm-open:hover { border-style: solid; }
.cm-compose-body { display: none; grid-column: 1 / -1; gap: 12px; }
.cm-compose.open .cm-open { display: none; }
.cm-compose.open { align-items: start; }
.cm-compose.open .cm-compose-body { display: grid; grid-column: 2; }
.cm-compose textarea { width: 100%; min-height: 120px; resize: vertical; padding: 14px 16px; border: 2px solid var(--v3-ink); border-radius: 14px; background: var(--v3-paper); color: var(--v3-ink); font: inherit; font-size: 15px; line-height: 1.6; }
.cm-compose textarea:focus, .cm-reply-form textarea:focus { outline: 3px solid var(--v3-yellow); outline-offset: 1px; }
.cm-compose-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cm-compose-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--tx-muted, #6B5A44); }
.cm-compose-row select { height: 36px; padding: 0 10px; border: 2px solid var(--v3-ink); border-radius: 10px; background: var(--v3-paper); color: var(--v3-ink); font: inherit; font-size: 13px; font-weight: 700; }
.cm-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tx-muted, #6B5A44); }
.cm-count.over { color: #C0392B; }

/* ----- nút chung ----- */
.cm-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border: 3px solid var(--v3-ink); border-radius: 999px; background: var(--v3-cta); color: #121212; font: inherit; font-size: 14px; font-weight: 800; box-shadow: 3px 3px 0 var(--v3-ink); cursor: pointer; text-decoration: none; }
.cm-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--v3-ink); }
.cm-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.cm-btn.ghost { background: var(--v3-paper); color: var(--v3-ink); }
.cm-icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: none; color: var(--v3-ink); cursor: pointer; }
.cm-icon-btn:hover { background: var(--v3-cream); }
.cm-loadmore { justify-self: center; }

/* ----- đầu bảng tin ----- */
.cm-feed-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.cm-feed-head h2 { font-size: 16px; }
.cm-feed-head button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-radius: 10px; background: none; color: var(--v3-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cm-feed-head button:hover { background: var(--v3-cream); }
.cm-feed { display: grid; gap: 22px; }

/* ----- thẻ bài ----- */
.cm-post { background: var(--v3-paper); border: 3px solid var(--v3-ink); border-radius: 18px; box-shadow: 5px 5px 0 var(--v3-ink); color: var(--v3-ink); padding: 20px 22px 6px; scroll-margin-top: 110px; }
.cm-post.cm-flash { animation: cmFlash 1.8s ease 2; }
@keyframes cmFlash { 50% { box-shadow: 5px 5px 0 var(--v3-ink), 0 0 0 6px var(--v3-yellow); } }
.cm-post-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: start; }
.cm-who { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.cm-name-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; font-weight: 800; }
.cm-streak { flex: none; font-size: 12.5px; font-weight: 800; color: #D9480F; }
.cm-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; max-width: 100%; padding: 2px 9px; border: 2px solid var(--v3-ink); border-radius: 999px; background: var(--v3-yellow); color: #121212; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-kind { padding: 4px 10px; border: 2px solid var(--v3-ink); border-radius: 8px; background: var(--v3-paper); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; max-width: 120px; line-height: 1.25; }
.cm-more { position: relative; }
.cm-menu { position: absolute; right: 0; top: 38px; z-index: 20; min-width: 190px; display: grid; padding: 6px; background: var(--v3-paper); border: 3px solid var(--v3-ink); border-radius: 12px; box-shadow: 4px 4px 0 var(--v3-ink); }
.cm-menu button { padding: 9px 12px; border: 0; border-radius: 8px; background: none; color: var(--v3-ink); font: inherit; font-size: 13.5px; font-weight: 700; text-align: left; cursor: pointer; }
.cm-menu button:hover { background: var(--v3-cream); }
.cm-menu .danger { color: #B42318; }
.cm-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--tx-muted, #6B5A44); }
.cm-meta .cm-dot { margin-left: 4px; }
.cm-body { margin: 14px 0 0; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--v3-ink); }
.cm-body a { color: inherit; text-decoration: underline 2px var(--v3-yellow); text-underline-offset: 3px; }
.cm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 16px; padding: 8px 0; border-top: 2px dashed var(--v3-ink); }
.cm-actions button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--v3-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.cm-actions button:hover { background: var(--v3-cream); }
.cm-actions [data-act="like"].on { color: #D5374F; }
.cm-actions .cm-follow { margin-left: auto; }
.cm-actions .cm-follow.on { color: var(--v3-olive); }

/* ----- ảnh đại diện ----- */
.cm-av { display: inline-grid; place-items: center; flex: none; width: 48px; height: 48px; border: 2px solid var(--v3-ink); border-radius: 50%; overflow: hidden; background: var(--av, #EBC24F); color: #121212; font-size: 19px; font-weight: 800; }
.cm-av img { width: 100%; height: 100%; object-fit: cover; }
.cm-av-sm { width: 34px; height: 34px; font-size: 14px; }
.cm-av-xs { width: 30px; height: 30px; font-size: 13px; border-width: 1.5px; }
#cmMeAv .cm-av { width: 52px; height: 52px; }
.p-user i:has(.cm-av) { background: none; width: auto; height: auto; }

/* ----- trả lời ----- */
.cm-replies { margin: 0 -22px; padding: 14px 22px 18px; border-top: 2px solid var(--v3-ink); background: var(--v3-cream); border-radius: 0 0 15px 15px; }
.cm-reply-list { display: grid; gap: 14px; }
.cm-reply { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.cm-reply-main { background: var(--v3-paper); border: 2px solid var(--v3-ink); border-radius: 12px; padding: 9px 12px; }
.cm-reply-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.cm-reply .cm-body { margin-top: 4px; font-size: 14px; }
.cm-reply-meta { display: flex; gap: 12px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--tx-muted, #6B5A44); }
.cm-reply-meta button { padding: 0; border: 0; background: none; color: #B42318; font: inherit; font-weight: 700; cursor: pointer; }
.cm-reply-form { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; }
.cm-reply-form textarea { width: 100%; resize: vertical; padding: 10px 12px; border: 2px solid var(--v3-ink); border-radius: 12px; background: var(--v3-paper); color: var(--v3-ink); font: inherit; font-size: 14px; }
.cm-note { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--tx-muted, #6B5A44); }
.cm-note a { color: var(--v3-ink); font-weight: 800; text-decoration: underline 2px var(--v3-yellow); }

/* ----- trợ giúp tuần + nội quy ----- */
.cm-helpers { padding: 18px 18px 14px; }
.cm-helpers h2 { display: flex; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 2px solid var(--v3-ink); }
.cm-helpers ol { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.cm-helpers li { display: grid; grid-template-columns: 24px 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cm-rank { display: grid; place-items: center; width: 22px; height: 22px; border: 2px solid var(--v3-ink); border-radius: 6px; background: var(--v3-paper); font-size: 11px; font-weight: 800; color: #121212; }
.cm-rank.r1 { background: var(--v3-yellow); } .cm-rank.r2 { background: #D9D2C3; } .cm-rank.r3 { background: var(--v3-orange); }
.cm-h-name { min-width: 0; display: grid; }
.cm-h-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.cm-h-name small { font-size: 11px; font-weight: 700; color: var(--v3-olive); }
.cm-pts { padding: 2px 8px; border: 2px solid var(--v3-ink); border-radius: 8px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cm-h-empty { display: block !important; font-size: 13px; font-weight: 600; color: var(--tx-muted, #6B5A44); }
.cm-rules { padding: 18px; }
.cm-rules ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }

/* ----- trạng thái ----- */
.cm-empty { display: grid; justify-items: center; gap: 10px; padding: 36px 24px; text-align: center; background: var(--v3-paper); border: 3px dashed var(--v3-ink); border-radius: 18px; }
.cm-empty img { width: 110px; height: auto; }
.cm-empty p { margin: 0; max-width: 420px; font-size: 15px; font-weight: 700; line-height: 1.6; color: var(--v3-ink); }
.cm-skel { height: 170px; border-radius: 18px; border: 3px solid var(--v3-ink); background: linear-gradient(90deg, var(--v3-paper) 0%, var(--v3-cream) 50%, var(--v3-paper) 100%); background-size: 200% 100%; animation: cmSkel 1.2s linear infinite; }
.cm-skel.sm { height: 48px; border-width: 2px; border-radius: 12px; list-style: none; }
@keyframes cmSkel { to { background-position: -200% 0; } }
.cm-toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; max-width: calc(100% - 32px); padding: 12px 18px; border: 3px solid #121212; border-radius: 14px; background: #121212; color: #FFFDF8; font-size: 14px; font-weight: 700; box-shadow: 4px 4px 0 #EBC24F; transition: opacity .2s, transform .2s; }
.cm-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ----- hộp mời đăng nhập ----- */
.cm-login { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; background: rgba(18, 18, 18, .55); }
.cm-login[hidden] { display: none; }
.cm-login-box { position: relative; width: min(400px, 100%); display: grid; justify-items: center; gap: 10px; padding: 28px 24px 22px; text-align: center; }
.cm-login-box img { width: 104px; height: auto; margin-top: -4px; }
.cm-login-box h2 { font-family: var(--v3-display); font-weight: 900; font-size: 24px; }
.cm-login-box p { margin: 0 0 6px; font-size: 14.5px; font-weight: 600; }
.cm-login-box small { font-size: 12px; font-weight: 600; color: var(--tx-muted, #6B5A44); }
.cm-login-x { position: absolute; top: 10px; right: 10px; }

/* ----- máy tính bảng: 2 cột (bộ lọc trái, bảng tin) ----- */
@media (max-width: 1180px) {
  .cm-wrap { grid-template-columns: 230px minmax(0, 1fr); }
  .cm-right { grid-column: 2; position: static; grid-template-columns: 1fr 1fr; align-items: start; }
}
/* ----- điện thoại: 1 cột; tab thành hàng ngang, bộ lọc thu gọn ----- */
@media (max-width: 820px) {
  .cm-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 84px; gap: 16px; }
  .cm-side { position: static; gap: 12px; }
  .cm-right { grid-column: auto; grid-template-columns: 1fr; }
  .cm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px; gap: 4px; }
  .cm-tabs button { flex-direction: column; gap: 4px; justify-content: center; padding: 8px 4px; font-size: 12.5px; line-height: 1.2; text-align: center; }
  .cm-filter-toggle { display: inline-flex; align-items: center; gap: 8px; justify-self: start; padding: 9px 14px; border: 2px solid var(--v3-ink); border-radius: 999px; background: var(--v3-paper); color: var(--v3-ink); font: inherit; font-size: 13.5px; font-weight: 800; box-shadow: 3px 3px 0 var(--v3-ink); cursor: pointer; }
  .cm-filters { display: none; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cm-side.filters-open .cm-filters { display: grid; }
  .cm-compose { grid-template-columns: 44px minmax(0, 1fr); padding: 14px; gap: 10px; }
  #cmMeAv .cm-av { width: 44px; height: 44px; }
  .cm-compose.open .cm-compose-body { grid-column: 1 / -1; }
  .cm-post { padding: 16px 16px 4px; }
  .cm-post-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cm-kind { grid-column: 2; grid-row: 2; justify-self: start; }
  .cm-more { grid-column: 3; grid-row: 1; }
  .cm-replies { margin: 0 -16px; padding: 12px 16px 16px; }
  .cm-actions button { padding: 8px 7px; font-size: 13px; }
}
@media (max-width: 480px) {
  .cm-filters { grid-template-columns: 1fr; }
  .cm-actions [data-act="share"] span { display: none; }
  .cm-reply-form { grid-template-columns: minmax(0, 1fr) auto; }
  .cm-reply-form .cm-av { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cm-skel { animation: none; } .cm-post.cm-flash { animation: none; } }
