@charset "UTF-8";
/* ============================================================================
   YTDL Pro — Design System v2.0
   Tokens & quy tắc: xem DESIGN.md ở gốc dự án.
   Không nạp font/CSS ngoài (CSP: font-src 'self').
   ========================================================================= */

/* ---------------------------------------------------------------------------
   1. TOKENS
   ------------------------------------------------------------------------ */
:root {
  color-scheme: light;

  /* Brand — Signal Violet */
  --brand-50: #efecff;
  --brand-100: #e0daff;
  --brand-300: #a99bff;
  --brand-500: #5a45ff;
  --brand-600: #4a35e8;
  --brand-700: #3b28c4;
  --brand-900: #241a6e;

  /* Signal — trạng thái sẵn sàng */
  --signal-50: #e6faf3;
  --signal-500: #00c48c;
  --signal-600: #00a878;

  /* Semantic */
  --warn-50: #fff7e6;
  --warn-600: #b45309;
  --danger-50: #fef2f2;
  --danger-500: #e5484d;
  --danger-700: #a81f24;
  --info-50: #eaf4fe;
  --info-600: #1a6fc4;

  /* Neutral */
  --canvas: #ffffff;
  --canvas-soft: #f7f8fc;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-sunken: #f1f3f9;
  --ink: #0e1a2b;
  --ink-secondary: #3d4f66;
  --ink-muted: #6b7c93;
  --ink-faint: #96a3b6;
  --hairline: #e4e8ef;
  --hairline-strong: #cdd5e0;
  --overlay: rgb(14 26 43 / 0.45);

  /* Bóng đổ */
  --shadow-color: 14 26 43;
  --brand-glow: 90 69 255;
  --shadow-xs: 0 1px 2px rgb(var(--shadow-color) / 0.05);
  --shadow-sm: 0 1px 3px rgb(var(--shadow-color) / 0.07), 0 1px 2px rgb(var(--shadow-color) / 0.04);
  --shadow-md: 0 4px 14px -2px rgb(var(--shadow-color) / 0.09), 0 2px 5px -2px rgb(var(--shadow-color) / 0.05);
  --shadow-lg: 0 14px 34px -10px rgb(var(--shadow-color) / 0.16), 0 4px 10px -4px rgb(var(--shadow-color) / 0.06);
  --shadow-xl: 0 28px 64px -18px rgb(var(--shadow-color) / 0.26);
  --shadow-brand: 0 10px 26px -8px rgb(var(--brand-glow) / 0.42);

  /* Typography */
  --font-sans: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, monospace;

  /* Radius */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* Layout */
  --container: 1120px;
  --measure: 760px;
  --workspace-w: 840px;
  --header-h: 64px;

  /* Z-index */
  --z-sticky: 50;
  --z-dropdown: 60;
  --z-overlay: 100;
  --z-toast: 120;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 180ms;
}

/* Dark — theo hệ thống */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
  :root:not([data-theme="light"]) {
    --brand-50: rgb(139 120 255 / 0.14);
    --brand-100: rgb(139 120 255 / 0.2);
    --brand-300: #b3a5ff;
    --brand-500: #8b78ff;
    --brand-600: #a094ff;
    --brand-700: #b3a5ff;
    --brand-900: #efecff;
    --signal-50: rgb(46 230 168 / 0.14);
    --signal-500: #2ee6a8;
    --signal-600: #5cecbd;
    --warn-50: rgb(245 158 11 / 0.14);
    --warn-600: #fbbf5c;
    --danger-50: rgb(229 72 77 / 0.14);
    --danger-500: #f4777b;
    --danger-700: #fca5a5;
    --info-50: rgb(43 140 240 / 0.14);
    --info-600: #7ab8f5;
    --canvas: #08090f;
    --canvas-soft: #0d0f18;
    --surface: #12141f;
    --surface-raised: #181b28;
    --surface-sunken: #0d0f18;
    --ink: #f2f4fa;
    --ink-secondary: #c2c9da;
    --ink-muted: #8f99af;
    --ink-faint: #6b7387;
    --hairline: #23273a;
    --hairline-strong: #333852;
    --overlay: rgb(0 0 0 / 0.65);
    --shadow-color: 0 0 0;
  }
}

/* Dark — do người dùng chọn */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-50: rgb(139 120 255 / 0.14);
  --brand-100: rgb(139 120 255 / 0.2);
  --brand-300: #b3a5ff;
  --brand-500: #8b78ff;
  --brand-600: #a094ff;
  --brand-700: #b3a5ff;
  --brand-900: #efecff;
  --signal-50: rgb(46 230 168 / 0.14);
  --signal-500: #2ee6a8;
  --signal-600: #5cecbd;
  --warn-50: rgb(245 158 11 / 0.14);
  --warn-600: #fbbf5c;
  --danger-50: rgb(229 72 77 / 0.14);
  --danger-500: #f4777b;
  --danger-700: #fca5a5;
  --info-50: rgb(43 140 240 / 0.14);
  --info-600: #7ab8f5;
  --canvas: #08090f;
  --canvas-soft: #0d0f18;
  --surface: #12141f;
  --surface-raised: #181b28;
  --surface-sunken: #0d0f18;
  --ink: #f2f4fa;
  --ink-secondary: #c2c9da;
  --ink-muted: #8f99af;
  --ink-faint: #6b7387;
  --hairline: #23273a;
  --hairline-strong: #333852;
  --overlay: rgb(0 0 0 / 0.65);
  --shadow-color: 0 0 0;
}

