/* =========================================================
   kitudacbiet.me — Shared stylesheet (dùng chung 3 trang)
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #111318;
  --bg-2: #161920;
  --panel: #1b1f27;
  --panel-2: #222731;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f2f3f5;
  --text-2: #b9bec9;
  --text-3: #8b92a0;
  --brand: #ffc21a;
  --brand-2: #ffd84d;
  --brand-ink: #1a1405;
  --fire: #ff6a1a;
  --ok: #34d399;
  --bad: #f87171;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --glow: 0 6px 24px rgba(255, 194, 26, .35);

  --container: 1200px;
  --gutter: 24px;
  --header-h: 68px;
  --bnav-h: 0px;

  --fs-p: 17px;      /* chuẩn đoạn văn */
  --fs-sm: 15px;     /* chữ phụ: không nhỏ hơn 14px */
  --fs-xs: 14px;
  --fs-h1: clamp(30px, 5.2vw, 58px);
  --fs-h2: clamp(22px, 2.6vw, 28px);
  --fs-h3: clamp(18px, 2vw, 21px);

  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-p);
  line-height: 1.65;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 194, 26, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 40%, rgba(255, 106, 26, .06), transparent 60%),
    var(--bg);
  overflow-x: clip;
  padding-bottom: var(--bnav-h);
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 800; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.icon--fill { fill: currentColor; stroke: none; }

/* ---------- 3. Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.section { margin-top: 36px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.grid-main > * { min-width: 0; }
.stack > * + * { margin-top: 28px; }

/* ---------- 4. Typography helpers ---------- */
.display { font-style: italic; font-weight: 800; letter-spacing: -.01em; }
.text-brand { color: var(--brand); }
.muted { color: var(--text-2); }

/* ---------- 5. Buttons & chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px;
  font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: var(--brand-ink); box-shadow: var(--glow); }
.btn--primary:hover { box-shadow: 0 8px 30px rgba(255, 194, 26, .55); }
.btn--ghost { background: var(--panel-2); border: 1px solid var(--line-2); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 10px; }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 11px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  font-weight: 600; font-size: 15px; color: var(--text);
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.chip:hover { border-color: rgba(255, 194, 26, .6); }
.chip.is-active { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: var(--brand-ink); border-color: transparent; box-shadow: var(--glow); }
.tag {
  align-self: flex-start; width: fit-content;
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255, 194, 26, .12); color: var(--brand); font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--text-2); transition: color .2s, background .2s;
}
.icon-btn:hover { color: var(--brand); background: rgba(255, 255, 255, .06); }
.icon-btn.is-on { color: var(--brand); }
.icon-btn.is-on .icon { fill: currentColor; }

/* ---------- 6. Panel (box chung) ---------- */
.panel {
  position: relative; background: linear-gradient(180deg, rgba(34, 39, 49, .9), rgba(27, 31, 39, .92));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel__title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h2); font-style: italic; }
.panel__title .icon { width: 28px; height: 28px; color: var(--brand); }
.panel__title .icon.fire { color: var(--fire); }
.panel__link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: var(--fs-sm); }
.panel__link .icon { width: 18px; height: 18px; transition: transform .2s; }
.panel__link:hover .icon { transform: translateX(3px); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h2); font-style: italic; margin-bottom: 18px; }
.section-title .icon { width: 28px; height: 28px; color: var(--brand); }
.section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 194, 26, .5), transparent); margin-left: 8px; }

