/*
Theme Name: SnapTik Clone
Theme URI: https://snaptik.vn
Author: SnapTik
Description: WordPress theme clone snaptik.vn - TikTok Video Downloader với SEO đa ngôn ngữ
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: snaptik
*/

/* =============================================
   RESET & BASE
============================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #18bc9c;
  --red-dark: #d4173a;
  --red-light: #ff4d6a;
  --black: #121212;
  --dark: #1a1a1a;
  --dark2: #242424;
  --dark3: #2e2e2e;
  --gray: #888;
  --gray-light: #aaa;
  --white: #fff;
  --white-soft: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--red);
}

img {
  max-width: 100%;
  display: block;
}

/* =============================================
   HEADER / NAVBAR
============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.5px;
}

.site-logo span {
  color: var(--red);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--white);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.lang-btn svg {
  width: 14px;
  height: 14px;
}

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 160px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 200;
}

.lang-switcher:hover .lang-dropdown,
.lang-dropdown.open {
  display: block;
}

.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  transition: var(--transition);
}

.lang-dropdown a:hover {
  background: var(--white-soft);
}

.lang-dropdown a.active {
  color: var(--red);
  font-weight: 600;
}

.lang-flag {
  font-size: 16px;
}

/* =============================================
   HERO SECTION
============================================= */
.hero {
  background: linear-gradient(180deg, #1a0008 0%, var(--black) 100%);
  padding: 60px 24px 48px;
  text-align: center;
}

.hero-inner {
  max-width: 1220px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(26px, 5vw, 42px);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-desc {
  font-size: 16px;
  color: var(--gray-light);
  max-width: 1000px;
  margin: 0 auto 32px;
  line-height: 1.7;
}


/* URL Input box — see responsive fix section below */



/* Browser extensions */
.ext-links {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ext-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition);
}

.ext-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.ext-link-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.ext-link-meta {
  display: flex;
  flex-direction: column;
}

.ext-link-name {
  font-weight: 600;
  font-size: 13px;
}

.ext-link-source {
  font-size: 11px;
  color: var(--gray);
}

/* =============================================
   TABLE OF CONTENTS (anchor nav)
============================================= */
.toc-nav {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin-bottom: 36px;
  background: var(--white-soft);
}

.toc-list {
  list-style: decimal;
  margin: 0;
  padding: 0 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-list li {
  color: var(--gray);
  font-size: 14px;
  line-height: 1.6;
}

.toc-link {
  display: inline;
  font-size: 14px;
  font-weight: 400;
  color: var(--gray-light);
  text-decoration: none;
  transition: var(--transition);
}

.toc-link:hover {
  color: var(--red);
  text-decoration: underline;
}

.toc-link.is-active {
  color: var(--red);
  font-weight: 500;
}

/* =============================================
   MAIN CONTENT
============================================= */
.site-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Section headings */
.site-main h2 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin: 48px 0 20px;
  padding-top: 8px;
  color: var(--white);
  letter-spacing: -0.3px;
}

.site-main h2:first-child {
  margin-top: 0;
}

.site-main h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--white);
}

.site-main p {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 16px;
}

.site-main strong {
  color: var(--white);
}

.site-main ul,
.site-main ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.site-main li {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 8px;
}

/* Content images — WP editor emits <figure style="width:1024px"> which overflows
   mobile. The inline width must be overridden to stop the horizontal scroll. */
.content-img {
  border-radius: var(--radius);
  margin: 20px 0;
  width: 100%;
  border: 1px solid var(--border);
}

.entry-content img,
.cms-content img,
.entry-content video,
.cms-content video,
.entry-content iframe,
.cms-content iframe {
  max-width: 100%;
  height: auto;
}

.entry-content figure,
.cms-content figure,
.entry-content .wp-caption,
.cms-content .wp-caption {
  max-width: 100%;
  width: auto !important;
  margin-left: auto;
  margin-right: auto;
}

.entry-content .wp-caption img,
.cms-content .wp-caption img {
  width: 100%;
  display: block;
}

.entry-content .aligncenter,
.cms-content .aligncenter {
  max-width: 100%;
}

.entry-content .wp-caption-text,
.cms-content .wp-caption-text,
.entry-content figcaption,
.cms-content figcaption {
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}

[data-mode="light"] .entry-content .wp-caption-text,
[data-mode="light"] .cms-content .wp-caption-text,
[data-mode="light"] .entry-content figcaption,
[data-mode="light"] .cms-content figcaption {
  color: #888;
}

.content-img-caption {
  font-size: 13px;
  color: var(--gray);
  text-align: center;
  margin-top: -12px;
  margin-bottom: 20px;
  font-style: italic;
}

/* =============================================
   HOW-TO STEPS
============================================= */
.howto-steps {
  counter-reset: step;
  margin: 24px 0;
}

.howto-step {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

.howto-step-num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  margin-top: 2px;
}

.howto-step-content p {
  margin-bottom: 0;
}

/* =============================================
   FEATURES GRID
============================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.feature-card {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: rgba(254, 44, 85, 0.3);
  background: var(--dark3);
}

.feature-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

.feature-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--white);
}

.feature-desc {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.6;
}

/* =============================================
   FAQ SECTION
============================================= */
.faq-list {
  margin: 24px 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.open {
  border-color: rgba(254, 44, 85, 0.3);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--dark2);
  border: none;
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  gap: 16px;
  font-family: var(--font);
}

.faq-question:hover {
  background: var(--dark3);
}

.faq-item.open .faq-question {
  background: var(--dark3);
}

.faq-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--red);
}

.faq-answer {
  display: none;
  padding: 16px 20px;
  color: var(--gray-light);
  font-size: 15px;
  line-height: 1.7;
  background: var(--dark);
}