/* ---------------------------------------------------------------------------
   2. RESET & NỀN TẢNG
   ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; opacity: 0.55; }

img, svg, video { max-width: 100%; }
img { height: auto; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

::selection { background: var(--brand-500); color: #fff; }

h1, h2, h3, h4, h5 { color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 700; line-height: 1.1; letter-spacing: -1.2px; }
h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; line-height: 1.15; letter-spacing: -0.8px; }
h3 { font-size: 19px; font-weight: 650; line-height: 1.35; letter-spacing: -0.2px; }
h4 { font-size: 16px; font-weight: 650; line-height: 1.4; }
p { margin: 0; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 32px 0; }
code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  padding: 2px 6px;
  overflow-wrap: anywhere;
}
strong, b { font-weight: 650; color: var(--ink); }
::placeholder { color: var(--ink-faint); opacity: 1; }

.wrap { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }
@media (min-width: 768px) { .wrap { width: min(var(--container), calc(100% - 48px)); } }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -120px; left: 16px; z-index: var(--z-toast);
  background: var(--surface); color: var(--brand-600);
  padding: 12px 20px; border: 2px solid var(--brand-500); border-radius: var(--r-md);
  font-weight: 650; text-decoration: none; transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 16px; }

.text-center { text-align: center; }
.muted { color: var(--ink-muted); }

/* ---------------------------------------------------------------------------
   3. TYPOGRAPHY HELPERS
   ------------------------------------------------------------------------ */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; line-height: 1.4;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 14px;
}
.status-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-500); flex: none;
}
.status-dot.green { background: var(--signal-500); }
.status-dot.orange { background: #f59e0b; }
.status-dot.red { background: var(--danger-500); }

.hint { color: var(--ink-muted); font-size: 13px; line-height: 1.55; margin: 10px 0 0; }

/* ---------------------------------------------------------------------------
   4. CHIP / BADGE
   ------------------------------------------------------------------------ */
.chip,
.feature-tags span,
.category-badge,
.step-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: 11.5px; font-weight: 700; line-height: 1.4;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--surface-sunken);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
  white-space: nowrap;
}
.chip--brand, .category-badge {
  background: var(--brand-50); border-color: transparent; color: var(--brand-700);
}
.chip--signal { background: var(--signal-50); border-color: transparent; color: var(--signal-600); }
.chip--warn { background: var(--warn-50); border-color: transparent; color: var(--warn-600); }
.chip--outline { background: transparent; border-color: var(--hairline-strong); }

/* ---------------------------------------------------------------------------
   5. BUTTONS
   ------------------------------------------------------------------------ */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 13px 26px;
  max-width: 100%;
  border: 1px solid transparent; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 650; line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.button:hover { text-decoration: none; }
.button:not(:disabled):active { transform: translateY(0); }

