/* =====================================================================
   community-hop.css – 20/11/2026 (tk2)
   Lớp vỏ mới cho HỘP NỔI + KHU BÌNH LUẬN trang /community, đồng bộ trang chủ + Giới thiệu:
   giấy kem #FFFDF8, viền mực 2px #121212, bo 10px (nhỏ 6px), bóng lệch cứng, chàm #5E75B8,
   vàng logo #EFC278 cho nút CTA, cam #E66C2C chỉ nhấn nhỏ. Không kính mờ, không linh vật.
   Nạp SAU community-moi.css và mọi css khác. Chỉ áp ở giao diện sáng (tối giữ theme-dark.css).
   Không đổi HTML/JS.
   ===================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Unbounded:wght@700&family=Plus+Jakarta+Sans:wght@500;600;700;800&family=Space+Mono:wght@700&display=swap");

html:not([data-theme="dark"]) body.v3-community:not(#_h) {
  --hp-giay: #FFFDF8;
  --hp-nen: #F7F1E3;
  --hp-muc: #17222D;
  --hp-phu: #4A5560;
  --hp-vien: 2px solid #121212;
  --hp-vien-nhe: 1.5px solid rgba(18, 18, 18, .22);
  --hp-bong: 4px 4px 0 rgba(24, 38, 65, .28);
  --hp-bong-nut: 3px 3px 0 rgba(24, 38, 65, .28);
  --hp-bong-nhan: 2px 2px 0 rgba(24, 38, 65, .28);
  --hp-cham: #5E75B8;
  --hp-cham-dam: #4A5F9E;
  --hp-vang: #EFC278;
  --hp-cam: #E66C2C;
  --hp-chu: "Plus Jakarta Sans", system-ui, sans-serif;
  --hp-tde: "Unbounded", "Plus Jakarta Sans", sans-serif;
  --hp-nhan: "Space Mono", ui-monospace, monospace;
}

/* ---------- 1. Hộp đăng nhập ---------- */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login {
  background: rgba(23, 34, 45, .45) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  padding: 16px !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login[hidden] { display: none !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box {
  width: min(420px, 100%) !important;
  max-height: calc(100dvh - 32px); overflow-y: auto;
  gap: 12px !important;
  padding: 0 0 22px !important;
  background: var(--hp-giay) !important;
  border: var(--hp-vien) !important;
  border-radius: 10px !important;
  box-shadow: var(--hp-bong) !important;
  color: var(--hp-muc) !important;
  font-family: var(--hp-chu) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background-image: none !important;
  overflow-x: hidden;
}
/* dải đầu hộp màu chàm, có nhãn nhỏ kiểu Space Mono */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box::before {
  content: "CỘNG ĐỒNG TOEX";
  display: block; justify-self: stretch; box-sizing: border-box;
  padding: 14px 60px 13px 20px;
  background: #4A5F9E;
  border-bottom: var(--hp-vien);
  color: var(--hp-giay);
  font: 700 11px/1.2 var(--hp-nhan); letter-spacing: .14em; text-align: left;
}
html[lang="en"]:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box::before { content: "TOEX COMMUNITY"; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box > img { display: none !important; } /* không linh vật */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box h2 {
  margin: 10px 22px 0 !important;
  font-family: var(--hp-tde) !important; font-weight: 700 !important;
  font-size: 22px !important; line-height: 1.3 !important; letter-spacing: -.01em;
  color: var(--hp-muc) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box p {
  margin: 0 22px 6px !important;
  font-size: 15px !important; font-weight: 600 !important; line-height: 1.6;
  color: var(--hp-phu) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box small {
  margin: 0 22px;
  font-family: var(--hp-nhan) !important; font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .06em; color: var(--hp-phu) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-x {
  position: absolute !important; top: 4px !important; right: 6px !important;
  width: 44px !important; height: 44px !important; min-height: 44px !important;
  display: grid !important; place-items: center;
  padding: 0 !important; border: 0 !important; border-radius: 6px !important;
  background: transparent !important; box-shadow: none !important;
  color: var(--hp-giay) !important; cursor: pointer;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-x:hover { background: #3F5590 !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-x:focus-visible { outline: 3px solid var(--hp-vang) !important; outline-offset: -3px; }
/* nút chính: chữ mực trên nền vàng + ô mũi tên chàm */
html:not([data-theme="dark"]) body.v3-community:not(#_h) #cmLoginGo {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px !important; margin: 4px 22px 0;
  padding: 0 6px 0 20px !important;
  border: var(--hp-vien) !important; border-radius: 10px !important;
  background: var(--hp-vang) !important; color: #121212 !important;
  font-family: var(--hp-chu) !important; font-size: 15px !important; font-weight: 800 !important;
  box-shadow: var(--hp-bong-nut) !important;
  text-decoration: none !important; transition: transform .15s, box-shadow .15s;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) #cmLoginGo::after {
  content: ""; flex: none; width: 34px; height: 34px;
  border: var(--hp-vien); border-radius: 6px;
  background: #4A5F9E url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFDF8' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px no-repeat;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) #cmLoginGo:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(24, 38, 65, .28) !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) #cmLoginGo:focus-visible { outline: 3px solid var(--hp-cham) !important; outline-offset: 3px; }

/* ---------- 2. Menu "…", thông báo nổi, nháy bài ---------- */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu {
  min-width: 210px !important; padding: 6px !important; gap: 2px;
  background: var(--hp-giay) !important;
  border: var(--hp-vien) !important; border-radius: 10px !important;
  box-shadow: var(--hp-bong) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background-image: none !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu[hidden] { display: none !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu button {
  min-height: 44px !important; padding: 0 12px !important;
  border: 0 !important; border-radius: 6px !important;
  background: none !important; box-shadow: none !important;
  color: var(--hp-muc) !important;
  font-family: var(--hp-chu) !important; font-size: 14px !important; font-weight: 700 !important;
  text-align: left !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu button:hover,
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu button:focus-visible {
  background: var(--hp-nen) !important; outline: none;
  box-shadow: inset 3px 0 0 var(--hp-cham) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu .danger { color: #B8461A !important; border-top: var(--hp-vien-nhe) !important; border-radius: 0 0 6px 6px !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-menu .danger:hover { box-shadow: inset 3px 0 0 var(--hp-cam) !important; }

html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-toast {
  bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
  padding: 12px 18px 12px 16px !important;
  border: var(--hp-vien) !important; border-left: 8px solid var(--hp-vang) !important;
  border-radius: 10px !important;
  background: #3F5590 !important; color: var(--hp-giay) !important;
  font-family: var(--hp-chu) !important; font-size: 14px !important; font-weight: 700 !important; line-height: 1.45;
  box-shadow: var(--hp-bong) !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}

html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-post.cm-flash { animation: hpFlash 1.8s ease 2 !important; }
@keyframes hpFlash { 50% { box-shadow: 4px 4px 0 rgba(24, 38, 65, .28), 0 0 0 5px #EFC278; } }

/* ---------- 3. Khu bình luận ---------- */
/* 3a. Hai trả lời xem trước */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-preview {
  margin: 0 0 14px !important;
  background: var(--hp-nen) !important;
  border: var(--hp-vien) !important; border-radius: 10px !important;
  box-shadow: none !important; overflow: hidden;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv { padding: 12px 14px !important; gap: 10px !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv + .cm-pv { border-top: var(--hp-vien-nhe) !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-main { min-width: 0; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-head,
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-head {
  font-family: var(--hp-chu) !important; font-size: 14px !important; color: var(--hp-muc) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-head b,
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-head b { font-weight: 800; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-head time,
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-meta time {
  font-family: var(--hp-nhan) !important; font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .04em; text-transform: uppercase; color: var(--hp-phu) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-body {
  font-family: var(--hp-chu) !important; font-size: 14.5px !important; font-weight: 500; line-height: 1.6 !important;
  color: var(--hp-muc) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-all {
  min-height: 44px !important; padding: 0 14px !important; gap: 8px !important;
  border: 0 !important; border-top: var(--hp-vien) !important; border-radius: 0 !important;
  background: var(--hp-giay) !important; box-shadow: none !important;
  color: #4A5F9E !important;
  font-family: var(--hp-nhan) !important; font-size: 11.5px !important; font-weight: 700 !important;
  letter-spacing: .08em; text-transform: uppercase;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-all:hover { background: #4A5F9E !important; color: var(--hp-giay) !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-pv-all:focus-visible { outline: 3px solid var(--hp-cham) !important; outline-offset: -3px; }

/* 3b. Khung trả lời đầy đủ */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-replies {
  background: var(--hp-nen) !important;
  border-top: var(--hp-vien) !important;
  border-radius: 0 0 10px 10px !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  background-image: none !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-replies[hidden] { display: none !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-list { gap: 12px !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply { gap: 10px !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-main {
  min-width: 0;
  padding: 10px 14px !important;
  background: var(--hp-giay) !important;
  border: var(--hp-vien) !important; border-radius: 10px !important;
  box-shadow: var(--hp-bong-nhan) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply .cm-body {
  font-family: var(--hp-chu) !important; font-size: 14.5px !important; line-height: 1.6 !important;
  color: var(--hp-muc) !important; overflow-wrap: anywhere;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-meta { align-items: center; gap: 10px !important; margin-top: 6px !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-meta button {
  min-height: 32px; padding: 0 10px !important; margin: -6px 0 -6px -4px;
  border: 0 !important; border-radius: 6px !important; background: none !important;
  color: #B8461A !important;
  font-family: var(--hp-nhan) !important; font-size: 11px !important; font-weight: 700 !important;
  letter-spacing: .06em; text-transform: uppercase;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-meta button:hover { background: rgba(230, 108, 44, .12) !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-replies .cm-note {
  font-family: var(--hp-chu) !important; font-size: 14px !important; color: var(--hp-phu) !important;
}

/* 3c. Ô viết trả lời + nút gửi kiểu ô mũi tên vàng */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form { align-items: end !important; gap: 10px !important; margin-top: 14px !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form textarea {
  min-height: 48px; padding: 11px 14px !important;
  background: var(--hp-giay) !important;
  border: var(--hp-vien) !important; border-radius: 10px !important;
  box-shadow: none !important;
  color: var(--hp-muc) !important;
  font-family: var(--hp-chu) !important; font-size: 16px !important; line-height: 1.5;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form textarea::placeholder { color: var(--hp-phu); opacity: 1; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form textarea:focus { outline: 3px solid var(--hp-cham) !important; outline-offset: 1px; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form .cm-btn {
  display: inline-flex !important; align-items: center; gap: 10px;
  min-height: 48px !important; padding: 0 6px 0 16px !important;
  border: var(--hp-vien) !important; border-radius: 10px !important;
  background: #4A5F9E !important; color: var(--hp-giay) !important;
  font-family: var(--hp-chu) !important; font-size: 14.5px !important; font-weight: 800 !important;
  box-shadow: var(--hp-bong-nut) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form .cm-btn::after {
  content: ""; flex: none; width: 34px; height: 34px;
  border: var(--hp-vien); border-radius: 6px;
  background: var(--hp-vang) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / 18px no-repeat;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form .cm-btn:hover { background: #3F5590 !important; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(24, 38, 65, .28) !important; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form .cm-btn:focus-visible { outline: 3px solid var(--hp-vang) !important; outline-offset: 2px; }
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form .cm-btn:disabled { opacity: .6; transform: none; }

/* ---------- 4. Trạng thái trống ---------- */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-empty {
  gap: 10px !important; padding: 34px 24px !important;
  background: var(--hp-giay) !important;
  border: 2px dashed #121212 !important; border-radius: 10px !important;
  box-shadow: none !important;
}
/* vạch vàng nhỏ thay linh vật (không chữ: khối này dùng cả cho báo lỗi mạng) */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-empty::before {
  content: ""; width: 44px; height: 10px;
  border: var(--hp-vien); border-radius: 6px;
  background: var(--hp-vang); box-shadow: var(--hp-bong-nhan);
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-empty img { display: none !important; } /* không linh vật */
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-empty p {
  max-width: 440px !important;
  font-family: var(--hp-chu) !important; font-size: 15.5px !important; font-weight: 700 !important; line-height: 1.6 !important;
  color: var(--hp-muc) !important;
}
html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-h-empty {
  padding: 12px 14px !important;
  background: var(--hp-nen) !important;
  border: 1.5px dashed rgba(18, 18, 18, .45) !important; border-radius: 6px !important;
  font-family: var(--hp-chu) !important; font-size: 13.5px !important; font-weight: 600 !important; line-height: 1.55;
  color: var(--hp-phu) !important; list-style: none;
}

/* ---------- Điện thoại ---------- */
@media (max-width: 600px) {
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login { align-items: end !important; padding: 0 !important; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box {
    width: 100% !important; max-height: 88dvh;
    border-radius: 10px 10px 0 0 !important; border-bottom: 0 !important;
    box-shadow: 0 -4px 0 rgba(24, 38, 65, .28) !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box h2 { font-size: 20px !important; margin: 8px 18px 0 !important; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box p,
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-login-box small { margin-left: 18px !important; margin-right: 18px !important; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) #cmLoginGo { align-self: stretch; justify-self: stretch; margin: 4px 18px 0 !important; justify-content: space-between; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-toast { max-width: calc(100% - 32px) !important; bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-reply-form .cm-btn { padding: 0 5px 0 12px !important; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-empty { padding: 28px 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-post.cm-flash { animation: none !important; }
  html:not([data-theme="dark"]) body.v3-community:not(#_h) #cmLoginGo,
  html:not([data-theme="dark"]) body.v3-community:not(#_h) .cm-toast { transition: none !important; }
}
