/* trang/tin-mau.css — kiểu riêng của màn Tin mẫu & Nhãn (tiền tố tm-). Thành phần dùng chung: chung.css */
.tm-ghi-chu { margin-bottom: 12px; }
.tm-ghi-chu:empty { display: none; }
.tm-cong-cu { margin-top: 14px; min-height: 40px; }
.tm-cong-cu:empty { display: none; }
.tm-ds > .ds-khung + .muc-tieu-de { margin-top: 22px; }
.tm-dau-khoi { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tm-dau-khoi > svg { color: var(--mo); }
.tm-dau-so { font-weight: 600; color: var(--mo-2); letter-spacing: 0; }

/* dòng tin mẫu / nhãn */
.tm-muc { display: flex; align-items: stretch; border-bottom: 1px solid var(--vien); background: #fff; min-width: 0; }
.tm-muc:last-child { border-bottom: 0; }
.tm-muc-chinh { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; text-align: left; }
.tm-muc-chinh:hover { background: #fdfbf7; }
.tm-muc-chinh:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--vang); border-radius: 0; }
.tm-phim { flex: none; display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--nen-2); color: var(--muc-2); font: 600 12.5px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.tm-muc-chinh > .tm-phim { width: 92px; margin-top: 1px; }
.tm-muc-chu { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tm-muc-ten { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-muc-nd { font-size: 13.5px; color: var(--mo); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-line; }
.tm-muc-nd-chinh { color: var(--muc-2); }
.tm-muc-anh { flex: none; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--vien); }
.tm-muc-co-anh { flex: none; color: var(--mo); padding-top: 3px; }
.tm-muc-nut { flex: none; display: flex; align-items: center; gap: 2px; padding: 0 8px 0 0; }
.tm-muc-nhan { align-items: center; }
.tm-nhan-chinh { flex: 1; min-width: 0; padding: 12px 14px; display: flex; align-items: center; }
.nhan-mau.tm-nhan-to { height: 26px; font-size: 13px; padding: 0 10px 0 9px; }

/* khung xem trước (bong bóng giống tin gửi đi) */
.tm-xem-nen { background: var(--nen-2); border: 1px solid var(--vien); border-radius: 12px; padding: 12px 14px 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; min-width: 0; }
.tm-xem-nhan { align-self: flex-start; font-size: 12px; font-weight: 650; color: var(--mo); text-transform: uppercase; letter-spacing: .04em; }
.tm-bb { max-width: 100%; background: var(--vang-nhat); border: 1px solid #ead9b8; border-radius: 14px 14px 4px 14px; padding: 9px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tm-bb-chu { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 14.5px; }
.tm-bb-anh { max-width: min(240px, 100%); max-height: 240px; border-radius: 9px; object-fit: contain; background: #fff; }
.tm-bien { background: #ecd9b6; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.tm-bien-ds { background: var(--vang-nhat); color: var(--muc-2); font-weight: 600; padding: 0 4px; }

/* hộp sửa tin mẫu */
.tm-sua { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tm-sua-hang { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.tm-sua-phai { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 0; }
.tm-phim-o { position: relative; }
.tm-phim-gach { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--mo); font-weight: 700; pointer-events: none; }
.o-nhap.tm-o-phim { padding-left: 24px; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
textarea.o-nhap.tm-o-nd { height: auto; min-height: 132px; padding: 9px 12px; line-height: 1.5; resize: vertical; }
.tm-chen { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: -6px; }
.chip.tm-chip-bien { height: 30px; padding: 0 10px; font-size: 13px; }
.tm-anh-khoi { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tm-anh-dong { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--vien-2); border-radius: var(--bo); background: #fff; }
.tm-anh-nho { flex: none; width: 46px; height: 46px; border-radius: 8px; object-fit: cover; border: 1px solid var(--vien); }
.tm-anh-mat { display: inline-flex; align-items: center; justify-content: center; background: var(--nen-2); color: var(--mo); }
.tm-xoay { margin: 6px; }

/* hộp sửa nhãn */
.tm-bang-mau { display: grid; grid-template-columns: repeat(6, 36px); gap: 10px; }
.tm-o-mau { width: 36px; height: 36px; border-radius: 50%; background: var(--mau); color: #fff; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--vien-2); transition: transform .08s, box-shadow .12s; }
.tm-o-mau:hover { transform: scale(1.08); }
.tm-o-mau.chon { box-shadow: 0 0 0 2px var(--muc); }
.tm-o-mau:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--muc), var(--vong); border-radius: 50%; }
.tm-nhan-xem { display: flex; align-items: center; gap: 10px; min-height: 28px; }

@media (max-width: 760px) {
  .tm-cong-cu > .tm-nut-them { flex: 1 1 100%; }
  .tm-cong-cu > .gian { display: none; }
  .tm-cong-cu > .o-chon { flex: 1 1 100%; }
  .tm-muc-chinh > .tm-phim { width: auto; }
  .tm-muc-chinh { flex-wrap: wrap; gap: 6px 10px; padding: 12px; }
  .tm-muc-chu { flex-basis: 100%; order: 3; }
  .tm-muc-anh { order: 2; margin-left: auto; width: 40px; height: 40px; }
  .tm-muc-nut { flex-direction: column; justify-content: center; padding-right: 4px; }
  .tm-sua { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tm-sua-hang { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .tm-sua-phai { position: static; }
  .chip.tm-chip-bien { height: 44px; }
  .tm-bang-mau { grid-template-columns: repeat(6, 44px); gap: 8px; }
  .tm-o-mau { width: 44px; height: 44px; }
}