.primary { background: var(--brand-500); color: #fff; }
.primary:not(:disabled):hover { background: var(--brand-600); box-shadow: var(--shadow-brand); transform: translateY(-1px); }
.primary:not(:disabled):active { background: var(--brand-700); box-shadow: none; }

.secondary {
  background: var(--surface); color: var(--ink);
  border-color: var(--hairline-strong);
}
.secondary:not(:disabled):hover { background: var(--surface-sunken); border-color: var(--ink-faint); }

.ghost { background: transparent; color: var(--ink-muted); padding: 10px 16px; }
.ghost:not(:disabled):hover { background: var(--surface-sunken); color: var(--ink); }

.danger { background: var(--danger-500); color: #fff; }
.danger:not(:disabled):hover { background: #c62a30; }

.button.small { min-height: 36px; padding: 8px 16px; font-size: 13px; }
.full-width { width: 100%; }
#download-button { margin-top: 24px; }
.action-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.cta-buttons, .cta-row-center { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }

/* ---------------------------------------------------------------------------
   6. HEADER & NAVIGATION
   ------------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--surface);
  border-bottom: 1px solid var(--hairline);
}
@supports (backdrop-filter: blur(1px)) {
  .site-header {
    background: rgb(255 255 255 / 0.82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
  :root[data-theme="dark"] .site-header { background: rgb(18 20 31 / 0.82); }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .site-header { background: rgb(18 20 31 / 0.82); }
  }
}
.header-inner {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 20px; min-height: var(--header-h);
  padding: 8px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.4px;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: block; flex: none;
  box-shadow: 0 2px 8px rgb(2 132 199 / 0.35);
  transition: transform var(--dur) var(--ease);
}
.brand:hover .brand-logo-icon {
  transform: translateY(-1px) scale(1.05);
}
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-500); color: #fff;
  font-size: 17px; font-weight: 700; line-height: 1;
  box-shadow: var(--shadow-brand);
}
.brand-text { white-space: nowrap; }
.brand-sub {
  font-size: 12px; font-weight: 500; color: var(--ink-faint);
  letter-spacing: 0; margin-left: 4px;
}

.main-nav {
  order: 3; width: 100%; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; white-space: nowrap; }
.nav-list a {
  display: block; padding: 8px 14px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; color: var(--ink-muted); text-decoration: none;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.nav-list a:hover { background: var(--surface-sunken); color: var(--ink); text-decoration: none; }
.nav-list a.active { background: var(--brand-50); color: var(--brand-700); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.icon-button {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  min-height: 40px; padding: 8px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-button:hover { background: var(--surface-sunken); }
.icon-button svg { width: 16px; height: 16px; flex: none; }
.theme-label { display: none; white-space: nowrap; }
@media (min-width: 560px) { .theme-label { display: inline; } }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: block; }
}

/* Một hàng khi đủ chỗ. Nav co lại và tự cuộn ngang (min-width: 0) thay vì ép
   nút chuyển giao diện co lại rồi xuống dòng — lỗi thấy ở khổ ~840px. */
@media (min-width: 720px) {
  .header-inner { flex-wrap: nowrap; }
  .main-nav { order: 0; width: auto; flex: 1 1 auto; min-width: 0; }
}

/* ---------------------------------------------------------------------------
   7. BREADCRUMBS
   ------------------------------------------------------------------------ */
.breadcrumbs { padding: 16px 0 0; font-size: 13px; color: var(--ink-muted); }
.breadcrumbs ol {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; list-style: none; margin: 0; padding: 0;
}
.breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs a { color: var(--ink-muted); }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs .sep { color: var(--hairline-strong); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------------------
   8. HERO
   ------------------------------------------------------------------------ */
.hero { position: relative; padding: 56px 0 32px; text-align: center; }
.hero > * { position: relative; z-index: 1; }

/* Aurora — dải sáng mờ ở 1/3 trên, vẽ trên <main> để tràn hết chiều ngang */
main { position: relative; }
main::before {
  content: "";
  position: absolute; inset: 0 0 auto; height: 640px;
  background:
    radial-gradient(58% 52% at 14% 0%, rgb(var(--brand-glow) / 0.16), transparent 62%),
    radial-gradient(48% 46% at 86% 6%, rgb(0 196 140 / 0.13), transparent 64%),
    radial-gradient(70% 58% at 50% 92%, rgb(43 140 240 / 0.1), transparent 66%);
  pointer-events: none; z-index: -1;
}
:root[data-theme="dark"] main::before { opacity: 0.8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) main::before { opacity: 0.8; } }

.hero h1 { margin-bottom: 18px; }
.hero h1 .accent {
  background: linear-gradient(96deg, var(--brand-500), var(--brand-300));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro-box { max-width: 700px; margin-inline: auto; }
.hero-copy { color: var(--ink-muted); font-size: 17px; line-height: 1.65; }
.feature-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.feature-tags span { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }

.home-page .hero { padding-top: 72px; }
.home-page .hero h1 { font-size: clamp(34px, 5.2vw, 56px); letter-spacing: -1.8px; line-height: 1.06; }

/* Khối giới thiệu + thẻ tính năng, đặt sau công cụ trong DOM (xem index.html). */
.hero-intro { margin-top: 32px; text-align: center; }
.hero-intro .hero-copy { margin-bottom: 0; }

/* Màn hình rộng: kéo khối giới thiệu trở lại phía trên công cụ nên bố cục desktop
   không đổi. Mobile giữ nguyên thứ tự DOM: H1 → công cụ → giới thiệu, để người
   dùng tới được ô dán link ngay mà không phải cuộn qua đoạn giới thiệu dài. */
@media (min-width: 900px) {
  .home-page { display: flex; flex-direction: column; }
  .home-page > .hero { order: -2; }
  .home-page > .hero-intro { order: -1; margin-top: 0; }
  /* Flex không gộp margin dọc: bù lại để nhịp dọc giữa các section không đổi. */
  .home-page > .content-section + .content-section { margin-top: 0; }
}

/* ---------------------------------------------------------------------------
   9. WORKSPACE — thẻ công cụ
   ------------------------------------------------------------------------ */
.workspace {
  position: relative;
  max-width: var(--workspace-w);
  margin: 40px auto 0;
  padding: 28px 26px 26px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  box-shadow: 0 1px 2px rgb(var(--shadow-color) / 0.04), 0 12px 32px -12px rgb(var(--shadow-color) / 0.14);
  --ws-fill: 0%;
}
.workspace::before {
  content: ""; position: absolute; inset: -1px -1px auto; height: 120px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: radial-gradient(70% 100% at 50% 0%, rgb(var(--brand-glow) / 0.1), transparent 70%);
  pointer-events: none;
}
.workspace > * { position: relative; z-index: 1; }

.ws-head {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 14px 20px; margin-bottom: 24px;
}
.ws-head h2 { font-size: 20px; letter-spacing: -0.4px; }
.ws-head .chip { margin-bottom: 8px; }

/* Stepper */
.stepper { display: flex; align-items: flex-start; gap: 6px; list-style: none; margin: 0; padding: 0; }
.stepper li {
  position: relative; display: grid; gap: 6px; justify-items: center;
  min-width: 54px; text-align: center;
}
.stepper li::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface-sunken); border: 1.5px solid var(--hairline-strong);
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.stepper li:not(:last-child)::after {
  content: ""; position: absolute; top: 4px; left: calc(50% + 9px);
  width: calc(100% - 12px); height: 1.5px; background: var(--hairline-strong);
  transition: background-color var(--dur) var(--ease);
}
.stepper-label { font-size: 11px; font-weight: 600; color: var(--ink-faint); letter-spacing: 0.01em; }

.workspace[data-state="options"] .stepper li:nth-child(1)::before,
.workspace[data-state="starting"] .stepper li:nth-child(1)::before,
.workspace[data-state="downloading"] .stepper li:nth-child(1)::before,
.workspace[data-state="downloading"] .stepper li:nth-child(2)::before,
.workspace[data-state="done"] .stepper li:nth-child(1)::before,
.workspace[data-state="done"] .stepper li:nth-child(2)::before,
.workspace[data-state="done"] .stepper li:nth-child(3)::before {
  background: var(--brand-500); border-color: var(--brand-500);
}
.workspace[data-state="options"] .stepper li:nth-child(1)::after,
.workspace[data-state="starting"] .stepper li:nth-child(1)::after,
.workspace[data-state="downloading"] .stepper li:nth-child(1)::after,
.workspace[data-state="downloading"] .stepper li:nth-child(2)::after,
.workspace[data-state="done"] .stepper li:nth-child(1)::after,
.workspace[data-state="done"] .stepper li:nth-child(2)::after {
  background: var(--brand-500);
}
.workspace[data-state="idle"] .stepper li:nth-child(1)::before,
.workspace[data-state="analyzing"] .stepper li:nth-child(1)::before,
.workspace[data-state="options"] .stepper li:nth-child(2)::before,
.workspace[data-state="starting"] .stepper li:nth-child(2)::before,
.workspace[data-state="downloading"] .stepper li:nth-child(3)::before,
.workspace[data-state="error"] .stepper li:nth-child(1)::before {
  border-color: var(--brand-500); background: var(--surface);
  box-shadow: 0 0 0 4px rgb(var(--brand-glow) / 0.16);
}
.workspace[data-state="idle"] .stepper li:nth-child(1) .stepper-label,
.workspace[data-state="analyzing"] .stepper li:nth-child(1) .stepper-label,
.workspace[data-state="options"] .stepper li:nth-child(2) .stepper-label,
.workspace[data-state="starting"] .stepper li:nth-child(2) .stepper-label,
.workspace[data-state="downloading"] .stepper li:nth-child(3) .stepper-label,
.workspace[data-state="error"] .stepper li:nth-child(1) .stepper-label {
  color: var(--brand-600); font-weight: 700;
}
.workspace[data-state="done"] .stepper li:nth-child(3)::before { border-color: var(--brand-500); }

/* Form */
label { display: block; font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 8px; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 12px 16px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline-strong); border-radius: var(--r-md);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--ink-faint); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgb(var(--brand-glow) / 0.18);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b7c93' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
:root[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238f99af' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238f99af' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  }
}

.input-row { display: flex; flex-direction: column; gap: 10px; }
.input-row .button { min-height: 48px; white-space: nowrap; }

/* Panels */
.video-panel, .progress-panel, .done-panel, .loading-panel {
  border-top: 1px solid var(--hairline);
  margin-top: 24px; padding-top: 24px;
}
.loading-panel { display: grid; gap: 16px; }
.video-card { display: grid; gap: 18px; margin-bottom: 24px; }
.thumbnail-wrap {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-sunken); aspect-ratio: 16 / 9;
}
.thumbnail-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.duration-badge {
  position: absolute; right: 10px; bottom: 10px;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: rgb(8 9 15 / 0.78); color: #fff;
  font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.video-details .eyebrow { margin-bottom: 6px; }
.video-details h3 { font-size: 18px; overflow-wrap: anywhere; }

/* Segmented tabs */
.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 20px;
  background: var(--surface-sunken); border-radius: var(--r-pill);
}
.tabs button {
  flex: 1; min-height: 42px; padding: 10px 12px;
  background: transparent; border: 0; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 650; color: var(--ink-muted);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.tabs button:hover:not([aria-selected="true"]):not(:disabled) { color: var(--ink); }
.tabs button[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 3px rgb(var(--shadow-color) / 0.1);
}
.tabs button:disabled { opacity: 0.4; }
#video-options, #audio-options { margin-bottom: 4px; }

/* Progress */
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.progress-head h3 { font-size: 15px; }
#progress-percent {
  color: var(--brand-600); font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}