.faq-item.open .faq-answer {
  display: block;
}

/* =============================================
   DOWNLOAD RESULT MODAL
============================================= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 720px;
  width: 100%;
  max-height: min(760px, calc(100vh - 48px));
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-end: 16px;
  background: none;
  border: none;
  color: var(--gray);
  font-size: 22px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--white);
}

.modal-close:focus-visible,
.btn-dl-option:focus-visible {
  outline: 3px solid rgba(254, 44, 85, 0.45);
  outline-offset: 3px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-block: 0 8px;
  margin-inline: 0 36px;
}

.modal-status {
  min-height: 1.5em;
  margin-bottom: 12px;
  color: var(--gray-light);
  font-size: 14px;
  line-height: 1.5;
}

.modal-status.is-error {
  color: #ff7088;
}

.modal-status.is-success {
  color: #8de0a7;
}

.modal-status.is-loading::before {
  content: '';
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-inline-end: 8px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: snaptik-status-spin 0.8s linear infinite;
  vertical-align: -0.05em;
}

@keyframes snaptik-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-region {
  margin-bottom: 20px;
}

.progress-bar {
  position: relative;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar.is-indeterminate .progress-fill {
  width: 42% !important;
  animation: snaptik-progress-indeterminate 1.15s ease-in-out infinite;
  transition: none;
}

@keyframes snaptik-progress-indeterminate {
  from {
    transform: translateX(-120%);
  }

  to {
    transform: translateX(290%);
  }
}

.progress-text {
  display: block;
  min-height: 1.25em;
  margin-top: 6px;
  color: var(--gray);
  font-size: 12px;
  text-align: end;
}

.download-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-download-another {
  width: 100%;
  padding: 13px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gray-light);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-download-another:hover {
  border-color: var(--red);
  color: var(--white);
}

.btn-download-another[hidden] {
  display: none !important;
}

.btn-download-another[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}

.download-preview {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--dark3);
  min-width: 0;
}

.download-preview[hidden],
.download-actions[hidden],
.download-image-grid[hidden] {
  display: none !important;
}

.download-preview.has-thumbnail {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
}

.download-preview-thumb {
  width: 104px;
  height: 136px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--dark);
}

.download-preview-meta {
  min-width: 0;
}

.download-preview-title {
  margin: 0;
  color: var(--white);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.download-preview-author {
  margin: 6px 0 0;
  color: var(--gray-light);
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.download-preview-description {
  display: -webkit-box;
  margin: 8px 0 0;
  color: var(--gray-light);
  font-size: 13px;
  line-height: 1.55;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.download-preview-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 10px 0 0;
  color: var(--gray);
  font-size: 12px;
}

.download-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.btn-dl-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-dl-option:hover {
  background: var(--red);
  border-color: var(--red);
}

.btn-dl-option .download-action-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.btn-dl-option .download-action-detail {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--gray);
  font-weight: 400;
}

.btn-dl-option:hover .download-action-detail {
  color: rgba(255, 255, 255, 0.8);
}

/* Phase 5 uses these same controls for real downloads; the attribute reflects
   only the brief busy state while an individual file is being saved. */
.btn-dl-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.58;
}

.btn-dl-option[aria-disabled="true"]:hover {
  background: var(--dark3);
  border-color: var(--border);
}

.btn-dl-option.is-busy:focus-visible {
  outline-color: rgba(254, 44, 85, 0.75);
}

.download-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.download-image-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--dark3);
}

.download-image-card img {
  width: 100%;
  aspect-ratio: 9 / 14;
  object-fit: cover;
  border-radius: 6px;
  background: var(--dark);
}

.download-image-card.has-image-error img {
  display: none;
}

.download-image-card .image-dl-btn {
  width: 100%;
  margin-top: auto;
}

/* =============================================
   COOKIE BANNER
============================================= */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--dark2);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 400;
  font-size: 14px;
  color: var(--gray-light);
}

.cookie-banner a {
  color: var(--red);
}

.btn-cookie-accept {
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-cookie-accept:hover {
  background: var(--red-dark);
}

/* =============================================
   FOOTER
============================================= */
.site-footer {
  background: var(--dark);
  border-top: 1px solid var(--border);
  padding: 40px 24px 24px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
}

.footer-brand {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 800;
}

.footer-brand span {
  color: var(--red);
}

.footer-tagline {
  color: var(--gray);
  font-size: 14px;
  margin-bottom: 24px;
  max-width: 400px;
  line-height: 1.6;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  margin-bottom: 12px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  font-size: 14px;
  color: var(--gray-light);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--white);
}

.footer-social {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--gray-light);
  transition: var(--transition);
}

.social-link:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.25);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 13px;
  color: var(--gray);
}

.footer-copyright a {
  color: var(--gray-light);
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--gray);
  max-width: 500px;
  text-align: right;
}

/* =============================================
   CMS PAGES (Privacy, Terms, Contact, About)
============================================= */
.cms-hero {
  background: linear-gradient(180deg, #1a0008 0%, var(--black) 100%);
  padding: 60px 24px 40px;
  text-align: center;
}

.cms-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  margin-bottom: 12px;
}

.cms-hero .cms-meta {
  font-size: 14px;
  color: var(--gray);
}

.cms-hero .cms-meta a {
  color: var(--gray-light);
}

.cms-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.cms-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--white);
}

.cms-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--white);
}

.cms-content p {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 16px;
}

.cms-content ul,
.cms-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.cms-content li {
  color: var(--gray-light);
  line-height: 1.75;
  margin-bottom: 8px;
}

.cms-content a {
  color: var(--red);
}

.cms-content a:hover {
  text-decoration: underline;
}

