/* TỰ SINH bởi sites/social/scripts/port-ui.py từ public/css/app.css (một phần) — đừng sửa tay; ghi đè ở css/social.css */
:root {
  color-scheme: dark;
  --bg: #272B30; --surface: #373B43; --surface-2: #1D2023;
  --text: #EDEDEE; --muted: #AAACB1; --line: rgba(255,255,255,.13); --hover: rgba(255,255,255,.06);
  --accent: #FF9854; --accent-ink: #FF7D27; --accent-soft: rgba(255,138,61,.12);
  --ok: #A9D5B8; --ok-bg: rgba(169,213,184,.13); --warn: #F4D19C; --warn-bg: rgba(237,193,112,.16); --err: #ED857F; --err-bg: rgba(237,133,127,.09);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --side: 248px;
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body.legacy-unused { background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 12px; border: 0; cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--surface); transition: background .15s; }
.btn:hover:not(:disabled) { background: #3F454D; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent-ink); color: #191919; }
.btn.primary:hover:not(:disabled) { background: #FF7012; }
.btn.quiet { background: none; border: 1px solid var(--line); }
.btn.quiet:hover:not(:disabled) { background: var(--hover); }

.notice { margin: 20px 0 0; padding: 10px 14px; border-radius: 12px; font-size: .9rem; background: var(--err-bg); color: var(--err); border: 1px solid currentColor; }
.notice[hidden] { display: none; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface); color: var(--muted); }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.err { color: var(--err); background: var(--err-bg); }
.hint { font-size: .86rem; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* Row detail drawer */
dialog { margin: auto; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-2); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,0.60); }
dialog::backdrop { background: rgba(255,255,255,.4); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h3 { font-family: var(--serif); font-weight: 500; font-size: 1.15rem; }
.dlg-body { padding: 8px 20px 20px; overflow: auto; max-height: calc(100vh - 150px); }
.kv { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv dt { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font: .86rem/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }

/* ===== Access (users, access codes, site policy) ===== */
.ax-tabs { max-width: 480px; margin: 0 0 16px; } .ax-tabs button { flex: 1; white-space: nowrap; }
.ax-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; } .ax-bar .hint { flex: 1 1 280px; }
.ax-list { display: grid; gap: 12px; }
.ax-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; }
.ax-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
.ax-hint { font: .8rem var(--mono); padding: 1px 6px; border-radius: 6px; background: var(--hover); }
.ax-grants { display: flex; flex-wrap: wrap; gap: 6px; } .ax-chip { display: inline-flex; flex-direction: column; padding: 5px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .85rem; line-height: 1.25; } .ax-chip small { font-weight: 500; opacity: .85; font-size: .75rem; }
.ax-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; margin: 0; } .ax-meta dt { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; } .ax-meta dd { margin: 0; font-size: .92rem; }
.ax-card .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.small { padding: 6px 12px; font-size: .85rem; }
dialog#axdlg { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; } dialog#axdlg.ax-wide { width: min(680px, calc(100vw - 24px)); }
#axdlg input:not([type=checkbox]), #axdlg select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #191919; font: inherit; }
#axdlg .check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: .92rem; } #axdlg .check input { width: auto; margin-top: 4px; }
.ax-site { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0; } .ax-opts { padding: 4px 0 2px 24px; display: grid; gap: 4px; } .ax-row { display: flex; flex-wrap: wrap; gap: 2px 14px; align-items: center; } .ax-row > span { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 700; min-width: 64px; }
.ax-inline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .ax-inline input { flex: 1 1 180px; width: auto !important; }
.ax-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } @media (max-width: 520px) { .ax-two { grid-template-columns: 1fr; } }
.ax-secret { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 14px 16px; margin: 12px 0; border-radius: 12px; background: var(--bg); border: 1px dashed var(--accent); } .ax-secret code { font: 700 1.4rem var(--mono); letter-spacing: .1em; user-select: all; }
.ax-dev { list-style: none; padding: 0; display: grid; gap: 8px; } .ax-dev li { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; } .ax-dev small { display: block; color: var(--muted); }


