/* MIDU OS v3: trang trên máy. Màn /trang-web (thẻ từng trang) và khối "Trang trên máy" trong /cai-dat (Quản lý). */

/* ---- /trang-web */
.tw-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: stretch; }
.tw-the { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-width: 0; }
.tw-the-dau { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.tw-the-ic { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.tw-the-ten { min-width: 0; flex: 1; }
.tw-ten { margin: 0; font-size: var(--fs-lg); line-height: 1.3; overflow-wrap: anywhere; }
.tw-mo-ta { margin: 4px 0 0; font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere; }
.tw-the-tt { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.tw-may { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tw-goi-y { line-height: 1.45; }
.tw-the-chan { margin-top: auto; display: flex; }
.tw-mo { justify-content: center; }

/* ---- /cai-dat > Trang trên máy */
.tw-cd-luoi { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.tw-khoi { min-width: 0; }
.tw-khoi .section-title { flex-wrap: wrap; gap: 6px 10px; }
.tw-cd { display: flex; flex-direction: column; gap: 16px; }
.tw-cd-hang { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tw-cd-khoi { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--hair); }
.tw-cd-nhan { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tw-cd-nhan b { font-weight: 600; font-size: var(--fs-md); }
.tw-cd-nhap { display: flex; align-items: center; gap: 8px; }
.tw-cd-nhap .input { flex: 1; min-width: 0; letter-spacing: .08em; }
.tw-chon-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tw-chon { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px; border: 1px solid var(--hair-2); border-radius: var(--r); background: var(--card); cursor: pointer; min-width: 0; }
.tw-chon:hover { background: var(--panel-solid); }
.tw-chon input { flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.tw-chon-ten { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); }

@media (max-width: 640px) {
  .tw-luoi { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tw-mo { min-height: 44px; width: 100%; }
  .tw-cd-luoi { grid-template-columns: minmax(0, 1fr); }
  .tw-cd-nhap { flex-wrap: wrap; }
  .tw-cd-nhap .input { flex: 1 1 100%; min-height: 44px; font-size: var(--fs-lg); }
  .tw-cd-nhap .btn { flex: 1; justify-content: center; min-height: 44px; }
  .tw-chon-luoi { grid-template-columns: minmax(0, 1fr); }
  .tw-chon { min-height: 44px; }
  .tw-cd-hang .switch { flex: none; }
}