/* Contact form */
.contact-form {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: 32px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-light);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--dark3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--white);
  font-size: 15px;
  font-family: var(--font);
  transition: var(--transition);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--red);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

.form-select {
  appearance: none;
  cursor: pointer;
}

.btn-submit {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  font-family: var(--font);
}

.btn-submit:hover {
  background: var(--red-dark);
}

/* =============================================
   HERO FEATURE BADGES
============================================= */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 24px auto 0;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid rgba(254, 44, 85, 0.25);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-light);
  background: rgba(254, 44, 85, 0.06);
  white-space: nowrap;
  line-height: 1;
  transition: var(--transition);
}

.hero-badge svg {
  flex-shrink: 0;
}

.hero-badge:hover {
  border-color: rgba(254, 44, 85, 0.5);
  color: var(--white);
  background: rgba(254, 44, 85, 0.12);
}

/* Light mode */
[data-mode="light"] .hero-badge {
  border-color: rgba(254, 44, 85, 0.2);
  background: rgba(254, 44, 85, 0.05);
  color: #666;
}

[data-mode="light"] .hero-badge:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(254, 44, 85, 0.08);
}

@media (max-width: 600px) {
  .hero-badges {
    gap: 6px;
  }

  .hero-badge {
    font-size: 12px;
    padding: 5px 11px;
    gap: 5px;
  }
}

/* =============================================
   RESPONSIVE
============================================= */
@media (max-width: 768px) {
  .site-header {
    padding: 0 16px;
  }

  .hero {
    padding: 40px 16px 32px;
  }

  .site-main {
    padding: 32px 16px 60px;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-inner {
    padding: 0;
  }

  .footer-disclaimer {
    text-align: left;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .toc-nav {
    padding: 12px 16px;
  }

  .cms-hero {
    padding: 40px 16px 32px;
  }

  .modal-overlay {
    align-items: flex-start;
    padding: 16px;
    overflow-y: auto;
  }

  .modal-box {
    max-height: none;
    margin: auto 0;
    padding: 24px 20px;
  }

  .download-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .ext-links {
    flex-direction: column;
    align-items: center;
  }

  .download-preview.has-thumbnail {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
  }

  .download-preview-thumb {
    width: 76px;
    height: 104px;
  }

  .download-actions {
    grid-template-columns: 1fr;
  }

  .download-image-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   HEADER MENU NAV (from admin settings)
============================================= */
.header-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin: 0 16px;
}

.header-menu-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--gray-light);
  transition: var(--transition);
  white-space: nowrap;
}

.header-menu-link:hover {
  color: var(--white);
  background: var(--white-soft);
}

/* Header actions group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Dark/Light Mode Toggle button */
.mode-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--white-soft);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  transition: var(--transition);
  flex-shrink: 0;
}

.mode-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* =============================================
   FOOTER — 3 COLUMNS (match snaptik.vn screenshot)
============================================= */
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.footer-brand-logo {
  display: inline-block;
  font-size: 20px;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.footer-tagline-small {
  font-size: 13px;
  color: var(--gray);
  margin-bottom: 10px;
}

.footer-desc {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.65;
  max-width: 320px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--gray);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col li {
  margin-bottom: 12px;
}

.footer-col a {
  font-size: 14px;
  color: var(--gray-light);
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--white);
}

/* Bottom bar */
.footer-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-copyright {
  font-size: 13px;
  color: var(--gray);
}

.footer-copyright a {
  color: var(--gray-light);
  transition: var(--transition);
}

.footer-copyright a:hover {
  color: var(--white);
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--gray);
  max-width: 520px;
  text-align: right;
  line-height: 1.5;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-disclaimer {
    text-align: left;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .header-menu {
    display: none;
  }
}