/* Ô chọn gọn gàng thay cho dropdown mặc định của trình duyệt */
.ax-segs { max-width: none; width: 100%; margin: 0 0 6px; display: flex; } .ax-segs button { flex: 1; white-space: nowrap; padding-inline: 8px; }
.ax-segs button:disabled { opacity: .6; cursor: default; }
.ax-card .badge { margin-right: auto; margin-left: 8px; } .ax-open { text-decoration: none; }
#axdlg select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; background: #191919 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235F5E57' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
#axdlg select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#axdlg input:not([type=checkbox]):focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Thông báo nổi của trang Access: không dính vào nội dung, xếp chồng, tự ẩn */
#axtoasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.ax-toast { pointer-events: auto; cursor: pointer; padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: .92rem; line-height: 1.45; box-shadow: 0 10px 30px rgba(0,0,0,0.60); animation: ax-in .25s ease both; transition: opacity .4s, transform .4s; }
.ax-toast.err { background: var(--err, #ED857F); color: #191919; } .ax-toast.out { opacity: 0; transform: translateY(6px); }
@keyframes ax-in { from { opacity: 0; transform: translateY(10px); } }
#view .head p { margin-bottom: 14px; }
.ax-tabs { margin-bottom: 18px; } .ax-bar { margin-bottom: 16px; } .ax-list { margin-top: 4px; }
#axdlg .notice { margin-top: 14px; }

.ax-lock{border:1px solid var(--border,#292C32);border-radius:10px;padding:12px 14px;margin-bottom:14px;background:var(--surface,#191919)}
.ax-lock .ax-bar{margin-bottom:8px}
.ax-locklist{display:flex;flex-direction:column;gap:6px}
.ax-lockrow{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto;gap:12px;align-items:center;font-size:13px}
@media(max-width:640px){.ax-lockrow{grid-template-columns:1fr auto}.ax-lockrow small{display:none}}

/* iOS Safari phóng to trang khi focus ô nhập có chữ < 16px: trên thiết bị cảm ứng giữ tối thiểu 16px (không khoá zoom của người dùng) */
@media (hover: none) and (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { font-size: max(16px, 1em) !important; }
}
/* Dashboard › Video › Timeline editor (kiểu CapCut) */
dialog.vf-tl { width: min(1180px, 98vw); max-width: none; height: min(94vh, 880px); padding: 0; border: 0; border-radius: 18px; background: var(--surface-2); color: var(--text); box-shadow: 0 24px 80px rgba(0,0,0,.35); }
dialog.vf-tl[open] { display: flex; flex-direction: column; } dialog.vf-tl::backdrop { background: rgba(255,255,255,.55); }
.vf-tl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .vf-tl-head b { font: 500 1.15rem var(--serif); }
.vf-tl-body { flex: 1; min-height: 0; display: grid; grid-template-rows: auto auto auto auto minmax(150px, 1fr); gap: 12px; padding: 14px 16px 16px; overflow: auto; }
.vf-tl-top { display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.vf-tl-vid { position: relative; border-radius: 14px; overflow: hidden; background: #000; display: grid; justify-items: center; } .vf-tl-vid video { width: 100%; max-height: 300px; object-fit: contain; display: block; }
.vf-tl-sub { position: absolute; left: 6%; right: 6%; bottom: 10px; text-align: center; color: #fff; font: 600 .95rem/1.3 var(--sans); text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; }
.vf-tl-edit { display: grid; gap: 8px; min-width: 0; } .vf-tl-e-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.vf-tl-edit textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; color: var(--text); resize: vertical; }
.vf-tl-zh { margin: 0; padding: 6px 10px; border-radius: 10px; background: var(--surface); font-size: .85rem; color: var(--muted); }
.vf-tl-nums { display: flex; gap: 12px; flex-wrap: wrap; } .vf-tl-nums label { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; margin: 0; } .vf-tl-nums input { width: 6.5em; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; color: var(--text); }
.vf-tl-cps { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; } .vf-tl-cps.ok { background: var(--ok-bg); color: var(--ok); } .vf-tl-cps.warn { background: var(--warn-bg); color: var(--warn); } .vf-tl-cps.bad { background: var(--err-bg); color: var(--err); }
.vf-tl-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; } .vf-tl-time { font: 600 .85rem var(--mono); min-width: 12.5em; }
.vf-tl-zoom, .vf-tl-chk { display: flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; margin: 0; } .vf-tl-zoom input { width: 120px; }
.vf-tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; vertical-align: -1px; } .vf-tl-legend i.ok { background: #FF9854; } .vf-tl-legend i.warn { background: #E5BD65; } .vf-tl-legend i.bad { background: #ED857F; }
.vf-tl-scroll { align-self: start; overflow-x: auto; overflow-y: hidden; border-radius: 14px; background: #E0E1E2; border: 1px solid #CBCCCE; min-height: 170px; scrollbar-width: thin; }
.vf-tl-canvas { position: relative; height: 168px; touch-action: pan-x; user-select: none; }
.vf-tl-ruler { position: relative; height: 26px; border-bottom: 1px solid #CBCCCE; color: #666C76; font: 600 .68rem var(--mono); cursor: pointer; } .vf-tl-ruler span { position: absolute; top: 3px; transform: translateX(-50%); } .vf-tl-ruler i { position: absolute; bottom: 0; width: 1px; height: 6px; background: #AEB1B4; }
.vf-tl-strip { height: 56px; margin-top: 0; background-size: 100% 100%; background-repeat: no-repeat; background-color: #D7D9DB; cursor: pointer; opacity: .92; }
.vf-tl-track { position: relative; height: 70px; cursor: pointer; }
.vf-tl-blk { position: absolute; top: 9px; height: 52px; border-radius: 9px; background: #FF9854; color: #191919; overflow: hidden; cursor: grab; touch-action: none; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.vf-tl-blk.warn { background: #E5BD65; color: #FEF5E1; } .vf-tl-blk.bad { background: #ED857F; } .vf-tl-blk.sel { outline: 2px solid #191919; outline-offset: -1px; z-index: 2; } .vf-tl-blk:active { cursor: grabbing; }
.vf-tl-blk .tx { display: block; padding: 6px 12px; font-size: .74rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; pointer-events: none; }
.vf-tl-blk .h { position: absolute; top: 0; bottom: 0; width: 12px; cursor: ew-resize; touch-action: none; background: rgba(0,0,0,.22); } .vf-tl-blk .h.l { left: 0; } .vf-tl-blk .h.r { right: 0; } .vf-tl-blk .h::after { content: ''; position: absolute; top: 14px; bottom: 14px; left: 5px; width: 2px; border-radius: 1px; background: rgba(26,28,32,.7); }
.vf-tl-head-line { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #191919; z-index: 6; pointer-events: none; } .vf-tl-head-line::before { content: ''; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: #191919; border-bottom: 0; }
@media (max-width: 760px) {
  dialog.vf-tl { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .vf-tl-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; } .vf-tl-top { display: contents; }
  .vf-tl-vid { order: 1; } .vf-tl-bar { order: 2; } .vf-tl-trimbar { order: 3; } .vf-tl-scroll { order: 3; min-height: 170px; } .vf-tl-edit { order: 4; } .vf-tl-vid video { max-height: 200px; } .vf-tl-legend { display: none; }
}

/* cảm ứng: tay chạm cần vùng lớn hơn, và không chọn chữ / hiện menu khi nhấn giữ khối */
.vf-tl-blk, .vf-tl-blk * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) { .vf-tl-blk .h { width: min(24px, 34%); } .vf-tl-blk .h::after { left: calc(50% - 1px); } .vf-tl-blk .tx { padding: 6px 14px; } }
/* thanh bên trái thu gọn thành dải icon (màn rộng) */
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.side-toggle { flex: none; width: 32px; height: 32px; border-radius: 9px; border: 0; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; } .side-toggle:hover { background: var(--hover); color: var(--text); } .side-toggle svg { width: 18px; height: 18px; transition: transform .18s; }
@media (min-width: 860px) {
  .shell { transition: grid-template-columns .18s ease; }
  .shell.side-collapsed { --side: 68px; }
  .shell.side-collapsed .side { padding: 16px 10px; align-items: stretch; }
  .shell.side-collapsed .side-top { flex-direction: column; gap: 10px; } .shell.side-collapsed .brand { padding: 0; justify-content: center; } .shell.side-collapsed .brand .wm { display: none; }
  .shell.side-collapsed .side-toggle svg { transform: rotate(180deg); }
  .shell.side-collapsed .nav-label, .shell.side-collapsed .nav a .count, .shell.side-collapsed #dbnav, .shell.side-collapsed .who span, .shell.side-collapsed #logout { display: none; }
  .shell.side-collapsed .nav a { justify-content: center; padding: 0; gap: 0; font-size: 0; } .shell.side-collapsed .nav a svg { width: 20px; height: 20px; }
  .shell.side-collapsed .side-foot { padding-left: 0; padding-right: 0; justify-items: center; } .shell.side-collapsed .foot-btns { justify-content: center; }
}
@media (max-width: 859px) { .side-toggle { display: none; } }

.btn[hidden] { display: none !important; }   /* .btn đặt display nên thuộc tính hidden không có tác dụng nếu thiếu dòng này */




.vf-tl-wait { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 6px; padding: 16px; text-align: center; color: #fff; background: rgba(255,255,255,.72); font-size: .86rem; }
.vf-tl-wait[hidden] { display: none; } .vf-tl-wait span { font: 700 1.2rem var(--mono); } .vf-tl-wait small { opacity: .8; }
.vf-tl-wait i { display: block; width: 0; max-width: 80%; height: 4px; border-radius: 2px; background: var(--accent); transition: width .5s; justify-self: start; margin-left: 10%; }
/* Timeline: núm kéo vạch đầu phát, nhãn giọng Nam/Nữ, nút chọn giọng */
.vf-tl-head-line::before { display: none; }
.vf-tl-knob { position: absolute; top: -1px; left: -11px; width: 22px; height: 22px; border-radius: 50%; background: #191919; box-shadow: 0 1px 5px rgba(0,0,0,.45); pointer-events: auto; cursor: ew-resize; touch-action: none; z-index: 7; }
.vf-tl-knob::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--accent); }
@media (pointer: coarse) { .vf-tl-knob { width: 32px; height: 32px; left: -16px; top: -6px; } .vf-tl-knob::after { inset: 10px; } }
.vf-tl-blk .g { position: absolute; top: 3px; right: 13px; z-index: 1; padding: 0 5px; border-radius: 6px; font: 800 .6rem/1.5 var(--sans); background: rgba(26,28,32,.9); color: #9DBFEB; pointer-events: none; } .vf-tl-blk .g.f { color: #E78BBD; }
.vf-tl-blk .tx i { opacity: .75; }
.vf-tl-g { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; } .vf-tl-g .btn.on { background: var(--accent-ink); color: #191919; }

/* Làn tua riêng trên cùng timeline: núm nằm hẳn ngoài khung hình, kéo không đè lên dải hình / câu */
.vf-tl-canvas { height: 202px; }
.vf-tl-scroll { min-height: 204px; }
.vf-tl-lane { position: relative; height: 34px; background: #E8E8E9; border-bottom: 1px solid #CBCCCE; cursor: pointer; touch-action: none; }
.vf-tl-knob { top: 5px; left: -14px; width: 28px; height: 24px; border-radius: 8px; background: #191919; box-shadow: 0 1px 6px rgba(0,0,0,.5); }
.vf-tl-knob::after { inset: auto; left: 9px; right: 9px; top: 6px; bottom: 6px; border-radius: 0; background: none; border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.vf-tl-knob::before { content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: #191919; border-bottom: 0; }
@media (pointer: coarse) { .vf-tl-lane { height: 40px; } .vf-tl-canvas { height: 208px; } .vf-tl-scroll { min-height: 210px; } .vf-tl-knob { top: 4px; left: -20px; width: 40px; height: 30px; } .vf-tl-knob::after { inset: auto; left: 14px; right: 14px; top: 8px; bottom: 8px; } }
@media (max-width: 760px) { .vf-tl-vid, .vf-tl-bar, .vf-tl-trimbar, .vf-tl-scroll, .vf-tl-edit { flex: none; } .vf-tl-vid video { width: 100%; height: auto; max-height: 220px; } }
.vf-tl-scroll { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }   /* chỉ dải timeline cuộn ngang, không kéo giãn cả cửa sổ */
.vf-tl-body { overflow-x: hidden; }
.vf-tl-scroll { padding: 0 22px; }   /* chừa lề hai đầu: núm ở giây 0 / cuối video không bị cắt mất nửa */
/* Timeline › cắt ngắn video: vùng tối ngoài đoạn giữ lại + tay cắt màu vàng ở hai đầu dải khung hình */
.vf-tl-cut { position: absolute; top: 34px; bottom: 0; left: 0; width: 0; background: rgba(0,0,0,.58); pointer-events: none; z-index: 3; }
.vf-tl-trimh { position: absolute; top: 60px; height: 56px; width: 14px; background: #F2C14E; z-index: 5; cursor: ew-resize; touch-action: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.vf-tl-trimh.l { margin-left: -14px; border-radius: 7px 0 0 7px; } .vf-tl-trimh.r { border-radius: 0 7px 7px 0; }
.vf-tl-trimh::after { content: ''; position: absolute; top: 18px; bottom: 18px; left: 6px; width: 2px; border-radius: 1px; background: #F7E2B2; }
@media (pointer: coarse) { .vf-tl-cut { top: 40px; } .vf-tl-trimh { top: 66px; width: 22px; } .vf-tl-trimh.l { margin-left: -22px; } .vf-tl-trimh::after { left: 10px; } }
.vf-tl-blk.out { opacity: .35; }
.vf-tl-trimbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: .85rem; } .vf-tl-trimbar #tltrimlbl { color: var(--muted); }
@media (max-width: 760px) { .vf-tl-trimbar { order: 2; flex: none; } }
/* Timeline › Dịch chữ trong hình: kéo vùng trên khung video, AI đọc + dịch */
.vf-tl-col { display: grid; gap: 10px; min-width: 0; align-content: start; }
.vf-tl-ocrl { position: absolute; inset: 0; z-index: 4; cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: inset 0 0 0 2px #F2C14E; border-radius: 14px; }
.vf-tl-ocrl[hidden], .vf-tl-ocrl i[hidden], .vf-tl-ocrh[hidden] { display: none; }
.vf-tl-ocrl i { position: absolute; border: 2px solid #F2C14E; background: rgba(242,193,78,.14); box-shadow: 0 0 0 9999px rgba(0,0,0,.38); border-radius: 3px; pointer-events: none; }
.vf-tl-ocrh { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.78); color: #fff; font-size: .78rem; white-space: nowrap; pointer-events: none; }
.vf-tl-ocr { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line, #33373E); font-size: .86rem; }
.vf-tl-ocr[hidden] { display: none; } .vf-tl-ocr > p, .vf-tl-ocr > .actions { grid-column: 1 / -1; margin: 0; }
.vf-tl-ocr img { justify-self: start; max-width: 100%; max-height: 96px; object-fit: contain; border-radius: 6px; background: #000; }
.vf-tl-ocr-b { display: grid; gap: 4px; min-width: 0; } .vf-tl-ocr-b small { color: var(--muted); } .vf-tl-ocr-b p { margin: 0; }
.vf-tl-ocr-b .src { font-size: 1rem; line-height: 1.35; word-break: break-word; } .vf-tl-ocr-b textarea { width: 100%; font-size: max(16px, .9rem); resize: vertical; }
.vf-tl-ocr-b .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
dialog.vf-tl.ocr .vf-tl-sub { display: none; }   /* ẩn phụ đề Việt vẽ đè để thấy rõ chữ gốc */
dialog.vf-tl.ocr .vf-tl-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
dialog.vf-tl.ocr .vf-tl-vid video { max-height: min(56vh, 520px); }
@media (max-width: 760px) { .vf-tl-col { display: contents; } .vf-tl-ocr { order: 1; flex: none; } .vf-tl-ocr img { max-height: 72px; } }
/* Timeline › Vietsub trong hình: xem trước trên video + danh sách vùng */
.vf-tl-ovv { position: absolute; inset: 0; pointer-events: none; z-index: 2; } dialog.vf-tl.ocr .vf-tl-ovv { display: none; }
.vf-tl-ovb { position: absolute; display: grid; place-items: center; overflow: hidden; -webkit-backdrop-filter: blur(9px); backdrop-filter: blur(9px); border-radius: 2px; }
.vf-tl-ovb.box { background: rgba(0,0,0,.59); } .vf-tl-ovb.sel { outline: 1.5px dashed #F2C14E; outline-offset: 1px; }
.vf-tl-ovb span { width: 100%; height: 100%; box-sizing: border-box; display: grid; place-items: center; text-align: center; overflow: hidden; color: #fff; font-family: 'DejaVu Sans', 'Be Vietnam Pro', system-ui, sans-serif; font-weight: 700; line-height: 1.15; -webkit-text-stroke: .09em #000; paint-order: stroke fill; }
.vf-tl-ovl { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface); font-size: .85rem; } .vf-tl-ovl[hidden] { display: none; }
.vf-tl-ovi { display: grid; gap: 6px; padding: 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; cursor: pointer; } .vf-tl-ovi.sel { border-color: #F2C14E; }
.vf-tl-ovi .r { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; } .vf-tl-ovi label { display: inline-flex; align-items: center; gap: 4px; }
.vf-tl-ovi input[type=number] { width: 5.5em; font-size: max(16px, .85rem); } .vf-tl-ovi input[type=text] { width: 100%; font-size: max(16px, .9rem); } .vf-tl-ovi select { font-size: max(16px, .85rem); }
@media (min-width: 761px) { .vf-tl-ovl { max-height: 38vh; overflow: auto; } }
@media (max-width: 760px) { .vf-tl-ovl { order: 5; flex: none; } }
/* Timeline › logo kênh: kéo để dời, kéo góc để đổi cỡ (áp dụng khi Ghép tiếng) */
.vf-tl-logo { position: absolute; z-index: 3; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; outline: 1px dashed rgba(26,28,32,.55); outline-offset: 2px; } .vf-tl-logo[hidden] { display: none; }
.vf-tl-logo.drag { cursor: grabbing; outline-color: #F2C14E; } .vf-tl-logo img { display: block; width: 100%; height: auto; pointer-events: none; }
.vf-tl-logo .rz { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #F2C14E; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: nwse-resize; }
@media (pointer: coarse) { .vf-tl-logo .rz { width: 26px; height: 26px; right: -13px; bottom: -13px; } }
dialog.vf-tl.ocr .vf-tl-logo { display: none; }
.vf-tl-logobar #tllglbl { color: var(--muted); }
/* Timeline › làn Vietsub trong hình: khối tím dưới dải câu, kéo thân = dời, kéo mép = đổi đầu / cuối */
.vf-tl-ovtrack { position: relative; height: 0; } dialog.vf-tl.hasov .vf-tl-ovtrack { height: 32px; border-top: 1px dashed #CBCCCE; }
dialog.vf-tl.hasov .vf-tl-canvas { height: 236px; } dialog.vf-tl.hasov .vf-tl-scroll { min-height: 238px; }
@media (pointer: coarse) { dialog.vf-tl.hasov .vf-tl-ovtrack { height: 38px; } dialog.vf-tl.hasov .vf-tl-canvas { height: 248px; } dialog.vf-tl.hasov .vf-tl-scroll { min-height: 250px; } }
.vf-tl-ovk { position: absolute; top: 4px; bottom: 4px; display: flex; align-items: center; overflow: hidden; border-radius: 6px; background: #6D5BD0; color: #fff; font-size: .7rem; line-height: 1.1; cursor: grab; touch-action: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.vf-tl-ovk.box { background: #9B92D4; } .vf-tl-ovk.sel { box-shadow: 0 0 0 2px #F2C14E; z-index: 2; }
.vf-tl-ovk .tx { flex: 1; min-width: 0; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; } .vf-tl-ovk .tx i { opacity: .75; }
.vf-tl-ovk .h { flex: none; width: 10px; align-self: stretch; cursor: ew-resize; background: rgba(255,255,255,.22); touch-action: none; }
@media (pointer: coarse) { .vf-tl-ovk .h { width: 16px; } }
/* ===== Timeline bố cục v2: video luôn trong tầm nhìn, bảng thuộc tính bên phải, timeline cố định ở đáy ===== */
.vf-tl-body { display: grid; grid-template-rows: minmax(190px, 1fr) auto auto auto; gap: 10px; padding: 12px 16px 14px; overflow: auto; }
.vf-tl-top { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); align-items: stretch; min-height: 0; }
.vf-tl-vid { display: block; min-height: 0; height: 100%; }
.vf-tl-vid video, dialog.vf-tl.ocr .vf-tl-vid video { width: 100%; height: 100%; max-height: none; object-fit: contain; }
dialog.vf-tl.ocr .vf-tl-top { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); }
.vf-tl-insp { min-height: 0; min-width: 0; overflow: auto; display: grid; gap: 10px; align-content: start; padding: 2px 4px 2px 2px; }
.vf-tl-insp > [hidden] { display: none !important; }
.vf-tl-bar { gap: 8px 10px; } .vf-tl-sp { flex: 1; } .vf-tl-time { min-width: 0; }
.vf-tl-helpb { min-width: 34px; font-weight: 800; } .vf-tl-help { flex-basis: 100%; margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--surface); line-height: 1.5; }
.vf-tl-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: .84rem; }
.vf-tl-opts .grp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; } .vf-tl-opts .grp > span { color: var(--muted); }
.vf-tl-ovl { padding: 0; background: none; } .vf-tl-ovi { cursor: default; padding: 0; background: none; border: 0; gap: 10px; }
.vf-tl-ovt { display: grid; gap: 4px; font-weight: 600; font-size: .85rem; } .vf-tl-ovt textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font: inherit; font-size: max(16px, .95rem); color: var(--text); resize: vertical; }
.vf-tl-ovi .vf-tl-nums input { width: 6em; }
/* làn vietsub: chiều cao theo số hàng (--ovh do JS đặt) */
dialog.vf-tl.hasov .vf-tl-ovtrack { height: var(--ovh, 32px); }
dialog.vf-tl.hasov .vf-tl-canvas { height: calc(202px + var(--ovh, 32px)); } dialog.vf-tl.hasov .vf-tl-scroll { min-height: calc(204px + var(--ovh, 32px)); }
.vf-tl-ovk { bottom: auto; }
@media (pointer: coarse) { dialog.vf-tl.hasov .vf-tl-canvas { height: calc(208px + var(--ovh, 38px)); } dialog.vf-tl.hasov .vf-tl-scroll { min-height: calc(210px + var(--ovh, 38px)); } }
/* màn thấp: thu dải timeline cho video còn chỗ */
@media (max-height: 760px) and (min-width: 761px) { .vf-tl-body { grid-template-rows: minmax(160px, 1fr) auto auto auto; } }
/* điện thoại: một cột cuộn dọc, video DÍNH trên cùng khi cuộn */
@media (max-width: 760px) {
  .vf-tl-body { display: flex; flex-direction: column; overflow: auto; padding: 0 12px 14px; gap: 10px; }
  .vf-tl-top { display: contents; }
  .vf-tl-vid { order: 1; position: sticky; top: 0; z-index: 8; flex: none; height: auto; margin: 0 -12px; border-radius: 0 0 12px 12px; }
  .vf-tl-vid video, dialog.vf-tl.ocr .vf-tl-vid video { height: auto; max-height: 34vh; }
  .vf-tl-bar { order: 2; } .vf-tl-opts { order: 3; flex: none; } .vf-tl-scroll { order: 4; } .vf-tl-insp { order: 5; overflow: visible; flex: none; }
  .vf-tl-legend { display: none; }
}
/* node Giọng đọc: 4 giọng theo vai (Nam 1/2, Nữ 1/2) */
.vf-vslots { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.vf-vslots > b { font-size: .85rem; } .vf-vslots > .hint { flex-basis: 100%; margin-top: -4px; }
@media (max-width: 760px) { .vf-vslots { display: grid; } }
/* Timeline › ô chữ do OCR tìm sẵn (chế độ Dịch chữ) */
.vf-tl-ocrd { position: absolute; border: 2px dashed #F2C14E; border-radius: 4px; background: rgba(242,193,78,.12); cursor: pointer; z-index: 1; }
.vf-tl-ocrd:hover, .vf-tl-ocrd.on { background: rgba(242,193,78,.32); border-style: solid; }
@media (pointer: coarse) { .vf-tl-ocrd { border-width: 3px; } }
/* Timeline › Quét chữ cứng */
.vf-tl-scan { display: grid; gap: 8px; padding: 10px; border-radius: 12px; background: var(--surface); font-size: .85rem; }
.vf-tl-scan p { margin: 0; } .vf-tl-scan .actions { display: flex; flex-wrap: wrap; gap: 6px; } .vf-tl-scan select { font-size: max(16px, .85rem); }
.vf-tl-scbar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; } .vf-tl-scbar i { display: block; height: 100%; background: var(--accent); transition: width .6s; }
.vf-tl-scl { display: grid; gap: 4px; max-height: 46vh; overflow: auto; }
.vf-tl-sci { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 6px; align-items: start; padding: 6px; border-radius: 8px; background: var(--surface-2); }
.vf-tl-sci.dup { opacity: .55; } .vf-tl-sci input[type=checkbox] { margin-top: 8px; width: 18px; height: 18px; }
.vf-tl-sci > div { display: grid; gap: 4px; min-width: 0; } .vf-tl-sci .zh { word-break: break-word; } .vf-tl-sci .zh em { color: var(--muted); font-size: .78rem; }
.vf-tl-sci input[type=text] { width: 100%; font-size: max(16px, .88rem); }
@media (max-width: 760px) { .vf-tl-scl { max-height: none; } }
/* Timeline › dải vietsub lời thoại (từ OCR): khung vàng kéo để dời, núm góc để đổi cỡ */
.vf-tl-band { position: absolute; z-index: 3; border: 1.5px dashed #F2C14E; border-radius: 4px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; } .vf-tl-band[hidden] { display: none; }
.vf-tl-band.drag { cursor: grabbing; border-style: solid; }
.vf-tl-band .rz { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #F2C14E; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: nwse-resize; }
@media (pointer: coarse) { .vf-tl-band .rz { width: 26px; height: 26px; right: -13px; bottom: -13px; } }
dialog.vf-tl.ocr .vf-tl-band { display: none; }
.vf-tl-opts .grp[hidden] { display: none; }



/* Dashboard › Video › API tự động (hộp thoại cài đặt + bảng job) */
.vf-jobs { width: 100%; border-collapse: collapse; font-size: .85rem; } .vf-jobs th, .vf-jobs td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } .vf-jobs th { font-weight: 600; color: var(--muted, #9FA2A6); }

