/* Xưởng dựng video - giao diện giấy ấm, chữ to, đọc lời văn cho dễ.
   Chủ dự án đọc lời dẫn dài bằng tiếng Việt nên nền sáng dễ đọc hơn nền tối. */

:root {
  --giay:        #f7f4ee;
  --giay-2:      #fffdf9;
  --vien:        #e3ddd1;
  --vien-dam:    #cfc7b6;
  --muc:         #23201a;
  --muc-nhat:    #6f685c;
  --muc-mo:      #9a9284;
  --che:         #2f6b4f;
  --che-sang:    #3f8c67;
  --che-mo:      #e8f1ec;
  --dat:         #a8642a;
  --dat-mo:      #f6ece1;
  --do:          #b23b30;
  --bong:        0 1px 2px rgba(35,32,26,.05), 0 8px 24px rgba(35,32,26,.06);
  --bong-sau:    0 2px 6px rgba(35,32,26,.08), 0 18px 48px rgba(35,32,26,.10);
  --tron:        14px;
  --tron-nho:    9px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--giay);
  color: var(--muc);
  font: 15px/1.6 "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 25px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0; }
h3 { font-size: 14px; margin: 0 0 8px; text-transform: uppercase;
     letter-spacing: .07em; color: var(--muc-nhat); }
p  { margin: 0 0 14px; }
em { color: var(--muc-nhat); font-style: italic; }

.dan { color: var(--muc-nhat); font-size: 14px; max-width: 62ch; }
.mo-nhat { color: var(--muc-mo); }

/* ------------------------------------------------------------- thanh trên */
.thanh-tren {
  position: sticky; top: 0; z-index: 40;
  /* Ba cột đều nhau để dải tab nằm ĐÚNG giữa màn hình, không bị tên hiệu
     bên trái đẩy lệch. Cột phải để trống làm đối trọng. */
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 20px; padding: 12px 26px;
  background: rgba(247,244,238,.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--vien);
}
.hieu { display: flex; align-items: center; gap: 11px; }
.hieu .dau {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--che-mo); border-radius: 11px; font-size: 19px;
}
.hieu strong { display: block; font-size: 15px; line-height: 1.25; }
.hieu small { color: var(--muc-mo); font-size: 12px; }

.nguoi-dung-hien-tai {
  justify-self: end; display: flex; align-items: center; gap: 10px;
}
.nguoi-dung-hien-tai #ten-nguoi-dung { font-size: 13px; color: var(--muc-nhat); }

