/* ==========================================================================
   YomiHub Website Design System
   Common Stylesheet for Trang Chủ (index.html), Hướng Dẫn (guide.html), Chính Sách (privacy.html)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Self-hosted Fonts: Be Vietnam Pro
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/bvp-vietnamese-400.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/bvp-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/bvp-vietnamese-600.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/bvp-latin-600.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/bvp-vietnamese-800.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Be Vietnam Pro';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('fonts/bvp-latin-800.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. Design Tokens
   -------------------------------------------------------------------------- */
:root {
  --violet: #5a2cb6;
  --blue: #2371e1;
  --teal: #00bda6;
  --paper: #f7f8fc;
  --ink: #161a2e;
  --muted: #5b6178;
  --line: #e1e5f0;

  --card-bg: #ffffff;
  --chip-bg: #ffffff;
  --badge-bg: #e8f0fe;
  --badge-fg: #1952be;
  --banner-grad: linear-gradient(118deg, #5a2cb6 0%, #2371e1 52%, #00bda6 100%);
  --banner-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --focus-ring: #00bda6;
  --card-shadow: 0 2px 8px rgba(22, 26, 46, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --violet: #7d5be0;
    --blue: #6ea2ff;
    --teal: #3fd9c4;
    --paper: #11152a;
    --ink: #e8ebf7;
    --muted: #a3a9c2;
    --line: #262c47;

    --card-bg: #181d36;
    --chip-bg: #1f2545;
    --badge-bg: #1c2a4d;
    --badge-fg: #8cb4ff;
    --banner-grad: linear-gradient(118deg, #5a2cb6 0%, #2371e1 52%, #00bda6 100%);
    --banner-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    --focus-ring: #3fd9c4;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  }
}

/* --------------------------------------------------------------------------
   3. View Transitions & Base Resets
   -------------------------------------------------------------------------- */
@view-transition {
  navigation: auto;
}

::view-transition-group(yh-band) {
  animation-duration: 0.2s;
}

::view-transition-group(yh-tabs) {
  animation-duration: 0.2s;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 180ms;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--paper);
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
}

p {
  max-width: 75ch;
  margin: 0 0 1rem 0;
}

a {
  color: var(--blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   4. Banner Band Header (Shared)
   -------------------------------------------------------------------------- */
.banner-band {
  view-transition-name: yh-band;
  background: var(--banner-grad);
  color: #ffffff;
  padding: 16px 20px 0;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.banner-container {
  max-width: 1040px;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  background: #ffffff;
  display: block;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--violet);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-top:hover {
  background: #ffffff;
  transform: translateY(-1px);
  text-decoration: none;
}

/* Hero Section */
.hero-index {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 32px;
  padding: 24px 0 36px;
}

.hero-text h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px 0;
  color: #ffffff;
  text-shadow: var(--banner-text-shadow);
}

.hero-lead {
  font-size: 1.08rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 24px;
  max-width: 58ch;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: #ffffff;
  color: #1a56db;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
  background: #f0f4ff;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
  text-decoration: none;
}

/* Banner image tilted as book page */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.book-tilt {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 18px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32), 0 2px 6px rgba(0, 0, 0, 0.2);
  transform: rotateY(-6deg) rotateX(4deg) scale(0.98);
  transition: transform 0.4s ease;
  animation: slideInBook 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.book-tilt:hover {
  transform: rotateY(0deg) rotateX(0deg) scale(1);
}

@keyframes slideInBook {
  from {
    opacity: 0;
    transform: translateY(16px) rotateY(-10deg) scale(0.95);
  }
  to {
    opacity: 1;
    transform: rotateY(-6deg) rotateX(4deg) scale(0.98);
  }
}

/* Hero Compact (Guide & Privacy) */
.hero-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0 28px;
  min-height: 140px;
}

.hero-compact-text h1 {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 8px 0;
  color: #ffffff;
  text-shadow: var(--banner-text-shadow);
}

.hero-compact-lead {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
  max-width: 60ch;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hero-compact-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Bookmark Tabs (Mấu đánh dấu trang)
   -------------------------------------------------------------------------- */
.bookmark-nav {
  view-transition-name: yh-tabs;
  display: flex;
  gap: 6px;
  align-items: flex-end;
  margin-top: 10px;
}

.tab-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 12px 12px 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom: none;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
  z-index: 1;
}

.tab-link:hover {
  background: rgba(255, 255, 255, 0.26);
  color: #ffffff;
  text-decoration: none;
}

.tab-link.active,
.tab-link[aria-current="page"] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  border-color: transparent;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
  z-index: 2;
  margin-bottom: -1px;
  padding-bottom: 12px;
}

.tab-link.active::after,
.tab-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--paper);
}