/* ---------- 7. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(17, 19, 24, .82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-style: italic; font-size: 26px; letter-spacing: -.02em; }
.logo .icon { width: 34px; height: 34px; color: var(--brand); fill: rgba(255, 194, 26, .25); }
.logo b { color: var(--brand); font-weight: 800; }
.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a { padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 16px; color: var(--text-2); transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.nav a.is-active { color: var(--brand-ink); background: var(--brand); transform: skewX(-8deg); }
.nav a.is-active span { display: inline-block; transform: skewX(8deg); }
.header-search { margin-left: 8px; }

/* Search overlay */
.search-pop { position: fixed; inset: 0; z-index: 90; background: rgba(8, 9, 12, .7); backdrop-filter: blur(6px); display: none; padding: 90px 15px 0; }
.search-pop.is-open { display: block; animation: fade .2s; }
.search-pop form { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 8px; }
.search-pop input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0 12px; font-size: 17px; }

/* ---------- 8. Hero + tool ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 0; isolation: isolate; }
.hero__art {
  position: absolute; z-index: -1; right: 0; top: 0; width: min(62%, 860px); height: 100%;
  background: url("../img/hero-char.webp") center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 35%), linear-gradient(0deg, transparent 0%, #000 35%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
  opacity: .95;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; z-index: -1; background: linear-gradient(0deg, var(--bg), transparent); }
.hero__title { font-size: var(--fs-h1); line-height: 1.02; font-style: italic; text-transform: uppercase; text-shadow: 0 4px 24px rgba(0, 0, 0, .5); transform: rotate(-3deg); transform-origin: left; }
.hero__title span { display: block; background: linear-gradient(180deg, #ffe680, var(--brand) 55%, #e89b00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { max-width: 460px; margin-top: 18px; color: var(--text-2); font-size: 18px; font-style: italic; }

.tool { margin-top: 36px; padding: 24px; border-color: rgba(255, 194, 26, .25); }
.tool::before { content: ""; position: absolute; left: -1px; top: -1px; width: 180px; height: 5px; border-radius: 20px 0 6px 0; background: var(--brand); box-shadow: var(--glow); }
.tool__head { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h3); font-style: italic; margin-bottom: 16px; }
.tool__head .icon { color: var(--brand); width: 26px; height: 26px; }
.tool__row { display: flex; gap: 12px; }
.field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; background: #13161c; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(255, 194, 26, .12); }
.field > .icon { margin-left: 14px; color: var(--text-3); }
.field input { flex: 1; min-width: 0; height: 52px; padding: 0 12px; background: none; border: 0; outline: 0; font-size: 17px; }
.field input::placeholder { color: var(--text-3); }
.field .icon-btn { margin-right: 6px; }
.tool__row .btn { min-height: 54px; padding: 0 28px; font-size: 17px; }
.tool__styles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 16px; }
.tool__result { margin-top: 18px; }
.tool__result:empty { display: none; }
.tool__count { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- 9. Name cards ---------- */
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.name-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.name-card {
  position: relative; display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 6px 6px 6px 14px;
  background: #171a21; border: 1px solid var(--line-2); border-radius: 12px; transition: border-color .2s, transform .2s var(--ease);
}
.name-card:hover { border-color: rgba(255, 194, 26, .55); transform: translateY(-2px); }
.name-card__text { flex: 1; min-width: 0; text-align: center; font-weight: 700; font-size: 18px; overflow-wrap: anywhere; line-height: 1.35; cursor: pointer; }
.name-card__actions { display: flex; }
.name-card .icon-btn { width: 36px; height: 36px; }
.name-card .icon-btn .icon { width: 19px; height: 19px; }
.name-card.is-copied { border-color: var(--ok); }