progress {
  display: block; width: 100%; height: 10px; margin-top: 16px;
  border: 0; border-radius: var(--r-pill); overflow: hidden;
  background: var(--surface-sunken); accent-color: var(--brand-500);
}
progress::-webkit-progress-bar { background: var(--surface-sunken); border-radius: var(--r-pill); }
progress::-webkit-progress-value {
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
  transition: width 320ms var(--ease);
}
progress::-moz-progress-bar {
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
}
.progress-details {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  margin-top: 10px; font-size: 13px; color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
#cancel-button { margin-top: 20px; }

/* Done */
.done-panel { text-align: center; }
.success-icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto;
  border-radius: 50%; background: var(--signal-50); color: var(--signal-600);
  font-size: 24px; font-weight: 700;
  box-shadow: 0 0 0 8px rgb(0 196 140 / 0.08);
}
.done-panel h3 { font-size: 21px; margin-top: 16px; }
.done-panel p { font-size: 13.5px; margin: 8px 0 20px; }

/* Error */
.error-panel {
  margin-top: 24px; padding: 18px 20px;
  background: var(--danger-50); border: 1px solid rgb(229 72 77 / 0.28);
  border-radius: var(--r-md); color: var(--danger-700);
}
.error-panel h3 { font-size: 15px; color: inherit; }
.error-panel p { font-size: 13.5px; margin: 8px 0 14px; }