.tab-chinh { display: flex; gap: 4px; justify-self: center; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 8px 15px; border-radius: 999px;
  font: inherit; font-size: 14px; color: var(--muc-nhat);
  transition: background .15s, color .15s;
}
.tab:hover { background: #ece7dd; color: var(--muc); }
.tab.dang-mo { background: var(--che); color: #fff; }

/* ------------------------------------------------------------------- màn */
.man { display: none; }
.man.dang-mo { display: block; }

#man-kho, #man-xong, #man-tai-khoan { max-width: 1180px; margin: 0 auto; padding: 34px 26px 70px; }
.gioi-thieu { margin-bottom: 26px; }
.gioi-thieu p { color: var(--muc-nhat); max-width: 60ch; }

/* -------------------------------------------------------------- kho nạp */
.luoi-nap {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
}
.the-nap {
  background: var(--giay-2); border: 1px solid var(--vien);
  border-radius: var(--tron); padding: 20px; box-shadow: var(--bong);
  display: flex; flex-direction: column; gap: 14px;
}
.dau-the { display: flex; gap: 12px; align-items: flex-start; }
.dau-the .bieu-tuong {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  background: var(--dat-mo); border-radius: 11px; font-size: 19px;
}
.dau-the p { margin: 2px 0 0; font-size: 13px; color: var(--muc-mo); }

.vung-tha {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 26px 14px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--vien-dam); border-radius: var(--tron-nho);
  background: #fbf9f5; transition: border-color .15s, background .15s;
}
.vung-tha:hover, .vung-tha.ke-tha { border-color: var(--che); background: var(--che-mo); }
.tha-chinh { font-size: 14px; font-weight: 600; color: var(--muc); }
.tha-phu { font-size: 12px; color: var(--muc-mo); }

/* Nút đếm: nhìn phát biết ô này đang có bao nhiêu dữ liệu, bấm thì mở danh sách */
.nut-dem {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; font: inherit; cursor: pointer; text-align: left;
  padding: 11px 14px; border-radius: var(--tron-nho);
  border: 1px solid var(--vien); background: #f2eee6; color: var(--muc);
  transition: background .15s, border-color .15s;
}
.nut-dem:hover { background: #ece7dd; border-color: var(--vien-dam); }
.nut-dem .dem-so { font-size: 13.5px; font-weight: 600; }
.nut-dem .dem-mo { font-size: 12.5px; color: var(--muc-mo); flex: none; }
.nut-dem.trong { background: transparent; }
.nut-dem.trong .dem-so { font-weight: 500; color: var(--muc-mo); }
.nut-dem.trong .dem-mo { display: none; }
.nut-dem[aria-expanded="true"] {
  background: var(--che-mo); border-color: var(--che); color: var(--che);
}
.nut-dem[aria-expanded="true"] .dem-mo { color: var(--che); }

.ds-file {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 6px;
  /* Ô lưới mặc định rộng bằng nội dung dài nhất, nên tên file dài làm cả hàng
     lòi ra ngoài thẻ. minmax(0,1fr) ép nó không được rộng quá khung. */
  grid-template-columns: minmax(0, 1fr);
}
/* display:grid ở trên đè mất thuộc tính hidden của HTML, phải nói rõ lại */
.ds-file[hidden] { display: none; }
.ds-file .so-chu-file {
  font-size: 11.5px; color: var(--che); background: var(--che-mo);
  padding: 2px 7px; border-radius: 999px; flex: none;
}
.ds-file li {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  padding: 8px 11px; background: #f2eee6; border-radius: 8px; font-size: 13px;
}
.ds-file .ten-file { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-file .co-file { color: var(--muc-mo); font-size: 12px; font-variant-numeric: tabular-nums; }
.ds-file .xoa {
  border: 0; background: transparent; cursor: pointer; color: var(--muc-mo);
  font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 5px;
}
.ds-file .xoa:hover { background: #e7ded2; color: var(--do); }

/* Nạp file lên thôi thì máy tìm cảnh chưa thấy - phải cho AI đọc đã */
.khu-doc {
  padding: 13px 15px; border-radius: var(--tron-nho);
  background: #fdf3e6; border: 1px solid #f0dcc0;
  display: grid; gap: 10px; justify-items: start;
}
.khu-doc[hidden] { display: none; }
.loi-doc { margin: 0; font-size: 13px; line-height: 1.6; color: #7a5320; }
.loi-doc strong { color: #5f3f16; }
.chay-doc { width: 100%; }
.chay-doc[hidden] { display: none; }
.thanh-chay.nho { height: 6px; margin: 2px 0 7px; }
.chay-doc .hang-chay { font-size: 12px; color: #7a5320; }
.ds-file .dau-doc {
  font-size: 11px; padding: 2px 7px; border-radius: 999px; flex: none;
}
.ds-file .dau-doc.roi { background: var(--che-mo); color: var(--che); }
.ds-file .dau-doc.chua { background: #f6e6cf; color: #8a5a1c; }

.go-tay summary { cursor: pointer; font-size: 13px; color: var(--che); }
.go-tay textarea { margin-top: 10px; }

/* ------------------------------------------------------- kho quay công ty */
.khu-kho { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--vien); }
.dau-khu {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 16px;
}
.dau-khu p { margin: 4px 0 0; }

.luoi-so {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}
.o-so {
  background: var(--giay-2); border: 1px solid var(--vien);
  border-radius: var(--tron); padding: 16px 18px; display: grid; gap: 2px;
}
.o-so b {
  font-size: 27px; font-weight: 700; letter-spacing: -.02em;
  color: var(--che); font-variant-numeric: tabular-nums; line-height: 1.15;
}
.o-so span { font-size: 12.5px; color: var(--muc-mo); }

.canh-quet {
  margin-top: 14px; padding: 14px 17px; border-radius: var(--tron-nho);
  background: #fdf3e6; border: 1px solid #f0dcc0;
  font-size: 13.5px; line-height: 1.65; color: #7a5320;
}
.canh-quet strong { color: #5f3f16; }
.canh-quet[hidden] { display: none; }

.ds-thu-muc {
  list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 5px;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  max-height: 330px; overflow-y: auto;
}
.ds-thu-muc[hidden] { display: none; }
.ds-thu-muc li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: #f2eee6; border-radius: 8px; font-size: 13px;
}
.ds-thu-muc .ten-tm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-thu-muc .so-tm { color: var(--muc-mo); flex: none; font-variant-numeric: tabular-nums; }

/* dải thể loại nhạc: chỉ để đọc, không bấm được nên đừng làm giống nút */
.chip-tinh { margin-top: 12px; flex-wrap: wrap; }
.chip-tinh .chip-doc {
  font-size: 12.5px; padding: 6px 13px; border-radius: 999px;
  background: var(--che-mo); color: var(--che); border: 1px solid #d5e5db;
}
.chip-tinh .chip-doc b { font-weight: 700; }
.chip-tinh .ghi-chip {
  font-size: 12px; color: var(--muc-mo); align-self: center; padding-left: 4px;
}

/* ---------------------------------------------------------- dựng: bố cục */
#man-dung { display: none; }
#man-dung.dang-mo {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  max-width: 1180px; margin: 0 auto; padding: 34px 26px 70px; gap: 40px;
  align-items: start;
}
.cot-buoc { position: sticky; top: 84px; }
.ds-buoc { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ds-buoc li {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px; font-size: 14px;
  color: var(--muc-mo); cursor: pointer; transition: background .15s, color .15s;
}
.ds-buoc li:hover { background: #ece7dd; }
.ds-buoc .so {
  width: 23px; height: 23px; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--vien-dam); border-radius: 50%;
  font-size: 12px; font-weight: 700;
}
.ds-buoc li.xong { color: var(--muc-nhat); }
.ds-buoc li.xong .so {
  background: var(--che); border-color: var(--che); color: #fff; font-size: 0;
}
.ds-buoc li.xong .so::after { content: "✓"; font-size: 12px; }
.ds-buoc li.dang-mo { background: var(--che-mo); color: var(--che); font-weight: 600; }
.ds-buoc li.dang-mo .so { border-color: var(--che); color: var(--che); }

.cot-noi-dung { min-width: 0; }
.buoc { display: none; animation: hien .22s ease; }
.buoc.dang-mo { display: block; }
@keyframes hien { from { opacity: 0; transform: translateY(6px); } }

/* --------------------------------------------------------------- nhập ô */
/* Thiếu password/email/number ở đây là lý do ô mật khẩu từng bị trơ ra như
   input mặc định của trình duyệt, lệch hẳn phong cách các ô còn lại. */
textarea, input[type=text], input[type=search], input[type=password],
input[type=email], input[type=number], select {
  width: 100%; font: inherit; color: var(--muc);
  background: var(--giay-2); border: 1px solid var(--vien-dam);
  border-radius: var(--tron-nho); padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.7; }
textarea:focus, input:focus, select:focus {
  outline: 0; border-color: var(--che);
  box-shadow: 0 0 0 3px rgba(47,107,79,.13);
}
select { cursor: pointer; }

.hang-chon { display: flex; gap: 16px; margin: 16px 0 0; flex-wrap: wrap; }
.hang-chon label { font-size: 13px; color: var(--muc-nhat); display: grid; gap: 5px; }
.hang-chon select { min-width: 150px; }
/* ======================================================= QUẢN LÝ TÀI KHOẢN */
.trang-tk-dau {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.tieu-de-tk-boc {
  max-width: 580px;
}
.the-tag-admin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dat);
  background: var(--dat-mo);
  border: 1px solid rgba(168,100,42,.22);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hang-thong-ke-tk {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.o-thong-ke-tk {
  background: var(--giay-2);
  border: 1px solid var(--vien);
  border-radius: var(--tron);
  padding: 12px 18px;
  min-width: 115px;
  box-shadow: var(--bong);
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.o-thong-ke-tk:hover {
  transform: translateY(-2px);
  border-color: var(--vien-dam);
  box-shadow: 0 4px 14px rgba(35,32,26,.08);
}
.o-thong-ke-tk .so-tk {
  font-size: 22px;
  font-weight: 700;
  color: var(--muc);
  line-height: 1.2;
}
.o-thong-ke-tk .nhan-tk {
  font-size: 12px;
  color: var(--muc-mo);
  font-weight: 500;
}

/* Khung 2 cột */
.bo-cuc-tai-khoan {
  display: grid;
  grid-template-columns: minmax(360px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .bo-cuc-tai-khoan {
    grid-template-columns: 1fr;
  }
}

.the-quan-ly {
  background: var(--giay-2);
  border: 1px solid var(--vien);
  border-radius: var(--tron);
  padding: 24px;
  box-shadow: var(--bong);
}
.the-quan-ly.the-tao-tk {
  position: sticky;
  top: 86px;
}
.dau-the-ql {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--vien);
}
.dau-the-ql.giua-hang {
  justify-content: space-between;
}
.dau-the-ql .tieu-de-ds {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bieu-tuong-ql {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: var(--che-mo);
  color: var(--che);
  border: 1px solid rgba(47,107,79,.15);
}
.dau-the-ql h2 {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--muc);
  margin: 0;
}
.mo-ta-the {
  font-size: 12.5px;
  color: var(--muc-mo);
  margin: 2px 0 0;
}

/* Form tạo tài khoản */
.bieu-mau-tk {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.nhom-nhap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nhom-nhap label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muc);
  display: flex;
  align-items: center;
  gap: 4px;
}
.nhom-nhap .dau-sao {
  color: var(--do);
  font-weight: 700;
}
.nhom-nhap .chu-thich-nhap {
  font-size: 11.5px;
  color: var(--muc-mo);
  line-height: 1.45;
}
.o-mat-khau-tk {
  position: relative;
}
.o-mat-khau-tk input {
  padding-right: 44px;
}
.nut-xem-mk-tk {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muc-mo);
  transition: color .15s, background .15s;
}
.nut-xem-mk-tk:hover {
  color: var(--che);
  background: var(--che-mo);
}

/* Thẻ chọn quyền Admin */
.the-chon-quyen {
  background: #fbf9f5;
  border: 1.5px solid var(--vien);
  border-radius: var(--tron-nho);
  padding: 13px 15px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.the-chon-quyen:hover {
  border-color: var(--vien-dam);
}
.the-chon-quyen.kich-hoat {
  background: var(--dat-mo);
  border-color: rgba(168,100,42,.45);
  box-shadow: 0 2px 8px rgba(168,100,42,.08);
}
.nhan-chon-quyen {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  margin: 0;
}
.nhan-chon-quyen input[type=checkbox] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--dat);
  flex: none;
}
.noi-dung-quyen {
  flex: 1;
}
.hang-ten-quyen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.hang-ten-quyen strong {
  font-size: 13.5px;
  color: var(--muc);
}
.huy-hieu-admin-mini {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--dat);
  color: #fff;
}
.noi-dung-quyen p {
  font-size: 12px;
  color: var(--muc-nhat);
  margin: 0;
  line-height: 1.45;
}

/* Nút tạo tài khoản */
.nut-gui-tk {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 14.5px;
  margin-top: 4px;
  box-shadow: 0 2px 6px rgba(47,107,79,.2);
}
.nut-gui-tk:hover {
  box-shadow: 0 4px 12px rgba(47,107,79,.3);
}

/* Khung thông báo */
.khung-bao-tk {
  padding: 12px 14px;
  border-radius: var(--tron-nho);
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  animation: hien-thong-bao .25s ease both;
}
@keyframes hien-thong-bao {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.khung-bao-tk.ok {
  background: var(--che-mo);
  border: 1px solid rgba(47,107,79,.3);
  color: var(--che);
}
.khung-bao-tk.loi {
  background: #fdf2f1;
  border: 1px solid rgba(178,59,48,.3);
  color: var(--do);
}

/* Cột phải: Tìm kiếm & Danh sách thành viên */
.huy-hieu-dem {
  font-size: 12px;
  font-weight: 600;
  color: var(--che);
  background: var(--che-mo);
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid rgba(47,107,79,.15);
}
.thanh-tim-tk {
  position: relative;
  margin-bottom: 16px;
}
.thanh-tim-tk .icon-tim-tk {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muc-mo);
  pointer-events: none;
}
.thanh-tim-tk input {
  padding-left: 38px;
  background: #fbf9f5;
  border-color: var(--vien);
}
.thanh-tim-tk input:focus {
  background: #fff;
}

.danh-sach-thanh-vien {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 640px;
  overflow-y: auto;
  padding-right: 2px;
}
.dang-tai-ds {
  text-align: center;
  padding: 24px;
  font-size: 13.5px;
}

/* Thẻ từng thành viên */
.the-thanh-vien {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fbf9f5;
  border: 1px solid var(--vien);
  border-radius: var(--tron-nho);
  padding: 13px 16px;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.the-thanh-vien:hover {
  background: #fff;
  border-color: var(--vien-dam);
  box-shadow: 0 4px 14px rgba(35,32,26,.06);
  transform: translateY(-1px);
}
.avatar-thanh-vien {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--che);
  background: linear-gradient(135deg, var(--che-mo), #d4ebd9);
  border: 1.5px solid rgba(47,107,79,.2);
  text-transform: uppercase;
}
.avatar-thanh-vien.admin-avt {
  color: var(--dat);
  background: linear-gradient(135deg, var(--dat-mo), #eedbc6);
  border-color: rgba(168,100,42,.3);
}
.thong-tin-thanh-vien {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hang-ten-tv {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.hang-ten-tv .ten-chinh {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muc);
}
.hang-ten-tv .ten-dn-tag {
  font-size: 12px;
  font-family: ui-monospace, monospace;
  color: var(--muc-mo);
  background: rgba(35,32,26,.05);
  padding: 1px 6px;
  border-radius: 4px;
}
.hang-chi-tiet-tv {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muc-nhat);
  flex-wrap: wrap;
}
.hang-chi-tiet-tv .muc-email {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hang-chi-tiet-tv .muc-email.trong {
  color: var(--muc-mo);
  font-style: italic;
}
.hang-chi-tiet-tv .muc-ngay {
  color: var(--muc-mo);
  font-size: 11.5px;
}
.huy-hieu-vai-tro {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.huy-hieu-vai-tro.admin {
  color: var(--dat);
  background: var(--dat-mo);
  border: 1px solid rgba(168,100,42,.25);
}
.huy-hieu-vai-tro.nhan-vien {
  color: var(--muc-nhat);
  background: rgba(35,32,26,.06);
  border: 1px solid rgba(35,32,26,.08);
}
.the-thanh-vien-rong {
  text-align: center;
  padding: 40px 20px;
  color: var(--muc-mo);
  font-size: 13.5px;
}
.the-thanh-vien-rong .icon-rong {
  font-size: 32px;
  margin-bottom: 8px;
  display: block;
  opacity: .7;
}

/* ----------------------------------------------------------------- nút */
.hang-nut { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; align-items: center; }
.nut {
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
}
.nut:active { transform: translateY(1px); }
.nut.chinh { background: var(--che); color: #fff; }
.nut.chinh:hover { background: var(--che-sang); }
.nut.phu { background: transparent; border-color: var(--vien-dam); color: var(--muc-nhat); }
.nut.phu:hover { background: #ece7dd; color: var(--muc); }
.nut.to { padding: 14px 30px; font-size: 15px; }
.nut.nho { padding: 7px 14px; font-size: 13px; }
.nut[disabled] { opacity: .45; cursor: not-allowed; }
.nut.lui { margin-right: auto; }
a.nut { text-decoration: none; display: inline-block; }

/* ------------------------------------------------------------- thẻ chọn */
.luoi-chon { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 6px; }
.luoi-chon.hai { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.the-chon {
  text-align: left; cursor: pointer; font: inherit;
  background: var(--giay-2); border: 1.5px solid var(--vien);
  border-radius: var(--tron); padding: 17px; display: grid; gap: 3px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.the-chon:hover { border-color: var(--vien-dam); box-shadow: var(--bong); }
.the-chon.dang-chon { border-color: var(--che); background: var(--che-mo); }
.the-chon .bieu-tuong { font-size: 21px; }
.the-chon strong { font-size: 15px; }
.the-chon small { color: var(--muc-mo); font-size: 12.5px; line-height: 1.5; }

.luoi-the { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

/* ----------------------------------------------------------- hộp AI nghĩ */
.hop-ai {
  background: var(--dat-mo); border: 1px solid #ecdcc9;
  border-radius: var(--tron); padding: 18px 20px; margin-bottom: 20px;
}
.nhan-ai {
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--dat); margin-bottom: 7px;
}
.hop-ai p { font-size: 14px; color: #6a4a2c; }
.ds-canh { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.ds-canh li { font-size: 13.5px; color: #6a4a2c; }

/* ------------------------------------------------------------- lời văn */
.o-van-boc { position: relative; margin-top: 18px; }
#o-loi-van { font-size: 16px; line-height: 1.85; padding: 18px 19px 40px; }
.thuoc-van {
  display: flex; gap: 14px; align-items: center;
  font-size: 12.5px; color: var(--muc-mo); font-variant-numeric: tabular-nums;
}
.o-van-boc .thuoc-van { position: absolute; right: 15px; bottom: 12px; }
.hop-gop-y { display: flex; gap: 9px; margin-top: 12px; }
.hop-gop-y input { flex: 1; }

/* ------------------------------------------------------------ giọng đọc */
.ds-giong { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); margin-top: 18px; }
.the-giong {
  display: flex; align-items: center; gap: 13px; cursor: pointer;
  background: var(--giay-2); border: 1.5px solid var(--vien);
  border-radius: var(--tron); padding: 14px 16px; text-align: left; font: inherit;
  transition: border-color .15s, background .15s;
}
.the-giong.dang-chon { border-color: var(--che); background: var(--che-mo); }
.the-giong .nghe {
  width: 38px; height: 38px; flex: none; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--vien-dam); background: var(--giay);
  display: grid; place-items: center; font-size: 13px; color: var(--che);
  transition: background .15s, border-color .15s;
}
.the-giong .nghe:hover { background: var(--che); border-color: var(--che); color: #fff; }
.the-giong .nghe.dang-tai { animation: nhap 1s infinite; }
@keyframes nhap { 50% { opacity: .35; } }
.the-giong .ten-giong { font-weight: 600; font-size: 14.5px; }
.the-giong .ta-giong { font-size: 12.5px; color: var(--muc-mo); line-height: 1.5; }
.nhan-gioi {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #efe9df; color: var(--muc-nhat); margin-left: 7px;
}

/* ------------------------------------------------------------------ nhạc */
.loc-nhac { display: flex; gap: 12px; align-items: center; margin: 18px 0 14px; flex-wrap: wrap; }
#tim-nhac { flex: 1; min-width: 210px; }
.chip-hang { display: flex; gap: 5px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--vien-dam);
  background: transparent; color: var(--muc-nhat);
}
.chip:hover { background: #ece7dd; }
.chip.dang-chon { background: var(--che); border-color: var(--che); color: #fff; }

.ds-nhac {
  display: grid; gap: 7px; max-height: 380px; overflow-y: auto;
  padding-right: 8px; border-radius: var(--tron-nho);
}
.the-nhac {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-width: 0;   /* thiếu dòng này thì thẻ phình quá ô, nhãn nguồn bị đẩy khuất */
  cursor: pointer;
  background: var(--giay-2); border: 1.5px solid var(--vien);
  border-radius: var(--tron-nho); padding: 11px 14px; text-align: left; font: inherit;
}
.the-nhac:hover { border-color: var(--vien-dam); }
.the-nhac.dang-chon { border-color: var(--che); background: var(--che-mo); }
.the-nhac .nghe {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--vien-dam); background: var(--giay);
  display: grid; place-items: center; font-size: 11px; color: var(--che); cursor: pointer;
}
.the-nhac .nghe:hover { background: var(--che); border-color: var(--che); color: #fff; }
.the-nhac .than { flex: 1; min-width: 0; }
.the-nhac .ten-nhac {
  font-size: 13.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.the-nhac .ta-nhac {
  font-size: 12px; color: var(--muc-mo);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nhan-nguon {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; flex: none;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase;
}
.nhan-nguon.tiktok { background: #f4e4ea; color: #a8375e; }
.nhan-nguon.goc { background: var(--che-mo); color: var(--che); }
.nhan-nguon.cua-toi { background: var(--dat-mo); color: var(--dat); }

/* ------------------------------------------------------- chọn đoạn nhạc */
.chon-doan { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--vien); }
.chon-doan h2 { margin-bottom: 5px; }
.song-boc {
  position: relative; margin-top: 14px; border-radius: var(--tron-nho);
  background: #efeae1; overflow: hidden; cursor: grab; user-select: none;
  border: 1px solid var(--vien);
}
.song-boc.dang-keo { cursor: grabbing; }
#song { display: block; width: 100%; height: 120px; }
.cua-so {
  position: absolute; top: 0; bottom: 0; left: 0; width: 30%;
  background: rgba(47,107,79,.17);
  border-left: 2.5px solid var(--che); border-right: 2.5px solid var(--che);
}
.cua-so .tay {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 26px; height: 26px; border-radius: 50%; background: var(--che);
  box-shadow: 0 1px 5px rgba(0,0,0,.2);
}
.cua-so .tay::after {
  content: "⇔"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 12px;
}
.hang-song {
  display: flex; align-items: center; gap: 14px; margin-top: 11px;
  font-size: 13px; color: var(--muc-nhat); font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- xác nhận */
.phieu {
  background: var(--giay-2); border: 1px solid var(--vien);
  border-radius: var(--tron); box-shadow: var(--bong); overflow: hidden;
  margin-top: 18px;
}
.phieu-van { padding: 22px 24px; border-bottom: 1px solid var(--vien); background: #fffefb; }
.nhan-phieu {
  font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--che); margin-bottom: 10px;
}
#tt-van {
  margin: 0 0 12px; padding: 0 0 0 15px; border-left: 3px solid var(--che-mo);
  font-size: 16.5px; line-height: 1.9; color: var(--muc);
}
.phieu-dong { margin: 0; padding: 6px 0; }
.phieu-dong > div {
  display: grid; grid-template-columns: 118px 1fr auto;
  gap: 14px; align-items: baseline; padding: 10px 24px;
}
.phieu-dong > div + div { border-top: 1px solid #f0ece4; }
.phieu-dong dt { font-size: 13px; color: var(--muc-mo); }
.phieu-dong dd { margin: 0; font-size: 14px; }
.sua-nhanh {
  border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: 12.5px; color: var(--che); padding: 3px 8px; border-radius: 6px;
}
.sua-nhanh:hover { background: var(--che-mo); }

.hop-cau-sua { margin-top: 20px; display: grid; gap: 7px; }
.hop-cau-sua label { font-size: 13px; color: var(--muc-nhat); }

/* --------------------------------------------------------------- đang chạy */
.thanh-chay {
  height: 7px; background: #e7e1d6; border-radius: 999px;
  overflow: hidden; margin: 20px 0 9px;
}
.chay-trong {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--che), var(--che-sang));
  transition: width .5s ease;
}
.hang-chay {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--muc-nhat); font-variant-numeric: tabular-nums;
}
#ket-qua { margin-top: 24px; }
#video-xong {
  width: 100%; max-width: 340px; border-radius: var(--tron);
  background: #000; box-shadow: var(--bong-sau); display: block;
}

/* ------------------------------------------------------------ đã dựng */
.luoi-video { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.the-video {
  background: var(--giay-2); border: 1px solid var(--vien);
  border-radius: var(--tron); overflow: hidden; box-shadow: var(--bong);
}
.the-video video { width: 100%; display: block; background: #000; aspect-ratio: 9/16; object-fit: contain; }
.the-video .chan { padding: 11px 13px; }
.the-video .ten-v {
  font-size: 13px; font-weight: 600; word-break: break-word; line-height: 1.45;
}
.the-video .luc-v { font-size: 12px; color: var(--muc-mo); margin-top: 3px; }

/* ---------------------------------------------------------- thêm tinh */
.them-tinh { margin-top: 20px; }
.them-tinh summary { cursor: pointer; font-size: 13.5px; color: var(--che); padding: 7px 0; }
.luoi-tinh {
  display: grid; gap: 13px; margin-top: 13px;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
}
.luoi-tinh label { font-size: 13px; color: var(--muc-nhat); display: grid; gap: 5px; }
.o-bat { display: flex !important; align-items: center; gap: 8px; align-self: end; }
.o-bat input { width: auto; }

/* -------------------------------------------------------------- bánh mì */
.banh-mi {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 90px);
  background: var(--muc); color: #f7f4ee; padding: 12px 22px;
  border-radius: 999px; font-size: 14px; box-shadow: var(--bong-sau);
  opacity: 0; pointer-events: none; transition: transform .28s, opacity .28s;
  z-index: 90; max-width: 84vw; text-align: center;
}
.banh-mi.hien { transform: translate(-50%, 0); opacity: 1; }
.banh-mi.xau { background: var(--do); }

@media (max-width: 820px) {
  #man-dung.dang-mo { grid-template-columns: 1fr; gap: 22px; }
  .cot-buoc { position: static; }
  .ds-buoc { grid-auto-flow: column; overflow-x: auto; gap: 5px; }
  .ds-buoc .ten { display: none; }
  .phieu-dong > div { grid-template-columns: 1fr auto; }
  .phieu-dong dt { grid-column: 1 / -1; }
}

/* ============================================= Danh sách file bày ngang
   Kiểu cửa sổ thư mục Windows: mỗi dòng một file, có ảnh nhỏ để nhận ra cảnh.
   Lưới thẻ vuông nhìn đẹp nhưng mỗi màn chỉ chứa mươi clip mà tên cắt cụt hết. */
.ds-hang { display: grid; gap: 2px; }
.hang-dau, .hang-file {
  display: grid; align-items: center; gap: 12px;
  grid-template-columns: 46px minmax(0, 1fr) 150px 80px 118px 74px 26px;
}
.hang-dau {
  padding: 0 11px 7px; font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muc-mo);
  border-bottom: 1px solid var(--vien); margin-bottom: 3px;
}
.hang-file {
  padding: 6px 11px; border-radius: 8px; border: 1px solid transparent;
  background: transparent; font: inherit; text-align: left; min-width: 0;
  transition: background .12s, border-color .12s;
}
.hang-file.xem-duoc { cursor: pointer; }
.hang-file:nth-child(even) { background: #f4f0e9; }
.hang-file.xem-duoc:hover, .hang-file:focus-visible {
  background: var(--che-mo); border-color: var(--che); outline: 0;
}

.o-anh {
  position: relative; width: 46px; height: 34px; border-radius: 5px;
  overflow: hidden; background: #ded8cc; display: grid; place-items: center;
  flex: none;
}
.o-anh img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.o-anh .chua-anh { font-size: 15px; opacity: .5; }
.hang-file.xem-duoc:hover .o-anh::after {
  content: "▶"; position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.4); color: #fff; font-size: 12px;
}

.o-ten {
  font-size: 13.5px; font-weight: 500; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.o-tm, .o-ngay, .o-co {
  font-size: 12.5px; color: var(--muc-mo); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.o-co, .hang-dau span:nth-child(6) { text-align: right; font-variant-numeric: tabular-nums; }
.o-ngay { font-variant-numeric: tabular-nums; }

.the-nhan {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--che-mo); color: var(--che); white-space: nowrap;
}
.the-nhan.chua { background: #f6e6cf; color: #8a5a1c; }

.bo-hang {
  width: 24px; height: 24px; border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--muc-mo); font-size: 13px; line-height: 1;
  display: grid; place-items: center; opacity: 0; transition: opacity .12s;
}
.hang-file:hover .bo-hang { opacity: 1; }
.bo-hang:hover { background: #e7ded2; color: var(--do); }

@media (max-width: 760px) {
  .hang-dau, .hang-file { grid-template-columns: 42px minmax(0,1fr) 74px 26px; }
  .o-tm, .o-ngay, .o-co,
  .hang-dau span:nth-child(3), .hang-dau span:nth-child(5),
  .hang-dau span:nth-child(6) { display: none; }
}

.phan-trang {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; flex-wrap: wrap;
}
.phan-trang:empty { display: none; }
.phan-trang button {
  font: inherit; font-size: 13px; cursor: pointer; min-width: 32px;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--vien-dam); background: var(--giay-2); color: var(--muc-nhat);
}
.phan-trang button:hover:not(:disabled) { background: #ece7dd; color: var(--muc); }
.phan-trang button.dang-o {
  background: var(--che); border-color: var(--che); color: #fff; font-weight: 700;
}
.phan-trang button:disabled { opacity: .35; cursor: default; }
.phan-trang .dem-trang {
  font-size: 12.5px; color: var(--muc-mo); margin-left: 6px;
  font-variant-numeric: tabular-nums;
}

.loc-kho { display: flex; gap: 10px; margin: 20px 0 14px; flex-wrap: wrap; }
#tim-clip { flex: 1; min-width: 220px; }
#loc-thu-muc { width: auto; min-width: 190px; }

/* -------------------------------------------------------- hộp xem trước */
.hop-xem { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.hop-xem[hidden] { display: none; }
.nen-xem { position: absolute; inset: 0; background: rgba(24,21,17,.72); backdrop-filter: blur(3px); }
.khung-xem {
  position: relative; z-index: 1; max-width: min(92vw, 560px); max-height: 88vh;
  background: var(--giay-2); border-radius: var(--tron); overflow: hidden;
  box-shadow: var(--bong-sau); display: flex; flex-direction: column;
}
#video-xem { width: 100%; max-height: 76vh; background: #000; display: block; }
.ten-xem {
  padding: 11px 15px; font-size: 13px; color: var(--muc-nhat);
  word-break: break-word; line-height: 1.5;
}
.dong-xem {
  position: absolute; top: 9px; right: 9px; z-index: 2;
  width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(35,32,26,.6); color: #fff; font-size: 14px;
  display: grid; place-items: center;
}
.dong-xem:hover { background: var(--do); }

/* --------------------------------- cửa sổ bật ra xem kho (không sổ xuống nữa) */
.hop-xem.hop-to .khung-xem { max-width: min(94vw, 940px); }
/* Phải đặt width chứ không chỉ max-width: khung nằm trong lưới place-items
   center nên nó co lại vừa nội dung, đặt mỗi max-width thì cửa sổ hẹp tí. */
.khung-kho { width: min(94vw, 940px); max-height: 86vh; }
.dau-kho {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 20px 22px 14px; border-bottom: 1px solid var(--vien);
}
.dau-kho h2 { font-size: 19px; }
.dau-kho p { margin: 3px 0 0; font-size: 13px; }
.than-kho { padding: 18px 22px; overflow-y: auto; flex: 1; min-height: 0; }
.khung-kho .phan-trang {
  margin: 0; padding: 12px 22px 16px; border-top: 1px solid var(--vien);
}
.dong-xem.tinh { position: static; flex: none; background: #ece7dd; color: var(--muc-nhat); }
.dong-xem.tinh:hover { background: var(--do); color: #fff; }

/* ---------------------------------------- nạp thêm video ngay ở bước Nguồn hình */
.khu-nap-tai-cho { margin-top: 18px; display: grid; gap: 12px; justify-items: start; }
.khu-nap-tai-cho[hidden] { display: none; }
.khu-nap-tai-cho .vung-tha { width: 100%; }
.loi-du {
  margin: 0; font-size: 13.5px; line-height: 1.6; padding: 12px 15px;
  border-radius: var(--tron-nho); width: 100%;
}
.loi-du.thieu { background: #fdf3e6; border: 1px solid #f0dcc0; color: #7a5320; }
.loi-du.du { background: var(--che-mo); border: 1px solid #d5e5db; color: var(--che); }
.loi-du strong { font-weight: 700; }

/* ô để người dùng tự gõ, đặt ngay dưới các thẻ chọn sẵn */
.o-tu-go { margin-top: 16px; display: grid; gap: 6px; }
.o-tu-go label { font-size: 13px; color: var(--muc-nhat); }

/* ------------------------------- màn đang dựng: chỉ thanh % và tên chặng
   Bỏ hẳn khung đen kiểu dòng lệnh. Thay bằng danh sách chặng có dấu tích,
   nhìn là biết đang ở đâu và còn mấy chặng nữa. */
.thanh-chay.to { height: 10px; }
.chi-tiet-chay {
  margin: 14px 0 0; font-size: 13px; color: var(--muc-nhat);
  min-height: 20px; line-height: 1.5;
}
.ds-chang { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 3px; }
.ds-chang li {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 12px; border-radius: 9px; font-size: 13.5px;
  color: var(--muc-mo); transition: background .2s, color .2s;
}
.ds-chang .cham {
  width: 19px; height: 19px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--vien-dam); display: grid; place-items: center;
  font-size: 10px; color: transparent;
}
.ds-chang li.xong { color: var(--muc-nhat); }
.ds-chang li.xong .cham {
  background: var(--che); border-color: var(--che); color: #fff;
}
.ds-chang li.dang {
  background: var(--che-mo); color: var(--che); font-weight: 600;
}
.ds-chang li.dang .cham { border-color: var(--che); }
.ds-chang li.dang .cham::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--che); animation: tho 1.1s ease-in-out infinite;
}
@keyframes tho { 50% { opacity: .25; transform: scale(.7); } }

/* ------------------------------- gợi ý số cảnh ở bước Ngữ cảnh
   Người dùng cần biết trước cần mấy cảnh thì mới tả ngữ cảnh cho vừa. */
.hop-goi-y { margin-top: 18px; }
.so-goi-y {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.so-goi-y .o {
  background: var(--giay-2); border: 1px solid var(--vien);
  border-radius: var(--tron-nho); padding: 13px 15px; display: grid; gap: 2px;
}
.so-goi-y .o b {
  font-size: 21px; font-weight: 700; color: var(--che); line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.so-goi-y .o span { font-size: 12px; color: var(--muc-mo); }
.canh-ai {
  margin-top: 12px; padding: 15px 17px; border-radius: var(--tron-nho);
  background: var(--dat-mo); border: 1px solid #ecdcc9;
}
.canh-ai[hidden] { display: none; }

.hang-go { display: flex; gap: 9px; }
.hang-go input { flex: 1; }
.ket-thu {
  margin-top: 11px; padding: 13px 15px; border-radius: var(--tron-nho);
  font-size: 13.5px; line-height: 1.6;
}
.ket-thu[hidden] { display: none; }
.ket-thu.co { background: var(--che-mo); border: 1px solid #d5e5db; color: var(--che); }
.ket-thu.thieu { background: #fdf3e6; border: 1px solid #f0dcc0; color: #7a5320; }
.ket-thu .vi-du { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }
.ket-thu .vi-du img {
  width: 92px; height: 68px; object-fit: cover; border-radius: 7px;
  background: #ded8cc; cursor: pointer;
}

/* ------------------------------- chỉnh tốc độ đọc theo chính bài đã viết */
.khu-toc-do { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--vien); }
.khu-toc-do h2 { margin-bottom: 5px; }
.nac-toc-do { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.nac-toc-do button {
  font: inherit; font-size: 13px; cursor: pointer; padding: 9px 15px;
  border-radius: 999px; border: 1px solid var(--vien-dam);
  background: var(--giay-2); color: var(--muc-nhat);
}
.nac-toc-do button:hover { background: #ece7dd; color: var(--muc); }
.nac-toc-do button.dang-chon {
  background: var(--che); border-color: var(--che); color: #fff; font-weight: 600;
}
.loi-vua {
  margin: 14px 0 0; padding: 12px 15px; border-radius: var(--tron-nho);
  font-size: 13.5px; line-height: 1.6;
}
.loi-vua:empty { display: none; }
.loi-vua.vua { background: var(--che-mo); border: 1px solid #d5e5db; color: var(--che); }
.loi-vua.lech { background: #fdf3e6; border: 1px solid #f0dcc0; color: #7a5320; }

/* ------------------------------------- sửa lại chính video vừa dựng xong */
.khu-sua {
  margin-top: 22px; padding: 18px 20px; border-radius: var(--tron);
  background: var(--giay-2); border: 1px solid var(--vien); box-shadow: var(--bong);
}
.khu-sua h2 { margin-bottom: 4px; }
.khu-sua .dan { margin-bottom: 14px; }
.khu-sua .hang-go { margin-bottom: 12px; }
.goi-sua { flex-wrap: wrap; }
.goi-sua .chip { font-size: 12.5px; padding: 6px 13px; }

/* -------------------- cho lời văn vừa với video, và nhạc dạo đầu mấy giây */
.hang-vua { display: flex; gap: 9px; margin-top: 12px; flex-wrap: wrap; }
.hang-vua[hidden] { display: none; }
.o-dao-dau { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--vien); }
.o-dao-dau > label { font-size: 13.5px; font-weight: 600; display: block; }
.o-dao-dau .dan { margin: 11px 0 0; }

/* Thanh phát hiện ra khi trình duyệt chặn tự phát */
.thanh-nghe {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 12px; padding: 11px 14px; border-radius: var(--tron-nho);
  background: var(--che-mo); border: 1px solid #d5e5db;
  font-size: 13px; color: var(--che);
}
.thanh-nghe audio { height: 34px; }

/* ------------------------------------------- vòng tròn xoay lúc chờ
   Đọc thử bằng AI mất mươi giây. Không có gì quay thì người dùng tưởng
   máy chết, bấm đi bấm lại. */
.xoay {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  display: inline-block; vertical-align: -2px;
  animation: quay .7s linear infinite;
}
@keyframes quay { to { transform: rotate(360deg); } }

.the-giong .nghe .xoay { width: 15px; height: 15px; vertical-align: 0; }
.nut .xoay { margin-right: 7px; }

/* Dòng nhắc còn bao lâu, đặt ngay dưới danh sách giọng */
.dang-doc {
  display: flex; align-items: center; gap: 10px; margin-top: 12px;
  padding: 11px 14px; border-radius: var(--tron-nho);
  background: var(--dat-mo); border: 1px solid #ecdcc9;
  font-size: 13px; color: #7a5320;
}
.dang-doc[hidden] { display: none; }
.dang-doc .dem-giay { font-variant-numeric: tabular-nums; margin-left: auto; }
.the-giong .cho-doc {
  display: block; margin-top: 4px; font-size: 11px; color: var(--dat);
  background: var(--dat-mo); padding: 2px 8px; border-radius: 999px;
  width: fit-content;
}
.hang-nghe-loi { display: flex; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.thanh-nghe[hidden] { display: none; }
.thanh-nghe #may-nghe { flex: 1; min-width: 220px; }
/* Nút nhấp nháy khi người dùng gõ ngữ cảnh mới mà chưa cho AI phân cảnh lại */
.nut.nhap-nhay { animation: doi-bam 1.4s ease-in-out infinite; }
@keyframes doi-bam {
  50% { box-shadow: 0 0 0 5px rgba(47,107,79,.22); }
}
.lien-ket {
  border: 0; background: transparent; padding: 0; cursor: pointer;
  font: inherit; color: inherit; text-decoration: underline;
}

/* ------------------------------------------- bảng phân cảnh sửa được */
.ds-canh .canh-sua {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 3px;
}
.chu-canh {
  flex: 1; min-width: 0; padding: 4px 8px; border-radius: 6px;
  border: 1px solid transparent; cursor: text; line-height: 1.55;
}
.chu-canh:hover { border-color: #ecdcc9; background: #fffaf3; }
.chu-canh:focus {
  outline: 0; border-color: var(--dat); background: #fff;
  box-shadow: 0 0 0 3px rgba(168,100,42,.12);
}
.bo-canh {
  flex: none; width: 22px; height: 22px; border: 0; border-radius: 5px;
  background: transparent; color: #b08a5e; cursor: pointer; font-size: 12px;
  opacity: 0; transition: opacity .12s;
}
.canh-sua:hover .bo-canh { opacity: 1; }
.bo-canh:hover { background: #f0dcc0; color: var(--do); }
.them-canh {
  margin-top: 8px; border: 1px dashed #d8bf9d; background: transparent;
  color: var(--dat); font: inherit; font-size: 13px; cursor: pointer;
  padding: 7px 14px; border-radius: 8px;
}
.them-canh:hover { background: #fdf3e6; }
.dem-canh { margin-top: 11px; font-size: 12.5px; color: #7a5320; }
.the-thu-muc {
  flex: none; align-self: center; font-size: 10.5px; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px;
  background: #f0e2cd; color: #8a5a1c;
}
#nut-dung-lai { margin-top: 12px; }
#nut-dung-lai[hidden] { display: none; }

/* ---------------------------------------- bước Phong cách: bảng hình thức */
.khu-hinh-thuc { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--vien); }
.khu-hinh-thuc h2 { margin-bottom: 14px; }
.khu-chu {
  margin-top: 20px; padding: 16px 18px; border-radius: var(--tron-nho);
  background: #faf7f1; border: 1px solid var(--vien);
}
.khu-chu h3 { margin-bottom: 12px; }
.khu-chu[hidden] { display: none; }

/* ------------------------------- xem trước clip máy sẽ chọn (bước Ngữ cảnh) */
.khu-xem-truoc { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--vien); }
.khu-xem-truoc .dau-khu { margin-bottom: 14px; }
.khu-xem-truoc h2 { font-size: 17px; }
#ds-xem-truoc:empty { display: none; }
#ds-xem-truoc { margin-top: 14px; }
.hang-file .o-canh {
  font-size: 12px; color: var(--muc-mo); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hang-xem {
  grid-template-columns: 26px 62px minmax(0,1fr) minmax(0,1fr) 118px auto !important;
}
.so-canh-nho {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--che-mo); color: var(--che); font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

/* Lời văn phải hiện ĐÚNG như người dùng viết: xuống dòng ở đâu giữ ở đó. */
#tt-van { white-space: pre-wrap; }
#o-loi-van { white-space: pre-wrap; }

/* ------------------------- người dùng tự chốt từng cảnh: đổi clip, chọn đoạn */
.hang-xem .o-nut { display: flex; gap: 5px; flex: none; }
.nut-canh {
  border: 1px solid var(--vien-dam); background: var(--giay-2); cursor: pointer;
  font: inherit; font-size: 11.5px; padding: 4px 9px; border-radius: 6px;
  color: var(--muc-nhat); white-space: nowrap;
}
.nut-canh:hover { background: var(--che-mo); border-color: var(--che); color: var(--che); }
/* Nút một ký tự: thêm cảnh, xoá cảnh, xem thử */
.nut-canh.gon { padding: 4px 8px; font-weight: 700; }
.nut-canh.bo:hover { background: #fbeceb; border-color: #c0574c; color: #a8352a; }

/* Hàng cuối bảng: thêm cảnh vào cuối + đếm số cảnh sẽ dựng */
.hang-them {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 0 46px; padding: 9px 13px;
  border: 1px dashed var(--vien-dam); border-radius: 8px;
}
.hang-them .them-cuoi { border-style: dashed; }
.hang-them .dem-canh {
  font-size: 12px; color: var(--che); font-weight: 600; margin-left: auto;
}
.hang-file.da-chot { background: var(--che-mo); }
.hang-file.da-chot .o-ten { color: var(--che); font-weight: 600; }

.khu-doan { padding: 14px 16px 16px; }
#video-doan { width: 100%; max-height: 46vh; background: #000; display: block; }
.doan-nen {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, #e5ded1 0 2px, #efeae1 2px 9px);
}
#doan-boc { height: 56px; margin-top: 12px; }
.hop-xem .khung-xem .hang-song { margin-top: 11px; }

/* Câu văn đọc trên từng cảnh, đặt ngay dưới hàng clip để soi hình với chữ */
.van-cua-canh {
  display: flex; gap: 11px; align-items: baseline;
  margin: -1px 0 7px 46px; padding: 8px 13px;
  border-left: 2px solid var(--che-mo); border-radius: 0 8px 8px 0;
  background: #faf7f1; font-size: 13px; line-height: 1.65;
}
.van-cua-canh .nhan-van {
  flex: none; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--che); background: var(--che-mo);
  padding: 2px 8px; border-radius: 999px;
}
.van-cua-canh .chu-van { color: var(--muc); min-width: 0; }
.van-cua-canh.trong { border-left-color: var(--vien); }
.van-cua-canh.trong .nhan-van { color: var(--muc-mo); background: #ece7dd; }
.van-cua-canh.trong .chu-van { color: var(--muc-mo); font-style: italic; }
.van-cua-canh .dieu-van { display: flex; gap: 5px; flex: none; margin-left: auto; }
.van-cua-canh .nut-canh { font-size: 10.5px; padding: 3px 8px; }
