/*
 * TaiVideo.AI — Flatsome Child: CSS chính.
 *
 * PHẦN 1: Chuyển thể nguyên vẹn từ <style> trong file HTML mẫu tĩnh
 *         (tai-video-youtube_13.html) — giữ đúng tên class theo yêu cầu
 *         "tái hiện chính xác 100%".
 * PHẦN 2: CSS mới, dùng để "skin" lại các trạng thái (loading/error/kết
 *         quả/lịch sử) do JS của plugin WP Social Video Downloader
 *         (svd-public.js) điều khiển qua data-svd-* — xem
 *         template-parts/section-hero.php.
 *
 * Lưu ý: theme cố tình KHÔNG enqueue CSS mặc định của plugin
 * (public/css/svd-public.css) — toàn bộ giao diện nằm ở file này để khớp
 * 100% bản thiết kế HTML gốc (tông tím #6C4CFF) thay vì tông cyan/xanh mặc
 * định của plugin.
 */

:root {
	--bg: #ffffff;
	--bg-soft: #f7f6fe;
	--surface: #ffffff;
	--ink: #14121f;
	--muted: #6b6980;
	--line: #eae7f7;
	--primary: #6c4cff;
	--primary-dark: color-mix(in srgb, var(--primary) 80%, black);
	--primary-soft: #f0ecff;
	--violet-2: #9c8cff;
	--black-btn: #14121f;
}

/* ════════════════════════════════════════════════════════════
   PHẦN 1 — CHUYỂN THỂ TỪ HTML MẪU TĨNH
   ════════════════════════════════════════════════════════════ */

.tvd-page-wrap * ,
.tvd-page-wrap *::before,
.tvd-page-wrap *::after { box-sizing: border-box; }

.tvd-page-wrap { background: var(--bg); color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
.tvd-page-wrap img, .tvd-page-wrap svg { max-width: 100%; display: block; }
.tvd-page-wrap a { color: inherit; text-decoration: none; }
.tvd-page-wrap .wrap { max-width: 1440px; margin: 0 auto; padding: 0 40px; }
.tvd-page-wrap h1, .tvd-page-wrap h2, .tvd-page-wrap h3 { font-family: 'Plus Jakarta Sans', sans-serif; letter-spacing: -0.02em; font-weight: 800; margin: 0; }
.tvd-page-wrap p { margin: 0; }
.tvd-page-wrap .mono { font-family: 'IBM Plex Mono', monospace; }
.tvd-page-wrap .eyebrow {
	font-size: 12.5px; font-weight: 700; letter-spacing: 0.08em;
	text-transform: uppercase; color: var(--primary);
	display: inline-flex; align-items: center; gap: 8px;
}
.tvd-page-wrap .eyebrow::before { content: ""; width: 16px; height: 2px; background: var(--primary); display: inline-block; border-radius: 2px; }

/* ---------- NAV ---------- */
nav {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--line);
	font-family: 'Plus Jakarta Sans', sans-serif; color: var(--ink);
}
nav * , nav *::before, nav *::after { box-sizing: border-box; }
nav a { color: inherit; text-decoration: none; }
nav .wrap { max-width: 1440px; margin: 0 auto; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; height: 68px; }
nav .logo { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; }
nav .logo .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); transform: rotate(45deg); }
.tvd-logo-img { max-height: 34px; width: auto; display: block; }
nav .nav-links { display: flex; gap: 32px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
nav .nav-links a:hover { color: var(--ink); }
nav .nav-cta { display: flex; gap: 12px; align-items: center; }
@media (max-width: 860px) { nav .nav-links { display: none; } }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 14.5px;
	border: 1px solid transparent; cursor: pointer; white-space: nowrap; font-family: 'Plus Jakarta Sans', sans-serif;
}
.btn-primary { background: var(--black-btn); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-ghost { color: var(--ink); border-color: var(--line); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); }

