/* v304 TRANG CHỦ 3D (#205) — lớp phủ cả màn hình trên trang chủ thường (views/partials/trang-chu-3d.ejs).
   Màu SÁNG sang trọng như Quản trị (ông chủ 15/10: "sáng lên em, như phía quản trị ấy, đừng dùng màu đen"): kính trắng, chữ navy, nhấn vàng đồng.
   Ẩn sẵn — chỉ hiện khi public/js/tc3d-mo.js đặt html.tc3d-mo (máy đủ khoẻ). Nút nổi Zalo / Gọi / Chat (z 59–61) nằm TRÊN lớp này nhưng ẩn
   trong cảnh, chỉ hiện khi khách chọn "Mở chat" / "Gọi miễn phí" (html.tc3d-hien-chat / .tc3d-hien-goi). */
.tc3, .tc3-vao { display: none }
html.tc3d-mo, html.tc3d-mo body { overflow: hidden }
html.tc3d-mo .tc3 {
  display: block; position: fixed; inset: 0; z-index: 50; background: #E9EFF4; color: #12395F;
  --kinh: rgba(255, 255, 255, .93); --kinh-vien: #DCE3EA; --mo: #5E6B78; --vang: #C8922F; --navy: #12395F;
}
html.tc3d-mo .nn { display: none }
html.tc3d-mo:not(.tc3d-hien-chat) .cw { display: none }
html.tc3d-mo:not(.tc3d-hien-goi) .gw { display: none }
html.tc3d-co:not(.tc3d-mo) .tc3-vao {
  display: inline-flex; align-items: center; gap: 6px; position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 58;
  border: 1px solid #DCE3EA; background: rgba(255, 255, 255, .96); color: #12395F; border-radius: 999px; padding: 9px 16px;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 6px 20px rgba(18, 57, 95, .16)
}
.tc3-vao span { color: #C8922F }
.tc3-vao:hover { border-color: #C8922F }

.tc3-canh { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline: none }
.tc3-canh.tro { cursor: pointer }
.tc3 button, .tc3 a { font: inherit }
.tc3 :focus-visible { outline: 2px solid var(--vang); outline-offset: 2px }

.tc3-dau { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none }
.tc3-dau > * { pointer-events: auto }
.tc3-cho {
  background: var(--kinh); border: 1px solid var(--kinh-vien); border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600;
  color: var(--navy); box-shadow: 0 1px 2px rgba(18, 57, 95, .08); max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis
}
.tc3-dh { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end }
.tc3-dh[hidden] { display: none }
.tc3-nut {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--kinh-vien); background: var(--kinh); color: var(--navy);
  border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; line-height: 1.2; text-decoration: none;
  box-shadow: 0 1px 2px rgba(18, 57, 95, .08)
}
.tc3-nut:hover { border-color: var(--vang); color: var(--navy) }
.tc3-nut.chinh { background: var(--navy); color: #FFFFFF; border-color: var(--navy) }
.tc3-nut.chinh:hover { background: #0C2740; color: #FFFFFF }
.tc3-nut.mau { --m: #C8922F; box-shadow: inset 3px 0 0 var(--m), 0 1px 2px rgba(18, 57, 95, .08) }

.tc3-loi {
  position: absolute; left: 16px; bottom: 16px; width: min(560px, calc(100% - 32px)); background: var(--kinh); border: 1px solid var(--kinh-vien);
  border-radius: 16px; padding: 14px 16px; backdrop-filter: blur(8px); box-shadow: 0 12px 32px rgba(18, 57, 95, .16)
}
.tc3-ai { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #A87420 }
.tc3-noi { margin: 6px 0 10px; font-size: 15.5px; line-height: 1.55; color: #1B2A3A }
.tc3-chon { display: flex; flex-wrap: wrap; gap: 6px }

.tc3-ds {
  position: absolute; right: 16px; top: 64px; bottom: 16px; width: min(400px, calc(100% - 32px)); overflow: auto; background: var(--kinh);
  border: 1px solid var(--kinh-vien); border-radius: 16px; padding: 16px; backdrop-filter: blur(8px); box-shadow: 0 12px 32px rgba(18, 57, 95, .18)
}
.tc3-ds h2 { font-size: 17px; margin: 0 28px 12px 0; color: var(--navy) }
.tc3-dong { position: absolute; top: 8px; right: 10px; background: none; border: 0; color: var(--mo); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 6px }
.tc3-mang { border-top: 1px solid var(--kinh-vien); padding: 12px 0 }
.tc3-mang:first-child { border-top: 0; padding-top: 0 }
.tc3-mang-ten { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; color: var(--navy) }
.tc3-mang-ten::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--m, #C8922F); flex: none }
.tc3-mang-kh { color: var(--mo); font-size: 13px; margin: 2px 0 8px 18px }
.tc3-mang-ds { display: grid; gap: 6px; margin-left: 18px }
.tc3-dv {
  text-align: left; border: 1px solid var(--kinh-vien); background: #FFFFFF; color: var(--navy); border-radius: 10px; padding: 9px 12px;
  font-size: 14px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: center
}
.tc3-dv:hover { border-color: var(--m, #C8922F); box-shadow: inset 3px 0 0 var(--m, #C8922F) }
.tc3-dv small { font-weight: 500; color: var(--mo); font-size: 11.5px; white-space: nowrap }

.tc3-che {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; text-align: center; padding: 24px;
  background: linear-gradient(180deg, #F7F9FB 0%, #E9EFF4 100%); transition: opacity .45s ease
}
.tc3-che-ten { font-size: clamp(1.2rem, 3.4vw, 1.9rem); font-weight: 800; letter-spacing: .02em; color: var(--navy); max-width: 22ch; text-wrap: balance }
.tc3-che-vach { width: 120px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--vang), transparent); background-size: 200% 100%; animation: tc3-chay 1.2s linear infinite }
.tc3-che.xong { opacity: 0; pointer-events: none }
@keyframes tc3-chay { from { background-position: 100% 0 } to { background-position: -100% 0 } }

@media (max-width: 720px) {
  .tc3-dau { top: 10px; left: 10px; right: 10px }
  .tc3-cho { display: none }
  .tc3-dh { justify-content: flex-start }
  .tc3-nut { padding: 7px 11px; font-size: 13px }
  .tc3-loi { left: 10px; right: 10px; bottom: 10px; width: auto; padding: 12px 14px; max-height: 52vh; overflow: auto }
  .tc3-noi { font-size: 14.5px }
  .tc3-ds { left: 10px; right: 10px; top: auto; bottom: 10px; width: auto; max-height: 72vh }
  .tc3-ds:not([hidden]) ~ .tc3-loi { display: none }
}
@media (prefers-reduced-motion: reduce) { .tc3-che, .tc3-che-vach { transition: none; animation: none } }
