/* Video Instax: bước Trang trí (video-khach.js). Đen / trắng / xám kẽm + đỏ, chữ 12/14/16/20, bo 6/10/16 */
/* Khoá màn như tool sticker: không bôi đen, không menu giữ lâu; ô gõ chữ vẫn chọn được */
.vk { position: fixed; inset: 0; z-index: 3400; background: #fff; display: none; flex-direction: column; font-family: 'Inter', sans-serif; color: #18181b; height: 100svh;
      -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
      touch-action: manipulation; /* chặn chạm đúp phóng trang trên cả màn (chụm 2 ngón chặn bằng video-khach.js) */ }
.vk input { -webkit-user-select: text; user-select: text; }
.vk button { touch-action: manipulation; }
.vk-dau { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 4px 16px; border-bottom: 1px solid #e4e4e7; flex: none; }
.vk-dau h3 { margin: 0; font-size: 16px; font-weight: 700; }
.vk-phu { margin: 2px 0 0; font-size: 12px; color: #52525b; }
.vk-x { width: 44px; height: 44px; flex: none; border: none; background: none; font-size: 28px; line-height: 1; color: #18181b; cursor: pointer; }
.vk-than { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 16px 0; overflow: hidden; }
.vk-chan { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid #e4e4e7; }
.vk-chan .vk-tiep { margin-left: auto; min-width: 120px; }
.vk-dem { font-size: 14px; color: #52525b; }
.vk-dem.canh { color: #dc2626; }
.vk-goi { font-size: 12px; color: #52525b; margin: 8px 0; }
.vk-goi-mau { text-align: center; margin: 4px 0; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vk-nho { font-size: 12px; color: #52525b; margin: 0 0 6px; }

/* Đổi ảnh trong video */
.vk-than > .vk-luoi { overflow-y: auto; padding-bottom: 12px; }
.vk-luoi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .vk-luoi { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.vk-o { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #f4f4f5; aspect-ratio: 3 / 2; cursor: pointer; }
.vk-o img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vk-o.on { border-color: #18181b; }
.vk-so { position: absolute; top: 6px; right: 6px; min-width: 24px; height: 24px; border-radius: 12px; border: 2px solid #fff; background: rgba(0,0,0,.3); color: #fff; font: 700 12px/20px 'Inter', sans-serif; text-align: center; box-sizing: border-box; }
.vk-o.on .vk-so { background: #18181b; }

/* Tấm phim: to nhất, nút Hoàn tác / Làm lại ở góc */
.vk-khung { position: relative; width: 100%; max-width: 560px; margin: 0 auto; flex: none; display: flex; justify-content: center; }
.vk-khung canvas { display: block; touch-action: none; border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.vk-lui { position: absolute; top: 6px; left: 6px; display: flex; gap: 8px; }
.vk-lui button { position: relative; width: 44px; height: 44px; border-radius: 22px; border: none; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.vk-lui button:disabled { opacity: .35; }
.vk-lui svg { width: 18px; height: 18px; fill: none; stroke: #18181b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Ảnh trong video */
.vk-anh-ds { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 6px; }
.vk-anh-ds span { position: relative; }
.vk-anh-ds img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; display: block; }
.vk-anh-ds b { position: absolute; top: 2px; left: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: #18181b; color: #fff; font: 700 12px/16px 'Inter', sans-serif; text-align: center; }

/* 4 thẻ công cụ có biểu tượng */
.vk-the { display: flex; gap: 4px; margin: 2px 0 6px; flex: none; }
.vk-the button { flex: 1; min-width: 0; min-height: 48px; border: 1px solid #e4e4e7; border-radius: 10px; background: #fff; color: #18181b; font: 600 12px 'Inter', sans-serif; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 0; }
.vk-the svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vk-the button.on { background: #18181b; border-color: #18181b; color: #fff; }
.vk-cong { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 3px 12px; }

.vk-hang { display: flex; gap: 8px; align-items: center; margin: 4px 0 6px; flex-wrap: wrap; }
.vk-hang input { flex: 1 1 160px; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid #d4d4d8; border-radius: 10px; font: 16px 'Inter', sans-serif; box-sizing: border-box; }
/* Hàng vuốt ngang: chừa lề 2 bên để viền nút đang chọn không bị cắt */
.vk-phong, .vk-kieu, .vk-mauda { display: flex; gap: 8px; overflow-x: auto; padding: 3px 3px 6px; margin: 0 -3px; scrollbar-width: none; }
.vk-phong::-webkit-scrollbar, .vk-kieu::-webkit-scrollbar, .vk-mauda::-webkit-scrollbar { display: none; }
.vk-phong button { flex: none; min-height: 44px; max-width: 200px; padding: 0 12px; border: 1px solid #e4e4e7; border-radius: 10px; background: #fff; color: #18181b; font-size: 20px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vk-phong button.on { border-color: #18181b; box-shadow: 0 0 0 1px #18181b; }

/* Chấm màu */
.vk-cham { display: flex; gap: 2px; margin: 2px -3px; padding: 2px 3px; overflow-x: auto; scrollbar-width: none; }
.vk-cham::-webkit-scrollbar { display: none; }
.vk-cham button { flex: none; }
.vk-cham button { width: 44px; height: 44px; border-radius: 22px; border: none; background: none; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.vk-cham button::before { content: ""; width: 30px; height: 30px; border-radius: 15px; background: var(--m); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.vk-cham button.on { box-shadow: inset 0 0 0 2px #18181b; }

/* Kiểu nét: ô là nét mẫu thật */
.vk-net { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 2px; }
.vk-net button { border: 1px solid #e4e4e7; border-radius: 10px; background: #71717a; padding: 4px 4px 2px; cursor: pointer; display: flex; flex-direction: column; align-items: center; min-height: 44px; }
.vk-net button.on { border-color: #18181b; box-shadow: 0 0 0 2px #18181b; }
.vk-net img { width: 100%; height: 24px; object-fit: contain; display: block; }
.vk-net span { font: 600 12px 'Inter', sans-serif; color: #fff; }

/* Cỡ nét: thanh kéo + chấm xem trước */
.vk-co { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 14px; }
.vk-co input { flex: 1; min-width: 0; min-height: 44px; accent-color: #18181b; }
.vk-co i { flex: none; display: block; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); margin-right: 4px; }

/* Lưới hình vẽ + đá */
.vk-kieu button { flex: none; width: 52px; height: 52px; border: 1px solid #e4e4e7; border-radius: 10px; background: transparent; padding: 4px; cursor: pointer; }
.vk-kieu button.on { border-color: #18181b; box-shadow: 0 0 0 2px #18181b; }
.vk-kieu img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vk-hinh button { background: #a1a1aa; }
.vk-kieu.vk-hinh { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; overflow: visible; margin: 4px 0 0; padding: 3px; }
.vk-kieu.vk-hinh button { width: auto; aspect-ratio: 1; height: auto; }
.vk-mauda button { flex: none; width: 44px; height: 44px; border-radius: 22px; border: 1px solid #e4e4e7; background: transparent; padding: 3px; cursor: pointer; }
.vk-mauda button.on { box-shadow: 0 0 0 2px #18181b; }
.vk-mauda img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vk-vua { position: absolute; top: 6px; right: 6px; min-height: 44px; padding: 0 12px; border-radius: 18px; border: none; background: rgba(255,255,255,.92); box-shadow: 0 1px 4px rgba(0,0,0,.25); font: 600 12px 'Inter', sans-serif; color: #18181b; cursor: pointer; }
.vk-vua::after { content: ""; position: absolute; inset: -4px; }
