/* Máy nhắc chữ + quay video (anh Văn yêu cầu 31/10/2026, bám app Teleprompter trên iPhone) */
.nut-quay { display:flex; align-items:center; justify-content:center; gap:8px; margin:0 0 14px; }
.nut-quay svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

#nc { position:fixed; inset:0; z-index:60; background:#000; color:#fff; overflow:hidden; touch-action:manipulation; }
#nc .cam { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }   /* phủ kín 100% màn hình như app camera; canvas = hình đã làm đẹp, nằm đè lên video */
#nc .cam.guong { transform:scaleX(-1); }
/* lưới 1/3 để canh mắt (chỉ hiện trên màn hình, không ghi vào video) */
#nc .nc-luoi { position:absolute; inset:0; z-index:1; pointer-events:none; }
#nc .nc-luoi::before, #nc .nc-luoi::after { content:''; position:absolute; border:0 solid rgba(255,255,255,.45); }
#nc .nc-luoi::before { top:0; bottom:0; left:33.333%; width:33.334%; border-left-width:1px; border-right-width:1px; }
#nc .nc-luoi::after { left:0; right:0; top:33.333%; height:33.334%; border-top-width:1px; border-bottom-width:1px; }
#nc button { box-shadow:none; }
#nc svg { fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* hàng trên: quay về · lật camera · sửa chữ */
#nc .nc-tren { position:absolute; left:0; right:0; top:0; display:flex; align-items:center; gap:10px; padding:calc(10px + env(safe-area-inset-top)) 14px 8px; z-index:3; }
#nc .nc-tron { width:40px; height:40px; padding:0; border-radius:50%; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,.45); color:#fff; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
#nc .nc-tron svg { width:20px; height:20px; }
#nc .nc-tron.xanh { background:var(--nhan); color:var(--nhan-chu); }
#nc .nc-tren .gian { flex:1; }
#nc .nc-rec { display:none; align-items:center; gap:6px; padding:5px 12px; border-radius:99px; background:rgba(229,72,77,.9); font:700 14px/1 ui-monospace,Menlo,monospace; }
#nc .nc-rec::before { content:''; width:8px; height:8px; border-radius:50%; background:#fff; animation:nc-nhay 1s steps(1) infinite; }
#nc.dang-quay .nc-rec { display:flex; }
#nc.mat-tieng .nc-rec { background:#ffb020; color:#111; }   /* micro mất tiếng lúc đang quay (matTieng trong nhac-chu.js) */
#nc.mat-tieng .nc-rec::before { background:#111; }
#nc.mat-tieng .nc-rec::after { content:'MẤT TIẾNG'; font-family:system-ui,sans-serif; }
@keyframes nc-nhay { 50% { opacity:0; } }

