/* giao_dien_may_gap.css — J22 PR-1: giao dien man gap, CHI KHI co flag giao_dien_may_gap (body.giao-dien-may-gap).
 *
 * Nap SAU man_gap.css (khong sua man_gap.css). Co TAT = khong co class tren <body> => file nay khong luat nao ap.
 * Moi luat doi giao dien nam trong "body.giao-dien-may-gap" va media 431–1100 px (khong dung <=430 va >=1101),
 * tru khoi prefers-reduced-motion cuoi file. Khong do ten may; chi theo be rong / chieu cao / safe-area.
 * Viewport that cua may gap (anh Linh 21/11): ~1024x700 ngang, 700x1024 doc. Bien --sai-t/r/b/l, --mg-nav khai o man_gap.css.
 * Luat cuon drawer (2a) KHONG o day: xem drawer_cuon.css. Muc 2b (bo cuc drawer) o cuoi, trong flag.
 */

/* ===== 1. CHROME THAP: nho thanh, thanh tren mong (431–1100, cao <= 750) ===== */
@media (min-width: 431px) and (max-width: 1100px) {
  body.giao-dien-may-gap .uvx-app .uvx-topbar { min-height: 44px; padding-top: max(4px, var(--sai-t)); }
  /* nut noi: ben phai + tru safe-area; bottom tinh ca thanh duoi (--mg-nav) + safe-area day */
  body.giao-dien-may-gap #ht-fab { right: calc(18px + var(--sai-r)) !important; bottom: calc(var(--mg-nav) + 18px + var(--sai-b)) !important; }
  body.giao-dien-may-gap #ht-tb { right: calc(18px + var(--sai-r)) !important; bottom: calc(var(--mg-nav) + 76px + var(--sai-b)) !important; }
}
@media (min-width: 431px) and (max-width: 1100px) and (max-height: 750px) {
  body.giao-dien-may-gap { --mg-nav: 44px; --uvx-bn-h: 44px; }
  body.giao-dien-may-gap .uvx-app .uvx-topbar { min-height: 40px; padding-top: max(2px, var(--sai-t)); }
  body.giao-dien-may-gap .uvx-app .uvx-bottomnav { padding-top: 2px; }
  body.giao-dien-may-gap .uvx-app .uvx-bottomnav a { font-size: 9px; }
  body.giao-dien-may-gap .uvx-app .uvx-content { padding-top: 8px; }
}
/* ngang rong + thap (1024x700): bo thanh duoi, giu hamburger + topbar mot hang; Tro ly/chuong chi o thanh tren */
@media (min-width: 840px) and (max-width: 1100px) and (max-height: 750px) {
  body.giao-dien-may-gap { --mg-nav: 0px; --uvx-bn-h: 0px; }
  body.giao-dien-may-gap .uvx-app .uvx-bottomnav { display: none !important; }
  body.giao-dien-may-gap .uvx-app .uvx-content { scroll-padding-bottom: var(--sai-b); }
  body.giao-dien-may-gap .uvx-toast { bottom: calc(16px + var(--sai-b)); }
  /* mobile_ios.js dua #ht-fab vao .uvx-tb-right khi co class: tro ve dong chay trong thanh */
  body.giao-dien-may-gap .uvx-tb-right #ht-fab { position: static !important; right: auto !important; bottom: auto !important;
    flex-direction: row; align-items: center; gap: 0; }
  body.giao-dien-may-gap .uvx-tb-right #ht-chuong { display: none !important; }
}

/* ===== 2. TRANG CHU + THONG BAO: bo cuc 2 cot, bo mang phai, rut dong ===== */
@media (min-width: 431px) and (max-width: 1100px) {
  body.giao-dien-may-gap .tc, body.giao-dien-may-gap .tc.tc-vai, body.giao-dien-may-gap .tb-wrap { max-width: none; }
  /* safe-area da do .uvx-content ben ngoai giu (man_gap.css) — khong cong them o day, tranh mang phai kep */
  body.giao-dien-may-gap .tb-wrap { padding-left: 0; padding-right: 0; }
  body.giao-dien-may-gap .tl-hang, body.giao-dien-may-gap .tc .tc-o4, body.giao-dien-may-gap .tc.tc-vai .tc-o4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body.giao-dien-may-gap .tl-the { min-height: 100px; padding: 12px 14px; }
  body.giao-dien-may-gap .tl-the .s { font-size: 30px; overflow-wrap: anywhere; }
  body.giao-dien-may-gap .tl-the .n, body.giao-dien-may-gap .tl-the .p { overflow-wrap: anywhere; }
  body.giao-dien-may-gap .ctm-neo .so { font-size: 40px; overflow-wrap: anywhere; }
  body.giao-dien-may-gap .ctm-neo .gt, body.giao-dien-may-gap .ctm-neo .dl { overflow-wrap: anywhere; }
  body.giao-dien-may-gap #ban-tin-sang, body.giao-dien-may-gap .ctm-tin { overflow-wrap: anywhere; }
  /* clamp phần chữ, không clamp cả khung (tránh chữ tràn dưới vì <span class=n> + text) */
  body.giao-dien-may-gap #ban-tin-sang .ctm-tin-nd, body.giao-dien-may-gap .ctm-tin .ctm-tin-nd {
    overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical;
    -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
  body.giao-dien-may-gap #ban-tin-sang .ctm-tin-them { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 700;
    color: var(--navy, #1C2B4A); cursor: pointer; }
  body.giao-dien-may-gap #ban-tin-sang .ctm-tin-them::after { content: "xem thêm"; }
  body.giao-dien-may-gap #ban-tin-sang .ctm-tin-check:checked ~ .ctm-tin-nd {
    -webkit-line-clamp: unset; line-clamp: unset; display: block; overflow: visible; }
  body.giao-dien-may-gap #ban-tin-sang .ctm-tin-check:checked ~ .ctm-tin-them::after { content: "thu gọn"; }
  /* thong bao */
  body.giao-dien-may-gap .tb-item .body { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  body.giao-dien-may-gap .tb-item .meta .badge { max-width: 100%; overflow-wrap: anywhere; }
  body.giao-dien-may-gap .tb-tabs { flex-wrap: wrap; }
}

/* ===== 3. DRAWER (muc 2b): Dang xuat / giao dien / Tim tinh nang vao CUOI vung cuon, khong co dinh chiem nua man ===== */
@media (min-width: 431px) and (max-width: 1100px) {
  html body.giao-dien-may-gap .uvx-sidebar.is-open.is-open .uvx-nav { flex: 0 0 auto !important; min-height: 0 !important; overflow: visible !important; }
  html body.giao-dien-may-gap .uvx-sidebar.is-open.is-open .uvx-theme-sw,
  html body.giao-dien-may-gap .uvx-sidebar.is-open.is-open .uvx-feature-search { position: static !important; }
}

/* ===== 4. GIAM CHUYEN DONG (khong nam trong media rong) ===== */
@media (prefers-reduced-motion: reduce) {
  body.giao-dien-may-gap .uvx-topbar, body.giao-dien-may-gap .uvx-content, body.giao-dien-may-gap .uvx-sidebar { transition: none !important; animation: none !important; }
}