/* Skeletons */
.skeleton {
  height: 16px; margin-bottom: 10px; border-radius: var(--r-xs);
  background: var(--surface-sunken); animation: pulse 1.5s var(--ease) infinite;
}
.skeleton-image { aspect-ratio: 16 / 9; height: auto; margin: 0; border-radius: var(--r-md); }
.skeleton.short { width: 75%; }
.skeleton.shorter { width: 42%; }
@keyframes pulse { 50% { opacity: 0.45; } }

/* ---------------------------------------------------------------------------
   10. NOTICE / CALLOUT
   ------------------------------------------------------------------------ */
.notice {
  display: flex; gap: 12px; align-items: flex-start;
  max-width: var(--workspace-w); margin: 20px auto 0; padding: 14px 18px;
  background: var(--info-50); border: 1px solid rgb(43 140 240 / 0.2);
  border-radius: var(--r-md);
}
.notice-icon { color: var(--info-600); line-height: 1.5; flex: none; }
.notice p { font-size: 13px; color: var(--ink-secondary); margin: 0; }

.callout-box {
  margin: 24px 0; padding: 18px 20px;
  background: var(--surface-sunken); border-left: 3px solid var(--brand-500);
  border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 14px;
}
.callout-box p { margin: 0 0 10px; color: var(--ink-secondary); }
.callout-box p:last-child { margin: 0; }

/* ---------------------------------------------------------------------------
   11. SECTIONS & GRIDS
   ------------------------------------------------------------------------ */
.content-section { margin: 72px 0; }
.section-header { text-align: center; max-width: var(--measure); margin: 0 auto 36px; }
.section-header h2 { margin-bottom: 10px; }
.section-subtitle { color: var(--ink-muted); font-size: 15.5px; line-height: 1.6; margin: 0; }

.steps-grid, .features-grid, .hub-grid, .tips-grid, .platforms-grid, .blog-cards-grid {
  display: grid; grid-template-columns: 1fr; gap: 20px;
}

/* ---------------------------------------------------------------------------
   12. CARDS
   ------------------------------------------------------------------------ */
.step-card, .feature-item, .hub-card, .tip-card, .platform-card, .post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 24px;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.step-card h3, .feature-item h3, .hub-card h3, .tip-card h3, .platform-card h3 { margin: 0 0 10px; }
.step-card p, .feature-item p, .hub-card p, .tip-card p, .platform-card p {
  color: var(--ink-muted); font-size: 14px; line-height: 1.62; margin: 0;
}
a.hub-card, .hub-card:has(> h3 > a) { display: block; color: inherit; text-decoration: none; }
a.hub-card:hover, .hub-card:has(> h3 > a):hover {
  border-color: var(--hairline-strong); background: var(--canvas-soft);
  transform: translateY(-2px); text-decoration: none;
}
.hub-card h3 a { color: var(--ink); }
.hub-card:hover h3 a { color: var(--brand-600); }
.hub-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  font-size: 13px; font-weight: 650; color: var(--brand-600);
}
.card-meta-small { margin-top: 12px; font-size: 12px; color: var(--ink-faint); }

.step-num {
  display: inline-block; margin-bottom: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--brand-600);
}
.step-card::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 2px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: linear-gradient(90deg, var(--brand-500), transparent);
  opacity: 0.5;
}
.feature-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px;
  border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-600);
  font-size: 20px;
}
.feature-icon svg { width: 20px; height: 20px; }