/* --------------------------------------------------------------------------
   6. Content Paper Wrapper
   -------------------------------------------------------------------------- */
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 40px 0 16px 0;
  color: var(--ink);
}

h2 small {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   7. Download Shelf Table (Kệ sách tải về)
   -------------------------------------------------------------------------- */
.shelf-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.shelf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.shelf-table th {
  text-align: left;
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0;
}

.shelf-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.shelf-table tr:last-child td {
  border-bottom: none;
}

.shelf-platform {
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}

.shelf-note {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}

.shelf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* Chip download button */
a.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

a.dl:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
  text-decoration: none;
}

a.dl svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   8. What's New Cards
   -------------------------------------------------------------------------- */
.whatsnew-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin: 12px 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
}

.card h3 {
  margin: 0 0 12px 0;
  font-size: 1.12rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink);
}

.card.fix {
  border-left: 4px solid var(--blue);
}

.card.new {
  border-left: 4px solid var(--teal);
}

.card ul {
  margin: 0;
  padding-left: 20px;
}

.card li {
  margin: 6px 0;
  line-height: 1.5;
}

.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-fg);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   9. Features List (2-column layout with icon list)
   -------------------------------------------------------------------------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 18px;
  margin: 16px 0 32px;
}

.feature-item {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-item.highlight {
  border-color: rgba(35, 113, 225, 0.4);
}

.feature-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.feature-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.feature-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}

.feature-list {
  margin: 0 0 16px 0;
  padding-left: 20px;
  flex-grow: 1;
}

.feature-list li {
  margin: 4px 0;
  font-size: 0.94rem;
  color: var(--ink);
}

.feature-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue);
  margin-top: auto;
  align-self: flex-start;
}

.feature-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   10. Guide Page (Hướng Dẫn) Layout & Components
   -------------------------------------------------------------------------- */
.guide-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: flex-start;
  margin-top: 16px;
}

.guide-sidebar {
  position: sticky;
  top: 24px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--card-shadow);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.guide-search-box {
  margin-bottom: 16px;
}

.guide-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.15s ease;
}

.guide-search-input:focus {
  border-color: var(--blue);
  outline: none;
}

.toc-heading {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--muted);
  margin: 0 0 10px 0;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin: 4px 0;
}

.toc-link {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.toc-link:hover {
  background: var(--paper);
  color: var(--blue);
  text-decoration: none;
}

.toc-link.active {
  background: var(--badge-bg);
  color: var(--badge-fg);
  font-weight: 600;
}

/* Mobile TOC details accordion */
.toc-details {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
}

.toc-summary {
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

/* Guide Chapter Markup per contract */
.guide-main {
  min-width: 0;
}

.chapter {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 30px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  scroll-margin-top: 24px;
}

.chapter h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 0 0 10px 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}

.chapter .ch-icon {
  font-size: 1.4rem;
}

.chapter .intro {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 16px;
  font-style: normal;
}

/* Pill path */
.chapter .path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 12px 0 16px 0;
}

