/* Studio Của Mẹ — phong cách Apple, chữ to, tương phản rõ */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: #e3e3e8;
  --blue: #0071e3;
  --blue-soft: #e8f1fc;
  --green: #248a3d;
  --green-soft: #e6f6ea;
  --red: #d70015;
  --orange: #ff7a45;
  --pink: #ff4f7b;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(0,0,0,.06);
  --fs: 19px;
  color-scheme: light;
}
html.big { --fs: 23px; }
* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 2.1rem; line-height: 1.15; font-weight: 700; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: .4em 0; }
.muted { color: var(--muted); }
a { color: var(--blue); }

/* Thanh trên cùng — kính mờ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px max(20px, env(safe-area-inset-left)); gap: 12px;
  background: rgba(245,245,247,.78); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.05rem; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.save-state { color: var(--muted); font-size: .8rem; min-width: 70px; text-align: right; }
.icon-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font-size: 1.05rem; font-weight: 700; color: var(--text); cursor: pointer; }
.icon-btn:active { transform: scale(.95); }

.app { max-width: 1180px; margin: 0 auto; padding: 28px 20px 140px; }

/* Thẻ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
.card + .card { margin-top: 18px; }
.card h2 + p, .card h3 + p { margin-top: 6px; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; }
.spacer { height: 14px; }

/* Nút bấm */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 58px; padding: 0 26px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer; text-decoration: none;
  background: #e8e8ed; color: var(--text); transition: transform .08s, background .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #0077ed; }