/* ---------- HERO ---------- */
.hero { padding: 40px 0 32px; position: relative; overflow: hidden; scroll-margin-top: 88px; }
.hero::before {
	content: ""; position: absolute; top: -220px; left: 50%; transform: translateX(-50%);
	width: 900px; height: 500px; border-radius: 50%;
	background: radial-gradient(circle, rgba(108, 76, 255, 0.16), transparent 70%);
	z-index: 0; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero-head { max-width: 1000px; margin: 0 auto; text-align: center; }
.hero h1 { font-size: clamp(26px, 2.8vw, 40px); font-weight: 800; line-height: 1.2; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p.sub { font-size: 16px; color: var(--muted); max-width: 820px; margin: 0 auto; font-weight: 500; }

.downloader {
	max-width: 960px; margin: 28px auto 0;
	background: var(--surface); border: 2px dashed #d3cbff;
	border-radius: 24px; padding: 40px 32px;
	box-shadow: 0 24px 60px -28px rgba(108, 76, 255, 0.35);
	text-align: center; scroll-margin-top: 88px;
}
.downloader-inner { max-width: 640px; margin: 0 auto; }
.downloader-icon { width: 56px; height: 56px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
/* margin-bottom tăng từ 8px lên 24px vì đã bỏ .downloader-sub (theo yêu cầu) —
   bù lại khoảng cách trước ô nhập link cho khỏi dính sát. */
.downloader h2 { font-size: 22px; font-weight: 800; margin-bottom: 24px; }

.track {
	position: relative; display: flex; align-items: center; gap: 10px;
	background: var(--surface); border: 1.5px solid var(--primary); border-radius: 12px; padding: 6px 6px 6px 16px;
}
.track .link-icon { flex-shrink: 0; color: var(--primary); }
.track input {
	flex: 1; min-width: 0; border: none; outline: none; background: transparent;
	padding: 12px 44px 12px 4px; font-size: 15px; color: var(--ink);
	font-family: 'Plus Jakarta Sans', sans-serif;
}
.track input::placeholder { color: #a8a5be; }

.tvd-paste {
	position: absolute; right: 96px; top: 50%; transform: translateY(-50%);
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; padding: 0; color: var(--primary);
	background: var(--primary-soft); border: none; border-radius: 8px; cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.tvd-paste:hover { background: var(--primary); color: #fff; }

.go-btn {
	flex-shrink: 0; border: none; cursor: pointer;
	background: var(--primary); color: #fff; font-weight: 700; font-size: 14.5px;
	padding: 12px 22px; border-radius: 9px;
	display: flex; align-items: center; gap: 8px; font-family: 'Plus Jakarta Sans', sans-serif;
}
.go-btn:hover { background: var(--primary-dark); }
.go-btn[disabled] { opacity: .7; cursor: progress; }

.options { display: flex; gap: 8px; padding: 16px 0 0; flex-wrap: wrap; justify-content: center; }
.chip-select {
	font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; font-weight: 600;
	color: var(--primary-dark); background: var(--primary-soft); border: 1px solid #e1d9ff;
	padding: 7px 12px; border-radius: 999px;
}
.downloader-note { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 14px; max-width: 960px; margin-left: auto; margin-right: auto; }
.downloader-note a { text-decoration: underline; }

.trust { text-align: center; margin-top: 56px; }
.trust-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.trust-label b { color: var(--ink); }
.logo-row { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; margin-top: 20px; opacity: .55; }
.logo-row span { font-weight: 800; font-size: 16px; color: var(--muted); letter-spacing: .02em; }

.section-tint { background: var(--bg-soft); }

section { padding: 88px 0; scroll-margin-top: 68px; }
/* .col.X (2 lớp) để thắng specificity các rule padding/max-width mặc định
   của Flatsome trên .col (vd .row-small > .col{padding:clamp(...)}). */
.col.section-head { max-width: 600px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin-top: 14px; font-weight: 800; }
.section-head p { color: var(--muted); font-size: 16px; margin-top: 12px; font-weight: 500; }

/* KHÔNG đè display:grid ở đây nữa — [row]/[col] gốc của Flatsome vốn đã là
   flexbox responsive chuẩn (col span="4" => 3 cột đều nhau, tự xuống dòng
   ở mobile qua span__sm). Ép grid từng gây lỗi vỡ layout (col không lấp
   track, order/auto-placement không như flex). Chỉ chỉnh gap. */
/* row style="collapse" đã tắt hẳn đệm mặc định của Flatsome (padding:0
   !important trên .col) — tự set gap chính xác 20px như bản gốc, không lo
   cộng dồn. LƯU Ý: 3 cột flex-basis 33.33% + 2 khoảng gap 20px sẽ VƯỢT
   100% và bị đẩy xuống dòng (2+1) — phải trừ bớt flex-basis mỗi cột đúng
   phần gap chia đều (2 gap × 20px / 3 cột). */
.row.cards { gap: 20px; flex-wrap: nowrap; }
.row.cards > .col.card { flex-basis: calc(33.3333% - 13.334px); max-width: calc(33.3333% - 13.334px); }
@media (max-width: 860px) {
	.row.cards { flex-wrap: wrap; }
	.row.cards > .col.card { flex-basis: 100%; max-width: 100%; }
}
.col.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -18px rgba(108, 76, 255, .28); }
.card-media { width: 100%; height: 150px; background: var(--bg-soft); display: flex; align-items: center; justify-content: center; }
.card-body { padding: 20px; }
.card-body h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.card-body p { font-size: 14.5px; color: var(--muted); font-weight: 500; }

/* Tương tự .row.cards — 6 thẻ span=4 CẦN tự xuống dòng sau mỗi 3 thẻ (giữ
   flex-wrap:wrap mặc định), chỉ trừ bớt flex-basis mỗi thẻ để 3 thẻ + 2 gap
   vừa khít 100% (không bị vỡ thành 2+2+2 do cộng dồn gap vượt quá 100%). */
.row.tools-grid { gap: 20px; }
.row.tools-grid > .col.tool-card { flex-basis: calc(33.3333% - 13.334px); max-width: calc(33.3333% - 13.334px); }
@media (max-width: 860px) { .row.tools-grid > .col.tool-card { flex-basis: 100%; max-width: 100%; } }
/* !important bắt buộc: row style="collapse" khiến Flatsome tự áp
   ".row-collapse>.col{padding:0!important}" — phải thắng !important đó
   mới giữ được padding 24px như thiết kế gốc. */
.col.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 24px !important; transition: transform .2s ease, box-shadow .2s ease; }
.tool-card:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -18px rgba(108, 76, 255, .28); }
.tool-card h3 { font-size: 19px; font-weight: 800; margin-bottom: 18px; }
.tool-img-wrap { background: var(--bg-soft); border-radius: 16px; overflow: hidden; aspect-ratio: 16/10; }
.tool-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tools-cta { text-align: center; margin-top: 32px; }
@media (max-width: 860px) { .tools-grid { grid-template-columns: 1fr; } }

.col.chip-row { padding: 0; }
.tool-chip { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; }
.tool-chip:hover { border-color: var(--primary); color: var(--primary); }

.steps-timeline { position: relative; max-width: 920px; margin: 0 auto; }
.steps-line { position: absolute; top: 24px; left: 80px; right: 80px; height: 2px; background: var(--line); z-index: 0; }
.steps-row { display: flex; justify-content: space-between; position: relative; z-index: 1; }
.col.step { flex: 1; text-align: center; padding: 0 16px; }
.step-num {
	font-weight: 700; font-size: 14px; color: var(--primary); background: var(--primary-soft);
	width: 48px; height: 48px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
	margin: 0 auto 20px; border: 4px solid var(--surface);
}
.step h3 { font-size: 18px; margin-bottom: 10px; font-weight: 700; }
.step p { color: var(--muted); font-size: 14.5px; font-weight: 500; max-width: 260px; margin: 0 auto; }
@media (max-width: 860px) { .steps-line { display: none; } .steps-row { flex-direction: column; gap: 32px; } .step { padding: 0; } }

/* display/grid-template-columns của khối này đã chuyển sang PHẦN 3 (dùng
   flexbox gốc của Flatsome thay vì ép grid) — ở đây chỉ còn margin/order. */
.feature-block:last-child { margin-bottom: 0; }
.feature-block.reverse .fb-img { order: 2; }
.feature-block.reverse .fb-text { order: 1; }
.fb-img { border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 24px 48px -28px rgba(108, 76, 255, .35); overflow: hidden; background: var(--bg-soft); }
.fb-text .eyebrow { margin-bottom: 14px; }
.fb-text h3 { font-size: 26px; font-weight: 800; margin-bottom: 14px; line-height: 1.2; }
.fb-text p { color: var(--muted); font-size: 15.5px; font-weight: 500; }
.fb-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.fb-list li { list-style: none; display: flex; gap: 10px; font-size: 14.5px; color: var(--ink); font-weight: 500; }
.fb-list li::before { content: "✓"; color: var(--primary); font-weight: 800; }

/* display/grid-template-columns của khối này đã chuyển sang PHẦN 3 (áp lên
   .cta-row bằng flexbox gốc, không phải lên chính .cta-final/section nữa). */
.cta-final::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(circle at 15% 30%, rgba(108, 76, 255, .6), transparent 55%); }
.cta-content { position: relative; z-index: 2; padding: 64px 48px; display: flex; flex-direction: column; justify-content: center; }
.cta-final h2 { color: #fff; font-size: clamp(26px, 3.6vw, 38px); margin-bottom: 12px; }
.cta-final p { color: #b6b3c9; font-size: 16px; max-width: 440px; font-weight: 500; margin-bottom: 28px; }
.cta-btns { display: flex; gap: 14px; flex-wrap: wrap; }
.cta-final .btn-primary { background: var(--primary); }
.cta-final .btn-primary:hover { background: var(--primary-dark); }
.cta-final .btn-ghost { color: #fff; border-color: #38364a; }
.cta-image { position: relative; overflow: hidden; clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); }
.cta-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cta-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, var(--black-btn) 0%, rgba(20, 18, 31, .55) 22%, rgba(108, 76, 255, .25) 55%, transparent 75%); }
@media (max-width: 760px) {
	.cta-final { grid-template-columns: 1fr; }
	.cta-image { clip-path: none; min-height: 220px; }
	.cta-content { padding: 48px 28px; text-align: center; align-items: center; }
	.cta-final p { margin-left: auto; margin-right: auto; }
	.cta-btns { justify-content: center; }
}

footer { padding: 64px 0 32px; border-top: 1px solid var(--line); margin-top: 40px; font-family: 'Plus Jakarta Sans', sans-serif; color: var(--ink); }
footer * , footer *::before, footer *::after { box-sizing: border-box; }
footer a { color: inherit; text-decoration: none; }
footer .wrap { max-width: 1440px; margin: 0 auto; padding: 0 40px; }
footer .logo { font-weight: 800; font-size: 20px; display: flex; align-items: center; gap: 8px; }
footer .logo .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); transform: rotate(45deg); }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 320px; margin-top: 12px; font-weight: 500; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; font-weight: 700; }
.footer-col a { display: block; font-size: 14px; color: var(--ink); margin-bottom: 10px; font-weight: 500; }
.footer-col a:hover { color: var(--primary); }
/* Cột footer đến từ Widget (Appearance → Widgets → Chân trang 1/2) — style
   lại .widget-title (do sidebar Flatsome tự bọc) cho khớp .footer-col h4. */