.chapter .path span {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.chapter .path span + span::before {
  content: "›";
  margin-right: 6px;
  color: var(--muted);
  font-weight: 700;
}

/* Numbered Steps */
.chapter .steps {
  margin: 14px 0 18px 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step-counter;
}

.chapter .steps li {
  position: relative;
  counter-increment: step-counter;
  padding-left: 36px;
  margin-bottom: 10px;
  line-height: 1.5;
}

.chapter .steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tips & Note */
.chapter .tips {
  margin: 12px 0;
  padding-left: 20px;
}

.chapter .tips li {
  margin: 4px 0;
}

.chapter aside.note,
.callout {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* No results message */
.search-no-results {
  display: none;
  text-align: center;
  padding: 48px 20px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   11. Privacy Document Styling
   -------------------------------------------------------------------------- */
.doc-privacy {
  max-width: 820px;
  margin: 0 auto;
}

.privacy-toc {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.privacy-toc h3 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}

.privacy-toc ul {
  margin: 0;
  padding-left: 20px;
}

.privacy-toc li {
  margin: 4px 0;
  font-size: 0.92rem;
}

.doc-privacy h2 {
  font-size: 1.25rem;
  margin: 32px 0 12px 0;
}

.doc-privacy ul {
  padding-left: 24px;
}

.doc-privacy li {
  margin: 6px 0;
}

hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

/* --------------------------------------------------------------------------
   12. Footer (Shared across all 3 pages)
   -------------------------------------------------------------------------- */
footer {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 40px 20px 48px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
  background-color: var(--paper);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  font-weight: 600;
}

.footer-disclaimer {
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.5;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   13. Responsive Styles
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero-index {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 24px;
  }
  .hero-visual {
    order: -1;
    justify-content: flex-start;
  }
  .book-tilt {
    max-width: 320px;
    transform: none;
  }
  .guide-layout {
    grid-template-columns: 1fr;
  }
  .guide-sidebar {
    display: none;
  }
  .toc-details {
    display: block;
  }
}

@media (max-width: 640px) {
  .banner-band {
    padding: 12px 14px 0;
  }
  .hero-text h1 {
    font-size: 2rem;
  }
  .hero-lead {
    font-size: 0.98rem;
  }
  .hero-compact {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero-compact-icon {
    width: 56px;
    height: 56px;
  }
  .bookmark-nav {
    width: 100%;
    margin-top: 8px;
    gap: 2px;
  }
  .tab-link {
    flex: 1 1 0;
    padding: 9px 2px;
    font-size: 0.82rem;
    letter-spacing: -0.01em;
    text-align: center;
    border-radius: 8px 8px 0 0;
    white-space: nowrap;
  }
  .wrap {
    padding: 24px 14px 40px;
  }
  .shelf-table,
  .shelf-table thead,
  .shelf-table tbody,
  .shelf-table tr,
  .shelf-table th,
  .shelf-table td {
    display: block;
  }
  .shelf-table thead {
    display: none;
  }
  .shelf-table td {
    padding: 12px 14px;
  }
  .shelf-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .chapter {
    padding: 20px 16px;
  }
}

/* Claude 20/11: chuỗi dài (URL trong code) không làm tràn ngang trên điện thoại */
code, kbd { overflow-wrap: anywhere; word-break: break-word; }
@media (max-width: 640px) { .hero-compact-icon { display: none; } }

/* --------------------------------------------------------------------------
   14. Download Page (download.html) Specific Styles
   -------------------------------------------------------------------------- */
.quick-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 8px 0 32px 0;
}

.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 18px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.quick-btn:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  text-decoration: none;
}

.quick-btn.recommended {
  border-color: var(--teal);
  background: var(--card-bg);
  box-shadow: 0 0 0 1.5px var(--teal), var(--card-shadow);
}

.quick-btn-title {
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.quick-btn-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal);
  color: #ffffff;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.dl-group {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  margin-bottom: 24px;
  box-shadow: var(--card-shadow);
  scroll-margin-top: 24px;
}

.dl-group.highlighted {
  border-color: var(--teal);
  box-shadow: 0 0 0 1.5px var(--teal), var(--card-shadow);
}

.dl-group h2 {
  margin: 0 0 8px 0;
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-group .intro {
  margin: 0 0 18px 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.dl-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dl-item {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.dl-primary {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dl-size {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.dl-hint {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.dl-hash-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dl-sha {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-copy {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--blue);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.btn-copy:hover {
  background: var(--badge-bg);
  border-color: var(--blue);
}

.btn-copy.copied {
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
}

@media (max-width: 768px) {
  .dl-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .dl-primary {
    justify-content: space-between;
  }
  .dl-primary a.dl {
    flex-grow: 1;
    justify-content: center;
  }
  .dl-hash-box {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .quick-selector {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .dl-group {
    padding: 20px 16px;
  }
  .top-bar {
    gap: 8px;
  }
  .top-actions {
    gap: 6px;
  }
  .btn-top {
    padding: 6px 11px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
  .lang-opt {
    padding: 3px 8px;
    font-size: 0.75rem;
    min-width: 24px;
  }
}

/* --------------------------------------------------------------------------
   15. Language Switcher & Suggestion Banner (i18n)
   -------------------------------------------------------------------------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  min-width: 28px;
  line-height: 1;
}

.lang-opt:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.lang-opt.active,
.lang-opt[aria-current="true"] {
  background: #ffffff;
  color: var(--violet);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  font-weight: 800;
}

.lang-suggestion-banner {
  background: var(--card-bg);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 16px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  animation: slideDownBanner 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.lang-suggestion-action {
  color: var(--blue);
  font-weight: 700;
  text-decoration: underline;
}

.lang-suggestion-action:hover {
  color: var(--violet);
}

.lang-suggestion-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
}

.lang-suggestion-close:hover {
  color: var(--ink);
  background: var(--line);
}



/* Narrow phones: keep the top bar inside 390px with the VI | EN switch */
@media (max-width: 440px) {
  .brand-link { gap: 8px; font-size: 1.05rem; }
  .brand-logo { width: 34px; height: 34px; border-radius: 9px; }
  .top-bar { gap: 6px; }
  .btn-top { padding: 6px 9px; font-size: 0.76rem; }
}
@media (max-width: 360px) {
  .brand-link span { display: none; }
}