.btn.green { background: var(--green); color: #fff; }
.btn.red { background: var(--red); color: #fff; }
.btn.soft { background: var(--blue-soft); color: var(--blue); }
.btn.ghost { background: transparent; color: var(--blue); padding: 0 12px; }
.btn.small { min-height: 46px; padding: 0 18px; font-size: .9rem; }
.btn.big { min-height: 70px; font-size: 1.12rem; padding: 0 34px; }
.btn.block { width: 100%; }
.btn .spin { width: 20px; height: 20px; border: 3px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Trường nhập */
label.field { display: block; }
label.field > span { display: block; font-weight: 600; margin-bottom: 8px; }
input[type=text], input[type=number], input[type=password], textarea, select {
  width: 100%; font: inherit; color: var(--text);
  padding: 15px 18px; border-radius: 16px; border: 1.5px solid var(--line); background: #fbfbfd;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.15); background: #fff; }
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.with-mic { position: relative; }
.with-mic textarea, .with-mic input { padding-right: 70px; }
.mic {
  position: absolute; right: 10px; top: 10px; width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--blue-soft); color: var(--blue); font-size: 1.3rem;
}
.mic.on { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(215,0,21,.45);} 50% { box-shadow: 0 0 0 12px rgba(215,0,21,0);} }

/* Nút chọn (chip) */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 52px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff;
  font: inherit; font-size: .95rem; cursor: pointer; color: var(--text);
}
.chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.chip:active { transform: scale(.97); }

/* Trang chủ */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.hero p { font-size: 1.1rem; color: var(--muted); max-width: 640px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pcard { cursor: pointer; display: flex; flex-direction: column; gap: 10px; transition: transform .15s; position: relative; }
.pcard:hover { transform: translateY(-2px); }
.pcard .thumb { height: 150px; border-radius: 16px; background: linear-gradient(135deg, #ffd9c2, #ffc2d4); display: grid; place-items: center; font-size: 2.6rem; overflow: hidden; }
.pcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.progress-dots { display: flex; gap: 6px; }
.progress-dots i { width: 100%; height: 6px; border-radius: 3px; background: var(--line); }
.progress-dots i.on { background: var(--green); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.gray { background: #eee; color: var(--muted); }
.empty { text-align: center; padding: 60px 26px; }
.empty .big-emoji { font-size: 4rem; }
.howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.howto div { background: var(--bg); border-radius: 16px; padding: 16px; font-size: .9rem; }
.howto b { display: block; font-size: 1.6rem; }

/* Trang dự án */
.phead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.phead .title-input { font-size: 1.6rem; font-weight: 700; border: 0; background: transparent; padding: 6px 10px; border-radius: 12px; letter-spacing: -.02em; }
.phead .title-input:focus { background: #fff; }
.stepper { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 14px; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step {
  flex: 1 0 auto; min-width: 130px; display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: 18px; background: #fff; border: 2px solid transparent; cursor: pointer; box-shadow: var(--shadow);
  font: inherit; color: var(--text); text-align: left;
}
.step .num { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-weight: 700; font-size: .9rem; }
.step small { display: block; color: var(--muted); font-size: .72rem; line-height: 1.2; }
.step b { display: block; font-size: .95rem; line-height: 1.2; }
.step.done .num { background: var(--green); color: #fff; }
.step.active { border-color: var(--blue); }
.step.active .num { background: var(--blue); color: #fff; }

.layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }
.side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .side { position: static; } }

.stage-intro { display: flex; gap: 18px; align-items: flex-start; }
.stage-intro .emoji { font-size: 2.6rem; line-height: 1; }

/* Cảnh */
.scene { border: 1.5px solid var(--line); border-radius: 20px; padding: 20px; background: #fff; }
.scene + .scene { margin-top: 14px; }
.scene-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.scene-num { width: 42px; height: 42px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.scene .say { font-size: 1.08rem; }
.scene-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
@media (max-width: 640px) { .scene-meta { grid-template-columns: 1fr; } }
.guide { background: #fff8ec; border-radius: 16px; padding: 14px 16px; font-size: .95rem; }
.guide.blue { background: var(--blue-soft); }
.guide b { display: block; margin-bottom: 2px; }
.scene video, .scene audio { width: 100%; border-radius: 14px; margin-top: 12px; background: #000; }
.scene video { max-height: 420px; }
.scene audio { background: transparent; }
.scene.skip { opacity: .5; }
.mini-actions { display: flex; gap: 6px; margin-left: auto; }
.mini-actions button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--bg); cursor: pointer; font-size: 1rem; }

/* Danh sách kiểm tra */
.check { display: flex; gap: 14px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 1rem; }
.check:last-child { border-bottom: 0; }
.check input { width: 30px; height: 30px; accent-color: var(--green); flex: none; }

/* Trợ lý AI */
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { padding: 18px 22px 12px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #7f7fd5, #86a8e7, #91eae4); display: grid; place-items: center; color: #fff; font-size: 1.3rem; flex: none; }
.chat-log { padding: 16px; display: flex; flex-direction: column; gap: 10px; max-height: 420px; min-height: 160px; overflow-y: auto; background: #fafafa; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 20px; white-space: pre-wrap; font-size: .97rem; }
.msg.assistant { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.user { background: var(--blue); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.msg.typing { color: var(--muted); }
.chat-quick { padding: 10px 16px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.chat-quick .chip { min-height: 42px; font-size: .85rem; padding: 0 14px; }
.chat-input { display: flex; gap: 8px; padding: 12px 16px 16px; align-items: flex-end; }
.chat-input textarea { min-height: 56px; height: 56px; padding: 14px 16px; border-radius: 22px; }
.chat-input .mic { position: static; flex: none; width: 56px; height: 56px; }
.chat-input .send { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 1.3rem; cursor: pointer; }

/* Thanh điều hướng dưới */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 14px max(20px, env(safe-area-inset-left)) calc(14px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0,0,0,.07);
}
.bottom-nav .inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.bottom-nav .where { flex: 1; text-align: center; color: var(--muted); font-size: .9rem; }

/* Thông báo nhỏ */
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: rgba(29,29,31,.92); color: #fff; padding: 14px 24px; border-radius: 999px; font-weight: 600; z-index: 60; transition: all .25s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Hộp thoại */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.35); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal[hidden] { display: none; }
.sheet { background: #fff; border-radius: 28px; padding: 28px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 30px 80px rgba(0,0,0,.25); }

/* Máy quay toàn màn hình */
.studio { position: fixed; inset: 0; z-index: 70; background: #000; color: #fff; display: flex; flex-direction: column; }
.studio .stage { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; }
.studio video { max-width: 100%; max-height: 100%; height: 100%; object-fit: contain; }
.studio video.mirror { transform: scaleX(-1); }
.prompter { position: absolute; left: 0; right: 0; top: 0; height: 38%; overflow: hidden; background: linear-gradient(rgba(0,0,0,.75), rgba(0,0,0,.55) 80%, transparent); pointer-events: none; }
.prompter .text { padding: 24px 8%; font-size: 2rem; line-height: 1.45; font-weight: 600; text-align: center; will-change: transform; text-shadow: 0 2px 6px rgba(0,0,0,.6); }
.prompter.hide { display: none; }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9rem; font-weight: 800; text-shadow: 0 6px 30px rgba(0,0,0,.6); pointer-events: none; }
.rec-dot { position: absolute; top: 16px; right: 16px; background: var(--red); padding: 6px 14px; border-radius: 999px; font-weight: 700; display: none; z-index: 2; }
.rec-dot.on { display: block; }
.studio .controls { padding: 16px 20px calc(18px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; background: #111; }
.studio .controls .btn { background: #2c2c2e; color: #fff; }
.studio .controls .btn.primary { background: var(--blue); }
.studio .controls .btn.green { background: var(--green); }
.rec-btn { width: 84px; height: 84px; border-radius: 50%; border: 5px solid #fff; background: transparent; cursor: pointer; display: grid; place-items: center; }
.rec-btn i { width: 62px; height: 62px; border-radius: 50%; background: #ff3b30; transition: all .2s; display: block; }
.rec-btn.on i { width: 34px; height: 34px; border-radius: 8px; }
.studio .scene-label { position: absolute; left: 16px; bottom: 16px; background: rgba(0,0,0,.55); padding: 8px 14px; border-radius: 12px; font-size: .9rem; max-width: 70%; }

/* Ghi âm */
.meter { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #ffd60a, var(--red)); transition: width .08s; }

/* Kết quả dựng */
.final-video { width: 100%; max-height: 640px; border-radius: 18px; background: #000; }
.bar { height: 14px; border-radius: 7px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); transition: width .4s; }
.caption-box { background: var(--bg); border-radius: 16px; padding: 16px; white-space: pre-wrap; font-size: .97rem; }
.platform { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pf-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; flex: none; }
.pf-tiktok { background: #111; } .pf-facebook { background: #1877f2; } .pf-youtube { background: #ff0000; }

@media (max-width: 640px) {
  .app { padding: 18px 14px 150px; }
  .card { padding: 20px; }
  h1 { font-size: 1.7rem; }
  .bottom-nav .where { display: none; }
  .bottom-nav .btn { flex: 1; }
}
@media print {
  .topbar, .bottom-nav, .side, .stepper, .no-print { display: none !important; }
  .layout { display: block; } .card { box-shadow: none; }
}

/* Điện thoại: nút gọn hơn, chữ không bị gãy dòng */
@media (max-width: 640px) {
  :root { --fs: 17px; } html.big { --fs: 20px; }
  .btn { padding: 0 16px; font-size: .95rem; }
  .btn.big { padding: 0 20px; }
  .row > .btn.grow { flex: 1 1 100%; }
  .brand span { display: none; }
  .phead .title-input { font-size: 1.3rem; }
}

/* Trợ lý: nút đọc to, gợi ý bấm chọn, dấu chấm đang nghĩ */
.speak { display: block; margin-top: 8px; border: 0; background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.speak[data-on] { background: var(--blue); color: #fff; }
.reply-opts { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.reply-opts .chip { border-color: var(--blue); color: var(--blue); text-align: left; min-height: 50px; white-space: normal; padding: 8px 18px; }
.dots { display: inline-flex; gap: 4px; margin-right: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; } .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (max-width: 640px) { .chat-log { max-height: 55vh; } .msg { font-size: 1.02rem; } }

/* Hộp nhập PIN: đặt cao để bàn phím điện thoại không che */
.modal.top { align-items: start; padding-top: 8vh; overflow-y: auto; }

/* Bàn phím số trên màn hình (nhập PIN) */
.pin-show { font-size: 2rem; letter-spacing: .15em; min-height: 3.2rem; display: grid; place-items: center; background: var(--bg); border-radius: 16px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.keypad button { height: 68px; border-radius: 20px; border: 0; background: #ececf1; font: inherit; font-size: 1.7rem; font-weight: 600; color: var(--text); cursor: pointer; touch-action: manipulation; }
.keypad button:active { background: #d8d8df; transform: scale(.97); }
.keypad .alt { font-size: 1rem; background: #f7f7fa; }
.keypad .ok { background: var(--blue); color: #fff; font-size: 1.2rem; }

/* ===== Máy quay trên điện thoại: bố cục như ứng dụng camera ===== */
.studio { height: 100vh; height: 100dvh; }
.studio [hidden] { display: none !important; }
.studio .stage { display: block; flex: 1 1 0; min-height: 0; background: #000; }
.studio .stage video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: cover; background: #000; }
.studio .stage video#review { object-fit: contain; z-index: 3; }
.prompter { height: 34%; z-index: 2; background: linear-gradient(rgba(0,0,0,.7), rgba(0,0,0,.45) 85%, transparent); }
.prompter .text { padding: 14px 6% 40px; font-size: clamp(1.15rem, 5.4vw, 1.7rem); line-height: 1.4; }
.countdown { z-index: 4; font-size: clamp(5rem, 28vw, 9rem); }
.rec-dot { z-index: 5; top: calc(12px + env(safe-area-inset-top)); }
.studio .scene-label { z-index: 2; bottom: 10px; left: 10px; max-width: 80%; font-size: .8rem; padding: 6px 12px; }
.studio .controls { flex: none; flex-direction: column; gap: 10px; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
.studio .controls .crow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.studio .controls .crow.tools { justify-content: center; flex-wrap: wrap; }
.studio .controls .btn.small { min-height: 46px; padding: 0 14px; font-size: .85rem; white-space: nowrap; }
.studio .controls .crow.main .btn.small { flex: 1; max-width: 140px; }
.rec-btn { width: 76px; height: 76px; flex: none; }
.rec-btn i { width: 54px; height: 54px; }
.studio #ctl2 { flex-direction: row; justify-content: center; gap: 12px; }
.studio #ctl2 .btn { flex: 1; max-width: 220px; }

/* ===== Góc quay: giữ nguyên khung hình (không cắt phóng to) + thanh chọn ống kính ===== */
.studio .stage video#live { object-fit: contain; }
.lensbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; z-index: 3; display: flex; gap: 8px; padding: 6px; background: rgba(0,0,0,.45); border-radius: 999px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lens { min-width: 48px; height: 48px; padding: 0 10px; border-radius: 24px; border: 0; background: rgba(70,70,72,.85); color: #fff; font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; touch-action: manipulation; }
.lens.on { background: #ffd60a; color: #000; }
.studio .scene-label { bottom: 76px; }
.cam-info { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; z-index: 5; font-size: .7rem; color: #fff; opacity: .6; }
.lensbar[hidden] { display: none !important; }

/* ===== Chữ gợi ý: tạm dừng khi chạm, dấu ▶ chỗ đang đọc; nhãn đang quay nhỏ gọn ở góc dưới trái ===== */
.prompter { height: 40%; pointer-events: auto; cursor: pointer; -webkit-mask-image: linear-gradient(#000 82%, transparent); mask-image: linear-gradient(#000 82%, transparent); }
.prompter .text { padding: 14px 8% 24px 11%; }
.prompter .pmark { position: absolute; left: 3px; top: 6px; z-index: 1; color: #ffd60a; font-size: 1.1rem; text-shadow: 0 1px 4px #000; transition: top .15s linear; }
.prompter.paused::after { content: "⏸ Tạm dừng"; position: absolute; right: 10px; bottom: 26px; background: rgba(0,0,0,.65); color: #ffd60a; padding: 4px 10px; border-radius: 10px; font-size: .75rem; font-weight: 700; }
.rec-dot { top: auto !important; right: auto; bottom: 132px; left: 10px; z-index: 5; display: none; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; font-size: .75rem; background: rgba(0,0,0,.55); }
.rec-dot.on { display: inline-flex; }
.rec-dot i { width: 9px; height: 9px; border-radius: 50%; background: #ff3b30; animation: pulse2 1s infinite; }
@keyframes pulse2 { 50% { opacity: .3; } }
.cam-info { top: auto; left: auto; right: 10px; bottom: 80px; z-index: 2; }
.studio .controls .crow.tools .btn.small { padding: 0 10px; font-size: .8rem; }

.studio #ctl2 .btn { white-space: nowrap; padding: 0 14px; font-size: .95rem; min-height: 56px; }
.studio #ctl2 .btn.big { font-size: 1rem; }

/* ===== Thanh cắt video có hình ===== */
.trim { background: var(--bg); border-radius: 18px; padding: 16px 14px 14px; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.trim-title { font-weight: 700; font-size: 1.05rem; }
.trim-title .muted { font-weight: 400; font-size: .8rem; display: block; }
.trim-track { position: relative; height: 56px; margin: 40px 24px 10px; background: #fff; border-radius: 12px; touch-action: none; box-shadow: inset 0 0 0 1.5px #d8d8de; }
.trim-dim { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #b9b9c0, #b9b9c0 6px, #cfcfd5 6px, #cfcfd5 12px); }
.trim-dim.l { left: 0; border-radius: 12px 0 0 12px; } .trim-dim.r { right: 0; border-radius: 0 12px 12px 0; }
.trim-keep { position: absolute; top: 0; bottom: 0; background: #b6ebc4; border-top: 4px solid var(--green); border-bottom: 4px solid var(--green); }
.trim-play { position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; background: var(--blue); border-radius: 2px; pointer-events: none; z-index: 2; }
.trim-h { position: absolute; top: -38px; bottom: -14px; width: 56px; margin-left: -28px; display: flex; flex-direction: column; align-items: center; cursor: ew-resize; touch-action: none; z-index: 3; }
.trim-h span { font-size: 1.7rem; line-height: 1; }
.trim-h::after { content: ""; flex: 1; width: 8px; border-radius: 4px; background: var(--green); box-shadow: 0 0 0 2px #fff; }
.trim-h.out::after { background: var(--red); }
.trim-legend { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trim-legend .lg { background: #fff; border-radius: 14px; padding: 10px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.trim-legend .lg b { font-size: .8rem; font-weight: 600; }
.trim-legend .lg span { font-size: 1.1rem; font-weight: 700; }
.trim-legend .lg.in span { color: var(--green); } .trim-legend .lg.out span { color: var(--red); } .trim-legend .lg.keep { background: var(--green-soft); }
.trim-hint { font-size: .8rem; text-align: center; }
.trim-legend .lg b { font-size: .75rem; white-space: nowrap; }
.trim-legend .lg span { font-size: 1rem; white-space: nowrap; }

/* ===== Phong cách dựng + chuyển cảnh ===== */
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.look { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 18px; border: 2px solid var(--line); background: #fff; text-align: left; font: inherit; color: var(--text); cursor: pointer; min-height: 96px; }
.look .lk-ico { font-size: 1.8rem; line-height: 1.2; }
.look b { font-size: .95rem; } .look small { color: var(--muted); font-size: .75rem; line-height: 1.3; }
.look.on { border-color: var(--blue); background: var(--blue-soft); }
.chip.sub-yellow { color: #b88a00; font-weight: 700; } .chip.sub-box { background-image: linear-gradient(#222,#222); background-size: 100% 100%; color: #fff; }
.chip.sub-box.on, .chip.sub-yellow.on { box-shadow: 0 0 0 3px var(--blue); }
.ttiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; margin-top: 10px; }
.ttile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font: inherit; color: var(--text); cursor: pointer; }
.ttile b { font-size: .78rem; text-align: center; line-height: 1.2; }
.ttile.on { border-color: var(--blue); background: var(--blue-soft); }
.ttile[data-tr="auto"] { grid-column: span 2; flex-direction: row; justify-content: center; }
.trans-pick { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.tdemo { position: relative; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: #ddd; display: grid; place-items: center; flex: none; }
.tdemo.auto { width: 40px; height: 40px; font-size: 1.4rem; background: transparent; }
.tdemo i { position: absolute; inset: 0; display: block; }
.tdemo .ta { background: linear-gradient(135deg, #4aa3ff, #2467d9); }
.tdemo .tb { background: linear-gradient(135deg, #ffb35c, #ff6a3d); opacity: 0; }
.tdemo .tx { opacity: 0; }
.tdemo { --d: 2.6s; }
.k-none .tb { animation: kNone var(--d) infinite steps(1); }
.k-fade .tb { animation: kFade var(--d) infinite ease-in-out; }
.k-fadeblack .tx { background: #000; animation: kDip var(--d) infinite ease-in-out; } .k-fadeblack .tb { animation: kNone var(--d) infinite steps(1); }
.k-fadewhite .tx { background: #fff; animation: kDip var(--d) infinite ease-in-out; } .k-fadewhite .tb { animation: kNone var(--d) infinite steps(1); }
.k-slideleft .tb { opacity: 1; animation: kSlideL var(--d) infinite ease-in-out; } .k-slideleft .ta { animation: kSlideLA var(--d) infinite ease-in-out; }
.k-slideup .tb { opacity: 1; animation: kSlideU var(--d) infinite ease-in-out; } .k-slideup .ta { animation: kSlideUA var(--d) infinite ease-in-out; }
.k-zoomin .tb { opacity: 1; animation: kZoom var(--d) infinite ease-in-out; }
.k-circleopen .tb { opacity: 1; animation: kCircle var(--d) infinite ease-in-out; }
@keyframes kNone { 0%, 49.9% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes kFade { 0%, 15% { opacity: 0; } 50%, 65% { opacity: 1; } 100% { opacity: 0; } }
@keyframes kDip { 0%, 20% { opacity: 0; } 50% { opacity: 1; } 80%, 100% { opacity: 0; } }
@keyframes kSlideL { 0%, 15% { transform: translateX(100%); } 50%, 85% { transform: translateX(0); } 100% { transform: translateX(100%); } }
@keyframes kSlideLA { 0%, 15% { transform: translateX(0); } 50%, 85% { transform: translateX(-100%); } 100% { transform: translateX(0); } }
@keyframes kSlideU { 0%, 15% { transform: translateY(100%); } 50%, 85% { transform: translateY(0); } 100% { transform: translateY(100%); } }
@keyframes kSlideUA { 0%, 15% { transform: translateY(0); } 50%, 85% { transform: translateY(-100%); } 100% { transform: translateY(0); } }
@keyframes kZoom { 0%, 15% { transform: scale(.1); opacity: 0; } 50%, 85% { transform: scale(1); opacity: 1; } 100% { transform: scale(.1); opacity: 0; } }
@keyframes kCircle { 0%, 15% { clip-path: circle(0% at 50% 50%); } 50%, 85% { clip-path: circle(75% at 50% 50%); } 100% { clip-path: circle(0% at 50% 50%); } }
@media (prefers-reduced-motion: reduce) { .tdemo i { animation: none !important; } }
.looks { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.look { min-height: 88px; padding: 10px 12px; }

/* ===== Nhạc nền ===== */
.tracks { display: flex; flex-direction: column; gap: 8px; }
.track { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.track.on { border-color: var(--green); background: var(--green-soft); }
.tplay { width: 52px; height: 52px; flex: none; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 1.15rem; cursor: pointer; display: grid; place-items: center; }
.tplay.none { background: #ececf1; color: var(--text); font-size: 1.4rem; }
.tinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tinfo b { font-size: .98rem; } .tinfo small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.tcheck { width: 28px; text-align: center; color: var(--green); font-weight: 800; font-size: 1.3rem; }