/* khung chữ chạy: từ dưới hàng nút trên xuống sát khung Tốc độ (--day do JS đo) */
#nc .nc-chu { position:absolute; left:0; right:0; top:calc(58px + env(safe-area-inset-top)); bottom:var(--day, 230px); overflow-y:auto; padding:0 18px; z-index:2;
  scrollbar-width:none; -webkit-mask-image:linear-gradient(180deg, transparent 0, #000 6%, #000 90%, transparent 100%); mask-image:linear-gradient(180deg, transparent 0, #000 6%, #000 90%, transparent 100%); }
#nc.dang-sua .nc-chu { bottom:auto; height:40%; }   /* lúc sửa chừa chỗ cho bàn phím */
#nc .nc-chu::-webkit-scrollbar { display:none; }
#nc .nc-chu div { white-space:pre-wrap; word-break:break-word; font-weight:700; line-height:1.3; padding:var(--dem, 14px) 0 100%; text-shadow:0 2px 6px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.9); }
#nc.dang-sua .nc-chu div { padding-top:14px; }
#nc:not(.dang-sua) .nc-chu div { text-align:justify; }   /* căn đều 2 bên cho kín bề ngang (anh Văn 05/11/2026), lúc sửa thì để căn trái cho dễ gõ */
#nc .nc-chu .trong { opacity:.7; font-weight:600; }
#nc .nc-chu div[contenteditable=true], #nc .nc-chu div[contenteditable=plaintext-only] { outline:none; caret-color:var(--nhan); -webkit-user-select:text; user-select:text; }
#nc .nc-chu div:empty::before { content:attr(data-goi-y); opacity:.6; }
#nc.dang-sua .nc-duoi { display:none; }

/* bảng điều khiển dưới */
#nc .nc-duoi { position:absolute; left:0; right:0; bottom:0; padding:0 12px calc(14px + env(safe-area-inset-bottom)); z-index:3; }
#nc .nc-bang { max-width:520px; margin:0 auto 14px; padding:10px 14px; border-radius:16px; background:rgba(15,20,28,.72); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border:1px solid rgba(255,255,255,.08); }
#nc.dang-quay .nc-bang { border-color:rgba(229,72,77,.8); }
/* nút thu/bật bảng: thẻ nhỏ giữa mép trên bảng, bấm lúc nào cũng được, không dính nút quay; thu thì bảng ẩn, chỉ còn thẻ nằm trên nút quay (anh Văn 06/11/2026) */
#nc .nc-mo { display:flex; align-items:center; justify-content:center; width:76px; height:28px; padding:0; margin:0 auto; border-radius:14px 14px 0 0; background:rgba(15,20,28,.72); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px); border:1px solid rgba(255,255,255,.08); border-bottom:0; color:#fff; }
#nc .nc-mo svg { width:22px; height:22px; }
#nc.an-bang .nc-bang { display:none; }
#nc.an-bang .nc-mo { border-radius:14px; border-bottom:1px solid rgba(255,255,255,.08); margin-bottom:14px; }
#nc.dang-quay .nc-mo { border-color:rgba(229,72,77,.8); }
#nc .nc-toc, #nc .nc-dep, #nc .nc-dam { display:flex; align-items:center; gap:10px; }
#nc .nc-dep, #nc .nc-dam { margin-top:8px; }
#nc.dang-quay .nc-dep, #nc.dang-quay .nc-dam, #nc.dang-quay .nc-tone { opacity:.4; pointer-events:none; }   /* đang quay thì khoá làm đẹp + bộ lọc + tone */
/* hàng tone màu: ô ảnh mẫu vuông đã áp tone (tao-anh-tone.py), tên nằm ở mép dưới ảnh, vuốt ngang khi không đủ chỗ */
#nc .nc-tone { display:flex; gap:6px; margin-top:8px; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
#nc .nc-tone::-webkit-scrollbar { display:none; }
#nc .nc-tone button { position:relative; flex:none; width:66px; height:66px; padding:0; border-radius:12px; border:2px solid transparent; overflow:hidden; background:rgba(255,255,255,.12); background-clip:padding-box; }
#nc .nc-tone img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
#nc .nc-tone span { position:absolute; left:0; right:0; bottom:0; padding:12px 1px 4px; background:linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.72)); color:#fff; font-size:11px; font-weight:700; line-height:1.15; letter-spacing:-.3px; text-align:center; white-space:nowrap; text-shadow:0 1px 2px rgba(0,0,0,.6); }
#nc .nc-tone button.chon { border-color:var(--nhan); }
#nc .nc-tone i { flex:none; width:1px; margin:5px 4px; background:rgba(255,255,255,.3); }   /* vạch ngăn tone theo cảnh / tone theo cảm xúc */
#nc .nc-toc input, #nc .nc-dep input, #nc .nc-dam input { flex:1; min-width:0; accent-color:var(--nhan); }
#nc .nc-toc span, #nc .nc-dep span, #nc .nc-dam span { min-width:58px; font-size:13px; font-weight:600; color:rgba(255,255,255,.85); }
#nc .nc-toc b, #nc .nc-dep b, #nc .nc-dam b, #nc .nc-cong b { min-width:28px; text-align:center; font-size:16px; }
#nc .nc-tg { width:40px; height:34px; padding:0; border-radius:10px; background:rgba(255,255,255,.12); color:#fff; font-size:20px; font-weight:700; line-height:34px; }
#nc .nc-tg:active { background:rgba(255,255,255,.25); }
#nc .nc-nut { display:flex; align-items:center; justify-content:center; gap:18px; margin-top:8px; }
#nc .nc-nut .nho { width:36px; height:36px; padding:0; display:flex; align-items:center; justify-content:center; background:transparent; color:#fff; }
#nc .nc-nut .nho svg { width:22px; height:22px; }
#nc .nc-chay { min-width:96px; padding:7px 16px; border-radius:99px; background:#2f7cf6; color:#fff; font-size:14px; font-weight:700; letter-spacing:.04em; }
#nc .nc-hang { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:10px; max-width:520px; margin:0 auto; }
#nc .nc-noi { justify-self:start; white-space:nowrap; height:36px; padding:0 12px; border-radius:99px; display:flex; align-items:center; justify-content:center; gap:6px; background:rgba(0,0,0,.5); color:#fff; font-size:12px; font-weight:700; }
#nc .nc-noi svg { width:18px; height:18px; }
#nc .nc-noi.bat { background:#ffd60a; color:#1a1a1a; }
#nc .nc-ghi { width:74px; height:74px; padding:0; border-radius:50%; background:transparent; border:4px solid #fff; display:flex; align-items:center; justify-content:center; }
#nc .nc-ghi i { width:56px; height:56px; border-radius:50%; background:#e5484d; transition:all .2s; }
#nc.dang-quay .nc-ghi i { width:28px; height:28px; border-radius:6px; }
#nc .nc-dem { text-align:right; font:600 13px/1.2 ui-monospace,Menlo,monospace; color:rgba(255,255,255,.85); }
#nc .nc-dem small { display:block; font:500 11px/1.3 -apple-system,system-ui,sans-serif; color:rgba(255,255,255,.65); }

/* thanh cỡ chữ + màu khi sửa kịch bản, nằm sát trên bàn phím */
#nc .nc-cong { position:absolute; left:0; right:0; bottom:0; z-index:5; display:flex; align-items:center; gap:10px; padding:8px 12px calc(8px + env(safe-area-inset-bottom)); background:rgba(15,20,28,.92); border-top:1px solid rgba(255,255,255,.1); }
#nc .nc-cong .nc-tg { width:44px; font-size:16px; }
#nc .nc-mau { display:flex; gap:10px; margin-left:auto; }
#nc .nc-mau button { width:30px; height:30px; padding:0; border-radius:50%; border:2px solid rgba(255,255,255,.25); }
#nc .nc-mau button.chon { border-color:#fff; box-shadow:0 0 0 2px var(--nhan); }

/* xem lại đoạn vừa quay */
#nc .nc-xem { position:absolute; inset:0; z-index:6; display:flex; flex-direction:column; gap:12px; padding:calc(14px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); background:rgba(7,11,18,.96); }
#nc .nc-xem video { flex:1; min-height:0; width:100%; object-fit:contain; border-radius:14px; background:#000; }
#nc .nc-xem p { margin:0; text-align:center; }
#nc .nc-xem p.loi { color:#ff6b6b; font-weight:700; }   /* đoạn vừa quay không có tiếng */
#nc .nc-xem .nuts { margin:0; }
#nc .nc-xem .nuts button { padding:12px 4px; font-size:14px; white-space:nowrap; }
#nc .an { display:none !important; }
