/* Đính kèm, xem trước ảnh và góp ý. Chỉ trình bày; giữ các lớp / handler v166. */
.bang-dinh-kem {
  position: fixed; left: max(12px, env(safe-area-inset-left));
  bottom: calc(env(safe-area-inset-bottom) + 72px); z-index: 60;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
  width: min(360px, calc(100vw - 24px)); min-width: 0; padding: 10px;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 96px);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--mat, #fff); color: var(--chu, #12354d);
  border: 1px solid var(--vien, #d8e6ef); border-radius: 22px;
  box-shadow: 0 12px 36px #072c4926, inset 0 1px var(--vien-sang, #ffffff94);
}
.dk-muc {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; min-width: 0; min-height: 108px; padding: 8px 6px 12px;
  border: 1px solid transparent; border-radius: 16px;
  background: transparent; color: inherit; font: inherit; text-align: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.dk-muc:hover { background: var(--mat-2, #dfedf6); }
.dk-muc:active { background: var(--mat-2, #dfedf6); border-color: var(--vien); }
.dk-muc:focus-visible, .hu-muc:focus-visible {
  outline: 3px solid var(--chinh-2, #0875ac); outline-offset: 1px;
}
.dk-bieu {
  flex: none; display: block; width: 64px; height: 64px;
  font-size: 0; line-height: 1; background: var(--dk-tile) center 45% / 132% no-repeat;
}
.dk-chup { --dk-tile: url('/icons/menu-b/tiles/camera.svg?v=1'); }
.dk-thuvien { --dk-tile: url('/icons/menu-b/tiles/image.svg?v=1'); }
.dk-tep { --dk-tile: url('/icons/menu-b/tiles/file.svg?v=1'); }
.dk-quay { --dk-tile: url('/icons/menu-b/tiles/video.svg?v=1'); }
html[data-bieu-tuong="nhieu-mau"] .dk-chup { --dk-tile: url('/icons/menu-b/tiles-color/camera.svg?v=1'); }
html[data-bieu-tuong="nhieu-mau"] .dk-thuvien { --dk-tile: url('/icons/menu-b/tiles-color/image.svg?v=1'); }
html[data-bieu-tuong="nhieu-mau"] .dk-tep { --dk-tile: url('/icons/menu-b/tiles-color/file.svg?v=1'); }
html[data-bieu-tuong="nhieu-mau"] .dk-quay { --dk-tile: url('/icons/menu-b/tiles-color/video.svg?v=1'); }
.dk-ten { width: 100%; font-size: .875rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
/* Thanh bên PC: 84 + 340 px, đúng lưới hiện tại trong app.css. */
@media (min-width: 860px) { .bang-dinh-kem { left: 436px; } }

.xem-truoc-anh { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.xt-khung {
  display: flex; align-items: center; justify-content: center; min-height: 100px;
  max-height: 48dvh; overflow: hidden; padding: 6px;
  background: var(--nen, #eef5fa); border: 1px solid var(--vien); border-radius: 16px;
}
.xt-canvas { display: block; max-width: 100%; max-height: calc(48dvh - 14px); object-fit: contain; border-radius: 10px; }
.dai-hieu-ung {
  display: flex; gap: 8px; min-width: 0; overflow-x: auto;
  padding: 4px 4px 10px; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: var(--bieu-nhat, #587185) transparent;
}
.hu-muc {
  position: relative; flex: 0 0 84px; display: flex; flex-direction: column;
  align-items: center; gap: 7px; min-width: 0; padding: 5px 4px 8px;
  border: 2px solid transparent; border-radius: 14px; background: transparent;
  color: var(--chu, #12354d); font: inherit; font-size: .75rem; cursor: pointer;
}
.hu-muc:hover { background: var(--mat-2, #dfedf6); }
.hu-muc.hu-chon, .hu-muc[aria-checked="true"] {
  border-color: var(--chinh-2, #0875ac); background: var(--mat-2, #dfedf6); font-weight: 750;
}
/* Dấu chọn là hình vẽ, không thêm chữ chưa dịch bằng CSS. */
.hu-muc.hu-chon::after, .hu-muc[aria-checked="true"]::after {
  content: ''; position: absolute; top: 10px; right: 10px; width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
  filter: drop-shadow(0 1px 1px #000); pointer-events: none;
}
.hu-thu { display: block; width: 68px; height: 68px; object-fit: cover; border-radius: 9px; }
.hu-ten { max-width: 100%; min-height: 2.5em; line-height: 1.25; text-align: center; white-space: normal; overflow-wrap: anywhere; }

/* Góp ý: giữ thứ tự, giới hạn chữ, nhãn và trạng thái lỗi của form hiện có. */
.gop-y { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.gop-y > .nhat { margin: 0; font-size: .875rem; line-height: 1.5; }
.gop-y .gy-o {
  display: block; width: 100%; min-height: 156px; padding: 14px;
  border: 1px solid var(--vien, #d8e6ef); border-radius: 16px;
  background: var(--nen, #eef5fa); color: var(--chu, #12354d);
  font: inherit; line-height: 1.5; resize: vertical; overflow-wrap: anywhere;
}
.gop-y .gy-o::placeholder { color: var(--chu-nhat, #4d6577); opacity: 1; }
.gop-y .gy-o:focus-visible { outline: 3px solid var(--chinh-2, #0875ac); outline-offset: 2px; }
.gy-dem { align-self: flex-end; margin-top: -6px; font-variant-numeric: tabular-nums; }
.gop-y .hang-nut { align-items: center; margin: 0; }
.gy-anh { flex: 1 1 100%; overflow-wrap: anywhere; }
.gy-anh:empty, .gop-y .loi:empty { display: none; }
.gop-y .loi { margin: 0; overflow-wrap: anywhere; }
.gop-y .hang-nut > .nut { min-width: 0; max-width: 100%; min-height: 46px; padding: 10px 14px; text-align: center; white-space: normal; }
.gop-y .gy-nut { flex: 1; }
.gop-y > .hang-nut:last-of-type { padding-top: 4px; }
.gop-y .nut:disabled { opacity: .55; cursor: default; }
@media (prefers-reduced-motion: reduce) { .dk-muc, .hu-muc { transition: none; } }
@media (forced-colors: active) {
  .bang-dinh-kem, .gop-y .gy-o { border-color: CanvasText; box-shadow: none; }
  .dk-bieu { background: none; font-size: 1.75rem; display: grid; place-items: center; }
  .hu-muc.hu-chon, .hu-muc[aria-checked="true"] { border-color: Highlight; }
}