/* =============================================
   DOWNLOADER BOX — RESPONSIVE FIX
============================================= */
.downloader-box {
  background: var(--dark2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 680px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 32px rgba(254, 44, 85, 0.15);
}

/* Download and paste actions share a compact row. */
.downloader-actions-row {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.url-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 14px;
  padding: 8px 6px;
  outline: none;
  font-family: var(--font);
}

.url-input::placeholder {
  color: var(--gray);
}

/* Download button fills the action row beside the small paste control. */
.btn-download {
  display: block;
  flex: 1;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
  text-align: center;
  text-decoration: none;
}

.btn-download:hover {
  background: var(--red-dark);
}

.btn-download:active {
  transform: scale(0.99);
}

.btn-download[aria-disabled="true"] {
  opacity: 0.62;
  cursor: not-allowed;
}

/* Paste button */
.btn-paste {
  flex-shrink: 0;
  min-width: 52px;
  height: 44px;
  background: var(--white-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--gray-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  position: relative;
}

.btn-paste:hover {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-paste:disabled {
  cursor: progress;
  opacity: 0.7;
}

.paste-status {
  width: 100%;
  margin: -1px 0 0;
  color: var(--gray-light);
  font-size: 12px;
  line-height: 1.35;
  text-align: start;
}

.paste-status.is-error {
  color: #ff7088;
}

.paste-status.is-success {
  color: #8de0a7;
}

/* Keep the paste control available on mobile without focusing the input. */
@media (max-width: 520px) {
  .downloader-box {
    padding: 12px;
  }

  .url-input {
    font-size: 15px;
    padding: 10px 4px;
  }

  .btn-download {
    font-size: 16px;
    padding: 15px;
  }

  .btn-paste {
    height: 50px;
    min-width: 58px;
  }
}

/* Desktop: trở lại layout cũ (1 row) nếu màn đủ rộng */
@media (min-width: 521px) {
  .downloader-box {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px;
  }

  .paste-status {
    flex-basis: 100%;
  }

  .downloader-actions-row {
    width: auto;
    flex: 0 0 auto;
  }

  .btn-download {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 11px 24px;
  }

  .btn-paste {
    height: 42px;
  }
}

/* Light mode overrides for paste */
[data-mode="light"] .btn-paste {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #555;
}

[data-mode="light"] .btn-paste:hover {
  background: rgba(0, 0, 0, 0.09);
  color: #1d1d1d;
}

[data-mode="light"] .paste-status.is-success {
  color: #1d7a1d;
}

[data-mode="light"] .paste-status.is-error {
  color: #b7233d;
}

/* =============================================
   TOOL LAYOUT VARIANTS
   Classic (dark) là mặc định — không cần override.
   Chọn layout tại: Admin → SnapTik → 🎨 Giao diện Tool
============================================= */

/* ----- SnapSave (sáng, giống screenshot) ----- */
.tool-layout--snapsave.hero,
.tool-layout--snapsave.cms-tool {
  background: linear-gradient(180deg, #ffd6e0 0%, #f4f4f6 100%);
  padding: 56px 24px 44px;
}

.tool-layout--snapsave.hero h1,
.tool-layout--snapsave.cms-tool .downloader-box~* h1 {
  color: #111;
  font-size: clamp(28px, 5vw, 44px);
}

.tool-layout--snapsave .hero-desc {
  color: #555;
}

.tool-layout--snapsave .downloader-box {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px;
  padding: 10px 10px 10px 16px;
  box-shadow: 0 10px 36px rgba(254, 44, 85, 0.12);
}

.tool-layout--snapsave .url-input {
  color: #222;
}

.tool-layout--snapsave .url-input::placeholder {
  color: #999;
}

.tool-layout--snapsave .btn-paste {
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  color: #555;
  border-radius: 12px;
}

.tool-layout--snapsave .btn-paste:hover {
  background: #e6e6e6;
  color: #222;
  border-color: #d0d0d0;
}

.tool-layout--snapsave .btn-download {
  background: #00c896;
  border-radius: 12px;
  font-weight: 700;
  color: #fff;
}

.tool-layout--snapsave .btn-download:hover {
  background: #00b084;
}

.tool-layout--snapsave .hero-badge {
  background: #ffe0e8;
  border-color: #ffc2d0;
  color: #333;
}

.tool-layout--snapsave .hero-badge svg path {
  stroke: #00c896;
}

.tool-layout--snapsave .hero-badge:hover {
  background: #ffd0dc;
  border-color: #ff9bb3;
  color: #111;
}

.tool-layout--snapsave .paste-status {
  color: #666;
}

.tool-layout--snapsave .paste-status.is-success {
  color: #1d7a1d;
}

.tool-layout--snapsave .paste-status.is-error {
  color: #b7233d;
}

/* ----- Compact (thanh mảnh, bo tròn) ----- */
.tool-layout--compact.hero,
.tool-layout--compact.cms-tool {
  padding: 36px 24px 28px;
}

.tool-layout--compact .hero h1 {
  font-size: clamp(22px, 4vw, 32px);
  margin-bottom: 10px;
}

.tool-layout--compact .hero-desc {
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 820px;
}

.tool-layout--compact .downloader-box {
  border-radius: 999px;
  max-width: 820px;
  padding: 8px 8px 8px 20px;
  box-shadow: 0 4px 20px rgba(254, 44, 85, 0.12);
}

.tool-layout--compact .btn-download {
  border-radius: 999px;
  padding: 11px 28px;
}

.tool-layout--compact .btn-paste {
  border-radius: 999px;
}

.tool-layout--compact .hero-badges {
  margin-top: 16px;
  gap: 6px;
}

.tool-layout--compact .hero-badge {
  font-size: 12px;
  padding: 4px 11px;
}

/* CMS tool section — tách khỏi content */
.cms-tool {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cms-tool .hero-inner {
  max-width: 900px;
}

/* Mobile */
@media (max-width: 520px) {
  .tool-layout--snapsave .downloader-box {
    padding: 10px;
    border-radius: 12px;
  }

  .tool-layout--compact .downloader-box {
    border-radius: 16px;
    padding: 10px;
  }

  .tool-layout--compact .btn-download {
    border-radius: 12px;
  }

  .tool-layout--compact .btn-paste {
    border-radius: 12px;
  }
}

/* =============================================
   VISUAL REFRESH — polished downloader experience
============================================= */
:root {
  --page-glow: color-mix(in srgb, var(--red) 24%, transparent);
  --surface: rgba(255, 255, 255, 0.055);
  --surface-strong: rgba(255, 255, 255, 0.085);
}

body {
  background:
    radial-gradient(900px 480px at 50% -180px, var(--page-glow), transparent 68%),
    var(--black);
}

.site-header {
  height: 72px;
  padding-inline: clamp(18px, 4vw, 56px);
  background: rgba(18, 18, 20, 0.78);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-logo {
  font-size: 24px;
  letter-spacing: -1px;
}

.header-menu {
  gap: 6px;
  margin-inline: 28px;
}

.header-menu-link {
  padding: 8px 12px;
  border-radius: 999px;
}

.header-menu-link:hover {
  color: var(--white);
  transform: translateY(-1px);
}

.mode-toggle,
.lang-btn {
  min-height: 38px;
}

.mode-toggle:hover,
.lang-btn:hover {
  transform: translateY(-1px);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(58px, 8vw, 100px) 24px 60px;
  background:
    radial-gradient(600px 260px at 50% 0%, var(--page-glow), transparent 72%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 80%);
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
}

.hero::before {
  width: 210px;
  height: 210px;
  left: -105px;
  top: 5%;
  background: var(--page-glow);
  opacity: .38;
}

.hero::after {
  width: 160px;
  height: 160px;
  right: -60px;
  bottom: 18%;
  background: rgba(42, 208, 184, .13);
}

.hero-inner {
  max-width: 940px;
}

.hero h1 {
  max-width: 900px;
  margin-inline: auto;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -1.8px;
  line-height: 1.08;
  text-wrap: balance;
}

.hero-desc {
  max-width: 720px;
  margin-bottom: 34px;
  font-size: clamp(15px, 1.8vw, 18px);
}

.downloader-box {
  max-width: 790px;
  min-height: 70px;
  padding: 9px 10px 9px 18px;
  border-radius: 18px;
  background: rgba(35, 35, 40, .76);
  border-color: rgba(255, 255, 255, .13);
  box-shadow: 0 22px 60px rgba(0, 0, 0, .3), 0 0 0 5px rgba(255, 255, 255, .018);
}

.downloader-box:focus-within {
  border-color: color-mix(in srgb, var(--red) 72%, white);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35), 0 0 0 4px var(--page-glow);
}

.url-input {
  font-size: 15px;
  padding: 13px 8px;
}

.btn-paste {
  height: 48px;
  min-width: 66px;
  border-radius: 12px;
  font-weight: 600;
}

.btn-download {
  padding: 14px 27px;
  border-radius: 12px;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--red) 32%, transparent);
}

.btn-download:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.hero-badges {
  margin-top: 26px;
  gap: 10px;
}

.hero-badge {
  padding: 8px 13px;
  background: rgba(255, 255, 255, .035);
  border-color: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
}

.site-main {
  max-width: 960px;
  padding-top: 64px;
}

.site-main--with-toc {
  max-width: 1220px;
}

.article-layout {
  min-width: 0;
}

.site-main--with-toc .article-layout {
  display: grid;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.toc-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 2px 4px 2px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.site-main--with-toc .toc-nav {
  margin: 0;
}

.article-content {
  min-width: 0;
}

.toc-nav {
  position: relative;
  overflow: hidden;
  padding: 22px 26px;
  border-radius: 16px;
  background: var(--surface);
}

.toc-nav::before {
  content: attr(aria-label);
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
}

.toc-list {
  list-style: none;
  padding: 0;
  gap: 2px;
  counter-reset: toc;
}

.toc-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 2px;
  align-items: start;
  margin: 0;
  counter-increment: toc;
}

.toc-list li::before {
  content: counter(toc, decimal-leading-zero);
  padding-top: 5px;
  color: var(--gray);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.toc-link {
  display: inline-block;
  padding: 4px 0;
  line-height: 1.5;
}

.toc-link.is-active {
  color: var(--red);
}

.toc-link.is-active::after {
  content: '';
  display: block;
  width: 24px;
  height: 2px;
  margin-top: 2px;
  border-radius: 2px;
  background: currentColor;
}

.site-main h2 {
  position: relative;
  margin-top: 58px;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -.7px;
}

.site-main h2::before {
  content: '';
  display: block;
  width: 38px;
  height: 3px;
  margin-bottom: 14px;
  border-radius: 99px;
  background: var(--red);
}

.site-main h3 {
  font-size: 19px;
}

.site-main p,
.site-main li {
  font-size: 16px;
}

.entry-content> :first-child {
  margin-top: 0;
}

.entry-content>p:first-child {
  font-size: 17px;
  line-height: 1.8;
}

.entry-content a,
.cms-content a {
  color: var(--red);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--red) 42%, transparent);
  text-underline-offset: 3px;
}

.features-grid {
  gap: 18px;
}

.feature-card {
  padding: 26px;
  border-radius: 16px;
  background: var(--surface);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, .18);
}

.feature-icon {
  font-size: 30px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  margin: 0;
  border-radius: 14px;
  background: var(--surface);
}

.faq-question {
  padding: 18px 20px;
  background: transparent;
}

.faq-question:hover,
.faq-item.open .faq-question {
  background: var(--surface-strong);
}

.faq-answer {
  background: rgba(0, 0, 0, .11);
  padding: 18px 20px;
}

.site-footer {
  margin-top: 20px;
  padding: 54px clamp(18px, 4vw, 56px) 28px;
  background: rgba(255, 255, 255, .018);
}

.footer-inner {
  max-width: 1120px;
}

.footer-grid {
  gap: 56px;
}

.footer-brand-logo {
  font-size: 23px;
}

.footer-col a:hover {
  color: var(--red);
}

@media (max-width: 768px) {
  .site-header {
    height: 64px;
    padding-inline: 16px;
  }

  .hero {
    padding: 54px 16px 42px;
  }

  .hero h1 {
    letter-spacing: -1.2px;
  }

  .site-main {
    padding: 42px 16px 64px;
  }

  .site-main--with-toc .article-layout {
    display: block;
  }

  .toc-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    margin-bottom: 34px;
  }

  .toc-nav {
    padding: 18px 20px;
  }

  .site-main h2 {
    margin-top: 46px;
  }

  .site-footer {
    padding: 42px 20px 24px;
  }
}