.footer-col--widget .widget-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; display: block; margin-bottom: 14px; }
.footer-col--widget .widget { margin-bottom: 24px; }
.footer-col--widget .widget:last-child { margin-bottom: 0; }
.footer-col--widget p { margin-bottom: 10px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.footer-bottom span { font-size: 13px; color: var(--muted); font-weight: 500; }
.social { display: flex; gap: 14px; }
.social a { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; }
.social svg { width: 15px; height: 15px; fill: var(--primary); }

@media (max-width: 860px) {
	.cards { grid-template-columns: 1fr; }
	.feature-block, .feature-block.reverse { grid-template-columns: 1fr; }
	.feature-block.reverse .fb-img { order: 1; } .feature-block.reverse .fb-text { order: 2; }
	.footer-top { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════
   PHẦN 2 — SKIN LẠI TRẠNG THÁI ĐỘNG CỦA PLUGIN (data-svd-*)
   Selector [data-svd-widget] khớp đúng phần tử gốc do svd-public.js thao tác.
   ════════════════════════════════════════════════════════════ */

.tvd-platforms { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.tvd-platform {
	font-size: 11.5px; font-weight: 600; color: var(--muted); opacity: .45;
	padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
	transition: opacity .25s ease, color .25s ease, border-color .25s ease, transform .25s ease;
}
.tvd-platform.is-active { opacity: 1; color: var(--primary-dark); border-color: var(--primary); transform: translateY(-1px); }

.tvd-spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; display: none; animation: tvd-spin .7s linear infinite; }
[data-svd-widget].is-loading .tvd-spinner { display: inline-block; }
@keyframes tvd-spin { to { transform: rotate(360deg); } }

.svd-message { margin: 16px 0 0; padding: 12px 16px; font-size: 13.5px; font-weight: 600; border-radius: 10px; background: #fef2f2; color: #b42318; border: 1px solid #fecaca; text-align: left; }

.tvd-skeleton { display: none; margin-top: 20px; text-align: left; }
[data-svd-widget].is-loading .tvd-skeleton { display: block; }
[data-svd-widget].is-loading [data-svd-result] { display: none !important; }
.tvd-skel { position: relative; overflow: hidden; background: var(--bg-soft); border-radius: 8px; }
.tvd-skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, .8) 50%, transparent 100%); animation: tvd-shimmer 1.4s ease-in-out infinite; }
@keyframes tvd-shimmer { to { transform: translateX(100%); } }
.tvd-skel--thumb { width: 100%; aspect-ratio: 16/9; border-radius: 12px; margin-bottom: 14px; }
.tvd-skel--line { height: 16px; width: 100%; margin-bottom: 10px; }
.tvd-skel--short { width: 55%; }

.tvd-result { margin-top: 20px; text-align: left; }
.tvd-result-card { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 32px -20px rgba(108, 76, 255, .28); animation: tvd-fade-in .3s ease both; }
@keyframes tvd-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 560px) { .tvd-result-card { grid-template-columns: 200px 1fr; align-items: start; } }
.tvd-result-media { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg-soft); aspect-ratio: 16/9; }
.tvd-result-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tvd-duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(20, 18, 31, .82); border-radius: 6px; }
.tvd-result-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tvd-source { align-self: flex-start; padding: 3px 10px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--primary-dark); background: var(--primary-soft); border-radius: 999px; }
[data-svd-title] { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tvd-downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tvd-downloads .svd-dl {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 8px 14px; font-weight: 700; font-size: 14px;
	color: #fff; background: var(--primary); border-radius: 10px; cursor: pointer; text-decoration: none;
	transition: background-color .2s ease, box-shadow .2s ease;
}
.tvd-downloads .svd-dl:hover { background: var(--primary-dark); }
.tvd-downloads .svd-dl.is-downloading { opacity: .65; cursor: progress; pointer-events: none; }
.tvd-downloads .svd-dl--audio { background: var(--black-btn); }
.tvd-downloads .svd-dl--audio:hover { background: #000; }
.tvd-downloads .svd-dl__meta { font-size: 11.5px; opacity: .85; }
.tvd-copy {
	display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
	padding: 7px 14px; font-size: 13px; font-weight: 700; color: var(--primary-dark);
	background: var(--primary-soft); border: 1.5px solid var(--primary-soft); border-radius: 999px; cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.tvd-copy:hover { background: var(--primary); color: #fff; }
.tvd-copy.is-copied { background: var(--black-btn); color: #fff; }

.tvd-history { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); text-align: left; }
.tvd-history-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tvd-history-head h4 { font-size: 14px; font-weight: 700; }
.tvd-history-clear { font-size: 12.5px; color: var(--muted); background: none; border: none; cursor: pointer; text-decoration: underline; }
.tvd-history-clear:hover { color: #b42318; }
[data-svd-history-list] { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.svd-history__item { display: flex; align-items: stretch; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.svd-history__link { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; padding: 8px; text-align: left; color: var(--ink); background: none; border: none; cursor: pointer; font: inherit; }
.svd-history__thumb { width: 56px; height: 36px; flex: 0 0 auto; object-fit: cover; border-radius: 6px; background: var(--bg-soft); }
.svd-history__title { flex: 1 1 auto; min-width: 0; font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.svd-history__remove { flex: 0 0 auto; width: 34px; font-size: 18px; color: var(--muted); background: none; border: none; border-left: 1px solid var(--line); cursor: pointer; }
.svd-history__remove:hover { color: #fff; background: #b42318; }

/* Rung lắc cảnh báo khi URL trống/sai định dạng (JS toggle .svd-shake) */
.svd-shake { animation: tvd-shake .45s cubic-bezier(.36, .07, .19, .97) both; }
.svd-shake.track { border-color: #b42318; }
@keyframes tvd-shake {
	10%, 90% { transform: translateX(-1px); }
	20%, 80% { transform: translateX(2px); }
	30%, 50%, 70% { transform: translateX(-5px); }
	40%, 60% { transform: translateX(5px); }
}

/* Toast (thông báo nổi, dùng chung toàn site bởi svd-public.js) */
.svd-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); z-index: 99999;
	max-width: min(92vw, 420px); padding: 12px 18px; font-family: 'Plus Jakarta Sans', sans-serif;
	font-size: 14px; font-weight: 600; color: #fff; background: var(--black-btn); border-radius: 10px;
	box-shadow: 0 8px 28px rgba(20, 18, 31, .3); opacity: 0; visibility: hidden;
	transition: opacity .25s ease, transform .25s ease, visibility .25s; pointer-events: none;
}
.svd-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.svd-toast--success { background: #15803d; }
.svd-toast--error { background: #b42318; }

/* ── Re-skin FAQ của plugin ([svd_faq]) để khớp .faq/.faq-item bản gốc ── */
.faq .svd-faq { max-width: 100%; margin: 0; color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif; }
.faq .svd-faq__heading { display: none; } /* Trùng với h2 của section-head nên ẩn tiêu đề mặc định của plugin. */
.faq .svd-faq__item { background: transparent; border: none; border-bottom: 1px solid var(--line); border-radius: 0; margin-bottom: 0; }
.faq .svd-faq__item.active { border-color: var(--line); }
.faq .svd-faq__q { padding: 22px 4px; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.faq .svd-faq__icon::before, .faq .svd-faq__icon::after { background: var(--primary); }
.faq .svd-faq__a-inner { padding: 0 4px 22px; color: var(--muted); font-size: 14.5px; max-width: 680px; }

/* Utility bắt buộc phải có sẵn ở child theme (Flatsome cung cấp, nhưng cứ
   định nghĩa dự phòng để không vỡ layout khi Flatsome chưa active). */
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ════════════════════════════════════════════════════════════
   PHẦN 3 — KHỚP CSS Ở PHẦN 1 VỚI DOM THẬT DO ELEMENT GỐC FLATSOME
   sinh ra (section > .section-content > .row > .col > .col-inner,
   [ux_image] > .img > .img-inner > img, [ux_text] > .text,
   [button] > .button > span). Xem ghi chú đầu file
   inc/native-content.php để biết cấu trúc chính xác từng element.
   ════════════════════════════════════════════════════════════ */

/* [section]'s "padding" attribute chỉ nhận 1 giá trị dùng cho CẢ top lẫn
   bottom (xem inc/builder/core/server/helpers/elements.php) nên không thể
   set top=0/bottom=88px trực tiếp qua đó — section này (Lưới công cụ) cần
   nối liền ngay dưới section phía trên (top=0) nhưng vẫn có khoảng cách
   88px phía dưới. Flatsome tự in padding qua <style> gắn theo #id (đặc
   hiệu cao) nên phải !important mới thắng được. */
section.no-pad-top { padding-top: 0 !important; }

/* Container rộng 1440px khớp bản mẫu (Flatsome mặc định hẹp hơn);
   bỏ qua row full-width (CTA) vì nó cố tình tràn hết chiều ngang. */
.tvd-page-wrap .row:not(.row-full-width) {
	max-width: 1440px; padding-left: 40px; padding-right: 40px;
	margin-left: auto; margin-right: auto;
}

/* [ux_image]: class custom nằm ở div NGOÀI (.img), ảnh thật nằm trong
   .img-inner > img — dùng chung 1 kiểu "phủ kín" cho khối ảnh cần bo góc/
   tỉ lệ cố định (card-media, tool-img-wrap, cta-image). */
.card-media, .tool-img-wrap, .cta-image { position: relative; display: block; }
.card-media .img-inner, .tool-img-wrap .img-inner, .cta-image .img-inner { position: absolute; inset: 0; }
.card-media img, .tool-img-wrap img, .cta-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* .fb-img giờ là chính [col] chứa [ux_image] (ảnh vẫn nằm sâu hơn 2 cấp:
   .img > .img-inner > img) — cỡ tự nhiên, không cần ép tỉ lệ. */
.fb-img img { width: 100%; display: block; }

/* Dải chip nền tảng: [button] nằm trong .col-inner của MỘT cột duy nhất
   (do gộp nhiều [button] cùng 1 [col]) → flex-wrap áp lên .col-inner. */
.chip-row .col-inner { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* 3 bước: .steps-timeline và .steps-row giờ gộp chung vào 1 [row], vẽ
   đường nối bằng ::before thay vì div .steps-line rời như bản gốc. */
.steps-timeline { position: relative; max-width: 920px; }
.steps-timeline::before {
	content: ""; position: absolute; top: 24px; left: 80px; right: 80px; height: 2px;
	background: var(--line); z-index: 0;
}
.steps-timeline.steps-row { display: flex; justify-content: space-between; }
.steps-timeline > .col { position: relative; z-index: 1; }
@media (max-width: 860px) {
	.steps-timeline::before { display: none; }
	.steps-timeline.steps-row { flex-direction: column; gap: 32px; }
}

/* Feature blocks: DÙNG THẲNG flexbox gốc của [row]/[col] Flatsome (span="6"
   + span="6" đã tự chia đôi đều, span__sm="12" đã tự xuống dòng ở mobile) —
   không ép display:grid nữa (từng gây lỗi vỡ layout vì auto-placement của
   grid không tương thích cách Flatsome tính chiều rộng cột theo %).
   .fb-img/.fb-text là 2 [col] con trực tiếp, order vẫn hoạt động bình
   thường trong flexbox y như thiết kế gốc. */
/* row style="collapse" đã tắt đệm mặc định — tự set gap 56px đúng bản gốc.
   LƯU Ý: cột Flatsome dùng flex-basis:50%/max-width:50% (2 cột vừa khít
   100%) — cộng thêm "gap" sẽ vượt quá 100% và bị flex-wrap đẩy xuống dòng
   (vỡ layout y hệt lỗi trước). Phải trừ bớt flex-basis/max-width của MỖI
   cột đúng bằng nửa gap để 2 cột + gap vẫn vừa đúng 100%. */
.row.feature-block { gap: 56px; margin-bottom: 88px; flex-wrap: nowrap; }
.row.feature-block > .col.fb-img, .row.feature-block > .col.fb-text {
	flex-basis: calc(50% - 28px); max-width: calc(50% - 28px);
}
@media (max-width: 860px) {
	.row.feature-block { flex-wrap: wrap; }
	.row.feature-block > .col.fb-img, .row.feature-block > .col.fb-text { flex-basis: 100%; max-width: 100%; }
}
.row.feature-block:last-child { margin-bottom: 0; }
.row.feature-block.reverse .fb-img { order: 2; }
.row.feature-block.reverse .fb-text { order: 1; }

/* CTA cuối trang: nền/bo góc/overlay đặt trên <section>; 2 cột dùng flexbox
   gốc của [row] (span="7"/span="5" đã tự chia theo đúng tỉ lệ ~58/42, gần
   khớp tỉ lệ 1.15fr/.85fr bản gốc — không cần ép grid). */
section.cta-final {
	background: var(--black-btn); border-radius: 24px; position: relative; overflow: hidden;
	max-width: 1440px; margin: 0 40px;
}
@media (min-width: 1521px) { section.cta-final { margin-left: auto; margin-right: auto; } }
section.cta-final::before {
	content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
	background: radial-gradient(circle at 15% 30%, rgba(108, 76, 255, .6), transparent 55%);
}
section.cta-final .section-content { position: relative; z-index: 2; }
.cta-final .row.cta-row { align-items: stretch; min-height: 340px; max-width: none; padding: 0; margin: 0; }
/* !important bắt buộc — lý do tương tự .col.tool-card (cta-row cũng dùng
   style="collapse"). */
.cta-final .cta-content { padding: 64px 48px !important; display: flex; flex-direction: column; justify-content: center; box-sizing: border-box; }
.cta-final h2 { color: #fff; font-size: clamp(26px, 3.6vw, 38px); margin-bottom: 12px; }
.cta-final p { color: #b6b3c9; font-size: 16px; max-width: 440px; font-weight: 500; margin: 0 0 28px; }
.cta-final .cta-content .button { margin-right: 14px; margin-bottom: 14px; }
.cta-final .cta-image { position: relative; height: 100%; min-height: 260px; clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%); }
.cta-final .cta-image::after {
	content: ""; position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(115deg, var(--black-btn) 0%, rgba(20, 18, 31, .55) 22%, rgba(108, 76, 255, .25) 55%, transparent 75%);
}
@media (max-width: 760px) {
	.cta-final .row.cta-row { flex-direction: column; }
	.cta-final .cta-image { clip-path: none; min-height: 220px; }
	.cta-final .cta-content { padding: 48px 28px !important; text-align: center; align-items: center; }
	.cta-final p { margin-left: auto; margin-right: auto; }
}

/* [button] gốc → <a class="button {color} {my-class}"><span>text</span></a>.
   Reset toàn bộ style mặc định của Flatsome (uppercase, box-shadow, height cố
   định...) rồi vẽ lại đúng thiết kế gốc. */
.button.btn-primary, .button.btn-ghost, .button.tool-chip {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: auto; line-height: normal; text-transform: none; letter-spacing: normal;
	box-shadow: none; font-family: 'Plus Jakarta Sans', sans-serif;
}
.button.btn-primary { background: var(--black-btn); color: #fff; border: 1px solid transparent; border-radius: 999px; padding: 11px 22px; font-weight: 700; font-size: 14.5px; }
.button.btn-primary:hover { background: #000; color: #fff; }
.button.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 11px 22px; font-weight: 700; font-size: 14.5px; }
.button.btn-ghost:hover { border-color: var(--ink); background: transparent; }
.cta-final .button.btn-ghost { color: #fff; border-color: #38364a; }
.cta-final .button.btn-ghost:hover { border-color: #fff; }
/* CTA dùng nút tím (--primary) thay vì đen mặc định — cần specificity cao
   hơn rule .button.btn-primary chung ở trên (mới thêm sau, cùng-đặc-hiệu). */
.cta-final .cta-content .button.btn-primary { background: var(--primary); }
.cta-final .cta-content .button.btn-primary:hover { background: var(--primary-dark); }
.button.tool-chip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 600; }
.button.tool-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }
