/* Trang marketing phu (features, niche-finder, affiliate, contact).
   Dung chung token mau cua brand-home-template.css (.site). */

.brand-page {
  overflow-x: clip;
}

.bp-wrap {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.bp-narrow {
  width: min(760px, calc(100% - 48px));
}

/* ---------- Hero ---------- */
.bp-hero {
  position: relative;
  padding: 104px 0 72px;
  background:
    radial-gradient(circle at 50% -10%, var(--accent-soft), transparent 55%),
    var(--page);
}

.bp-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.bp-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bp-hero h1 {
  max-width: 900px;
  margin: 22px 0 18px;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.06;
  text-wrap: balance;
}

.bp-hero h1 em,
.bp-section-title em,
.bp-cta h2 em {
  color: var(--accent-heading);
  font-style: italic;
}

.bp-lead {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.6;
  text-wrap: pretty;
}

.bp-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
}

.bp-note {
  margin-top: 14px;
  color: var(--quiet);
  font-size: 14px;
}

/* ---------- Sections ---------- */
.bp-section {
  padding: 88px 0;
}

.bp-section-tint {
  background: var(--surface-soft);
}

.bp-section-title {
  margin: 0 0 14px;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 830;
  letter-spacing: -0.04em;
  line-height: 1.15;
  text-align: center;
  text-wrap: balance;
}

.bp-section-sub {
  max-width: 680px;
  margin: 0 auto 48px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
  text-align: center;
}

/* ---------- Card grid ---------- */
.bp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.bp-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition:
    transform 240ms ease,
    border-color 240ms ease;
}

a.bp-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* The dich cua link #anchor (vd /features#faceless-channel-finder): chua cho header dinh. */
.bp-card[id],
.bp-section[id] {
  scroll-margin-top: 88px;
}

.bp-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.bp-card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.bp-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.bp-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 20px;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 750;
}

.bp-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---------- Steps ---------- */
.bp-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  counter-reset: bp-step;
}

.bp-step {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.bp-step::before {
  counter-increment: bp-step;
  content: counter(bp-step);
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 850;
}

.bp-step h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bp-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- Split rows ---------- */
.bp-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 56px;
}

.bp-split + .bp-split {
  margin-top: 88px;
}

.bp-split-reverse .bp-split-text {
  order: 2;
}

.bp-split-text h2 {
  margin: 0 0 16px;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 830;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.bp-split-text p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.bp-split-text .button {
  margin-top: 12px;
}

.bp-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.bp-list li {
  position: relative;
  padding-left: 30px;
  color: var(--ink);
  line-height: 1.5;
}

.bp-list li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317140d' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
      center / 11px no-repeat,
    var(--accent);
}

.bp-shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.bp-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Stat panel ---------- */
.bp-stat-panel {
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background:
    radial-gradient(circle at 85% 0%, var(--accent-soft), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.bp-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.bp-stat span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.bp-stat strong {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 850;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.bp-stat-accent {
  background: var(--accent-soft);
}

.bp-stat-accent strong {
  color: var(--accent-text);
}

/* ---------- Terms table ---------- */
.bp-terms {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.bp-terms div {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) 2fr;
  gap: 20px;
  padding: 18px 24px;
}

.bp-terms div + div {
  border-top: 1px solid var(--line);
}

.bp-terms dt {
  font-weight: 750;
}

.bp-terms dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

/* ---------- FAQ ---------- */
.bp-faq {
  margin-top: 40px;
}

.bp-faq details {
  border-bottom: 1px solid var(--line);
}

.bp-faq summary {
  position: relative;
  padding: 22px 40px 22px 0;
  font-size: 18px;
  font-weight: 750;
  list-style: none;
  cursor: pointer;
}

.bp-faq summary::-webkit-details-marker {
  display: none;
}

.bp-faq summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 4px;
  color: var(--accent-text);
  font-size: 26px;
  font-weight: 500;
  transform: translateY(-50%);
  transition: transform 200ms ease;
}

.bp-faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.bp-faq-answer {
  padding: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.bp-faq-answer a,
.bp-inline-link {
  color: var(--accent-text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- CTA band ---------- */
.bp-cta {
  padding: 64px 32px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 176, 0, 0.28), transparent 50%),
    radial-gradient(circle at 90% 100%, rgba(255, 176, 0, 0.18), transparent 45%),
    #181816;
  color: #f3f2eb;
  text-align: center;
}

.site[data-theme="dark"] .bp-cta {
  border: 1px solid var(--line);
}

.bp-cta h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.12;
  text-wrap: balance;
}

.bp-cta h2 em {
  color: #ffc13f;
}

.bp-cta p {
  max-width: 600px;
  margin: 0 auto;
  color: #c9c8c0;
  font-size: 18px;
  line-height: 1.6;
}

.bp-cta .button-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #f3f2eb;
  box-shadow: none;
}

/* ---------- Contact ---------- */
.bp-contact-email {
  display: inline-block;
  margin-top: 14px;
  color: var(--accent-text);
  font-size: 19px;
  font-weight: 800;
  word-break: break-all;
}

.bp-about {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.bp-about h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 830;
  letter-spacing: -0.03em;
}

.bp-about p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.65;
}

.bp-about p:last-child {
  margin-bottom: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .bp-grid,
  .bp-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bp-split {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .bp-split-reverse .bp-split-text {
    order: 0;
  }
}

@media (max-width: 640px) {
  .bp-wrap,
  .bp-narrow {
    width: calc(100% - 32px);
  }

  .bp-hero {
    padding: 64px 0 48px;
  }

  .bp-section {
    padding: 60px 0;
  }

  .bp-grid,
  .bp-steps {
    grid-template-columns: 1fr;
  }

  .bp-card,
  .bp-step,
  .bp-stat-panel,
  .bp-about {
    padding: 22px;
  }

  .bp-terms div {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 18px;
  }

  .bp-cta {
    padding: 44px 20px;
    border-radius: 22px;
  }

  .bp-actions .button {
    width: 100%;
  }
}

/* =========================================================
   Affiliate page
   ========================================================= */
.aff-wrap {
  width: min(1184px, calc(100% - 48px));
  margin-inline: auto;
}

.aff-eyebrow {
  display: block;
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aff-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 32px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent) !important;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 28px rgba(242, 160, 0, 0.32);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.aff-pill:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(242, 160, 0, 0.38);
}

/* ---------- Hero ---------- */
.aff-hero {
  padding: 64px 0 96px;
}

.aff-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 72px;
}

.aff-hero-copy h1 {
  margin: 16px 0 28px;
  font-size: clamp(44px, 5.6vw, 74px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.aff-hero-copy h1 em,
.aff-dark h2 em {
  color: var(--accent-heading);
  font-style: italic;
}

.aff-hero-copy p {
  max-width: 540px;
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
}

.aff-hero-visual {
  display: grid;
  place-items: center;
  padding: 40px 72px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 30px 70px rgba(24, 24, 22, 0.08);
}

.aff-earn-card {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  padding: 36px 32px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 48px rgba(24, 24, 22, 0.16);
}

.aff-example-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--quiet);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.aff-earn-amount {
  font-size: clamp(40px, 4.4vw, 58px);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1;
}

.aff-earn-label {
  margin-top: 10px;
  color: var(--quiet);
  font-size: 18px;
  text-align: center;
}

.aff-chart {
  width: 100%;
  height: 120px;
  margin: 28px 0 22px;
}

.aff-earn-foot {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 16px;
  font-size: 17px;
}

.aff-earn-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.aff-earn-foot svg {
  color: var(--accent-text);
}

/* ---------- Steps ---------- */
.aff-steps-section {
  padding: 32px 0 72px;
}

.aff-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

.aff-step {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.aff-step-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-text);
}

.aff-step h3 {
  margin: 0 0 14px;
  font-size: 21px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.aff-step p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

/* ---------- Alternating rows ---------- */
.aff-rows {
  padding: 72px 0 112px;
}

.aff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 80px;
}

.aff-row + .aff-row {
  margin-top: 96px;
}

.aff-row-flip .aff-row-visual {
  order: 2;
}

.aff-row-text h2 {
  margin: 0 0 22px;
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.aff-row-text p {
  margin: 0 0 40px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.aff-row-text .aff-pill {
  min-height: 48px;
  padding: 0 28px;
  font-size: 16px;
}

.aff-big-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 50px rgba(24, 24, 22, 0.1);
  text-align: center;
}

.aff-big-card strong {
  font-size: clamp(64px, 7vw, 92px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1;
}

.aff-big-card span {
  margin-top: 14px;
  color: var(--quiet);
  font-size: clamp(20px, 2vw, 28px);
}

.aff-shot {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 50px rgba(24, 24, 22, 0.12);
}

.aff-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Dark terms section ---------- */
.aff-dark {
  padding: 96px 0 104px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 176, 0, 0.1), transparent 55%),
    #1a1814;
  color: #f3f2eb;
  text-align: center;
}

.aff-eyebrow-dark {
  color: #ffc13f;
}

.aff-dark h2 {
  margin: 18px 0 56px;
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.aff-dark h2 em {
  color: #ffc13f;
}

.aff-terms-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  text-align: left;
}

.aff-term {
  padding: 26px 26px 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.aff-term h3 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 750;
}

.aff-term p {
  margin: 0;
  color: #bdbcb4;
  font-size: 15px;
  line-height: 1.6;
}

.aff-term a {
  color: #ffc13f;
  font-weight: 700;
  word-break: break-all;
}

.aff-dark-cta {
  margin-top: 48px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .aff-hero-grid,
  .aff-row {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .aff-row-flip .aff-row-visual {
    order: 0;
  }

  .aff-hero-visual {
    padding: 28px;
  }

  .aff-steps,
  .aff-terms-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .aff-row + .aff-row {
    margin-top: 72px;
  }
}

@media (max-width: 640px) {
  .aff-wrap {
    width: calc(100% - 32px);
  }

  .aff-hero {
    padding: 40px 0 56px;
  }

  .aff-hero-copy p {
    font-size: 17px;
  }

  .aff-hero-visual {
    padding: 16px;
  }

  .aff-earn-card {
    padding: 32px 20px 20px;
  }

  .aff-earn-foot {
    font-size: 15px;
  }

  .aff-step {
    padding: 24px;
  }

  .aff-rows {
    padding: 40px 0 72px;
  }

  .aff-pill {
    width: 100%;
    justify-content: center;
  }

  .aff-dark {
    padding: 64px 0 72px;
  }
}

/* =========================================================
   Chuan hoa theo trang chu (do tu computed style cua BrandHome):
   nhan = .feature-overview-label, nut = .feature-overview-cta a
   ========================================================= */
.bp-label,
.aff-eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 9px 17px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.aff-eyebrow-dark {
  border-color: rgba(255, 193, 63, 0.35);
  background: rgba(255, 176, 0, 0.12);
  color: #ffc13f;
}

.brand-page .button,
.aff-pill,
.aff-row-text .aff-pill {
  min-height: 56px;
  padding: 0 32px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 750;
}

.brand-page .button-primary {
  box-shadow: 0 12px 28px rgba(242, 160, 0, 0.3);
}

.aff-dark .aff-eyebrow {
  margin-inline: auto;
}

/* =========================================================
   Affiliate — form dang ky
   ========================================================= */
html:has(.aff-apply) {
  scroll-behavior: smooth;
}

.aff-apply {
  padding: 112px 0 120px;
  scroll-margin-top: 72px;
}

.aff-apply-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 72px;
}

.aff-apply-copy {
  position: sticky;
  top: 110px;
}

.aff-apply-copy h2 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 3.8vw, 50px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.aff-apply-copy h2 em {
  color: var(--accent-heading);
  font-style: italic;
}

.aff-apply-copy > p {
  margin: 0 0 32px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.aff-apply-steps {
  display: grid;
  gap: 22px;
  margin: 0 0 36px;
  padding: 0;
  list-style: none;
  counter-reset: aff-apply;
}

.aff-apply-steps li {
  position: relative;
  display: grid;
  gap: 4px;
  padding-left: 52px;
}

.aff-apply-steps li::before {
  counter-increment: aff-apply;
  content: counter(aff-apply);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 800;
}

.aff-apply-steps strong {
  font-size: 17px;
  font-weight: 750;
}

.aff-apply-steps span {
  color: var(--muted);
  line-height: 1.55;
}

.aff-apply-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.aff-apply-contact a {
  color: var(--accent-text);
  font-weight: 700;
}

.aff-apply-card {
  padding: 40px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 30px 70px rgba(24, 24, 22, 0.09);
}

.apply-form {
  display: grid;
  gap: 20px;
}

.apply-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.apply-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.apply-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.apply-optional {
  color: var(--quiet);
  font-size: 13px;
  font-weight: 500;
}

.apply-field input,
.apply-field select,
.apply-field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--page);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.apply-field textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.5;
}

.apply-field input::placeholder,
.apply-field textarea::placeholder {
  color: var(--quiet);
}

.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.apply-field[data-invalid] input,
.apply-field[data-invalid] select,
.apply-field[data-invalid] textarea {
  border-color: #d64545;
}

.apply-hint,
.apply-error {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
}

.apply-hint {
  color: var(--quiet);
}

.apply-error {
  color: #c53030;
  font-weight: 600;
}

.site[data-theme="dark"] .apply-error {
  color: #ff8a8a;
}

.apply-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.apply-consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}

.apply-consent input {
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--accent-strong);
}

.apply-consent[data-invalid] label {
  color: #c53030;
}

.apply-form-error {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(214, 69, 69, 0.1);
  color: #b42323;
  font-size: 15px;
  font-weight: 600;
}

.site[data-theme="dark"] .apply-form-error {
  color: #ff9d9d;
}

.apply-submit {
  width: 100%;
  justify-content: center;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.apply-submit:disabled {
  cursor: progress;
  opacity: 0.75;
  transform: none;
}

.apply-spin {
  animation: apply-spin 900ms linear infinite;
}

@keyframes apply-spin {
  to {
    transform: rotate(360deg);
  }
}

.apply-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 12px;
  text-align: center;
}

.apply-success svg {
  color: #1f9d55;
}

.apply-success h3 {
  margin: 18px 0 10px;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.apply-success p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.6;
}

.apply-reference {
  margin-top: 20px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (max-width: 960px) {
  .aff-apply-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .aff-apply-copy {
    position: static;
  }
}

@media (max-width: 640px) {
  .aff-apply {
    padding: 64px 0 72px;
  }

  .aff-apply-card {
    padding: 22px;
    border-radius: 20px;
  }

  .apply-grid {
    grid-template-columns: 1fr;
  }
}

/* Form: nut va o chon dong bo voi phan con lai (template dat .site button { font: inherit }). */
.site .apply-submit {
  font-family: var(--font-satoshi), "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 750;
  line-height: 1;
}

.apply-grid {
  align-items: start;
}

.site .apply-field select {
  height: 50px;
  min-height: 50px;
  padding: 0 40px 0 15px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2390908b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
  background-size: 16px;
  line-height: 50px;
}

/* =========================================================
   Pricing page — dung lai bang gia cua trang chu (.landing-pricing)
   ========================================================= */
.landing-pricing-page {
  padding-top: 8px;
  padding-bottom: 32px;
}

.bp-pricing-note {
  width: min(640px, calc(100% - 48px));
  margin: 0 auto 88px;
  color: var(--quiet);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.bp-pricing-note a {
  color: var(--accent-text);
  font-weight: 700;
}

.bp-compare {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.bp-compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  font-size: 15.5px;
}

.bp-compare-row + .bp-compare-row {
  border-top: 1px solid var(--line);
}

.bp-compare-row > span:first-child {
  font-weight: 650;
}

.bp-compare-row > span:not(:first-child) {
  display: flex;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}

.bp-compare-head {
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.bp-compare-head > span:not(:first-child) {
  color: var(--ink);
}

.bp-compare-head > span:last-child {
  color: var(--accent-text);
}

.bp-compare-yes {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
}

.bp-compare-no {
  color: var(--quiet);
}

/* Ghi nguon + ngay kiem du kien doi thu, ngay duoi bang so sanh. */
.bp-compare-note {
  margin: 18px 0 0;
  color: var(--quiet);
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.bp-compare-note a {
  color: var(--accent-text);
  font-weight: 700;
}

/* Luoi 2 the (trang /alternatives/*): 2 cot tren desktop, 1 cot tren dien thoai. */
.bp-grid.bp-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bp-grid-two .bp-card h3 {
  margin-bottom: 4px;
}

/* Nhan nho "Pros" / "Cons" trong the uu/nhuoc diem. */
.bp-card-kicker {
  margin: 18px 0 0;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bp-card-kicker + .bp-list {
  margin-top: 10px;
}

/* Dau tru cho nhuoc diem: ve bang gradient de theo mau sang/toi. */
.bp-list-cons li::before {
  background:
    linear-gradient(var(--muted), var(--muted)) center / 9px 2.5px no-repeat,
    var(--surface-strong);
}

/* Danh sach cong cu (trang /alternatives dang danh sach). */
.bp-stack {
  display: grid;
  gap: 20px;
}

.bp-tool h3 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 830;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.bp-tool[id] {
  scroll-margin-top: 88px;
}

.bp-facts {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
}

.bp-facts > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.bp-facts dt {
  color: var(--ink);
  font-weight: 750;
}

.bp-facts dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.bp-sources {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.bp-sources a,
.bp-compare-row [role="rowheader"] a {
  color: var(--accent-text);
  font-weight: 700;
}

@media (max-width: 640px) {
  .bp-pricing-note {
    width: calc(100% - 32px);
    margin-bottom: 56px;
  }

  .bp-compare-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    padding: 14px 14px;
    font-size: 14px;
  }

  .bp-grid.bp-grid-two {
    grid-template-columns: 1fr;
  }

  .bp-facts > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  /* "Nhu cau:" mot hang, cong cu hang duoi -> moi dong deu 2 hang tren dien thoai. */
  .bp-list-split li strong {
    display: block;
  }
}

/* =========================================================
   Trang phap ly (Terms, Privacy, ban HTML thay the tu /admin)
   Mau lay tu token .site -> doc duoc ca theme sang lan toi.
   ========================================================= */
.bp-legal {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 72px 0 112px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.bp-legal h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(34px, 4.6vw, 56px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.bp-legal h2,
.bp-legal h3 {
  margin: 48px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.bp-legal h3 {
  margin-top: 28px;
  padding-top: 0;
  border-top: 0;
  font-size: 17px;
}

.bp-legal p,
.bp-legal .bp-legal-text {
  margin: 16px 0 0;
}

.bp-legal .bp-legal-updated {
  margin: 0 0 8px;
  color: var(--quiet);
  font-size: 15px;
}

.bp-legal ul,
.bp-legal ol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 0;
  padding-left: 22px;
}

.bp-legal ul {
  list-style: disc;
}

.bp-legal ol {
  list-style: decimal;
}

.bp-legal li::marker {
  color: var(--accent-text);
}

.bp-legal strong {
  color: var(--ink);
  font-weight: 700;
}

.bp-legal a {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bp-legal [id] {
  scroll-margin-top: 110px;
}

@media (max-width: 640px) {
  .bp-legal {
    width: calc(100% - 32px);
    padding: 48px 0 80px;
    font-size: 16px;
  }
}

/* =========================================================
   Bai viet dang blog (/alternatives/*, sau nay /blog/*): noi dung chay tu do,
   muc luc thanh doc dinh ben trai (to sang muc dang doc), the CTA dinh ben phai.
   Mau lay tu token .site -> dung ca giao dien sang/toi.
   ========================================================= */
.ar-wrap {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 40px 0 96px;
}

.ar-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 720px) 250px;
  justify-content: center;
  gap: 56px;
}

.ar-body {
  min-width: 0;
}

/* ---------- Dau bai ---------- */
.ar-header {
  margin: 0 0 8px;
}

.ar-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  color: var(--quiet);
  font-size: 14px;
  list-style: none;
}

.ar-crumbs li + li::before {
  content: "›";
  margin-right: 8px;
  color: var(--quiet);
}

.ar-crumbs a {
  color: var(--muted);
}

.ar-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.ar-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.ar-header h1 {
  margin: 18px 0 16px;
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-wrap: balance;
}

.ar-header h1 em {
  color: var(--accent-heading);
  font-style: italic;
}

.ar-dek {
  margin: 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.6;
}

.ar-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: center;
  margin: 24px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ar-byline img {
  border-radius: 10px;
}

.ar-byline-text {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
}

.ar-byline-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.ar-byline-meta {
  color: var(--quiet);
  font-size: 13.5px;
}

.ar-share {
  display: flex;
  gap: 8px;
}

.ar-share a,
.ar-share button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.ar-share a:hover,
.ar-share button:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.ar-disclosure {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
}

.ar-disclosure a,
.ar-section p a,
.ar-tool-text a,
.ar-section li a {
  color: var(--accent-text);
  font-weight: 700;
}

/* ---------- Muc luc: thanh doc, to sang muc dang doc ---------- */
.ar-toc {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-top: 4px;
}

.ar-toc-title {
  margin: 0 0 12px;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ar-toc ol,
.ar-toc-mobile ol {
  margin: 0;
  padding: 0;
  counter-reset: ar-toc;
  list-style: none;
}

.ar-toc ol {
  border-left: 1px solid var(--line);
}

.ar-toc li,
.ar-toc-mobile li {
  counter-increment: ar-toc;
}

.ar-toc a,
.ar-toc-mobile a {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}

.ar-toc a {
  margin-left: -1px;
  padding: 7px 0 7px 14px;
  border-left: 2px solid transparent;
}

.ar-toc a::before,
.ar-toc-mobile a::before {
  content: counter(ar-toc) ".";
  min-width: 16px;
  color: var(--quiet);
}

.ar-toc a:hover {
  color: var(--ink);
}

.ar-toc a.is-active {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 700;
}

.ar-toc a.is-active::before {
  color: var(--accent-text);
}

/* Muc con (tung cong cu): thut vao, khong danh so, chu nho hon. */
.ar-toc .ar-toc-sub,
.ar-toc-mobile .ar-toc-sub {
  margin: 0 0 4px;
  padding: 0;
  border-left: 0;
  counter-reset: none;
}

.ar-toc .ar-toc-sub li,
.ar-toc-mobile .ar-toc-sub li {
  counter-increment: none;
}

.ar-toc .ar-toc-sub a {
  padding: 4px 0 4px 38px;
  font-size: 13.5px;
}

.ar-toc-mobile .ar-toc-sub a {
  padding: 4px 0 4px 24px;
  font-size: 14px;
}

.ar-toc .ar-toc-sub a::before,
.ar-toc-mobile .ar-toc-sub a::before {
  content: none;
}

.ar-toc-mobile {
  display: none;
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ar-toc-mobile summary {
  padding: 14px 0;
  color: var(--ink);
  font-weight: 750;
  cursor: pointer;
}

.ar-toc-mobile ol {
  display: grid;
  gap: 2px;
  padding: 0 0 14px;
}

.ar-toc-mobile a {
  padding: 6px 0;
}

/* ---------- The CTA ben phai ---------- */
.ar-aside {
  position: sticky;
  top: 96px;
  align-self: start;
}

.ar-promo {
  padding: 24px;
  border-radius: var(--radius-card);
  background: #17140d;
  color: #f3f2eb;
}

.ar-promo-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 830;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.ar-promo-text {
  margin: 0 0 18px;
  color: #c9c8c0;
  font-size: 15px;
  line-height: 1.55;
}

.ar-promo-button {
  display: block;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
}

/* ---------- Noi dung ---------- */
.ar-section {
  scroll-margin-top: 88px;
  padding-top: 44px;
}

.ar-section h2 {
  margin: 0 0 16px;
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 830;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.ar-section p,
.ar-tool-text p,
.ar-steps li,
.ar-qa p {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.75;
}

.ar-section > .bp-list {
  margin: 8px 0 20px;
}

.ar-section > .bp-list li {
  font-size: 17px;
  line-height: 1.65;
}

.ar-callout {
  margin-top: 36px;
  padding: 22px 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: var(--radius-card);
  background: var(--accent-soft);
}

.ar-callout-title {
  margin: 0 0 4px;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ar-callout .bp-list li {
  color: var(--ink);
}

.ar-steps {
  display: grid;
  gap: 4px;
  margin: 8px 0 20px;
  padding: 0;
  counter-reset: ar-step;
  list-style: none;
}

.ar-steps li {
  position: relative;
  margin: 0;
  padding-left: 42px;
  counter-increment: ar-step;
}

.ar-steps li::before {
  content: counter(ar-step);
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.ar-table {
  margin: 20px 0 24px;
}

.ar-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.ar-table table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 15px;
}

.ar-table th,
.ar-table td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ar-table thead th {
  border-top: 0;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 800;
}

.ar-table tbody th {
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.ar-table td {
  color: var(--muted);
}

.ar-table a {
  color: var(--accent-text);
}

.ar-table figcaption {
  margin-top: 10px;
  color: var(--quiet);
  font-size: 13.5px;
  line-height: 1.6;
}

/* Bang hep (3 cot ngan, vd diem tung tieu chi trong bai Best): vua khung dien thoai, khong cuon ngang. */
.ar-table-compact table {
  min-width: 0;
  table-layout: fixed; /* cac bang cung loai trong mot bai thang cot voi nhau */
}

.ar-table-compact thead th:first-child {
  width: 34%;
}

.ar-table-compact thead th:nth-child(2) {
  width: 84px;
}

.ar-table-compact tbody th {
  white-space: normal;
}

@media (max-width: 560px) {
  .ar-table-compact th,
  .ar-table-compact td {
    padding: 11px 12px;
  }
}

/* ---------- Tung cong cu: khong dong khung, ngan bang duong ke ---------- */
.ar-tool {
  scroll-margin-top: 88px;
  margin: 36px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.ar-tool-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ar-rank {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-top: 1px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 850;
}

.ar-tool h3 {
  margin: 0;
  font-size: 25px;
  font-weight: 830;
  letter-spacing: -0.03em;
  line-height: 1.25;
}

.ar-tool-tag {
  margin: 3px 0 0;
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
}

.ar-tool-text p:last-child {
  margin-bottom: 0;
}

.ar-figure {
  margin: 20px 0 0;
}

/* Dong phu trong o bang (ghi chu gia, ly do): nho, mau nhat, xuong dong rieng. */
.ar-cell-note {
  display: block;
  margin-top: 3px;
  color: var(--quiet);
  font-size: 13px;
  line-height: 1.45;
}

.ar-figure a,
.ar-figure picture {
  display: block;
}

.ar-figure a {
  border-radius: 14px;
  cursor: zoom-in;
}

.ar-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ar-figure figcaption {
  margin-top: 8px;
  color: var(--quiet);
  font-size: 13.5px;
}

.ar-tool .bp-facts {
  margin-top: 22px;
}

.ar-pc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 22px;
}

.ar-pc .bp-list li {
  font-size: 15.5px;
}

.ar-tool-source {
  margin: 16px 0 0;
  font-size: 14px;
}

.ar-tool-source a {
  color: var(--accent-text);
  font-weight: 700;
}

.ar-qa h3 {
  margin: 22px 0 6px;
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.ar-section .bp-faq {
  margin-top: 8px;
}

/* ---------- Tac gia, bai lien quan ---------- */
.ar-author {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 56px 0 0;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ar-author img {
  flex: 0 0 auto;
  border-radius: 12px;
}

.ar-author p {
  margin: 0;
}

.ar-author-kicker {
  color: var(--quiet);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ar-author .ar-author-name {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 800;
}

.ar-author-role {
  color: var(--muted);
  font-size: 15px;
}

.ar-author .ar-author-bio {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.ar-related {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ar-related li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ar-related a {
  color: var(--accent-text);
  font-weight: 750;
}

.ar-related span {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  .ar-layout {
    grid-template-columns: 210px minmax(0, 720px);
    gap: 48px;
  }

  .ar-aside {
    display: none;
  }
}

@media (max-width: 1079px) {
  .ar-layout {
    grid-template-columns: minmax(0, 720px);
  }

  .ar-toc {
    display: none;
  }

  .ar-toc-mobile {
    display: block;
  }
}

@media (max-width: 640px) {
  .ar-wrap {
    width: calc(100% - 32px);
    padding: 28px 0 72px;
  }

  .ar-dek {
    font-size: 17px;
  }

  .ar-pc {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .ar-tool h3 {
    font-size: 22px;
  }

  /* Nut chia se xuong hang rieng, thang cot voi ten tac gia (avatar 40px + khoang 14px). */
  .ar-share {
    width: 100%;
    padding-left: 54px;
  }
}

/* =========================================================
   Thu vien /resources: trang chu + hub tung loai. The chu (chip loai bai, tieu de,
   mot cau, ngay kiem gia), nhom theo viec cong cu lam. Dung chung breadcrumb/chip/dek voi bai viet.
   ========================================================= */
.lib-header {
  max-width: 760px;
  margin: 0 auto 44px;
  text-align: center;
}

.lib-header .ar-crumbs ol {
  justify-content: center;
}

.lib-header h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 4vw, 50px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-wrap: balance;
}

.lib-header h1 em {
  color: var(--accent-heading);
  font-style: italic;
}

.lib-method {
  margin: 16px 0 0;
  color: var(--quiet);
  font-size: 14.5px;
}

.lib-method a,
.lib-section-head a {
  color: var(--accent-text);
  font-weight: 700;
}

.lib-section {
  max-width: 1120px;
  margin: 0 auto;
}

.lib-section + .lib-section {
  margin-top: 48px;
}

.lib-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.lib-section-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.lib-section-head a {
  font-size: 14.5px;
  white-space: nowrap;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lib-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  height: 100%;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lib-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.lib-card-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.28;
}

.lib-card-text {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.lib-card-meta {
  margin-top: auto;
  padding-top: 6px;
  color: var(--quiet);
  font-size: 13.5px;
}

@media (max-width: 1079px) {
  .lib-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .lib-header {
    margin-bottom: 32px;
    text-align: left;
  }

  .lib-header .ar-crumbs ol {
    justify-content: flex-start;
  }

  .lib-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .lib-section + .lib-section {
    margin-top: 36px;
  }
}