/* ---------------------------------------------------------------------------
   13. TABLES
   ------------------------------------------------------------------------ */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}
.seo-table, .prose table { width: 100%; border-collapse: collapse; font-size: 14px; }
.seo-table th, .seo-table td, .prose th, .prose td {
  padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}
.seo-table thead th {
  background: var(--surface-sunken); color: var(--ink-muted);
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.seo-table tbody tr:last-child td, .prose tr:last-child td { border-bottom: 0; }
.seo-table td { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.seo-table td:first-child, .prose td strong { color: var(--ink); font-weight: 650; }
.seo-table tbody tr:hover { background: var(--canvas-soft); }
.prose table { border: 1px solid var(--hairline); border-radius: var(--r-md); margin: 24px 0; }
.prose th { background: var(--surface-sunken); font-weight: 650; }

/* ---------------------------------------------------------------------------
   14. FAQ
   ------------------------------------------------------------------------ */
.faq-list, .faq-accordion-group { display: grid; gap: 10px; max-width: var(--measure); margin-inline: auto; }
.faq-item {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--r-md); overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}
.faq-item:hover { border-color: var(--hairline-strong); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px; cursor: pointer; user-select: none; list-style: none;
  font-size: 15px; font-weight: 650; line-height: 1.5; color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: none; width: 16px; height: 16px;
  background: currentColor; opacity: 0.45;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' d='M8 3v10M3 8h10'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' d='M8 3v10M3 8h10'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--dur) var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] { border-color: var(--hairline-strong); background: var(--canvas-soft); }
.faq-item[open] summary { color: var(--brand-700); }
.faq-answer { padding: 0 20px 20px; font-size: 14px; line-height: 1.65; color: var(--ink-muted); }
.faq-answer p { margin: 0; }
.faq-q-text { display: block; }
.center-cta { text-align: center; margin-top: 32px; }

/* ---------------------------------------------------------------------------
   15. PROSE
   ------------------------------------------------------------------------ */
.prose { max-width: var(--measure); margin-inline: auto; font-size: 15.5px; line-height: 1.72; color: var(--ink-secondary); }
.prose > *:first-child { margin-top: 0; }
.prose h2 {
  font-size: 24px; margin: 44px 0 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline); color: var(--ink);
}
.prose h3 { font-size: 18px; margin: 30px 0 10px; color: var(--ink); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--brand-500); }
.prose strong { color: var(--ink); }
.prose code { background: var(--surface-sunken); }
.prose img { border-radius: var(--r-md); }

/* ---------------------------------------------------------------------------
   16. GUIDE / HOWTO
   ------------------------------------------------------------------------ */
.howto-steps { display: grid; gap: 24px; max-width: 880px; margin-inline: auto; }
.howto-step-item {
  display: grid; gap: 18px; padding: 26px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.step-circle {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; background: var(--brand-500); color: #fff;
  font-size: 17px; font-weight: 700;
  box-shadow: var(--shadow-brand);
}
.howto-step-item h3 { margin-bottom: 10px; }
.howto-step-item p { color: var(--ink-muted); font-size: 14.5px; line-height: 1.68; margin: 0 0 14px; }
.howto-step-item ul { margin: 0 0 14px; padding-left: 22px; color: var(--ink-muted); font-size: 14.5px; }
.howto-step-item li { margin-bottom: 8px; }
.howto-step-item li::marker { color: var(--brand-500); }
.step-illustration {
  margin-top: 18px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--hairline); background: var(--canvas-soft);
}
.guide-svg { display: block; width: 100%; height: auto; }

/* ---------------------------------------------------------------------------
   17. BLOG
   ------------------------------------------------------------------------ */
.post-card { display: flex; flex-direction: column; padding: 26px; }
.post-card:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.card-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-faint); margin-bottom: 12px;
}
.dot-sep { color: var(--hairline-strong); }
.post-card h3 { font-size: 18px; margin-bottom: 10px; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--brand-600); text-decoration: none; }
.post-excerpt { flex: 1 1 auto; color: var(--ink-muted); font-size: 14px; line-height: 1.62; margin: 0 0 18px; }
.card-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 16px; border-top: 1px solid var(--hairline); font-size: 13px;
}
.author-name { color: var(--ink-muted); }
.read-more { font-weight: 650; color: var(--brand-600); }

.post-header { max-width: var(--measure); margin: 0 auto; padding: 44px 0 28px; text-align: center; }
.post-meta-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 10px; font-size: 13px; color: var(--ink-faint); margin-bottom: 16px;
}
.post-lead { font-size: 17px; line-height: 1.62; color: var(--ink-muted); margin: 16px 0 22px; }
.author-block {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 8px 18px 8px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--hairline); font-size: 13px;
}
.author-avatar {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--brand-50); font-size: 15px;
}
.author-info { display: flex; align-items: center; gap: 6px; }
.byline { color: var(--ink-faint); }