/* ---------- 10. Rank list ---------- */
.rank { display: grid; gap: 10px; counter-reset: rank; list-style: none; }
.rank__item { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: #171a21; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s; }
.rank__item:hover { border-color: rgba(255, 194, 26, .5); }
.rank__no { counter-increment: rank; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; font-size: 16px; color: #1b1b1b; background: #5a606c; flex: none; }
.rank__no::before { content: counter(rank); }
.rank__item:nth-child(1) .rank__no { background: linear-gradient(180deg, #ffe680, #f0a800); }
.rank__item:nth-child(2) .rank__no { background: linear-gradient(180deg, #eef1f6, #9aa3b2); }
.rank__item:nth-child(3) .rank__no { background: linear-gradient(180deg, #ffcf8a, #c97a22); }
.rank__name { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.rank__hot { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.rank__hot .icon { color: var(--fire); width: 18px; height: 18px; fill: rgba(255, 106, 26, .35); }

/* ---------- 11. Topic cards ---------- */
.topics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.topic {
  --c: var(--brand);
  display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 12px 14px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%), var(--panel);
  border: 1px solid var(--line-2); border-radius: 14px; font-weight: 700; font-size: 16px;
  transition: border-color .2s, transform .2s var(--ease);
}
.topic:hover { border-color: var(--c); transform: translateY(-3px); }
.topic__ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); flex: none; }
.topic__ico .icon { width: 24px; height: 24px; }
.topic span { flex: 1; min-width: 0; }
.topic > .icon { color: var(--c); width: 20px; height: 20px; }

/* ---------- 12. Post items ---------- */
.posts { display: grid; gap: 14px; list-style: none; }
.post { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; padding-bottom: 0; }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.post:hover .thumb img, .card:hover .thumb img { transform: scale(1.06); }
.thumb--gen { display: grid; place-items: center; background: linear-gradient(135deg, var(--g1, #3b2bd1), var(--g2, #b5179e)); }
.thumb--gen .icon { width: 42%; height: 42%; max-width: 64px; color: rgba(255, 255, 255, .92); }
.post__title { font-size: 18px; font-weight: 700; line-height: 1.4; transition: color .2s; }
.post__title a:hover { color: var(--brand); }
.post__excerpt { margin: 6px 0 8px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--text-3); font-size: var(--fs-xs); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.meta .icon { width: 16px; height: 16px; }

/* ---------- 13. Why box ---------- */
.why { overflow: hidden; display: flex; flex-direction: column; justify-content: center; min-height: 100%; }
.why__title { display: inline-block; align-self: flex-start; padding: 10px 18px; margin-bottom: 18px; font-size: 24px; font-style: italic; color: var(--brand-ink); background: var(--brand); transform: rotate(-3deg); clip-path: polygon(2% 0, 100% 4%, 97% 100%, 0 92%); line-height: 1.2; }
.checks { list-style: none; display: grid; gap: 12px; position: relative; z-index: 1; max-width: 62%; }
.checks li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.checks .icon { color: var(--brand); width: 24px; height: 24px; margin-top: 2px; }
.why__img { position: absolute; right: -10px; bottom: -6px; width: 44%; max-width: 220px; filter: drop-shadow(0 10px 30px rgba(255, 140, 0, .35)); }

/* ---------- 14. Prose (SEO content / bài viết) ---------- */
.prose { font-size: var(--fs-p); color: #dcdfe6; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--fs-h2); margin-top: 1.6em; color: var(--text); }
.prose h3 { font-size: var(--fs-h3); margin-top: 1.3em; color: var(--text); }
.prose p { margin: 0; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--brand); font-weight: 700; }
.prose strong { color: var(--text); }
.prose blockquote, .note { margin: 1.2em 0 0; padding: 14px 18px; border-left: 4px solid var(--brand); background: rgba(255, 194, 26, .07); border-radius: 0 12px 12px 0; }
.note { display: flex; gap: 12px; }
.note .icon { color: var(--brand); margin-top: 3px; }
.prose figure { margin: 1.4em 0 0; }
.prose figure img { border-radius: 14px; width: 100%; }
.prose figcaption { margin-top: 8px; text-align: center; color: var(--text-3); font-size: var(--fs-xs); }
.prose .name-grid { margin-top: 1em; }

/* Table — luôn bọc .table-wrap để không tràn body trên mobile */
.table-wrap { position: relative; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-2); border-radius: 14px; margin-top: 1.2em; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
.table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 16px; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: var(--panel-2); color: var(--brand); font-weight: 700; font-size: 15px; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.table .sym { font-size: 22px; font-weight: 700; white-space: nowrap; }
.table .icon-btn { width: 34px; height: 34px; }

/* FAQ */
.faq { display: grid; gap: 10px; margin-top: 1em; }
.faq details { background: #171a21; border: 1px solid var(--line); border-radius: 12px; }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; cursor: pointer; font-weight: 700; color: var(--text); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--brand); transition: transform .25s; }
.faq details[open] summary .icon { transform: rotate(90deg); }
.faq details > div { padding: 0 16px 16px; color: var(--text-2); }

/* Steps */
.steps { list-style: none; counter-reset: st; display: grid; gap: 12px; padding: 0 !important; }
.steps li { counter-increment: st; position: relative; padding: 14px 16px 14px 62px; background: #171a21; border: 1px solid var(--line); border-radius: 12px; margin: 0 !important; }
.steps li::before { content: counter(st); position: absolute; left: 14px; top: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-weight: 800; }
.steps b { display: block; color: var(--text); }

/* ---------- 15. Rating (Hữu ích / Cần cải thiện) ---------- */
.rating { text-align: center; }
.rating__q { font-size: var(--fs-h3); font-weight: 700; margin-bottom: 6px; }
.rating__sub { color: var(--text-2); font-size: var(--fs-sm); margin-bottom: 16px; }
.rating__btns { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.vote { display: inline-flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 20px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 700; transition: all .2s var(--ease); }
.vote .icon { width: 22px; height: 22px; }
.vote em { font-style: normal; font-size: 14px; color: var(--text-3); background: rgba(255, 255, 255, .06); padding: 2px 8px; border-radius: 999px; }
.vote--up:hover, .vote--up.is-on { border-color: var(--ok); color: var(--ok); }
.vote--down:hover, .vote--down.is-on { border-color: var(--bad); color: var(--bad); }
.vote.is-on { background: color-mix(in srgb, currentColor 12%, var(--panel-2)); }
.vote.is-on em { color: inherit; }
.rating__bar { max-width: 420px; height: 8px; margin: 18px auto 6px; border-radius: 99px; background: rgba(248, 113, 113, .35); overflow: hidden; }
.rating__bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .5s var(--ease); }
.rating__pct { font-size: var(--fs-xs); color: var(--text-3); }
.rating__form { display: none; max-width: 560px; margin: 16px auto 0; text-align: left; }
.rating__form.is-open { display: block; animation: fade .25s; }
.rating__form textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 12px; background: #13161c; border: 1px solid var(--line-2); resize: vertical; outline: 0; font-size: 16px; }
.rating__form textarea:focus { border-color: var(--brand); }
.rating__form .btn { margin-top: 10px; }
.rating__thanks { margin-top: 12px; color: var(--ok); font-weight: 600; display: none; }
.rating__thanks.is-show { display: block; }

/* ---------- 16. Breadcrumb + page head ---------- */
.page-head { padding: 34px 0 6px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-3); font-size: var(--fs-xs); list-style: none; margin-bottom: 14px; }
.crumbs a:hover { color: var(--brand); }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "/"; opacity: .5; }
.page-title { font-size: clamp(28px, 4vw, 44px); font-style: italic; }
.page-desc { color: var(--text-2); max-width: 720px; margin-top: 10px; }

/* ---------- 17. Category list (danh mục) ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.tabs { display: flex; gap: 8px; min-width: 0; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .chip { flex: none; min-height: 40px; }
.toolbar .field { flex: 0 1 300px; }
.toolbar .field input { height: 44px; font-size: 16px; }

.feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: center; padding: 16px; }
.feature .thumb { aspect-ratio: 16 / 10; }
.feature__title { font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; margin: 10px 0; }
.feature__title a:hover { color: var(--brand); }

.list { list-style: none; display: grid; gap: 16px; margin-top: 20px; }
.card { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; transition: border-color .2s, transform .25s var(--ease), box-shadow .25s; }
.card:hover { border-color: rgba(255, 194, 26, .4); transform: translateY(-3px); box-shadow: var(--shadow); }
.card__body { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 4px 4px 4px 0; }
.card__title { font-size: 20px; line-height: 1.35; margin: 8px 0 6px; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card.is-hidden { display: none; }
.empty { display: none; text-align: center; padding: 40px 0; color: var(--text-2); }
.empty.is-show { display: block; }

.pager { display: flex; justify-content: center; gap: 8px; margin-top: 28px; list-style: none; }
.pager a { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); font-weight: 700; }
.pager a.is-active, .pager a:hover { background: var(--brand); color: var(--brand-ink); border-color: transparent; }

.side > * + * { margin-top: 22px; }
.side-topics { list-style: none; display: grid; gap: 8px; }
.side-topics a { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 12px; background: #171a21; border: 1px solid var(--line); font-weight: 600; transition: border-color .2s, color .2s; }
.side-topics a:hover { border-color: var(--brand); color: var(--brand); }
.side-topics em { font-style: normal; font-size: 14px; color: var(--text-3); }
.cta { text-align: center; background: radial-gradient(400px 200px at 50% 0, rgba(255, 194, 26, .25), transparent), var(--panel); }
.cta h3 { font-size: 22px; font-style: italic; margin-bottom: 8px; }
.cta p { color: var(--text-2); font-size: var(--fs-sm); }
.cta .btn { width: 100%; }

/* ---------- 18. Article (chi tiết) ---------- */
.article-head { max-width: 860px; }
.article-head .meta { margin-top: 14px; font-size: var(--fs-sm); }
.cover { margin: 24px 0 0; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 21 / 9; background: var(--panel-2); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.toc ol { list-style: none; counter-reset: toc; display: grid; gap: 2px; }
.toc a { counter-increment: toc; display: flex; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 16px; line-height: 1.45; transition: background .2s, color .2s; }
.toc a::before { content: counter(toc) "."; color: var(--brand); font-weight: 700; }
.toc a:hover, .toc a.is-active { background: rgba(255, 194, 26, .08); color: var(--text); }
.side--sticky { position: sticky; top: calc(var(--header-h) + 16px); }
.share { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.share b { margin-right: 4px; }
.share .icon-btn { background: var(--panel-2); border: 1px solid var(--line-2); }
.author { display: flex; gap: 14px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); flex: none; }
.avatar .icon { width: 28px; height: 28px; }
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.related .post { grid-template-columns: 1fr; border: 0; padding: 0; gap: 10px; align-items: start; }

/* ---------- 19. Footer ---------- */
.site-footer { margin-top: 56px; padding: 44px 0 28px; background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .35)), #0d0f13; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; right: -60px; bottom: -40px; width: 320px; height: 120px; background: var(--brand); transform: rotate(-18deg); opacity: .9; clip-path: polygon(0 60%, 100% 0, 100% 40%, 10% 100%); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; position: relative; }
.footer-brand p { margin-top: 12px; color: var(--text-2); font-size: var(--fs-sm); max-width: 280px; }
.footer-col h4 { font-size: 18px; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: grid; gap: 10px; }
.footer-col a { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: var(--fs-sm); transition: color .2s; }
.footer-col a:hover { color: var(--brand); }
.footer-col a .icon { width: 16px; height: 16px; }
.socials { display: flex; gap: 12px; }
.socials a { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; transition: transform .2s var(--ease); }
.socials a:hover { transform: translateY(-3px); }
.socials .yt { background: #ff0000; color: #fff; }
.socials .tt { background: #000; color: #fff; border: 1px solid var(--line-2); }
.socials .fb { background: #1877f2; color: #fff; border-radius: 50%; }
.socials .icon { width: 24px; height: 24px; }
.copyright { position: relative; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--text-3); font-size: var(--fs-xs); }

/* ---------- 20. Mobile bottom nav (sáng tạo: dock nổi + nút tia sét) ---------- */
.bnav { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(5, 6, 9, .6); opacity: 0; visibility: hidden; transition: .25s; }
.sheet { position: fixed; z-index: 80; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto; padding: 10px 15px calc(110px + env(safe-area-inset-bottom)); background: var(--bg-2); border-top: 1px solid var(--line-2); border-radius: 24px 24px 0 0; transform: translateY(105%); visibility: hidden; transition: transform .35s var(--ease), visibility 0s .35s; }
.sheet::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto 14px; border-radius: 5px; background: var(--line-2); }
.sheet.is-open { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
.sheet.is-open ~ .sheet-backdrop, .sheet-backdrop.is-open { opacity: 1; visibility: visible; }
.sheet__title { display: flex; justify-content: space-between; align-items: center; font-size: 20px; font-style: italic; margin-bottom: 14px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; list-style: none; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); font-weight: 600; font-size: 14px; text-align: center; line-height: 1.3; }
.sheet-grid a .icon { width: 26px; height: 26px; color: var(--brand); }
.saved-list { display: grid; gap: 10px; }
.saved-empty { text-align: center; color: var(--text-2); padding: 20px 0; }

/* ---------- 21. Toast / back-to-top ---------- */
.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(24px + var(--bnav-h)); transform: translate(-50%, 20px); display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 12px; background: #fff; color: #111; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s var(--ease); max-width: calc(100% - 30px); }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast .icon { color: #16a34a; }
.to-top { position: fixed; z-index: 40; right: 18px; bottom: calc(24px + var(--bnav-h)); width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(10px); transition: .25s; }
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 26, .55), var(--glow); } 50% { box-shadow: 0 0 0 10px rgba(255, 194, 26, 0), var(--glow); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .grid-main { grid-template-columns: minmax(0, 1fr) 320px; }
  .topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool__styles { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  :root { --gutter: 20px; }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .side--sticky { position: static; }
  .nav { display: none; }
  .header-search { margin-left: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .feature { grid-template-columns: 1fr; }
  .card { grid-template-columns: 200px minmax(0, 1fr); }
  .related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Mobile: gutter 12px (≤ 15px), box bỏ padding/margin để item rộng tối đa ---- */
@media (max-width: 768px) {
  :root { --gutter: 12px; --header-h: 58px; --bnav-h: calc(78px + env(safe-area-inset-bottom)); --radius-lg: 16px; }
  .section { margin-top: 30px; }
  .logo { font-size: 22px; }
  .logo .icon { width: 28px; height: 28px; }

  /* Box (panel) không padding/viền/nền trên mobile → item chiếm trọn chiều ngang */
  .panel { padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
  .panel__head { margin-bottom: 14px; }
  .panel__title, .section-title { font-size: 21px; }
  .panel__title .icon, .section-title .icon { width: 24px; height: 24px; }

  /* Riêng tool & khối nổi bật: full-bleed sát mép, nội dung cách mép = gutter */
  .tool, .why, .cta, .feature { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 16px var(--gutter); border-radius: 0; border-left: 0; border-right: 0; background: linear-gradient(180deg, rgba(34, 39, 49, .95), rgba(27, 31, 39, .95)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .tool::before { border-radius: 0 0 6px 0; left: 0; }

  .hero { padding-top: 28px; }
  .hero__art { width: 100%; opacity: .45; -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%); mask-image: linear-gradient(180deg, #000 30%, transparent 95%); background-position: 70% top; }
  .hero__title { font-size: clamp(32px, 10vw, 44px); transform: rotate(-2deg); }
  .hero__sub { font-size: 16px; }
  .tool { margin-top: 24px; }
  .tool__row { flex-direction: column; gap: 10px; }
  .tool__row .btn { width: 100%; min-height: 50px; }
  .tool__styles { gap: 8px; }
  .tool__styles .chip { padding: 0 8px; font-size: 14px; gap: 6px; }

  .name-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .name-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .name-card { min-height: 52px; padding: 4px 2px 4px 8px; gap: 2px; }
  .name-card__text { font-size: 16px; }
  .name-card .icon-btn { width: 30px; height: 32px; }
  .name-card .icon-btn .icon { width: 17px; height: 17px; }

  .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .topic { min-height: 60px; padding: 10px; gap: 10px; font-size: 15px; line-height: 1.3; }
  .topic__ico { width: 38px; height: 38px; }
  .topic > .icon { display: none; }
  .topics .topic:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .post { grid-template-columns: 116px minmax(0, 1fr); gap: 12px; align-items: start; }
  .post__title { font-size: 16px; }
  .post__excerpt { -webkit-line-clamp: 2; font-size: 14px; margin: 4px 0 6px; }

  .why { padding-top: 22px; padding-bottom: 22px; }
  .why__title { font-size: 20px; }
  .checks { max-width: 64%; gap: 10px; }
  .checks li { font-size: 15px; }
  .why__img { width: 40%; right: -6px; }

  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar .field { flex: 1 1 auto; width: 100%; }
  .card { grid-template-columns: 1fr; gap: 12px; padding: 0 0 16px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .card:hover { transform: none; box-shadow: none; }
  .card__title { font-size: 19px; margin-top: 6px; }
  .list { gap: 18px; }
  .feature { padding-top: 16px; padding-bottom: 18px; gap: 14px; }

  .cover { aspect-ratio: 16 / 9; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); border-radius: 0; }
  .table { min-width: 460px; font-size: 15px; }
  .table th, .table td { padding: 10px 12px; }
  .steps li { padding: 12px 12px 12px 56px; }
  .steps li::before { left: 12px; top: 12px; width: 32px; height: 32px; }
  .related { grid-template-columns: minmax(0, 1fr); }
  .related .post { grid-template-columns: 116px minmax(0, 1fr); gap: 12px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .footer-brand, .footer-social { grid-column: 1 / -1; }
  .site-footer { padding-top: 32px; }

  .to-top { right: 12px; width: 42px; height: 42px; }

  /* Dock */
  .bnav {
    display: block; position: fixed; z-index: 60; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    height: 64px; border-radius: 22px;
    background: rgba(22, 25, 32, .86); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
    border: 1px solid var(--line-2); box-shadow: 0 12px 34px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  }
  .bnav ul { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); height: 100%; align-items: center; }
  .bnav a, .bnav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 64px; width: 100%; color: var(--text-3); font-size: 11.5px; font-weight: 600; transition: color .2s; }
  .bnav .icon { width: 22px; height: 22px; transition: transform .25s var(--ease); }
  .bnav .is-active { color: var(--brand); }
  .bnav .is-active .icon { transform: translateY(-2px); }
  .bnav .is-active::after { content: ""; position: absolute; bottom: 5px; width: 18px; height: 3px; border-radius: 3px; background: var(--brand); box-shadow: 0 0 10px var(--brand); }
  .bnav__fab { gap: 4px !important; }
  .bnav__fab .fab { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -30px; border-radius: 18px; transform: rotate(45deg); background: linear-gradient(135deg, var(--brand-2), #f59e0b); border: 4px solid var(--bg); color: var(--brand-ink); animation: pulse 2.4s infinite; }
  .bnav__fab .fab .icon { transform: rotate(-45deg); width: 24px; height: 24px; fill: currentColor; }
  .bnav__fab span:last-child { color: var(--brand); }
  .bnav .badge { position: absolute; top: 8px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fire); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
  .bnav .badge:empty { display: none; }
}

@media (max-width: 380px) {
  .tool__styles .chip .icon { display: none; }
  .name-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .checks { max-width: 100%; }
  .why__img { opacity: .35; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