@media (max-width: 520px) {
  .downloader-box {
    padding: 12px;
    border-radius: 16px;
  }

  .url-input {
    min-height: 48px;
    padding: 8px 4px;
  }

  .btn-paste {
    min-width: 72px;
    height: 52px;
  }

  .btn-download {
    padding: 15px 16px;
  }

  .hero-badges {
    gap: 7px;
  }

  .hero-badge {
    padding: 7px 10px;
  }

  .site-main p,
  .site-main li {
    font-size: 15px;
  }
}

/* =============================================
   SNAPSAVE — CLEAN SAAS HOMEPAGE SYSTEM
   All downloader IDs/classes remain unchanged for downloader.js.
============================================= */
:root {
  --primary: #08afa5;
  --primary-strong: #078f91;
  --primary-pale: #e7faf9;
  --navy: #0d3470;
  --ink: #172b4d;
  --muted: #64748b;
  --page: #f8fafc;
  --line: #e2eaf0;
  --card: #ffffff;
  --radius-card: 16px;
  --radius-control: 14px;
  --shadow-soft: 0 12px 32px rgba(20, 64, 92, .08);
  --shadow-lift: 0 18px 40px rgba(20, 64, 92, .12);
}

.site-header {
  height: 62px;
  padding-inline: clamp(20px, 5vw, 88px);
  background: rgba(14, 25, 44, .9);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: none;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 25px;
  letter-spacing: -.9px;
}