.post-body-layout { display: grid; grid-template-columns: 1fr; gap: 36px; max-width: 1000px; margin-inline: auto; }
.toc-sidebar { height: fit-content; padding: 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-md); }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 14px; }
.toc-nav ul { list-style: none; margin: 0; padding-left: 14px; }
.toc-nav > ul { padding-left: 0; }
.toc-nav li { margin-bottom: 8px; font-size: 13.5px; }
.toc-nav a { color: var(--ink-muted); }
.toc-nav a:hover { color: var(--brand-600); }
.post-content { min-width: 0; }

.post-footer { max-width: 1000px; margin: 56px auto 0; padding-top: 32px; border-top: 1px solid var(--hairline); }
.post-disclaimer {
  padding: 18px 20px; border-radius: var(--r-md); margin-bottom: 40px;
  background: var(--surface-sunken); border: 1px solid var(--hairline);
  font-size: 13px; color: var(--ink-muted);
}
.post-disclaimer p { margin: 0; }

/* ---------------------------------------------------------------------------
   18. CTA CARD
   ------------------------------------------------------------------------ */
.cta-card {
  max-width: var(--measure); margin-inline: auto; padding: 40px 28px;
  text-align: center; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-xl);
  box-shadow: 0 1px 2px rgb(var(--shadow-color) / 0.04), 0 12px 32px -14px rgb(var(--shadow-color) / 0.14);
}
.cta-card h2 { font-size: 24px; margin-bottom: 10px; }
.cta-card p { color: var(--ink-muted); font-size: 14.5px; max-width: 560px; margin: 0 auto; }

/* ---------------------------------------------------------------------------
   19. CONTACT
   ------------------------------------------------------------------------ */
.contact-layout { display: grid; grid-template-columns: 1fr; gap: 24px; max-width: 980px; margin-inline: auto; }
.contact-info-card, .contact-form-section {
  padding: 28px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.contact-info-card h2, .contact-form-section h2 { font-size: 18px; margin-bottom: 18px; }
.contact-details-list { display: grid; gap: 18px; list-style: none; margin: 0; padding: 0; font-size: 14px; color: var(--ink-muted); }
.contact-details-list strong { display: block; margin-bottom: 2px; font-size: 13px; }
.form-group { margin-bottom: 18px; }

/* ---------------------------------------------------------------------------
   20. FOOTER
   ------------------------------------------------------------------------ */
.site-footer {
  margin-top: 88px; padding: 56px 0 28px;
  background: var(--canvas-soft); border-top: 1px solid var(--hairline);
  font-size: 13.5px; color: var(--ink-muted);
}
.footer-content { display: grid; grid-template-columns: 1fr; gap: 36px; }
.footer-col h3 {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 16px;
}
.footer-col ul { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.footer-col a { color: var(--ink-secondary); }
.footer-col a:hover { color: var(--brand-600); }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 17px; color: var(--ink); }
.footer-desc { line-height: 1.6; margin: 0 0 16px; max-width: 46ch; }
.disclaimer-note {
  padding: 12px 14px; border-radius: var(--r-sm); margin: 0;
  background: var(--surface-sunken); border: 1px solid var(--hairline);
  font-size: 12px; line-height: 1.55;
}
.footer-bottom {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--hairline);
  font-size: 12.5px; text-align: center;
}

/* ---------------------------------------------------------------------------
   21. COOKIE BANNER
   ------------------------------------------------------------------------ */
.cookie-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: var(--z-overlay);
  display: flex; flex-direction: column; gap: 16px;
  width: min(620px, calc(100% - 32px));
  padding: 20px;
  background: var(--surface-raised);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  animation: banner-in 220ms var(--ease) both;
}
@keyframes banner-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.cookie-content h4 { margin-bottom: 6px; }
.cookie-content p { font-size: 12.5px; line-height: 1.55; color: var(--ink-muted); margin: 0; }
.cookie-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------------------------------------------------------------------------
   21b. CHỐNG TRÀN NGANG
   ------------------------------------------------------------------------ */
/* Track lưới mặc định là `auto`, nghĩa là tối thiểu bằng min-content của phần
   tử con. `<select>` có option dài hoặc `<input>` có intrinsic width mặc định
   có thể đẩy track rộng hơn khung chứa → tràn ngang ở khổ 320px.
   `minmax(0, 1fr)` chặn điều đó; phải đặt TRƯỚC khối responsive để các media
   query nhiều cột vẫn ghi đè được. */
.steps-grid, .features-grid, .hub-grid, .tips-grid, .platforms-grid, .blog-cards-grid,
.contact-layout, .video-card, .loading-panel, .howto-steps, .footer-content,
.post-body-layout, .faq-list, .faq-accordion-group, .contact-details-list,
.footer-col ul {
  grid-template-columns: minmax(0, 1fr);
}
input, select, textarea { min-width: 0; max-width: 100%; }
.prose, .prose > *, .post-content { min-width: 0; }

/* ---------------------------------------------------------------------------
   22. RESPONSIVE
   ------------------------------------------------------------------------ */