.site-logo-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #0a9cc7);
  box-shadow: 0 7px 14px rgba(8, 175, 165, .24);
}

.site-logo-mark svg {
  width: 21px;
  height: 21px;
}

.site-logo>span:last-child {
  color: #fff;
}

.site-logo em {
  color: var(--primary) !important;
}

.site-logo img {
  width: auto;
  height: 80px;
}

.header-menu {
  align-self: stretch;
  gap: 22px;
  margin-inline: clamp(26px, 4vw, 66px);
}

.header-menu-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0;
  border-radius: 0;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  position: relative;
}

.header-menu-link::after {
  content: '';
  position: absolute;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
  inset: auto 0 0;
  transform: scaleX(0);
  transition: transform .2s ease;
}

.header-menu-link:hover {
  color: #fff;
  background: transparent;
  transform: none;
}

.header-menu-link:hover::after,
body.home .header-menu-link:first-child::after {
  transform: scaleX(1);
}

.header-actions {
  gap: 12px;
}

.mode-toggle,
.lang-btn {
  min-height: 36px;
  height: 36px;
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.mode-toggle {
  width: 36px;
}

.lang-btn {
  padding-inline: 12px;
}

.hero {
  min-height: 374px;
  padding: clamp(44px, 5vw, 66px) 24px 30px;
  background: linear-gradient(120deg, #082b4d 0%, #0d3562 48%, #087c85 100%);
}

.hero::before {
  width: 330px;
  height: 330px;
  left: -170px;
  top: 54px;
  background: rgba(65, 222, 225, .22);
  filter: none;
  opacity: 1;
}

.hero::after {
  width: 170px;
  height: 170px;
  right: -60px;
  top: 32px;
  bottom: auto;
  background: rgba(131, 244, 241, .16);
  filter: none;
  opacity: 1;
}

.hero-inner {
  max-width: 920px;
}

.hero h1 {
  max-width: 860px;
  color: #fff;
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -1.55px;
  text-shadow: none;
}

.hero-desc {
  max-width: 700px;
  color: #d7f3f5;
  font-size: 16px;
  line-height: 1.65;
  margin-bottom: 22px;
}

.hero::selection {
  background: rgba(255, 255, 255, .24);
}

/* Keep the optional legacy tool-layout setting visually consistent too. */
.hero.tool-layout--snapsave,
.hero.tool-layout--compact {
  min-height: 374px;
  padding: clamp(44px, 5vw, 66px) 24px 30px;
  background: linear-gradient(120deg, #082b4d 0%, #0d3562 48%, #087c85 100%);
}

.hero.tool-layout--snapsave h1,
.hero.tool-layout--compact h1 {
  color: #fff;
  font-size: clamp(34px, 4vw, 52px);
}

.hero.tool-layout--snapsave .hero-desc,
.hero.tool-layout--compact .hero-desc {
  color: #d7f3f5;
  font-size: 16px;
  margin-bottom: 22px;
}

.downloader-box {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: min(100%, 870px);
  max-width: 870px;
  min-height: 62px;
  padding: 7px 8px 7px 16px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(4, 43, 75, .2), 0 0 0 4px rgba(255, 255, 255, .12);
}

.downloader-box:focus-within {
  border-color: #b9f3ef;
  box-shadow: 0 12px 30px rgba(4, 43, 75, .24), 0 0 0 4px rgba(181, 251, 246, .4);
}

.hero.tool-layout--snapsave .downloader-box,
.hero.tool-layout--compact .downloader-box {
  padding: 7px 8px 7px 16px;
  border-radius: 18px;
  background: #fff;
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 12px 28px rgba(4, 43, 75, .2), 0 0 0 4px rgba(255, 255, 255, .12);
}

.downloader-input-icon {
  display: grid;
  place-items: center;
  color: var(--primary-strong);
}

.downloader-input-icon svg {
  width: 21px;
  height: 21px;
}

.url-input {
  min-height: 48px;
  padding: 8px 2px;
  color: var(--ink);
  font-size: 15px;
}

.url-input::placeholder {
  color: #91a0b6;
}

.downloader-actions-row {
  display: flex;
  align-items: center;
  gap: 9px;
  width: auto;
}

.btn-paste,
.btn-download {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 700;
}

.btn-paste {
  min-width: auto;
  height: auto;
  padding: 0 17px;
  background: #f5f8fb;
  border-color: var(--line);
  color: #38516d;
}

.btn-paste:hover {
  color: var(--primary-strong);
  background: var(--primary-pale);
  border-color: #b9eee9;
}

.btn-download {
  flex: 0 0 auto;
  padding: 0 22px;
  background: linear-gradient(135deg, var(--primary), #0798a5);
  color: #fff;
  box-shadow: 0 7px 15px rgba(8, 175, 165, .24);
}

.btn-download::before {
  content: '↓';
  display: inline-block;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  transform: translateY(-1px);
}

.btn-download:hover {
  background: var(--primary-strong);
  color: #fff;
  filter: none;
  transform: translateY(-1px);
}

.tool-action-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.paste-status {
  grid-column: 1 / -1;
  margin: -3px 0 1px;
  color: #52657d;
}

.hero-badges {
  max-width: 900px;
  gap: 10px;
  margin-top: 0;
}

.hero-badge {
  min-height: 38px;
  padding: 8px 16px;
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .93);
  color: #38516d;
  box-shadow: 0 5px 12px rgba(2, 40, 67, .08);
  font-size: 13px;
}

.hero-badge svg {
  width: 15px;
  height: 15px;
}

.hero-badge svg path {
  stroke: var(--primary) !important;
}

.hero-badge:hover {
  color: var(--navy);
  background: #fff;
  border-color: #fff;
  transform: translateY(-1px);
}

.hero.tool-layout--snapsave .hero-badge,
.hero.tool-layout--compact .hero-badge {
  min-height: 38px;
  padding: 8px 16px;
  border-color: rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .93);
  color: #38516d;
}

.site-main {
  max-width: 920px;
  padding: 42px 24px 76px;
}

.site-main--with-toc {
  max-width: 1216px;
}

.site-main--with-toc .article-layout {
  grid-template-columns: minmax(240px, 270px) minmax(0, 1fr);
  gap: clamp(26px, 3vw, 34px);
}

.toc-sidebar {
  top: 82px;
  max-height: calc(100vh - 100px);
  padding-right: 2px;
}

.toc-nav {
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.toc-nav::before {
  padding-left: 34px;
  margin-bottom: 12px;
  color: var(--navy);
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.toc-nav::after {
  content: '☷';
  position: absolute;
  top: 21px;
  left: 19px;
  color: var(--primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.toc-list {
  gap: 3px;
}

.toc-list li {
  grid-template-columns: 25px minmax(0, 1fr);
  gap: 5px;
  padding: 2px 8px;
  border-radius: 10px;
  transition: background-color .18s ease;
}

.toc-list li:has(.toc-link.is-active) {
  background: var(--primary-pale);
}

.toc-list li::before {
  padding-top: 7px;
  color: var(--primary);
  font-size: 12px;
}

.toc-link {
  padding: 5px 0;
  color: #52708e;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.toc-link:hover,
.toc-link.is-active {
  color: var(--primary-strong);
  text-decoration: none;
}

.toc-link.is-active::after {
  display: none;
}

.article-content {
  padding: clamp(28px, 3vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.site-main h2 {
  margin: 0 0 17px;
  padding: 0 0 0 18px;
  color: var(--navy);
  font-size: clamp(25px, 2.5vw, 32px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1px;
}

.entry-content h2:not(:first-child),
.article-content>h2 {
  margin-top: 48px;
}

.entry-content>h2:first-child {
  margin-top: 0;
}

.site-main h2+* {
  margin-top: 0;
}

.site-main h2::before {
  position: absolute;
  left: 0;
  top: .13em;
  width: 5px;
  height: .95em;
  margin: 0;
  border-radius: 999px;
  background: var(--primary);
}

.site-main h3 {
  color: var(--navy);
  font-size: 19px;
}

.site-main p,
.site-main li {
  color: #52657d;
  line-height: 1.8;
}

.site-main p {
  margin-bottom: 18px;
}

.site-main strong {
  color: var(--ink);
}

.entry-content>p:first-child {
  color: #425b78;
  font-size: 16px;
  line-height: 1.82;
}

.entry-content ul,
.entry-content ol {
  padding-left: 23px;
}

.entry-content li::marker {
  color: var(--primary);
}

.entry-content a,
.cms-content a {
  color: var(--primary-strong);
  text-decoration-color: rgba(8, 175, 165, .38);
}

.url-input:focus-visible,
.btn-paste:focus-visible,
.btn-download:focus-visible,
.toc-link:focus-visible,
.mode-toggle:focus-visible,
.lang-btn:focus-visible {
  outline: 3px solid rgba(8, 175, 165, .35);
  outline-offset: 3px;
}

.features-grid {
  gap: 16px;
}

.feature-card {
  border-color: var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: 0 6px 18px rgba(20, 64, 92, .05);
}

.feature-card:hover {
  border-color: #abe6e1;
  background: #fff;
  box-shadow: var(--shadow-lift);
}

.feature-title {
  color: var(--navy);
}

.feature-desc {
  color: var(--muted);
}

.howto-step-num {
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(8, 175, 165, .22);
}

.faq-list {
  gap: 12px;
}

.faq-item {
  border-color: var(--line);
  border-radius: var(--radius-control);
  background: #fff;
}

.faq-item.open {
  border-color: #9ce4de;
  box-shadow: 0 8px 18px rgba(8, 175, 165, .07);
}

.faq-question {
  padding: 18px 20px;
  color: var(--navy);
  background: transparent;
}

.faq-question:hover,
.faq-item.open .faq-question {
  background: #f3fbfb;
}

.faq-icon {
  color: var(--primary);
  background: var(--primary-pale);
}

.faq-item.open .faq-icon {
  background: var(--primary);
}

.faq-answer {
  padding: 18px 20px;
  background: #fbfefe;
}

.site-footer {
  margin-top: 0;
  padding: 48px clamp(20px, 5vw, 88px) 26px;
  background: #0b2c50;
  border-color: rgba(255, 255, 255, .1);
}

.footer-inner {
  max-width: 1216px;
}

.footer-grid {
  gap: 52px;
  border-color: rgba(255, 255, 255, .12);
}

.footer-brand-logo,
.footer-col a:hover {
  color: #fff;
}

.footer-col-title {
  color: #a8dede;
}

.footer-desc,
.footer-tagline-small,
.footer-col a,
.footer-copyright,
.footer-disclaimer {
  color: #b7c9d9;
}

@media (max-width: 900px) {
  .site-main--with-toc .article-layout {
    grid-template-columns: minmax(216px, 240px) minmax(0, 1fr);
    gap: 22px;
  }

  .article-content {
    padding: 28px;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: 58px;
    padding-inline: 16px;
  }

  .site-logo {
    font-size: 22px;
  }

  .site-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .header-menu {
    display: none;
  }

  .hero {
    min-height: 0;
    padding: 46px 16px 28px;
  }

  .hero h1 {
    font-size: clamp(30px, 9vw, 42px);
    letter-spacing: -1.15px;
  }

  .hero-desc {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .downloader-box {
    grid-template-columns: 24px minmax(0, 1fr);
    padding: 9px 10px 9px 13px;
    border-radius: 16px;
  }

  .downloader-actions-row {
    grid-column: 1 / -1;
    width: 100%;
  }

  .btn-paste,
  .btn-download {
    flex: 1 1 0;
    padding-inline: 12px;
  }

  .hero-badge {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .site-main {
    padding: 30px 16px 56px;
  }

  .toc-sidebar {
    margin-bottom: 20px;
  }

  .toc-nav {
    padding: 18px 16px;
  }

  .article-content {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .site-main h2 {
    font-size: 25px;
  }

  .site-footer {
    padding: 38px 20px 24px;
  }
}

@media (max-width: 390px) {
  .header-actions {
    gap: 6px;
  }

  .lang-btn {
    padding-inline: 9px;
  }

  .btn-paste span {
    display: none;
  }

  .btn-paste {
    flex: 0 0 54px;
    padding: 0;
  }

  .btn-download {
    padding-inline: 12px;
  }

  .hero-badges {
    gap: 7px;
  }
}

/* =============================================
   COMPARISON TABLE (entry-content / cms-content)
   Bảng so sánh công cụ tải video trong WP editor.
   Không có style mặc định → không nền, không viền,
   dấu ✓ là text thô, cột dính nhau.
============================================= */
.entry-content table,
.cms-content table {
  width: 100%;
  max-width: 100%;
  margin: 28px 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  font-size: 15px;
}

.entry-content thead th,
.cms-content thead th {
  padding: 15px 18px;
  background: #f3fbfb;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-align: left;
  white-space: nowrap;
  vertical-align: bottom;
}

/* Cột tiêu chí rộng hơn, các cột công cụ căn giữa */
.entry-content thead th:first-child,
.cms-content thead th:first-child {
  width: 40%;
}

.entry-content thead th:not(:first-child),
.cms-content thead th:not(:first-child) {
  width: 20%;
  text-align: center;
  color: var(--primary-strong);
}

.entry-content tbody td,
.cms-content tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: #52657d;
  line-height: 1.5;
  vertical-align: middle;
}

.entry-content tbody td:first-child,
.cms-content tbody td:first-child {
  color: var(--ink);
  font-weight: 600;
}

.entry-content tbody td:not(:first-child),
.cms-content tbody td:not(:first-child) {
  text-align: center;
}

/* Bỏ đường kẻ ở hàng cuối để không đè lên bo góc */
.entry-content tbody tr:last-child td,
.cms-content tbody tr:last-child td {
  border-bottom: 0;
}

/* Hover hàng — nhẹ, không nhảy layout */
.entry-content tbody tr,
.cms-content tbody tr {
  transition: background-color var(--transition);
}

.entry-content tbody tr:hover,
.cms-content tbody tr:hover {
  background: #f7fdfd;
}

/* Dấu ✓ là text thô trong editor (không phải <span>) →
   ép ô chỉ chứa ✓ thành badge tròn màu teal.

   CÁCH HOẠT ĐỘNG:
   - Các ô trong bảng so sánh có nội dung là ✓ (hoặc ✔)
   - WP editor render là text thuần, không có class
   - CSS không match text content trực tiếp được
   → phải dùng JS, hoặc thêm class .check-cell vào editor

   Tạm thời: style lại ô có dấu ✓ để dễ nhìn hơn.
   Badge tròn hiện khi bọc <span class="check-icon">✓</span> */

/* Ô có class .check-cell hoặc .check → badge tròn */
.entry-content td.check-cell,
.cms-content td.check-cell,
.entry-content td.check,
.cms-content td.check {
  position: relative;
  text-align: center;
}

.entry-content td.check-cell::before,
.cms-content td.check-cell::before,
.entry-content td.check::before,
.cms-content td.check::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-pale), #e3f8f6);
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(8, 175, 165, 0.15);
}

/* Span bọc trong ô (nếu muốn tự custom HTML) */
.entry-content td .check-icon,
.cms-content td .check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-pale), #e3f8f6);
  color: var(--primary-strong);
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(8, 175, 165, 0.15);
}

/* Ô chữ như "Tùy video" / "Chưa xác minh" / "Nhanh" */
.entry-content td .cell-text,
.cms-content td .cell-text,
.entry-content td em,
.cms-content td em {
  color: #7b8fa6;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

/* Hàng "Tốc độ xử lý" — làm nổi giá trị tốt nhất */
.entry-content tbody td strong,
.cms-content tbody td strong {
  color: var(--primary-strong);
  font-weight: 800;
}

/* Mobile: cho bảng cuộn ngang thay vì bóp chữ */
@media (max-width: 768px) {

  .entry-content table,
  .cms-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
  }

  .entry-content thead th,
  .cms-content thead th,
  .entry-content tbody td,
  .cms-content tbody td {
    padding: 11px 12px;
    white-space: nowrap;
  }

  .entry-content thead th:first-child,
  .cms-content thead th:first-child,
  .entry-content tbody td:first-child,
  .cms-content tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--card);
    box-shadow: 1px 0 0 var(--line);
  }

  .entry-content thead th:first-child,
  .cms-content thead th:first-child {
    background: #f3fbfb;
    z-index: 3;
  }
}