@media (min-width: 560px) {
  .input-row { flex-direction: row; }
  .input-row .button { flex: none; }
  .action-row { justify-content: center; }
  .cookie-banner { flex-direction: row; align-items: center; justify-content: space-between; }
  .cookie-actions { flex: none; }
}

@media (min-width: 720px) {
  .content-section { margin: 80px 0; }
  .section-header { margin-bottom: 44px; }
  .steps-grid, .hub-grid, .tips-grid, .platforms-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .features-grid, .blog-cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .video-card, .loading-panel { grid-template-columns: 210px minmax(0, 1fr); align-items: center; }
  .howto-step-item { grid-template-columns: 40px minmax(0, 1fr); gap: 22px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; }
}

@media (min-width: 900px) {
  .footer-content { grid-template-columns: minmax(0, 1.7fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
  .contact-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .post-body-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .toc-sidebar { position: sticky; top: calc(var(--header-h) + 20px); }
  .workspace { padding: 32px 34px 30px; }
}

@media (max-width: 899px) {
  .toc-sidebar { order: 2; }
  .post-content { order: 1; }
}

/* ---------------------------------------------------------------------------
   23. ACCESSIBILITY
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --hairline: var(--hairline-strong); --ink-muted: var(--ink-secondary); }
}

@media print {
  .site-header, .site-footer, .cookie-banner, .workspace, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .hero::before { display: none; }
}

/* ---------------------------------------------------------------------------
   25. TRANG CÔNG CỤ MỞ RỘNG (thumbnail · phụ đề · social · cắt · convert · admin)
   Mọi giá trị lấy từ token ở mục 1, không dùng rem/px rời.
   ------------------------------------------------------------------------ */
.section-block { padding: 40px 0 72px; }
.section-block > .eyebrow { margin-bottom: 10px; }
.section-block > h1 { margin-bottom: 12px; }
.section-block > .muted { max-width: var(--measure); font-size: 16px; }

.tool-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 32px; }
.tool-links a {
  padding: 8px 16px; border: 1px solid var(--hairline); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-muted);
  font-size: 13px; font-weight: 600; text-decoration: none;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.tool-links a:hover {
  border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700);
  text-decoration: none;
}

/* Ô chọn tệp: thay widget mặc định của trình duyệt bằng nút theo hệ thống */
input[type="file"] {
  min-height: 56px; padding: 8px; cursor: pointer;
  background: var(--surface-sunken);
  border: 1px dashed var(--hairline-strong); border-radius: var(--r-md);
  color: var(--ink-muted); font-size: 13px;
}
input[type="file"]:hover { border-color: var(--brand-500); }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 9px 18px;
  border: 0; border-radius: var(--r-pill);
  background: var(--brand-500); color: #fff;
  font: inherit; font-size: 13px; font-weight: 650; cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--brand-600); }

/* Form nhiều trường: nhịp dọc rõ ràng thay vì các ô dính nhau */
#feature-tool form, #admin-form { display: grid; gap: 20px; }
#feature-tool form > label, #admin-form > label { margin-bottom: 0; }
#feature-tool form > .button, #admin-form > .button,
#feature-progress .button { justify-self: start; }
#feature-tool form .tool-grid { margin: 0; }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 20px; }
.tool-grid > * { min-width: 0; }
.tool-grid label { margin-bottom: 8px; }

#feature-status { margin: 20px 0 0; font-size: 14px; line-height: 1.6; color: var(--ink-muted); overflow-wrap: anywhere; }
#feature-status:empty { display: none; }
#feature-status[data-state="error"] { color: var(--danger-700); }
#feature-status[data-state="ok"] { color: var(--signal-600); }

#feature-progress { display: grid; gap: 16px; margin-top: 24px; }
#feature-bar { width: 100%; margin-top: 0; }
#feature-save { margin-top: 24px; }

.trim-options, .recent-history {
  margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--hairline);
}
.trim-options summary { padding: 8px 0; cursor: pointer; font-weight: 650; }
.trim-options summary::marker { color: var(--brand-500); }

.history-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 14px 0; border-bottom: 1px solid var(--hairline);
}
.history-row:last-child { border-bottom: 0; }
.history-row > span { flex: 1 1 220px; font-size: 14px; overflow-wrap: anywhere; }
.history-row audio { width: 100%; }

.thumbnail-result, .admin-stat, .admin-contact {
  padding: 16px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  overflow-wrap: anywhere;
}
.thumbnail-result img { display: block; width: 100%; height: auto; border-radius: var(--r-sm); }
.admin-stat strong { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--ink); font-variant-numeric: tabular-nums; }

#install-app { min-height: 40px; padding: 8px 16px; font-size: 13px; }

@media (max-width: 560px) {
  .section-block { padding: 28px 0 56px; }
  .tool-links { margin: 20px 0 24px; }
  #install-app { padding: 8px 12px; }
  .recent-history .progress-head { flex-wrap: wrap; gap: 12px; }
}

