/* Trang thuật ngữ (/thuat-ngu/<slug>, /en/glossary/<slug>) và mục lục A–Z.
   Phần header (#tabs, #tab-pill, #nav-overlay) giống trang chủ và Product Map. */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #F5F5F5; color: #111; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif; }
:where(#tabs, #tab-pill, #nav-overlay), :where(#tabs, #tab-pill, #nav-overlay) * { box-sizing: border-box; margin: 0; padding: 0; }
a.tab-btn { text-decoration: none; }

/* ── HEADER ─────────────────────────────────────────────── */
#tabs {
  position: fixed; top: 0; left: 0; right: 0; height: 80px;
  background: rgba(245,245,245,0.97); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; z-index: 200; gap: 16px;
}

/* Logo */
#header-logo {
  width: 34px; height: 40px; flex-shrink: 0; cursor: pointer;
  transition: opacity 0.2s, filter 0.2s; display: block;
}
#header-logo:hover { opacity: 0.6; }

/* Pill tab selector — fixed, centered in header */
#tab-pill {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 201;
  background: #f5f5f5; border: 1px solid #d4d4d4; border-radius: 160px;
  display: flex; align-items: center; padding: 8px 10px; gap: 2px;
  width: fit-content;
}
.tab-btn {
  background: transparent; border: none; cursor: pointer;
  color: #262626; font-size: 14px; font-weight: 500; padding: 10px 22px;
  border-radius: 160px; transition: background 0.18s, color 0.18s;
  font-family: inherit; white-space: nowrap; flex-shrink: 0; line-height: 1.4;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tab-btn:hover { background: rgba(0,0,0,0.05); }
.tab-btn.active { background: #241775; color: #fafafa; }
.tb-icon { display: none; font-size: 20px; line-height: 1; }
.tb-label { display: block; }

/* Menu icon (3-element: square · rounded-square · arrow) */
#menu-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  position: relative; cursor: pointer; background: none; border: none; padding: 0;
}
.mdot {
  position: absolute; top: 50%; background: #282935;
  transform: translateY(-50%); transition: background 0.2s;
}
.mdot-c { left: 50%; width: 10px; height: 10px; border-radius: 6px; transform: translate(-50%,-50%); }
.mdot-l { left: calc(50% - 14px); width: 10px; height: 10px; border-radius: 1px; transform: translate(-50%,-50%); }
.mdot-r { left: calc(50% + 14px); width: 0; height: 0;
  background: none; border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 7px solid #282935; transform: translate(-50%,-50%); border-radius: 1px; transition: border-top-color 0.2s;
}

/* ── NAV OVERLAY (nhanluu.com style) ─────────────────────── */
#nav-overlay {
  position: fixed; inset: 0; z-index: 600;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease;
}
#nav-overlay.open { opacity: 1; pointer-events: all; }
#nav-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
}
#nav-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(440px,100vw);
  background: linear-gradient(90deg, rgba(33,33,33,0.05), #1a1a1a 70%);
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px 52px; gap: 0;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
#nav-overlay.open #nav-panel { transform: translateX(0); }
#nav-close {
  position: absolute; top: 24px; right: 24px;
  width: 48px; height: 48px; background: none; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.nav-x-line {
  position: absolute; width: 22px; height: 2px; background: #fff; border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-x-line:nth-child(1) { transform: rotate(45deg); }
.nav-x-line:nth-child(2) { transform: rotate(-45deg); }
.nav-divider { width: 40px; height: 1px; background: rgba(255,255,255,0.12); margin-bottom: 40px; }
.nav-link {
  display: block; color: #c4c4c4; text-decoration: none;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: clamp(28px,5vw,42px); font-weight: 900;
  letter-spacing: 0.04em; line-height: 1.1;
  margin-bottom: 32px;
  transform: translateX(0); opacity: 0.7;
  transition: transform 0.25s ease, opacity 0.25s ease, color 0.25s ease;
}
.nav-link:hover { transform: translateX(-16px); opacity: 1; color: #fff; }
.nav-dark-toggle {
  margin-top: 48px; display: flex; align-items: center; gap: 12px;
  color: rgba(255,255,255,0.35); font-size: 13px; cursor: pointer;
  background: none; border: none; font-family: inherit; padding: 0;
  transition: color 0.2s;
}
.nav-dark-toggle:hover { color: rgba(255,255,255,0.7); }
.nav-dark-icon { font-size: 18px; }

/* ── DARK MODE (header) ── */
body.dark { background: #090B1E; }
body.dark #tabs { background: rgba(9,11,30,0.97); border-color: rgba(255,255,255,0.07); }
body.dark #tab-pill { background: rgba(30,28,60,0.97); border-color: rgba(255,255,255,0.1); }
body.dark .tab-btn { color: rgba(255,255,255,0.5); }
body.dark .tab-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
body.dark .tab-btn.active { background: #241775; color: #fafafa; }
body.dark .mdot { background: rgba(255,255,255,0.7); }
body.dark .mdot-r { background: none; border-top-color: rgba(255,255,255,0.7); }
body.dark #header-logo svg path { fill: #fafafa; }
body.dark #header-logo { filter: brightness(0) invert(1); }

/* ── MOBILE BOTTOM BAR ── */
/* ── TABLET: 7 tab vẫn vừa giữa logo và nút menu ── */
@media (min-width: 641px) and (max-width: 1000px) {
  .tab-btn { padding: 10px 12px; font-size: 13px; }
}
@media (min-width: 641px) and (max-width: 780px) {
  .tab-btn { padding: 8px 11px; }
  .tb-icon { display: block; font-size: 18px; }
  .tb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 640px) {
  #tabs { height: 56px; }
  #tab-pill {
    top: auto; bottom: 0; left: 0; right: 0; transform: none;
    height: 64px; width: 100%; border-radius: 0;
    background: rgba(245,245,245,0.97); backdrop-filter: blur(12px);
    border: none; border-top: 1px solid rgba(0,0,0,0.08);
    padding: 0; gap: 0; justify-content: space-around;
  }
  .tab-btn { flex: 1; padding: 8px 4px; border-radius: 0; font-size: 10px; font-weight: 500; gap: 3px; }
  .tb-label { white-space: normal; line-height: 1.15; text-align: center; font-size: 9.5px; }
  .tab-btn:hover { background: transparent; }
  .tab-btn.active { background: transparent; color: #241775; }
  .tb-icon { display: block; }
}
/* ── NỘI DUNG ───────────────────────────────────────────── */
#gx { padding: 104px 20px 72px; }
.gx-wrap { max-width: 760px; margin: 0 auto; }
.gx-wrap.gx-wide { max-width: 1080px; }
.gx-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.gx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(0,0,0,0.45); min-width: 0; }
.gx-crumbs a { color: #241775; text-decoration: none; font-weight: 500; }
.gx-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gx-crumbs span[aria-current] { color: rgba(0,0,0,0.7); }
.gx-lang { flex-shrink: 0; font-size: 12.5px; color: rgba(0,0,0,0.55); text-decoration: none; border: 1px solid rgba(0,0,0,0.12); border-radius: 20px; padding: 5px 12px; background: #fff; }
.gx-lang:hover { border-color: #241775; color: #241775; }

.gx-term { background: #fff; border: 1px solid rgba(0,0,0,0.07); border-radius: 16px; padding: 32px 36px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.gx-badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; margin: 0 0 14px; letter-spacing: 0.02em; }
.gx-term h1, .gx-idx-head h1 { font-size: clamp(26px, 4.2vw, 36px); line-height: 1.2; margin: 0 0 14px; letter-spacing: -0.01em; color: #111; text-wrap: balance; }
.gx-lead { font-size: 17px; line-height: 1.65; color: rgba(0,0,0,0.72); margin: 0; }
.gx-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.gx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; text-align: center; line-height: 1.35; box-sizing: border-box; border-radius: 999px;
  background: #241775; color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid #241775; transition: background .15s, color .15s, border-color .15s; }
.gx-btn:hover { background: #3a2a9e; border-color: #3a2a9e; }
.gx-btn-ghost { background: transparent; color: #241775; border-color: rgba(36,23,117,0.3); }
.gx-btn-ghost:hover { background: rgba(36,23,117,0.06); border-color: #241775; color: #241775; }
.gx-btn.is-disabled { background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.4); border-color: transparent; cursor: default; }

.gx-term h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(0,0,0,0.45); margin: 0 0 12px; }
.gx-card { margin-top: 28px; padding: 20px 22px; border-radius: 12px; background: #F7F5FC; border: 1px solid rgba(36,23,117,0.08); }
.gx-card p { margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: rgba(0,0,0,0.72); }
.gx-card dl { margin: 0 0 16px; display: grid; gap: 12px; }
.gx-card dt { font-size: 12.5px; font-weight: 600; color: #241775; margin-bottom: 2px; }
.gx-card dd { margin: 0; font-size: 15px; line-height: 1.6; color: rgba(0,0,0,0.75); }
.gx-card dd a, .gx-lead a { color: #241775; text-underline-offset: 3px; }
.gx-sec { margin-top: 28px; }
.gx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid rgba(0,0,0,0.1);
  font-size: 13.5px; color: #222; text-decoration: none; transition: border-color .15s, color .15s; }
.gx-chip:hover { border-color: #241775; color: #241775; }
.gx-chip i, .gx-group h2 i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.gx-pn { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(0,0,0,0.07); display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.gx-pn a { text-decoration: none; color: #111; font-size: 14.5px; font-weight: 600; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gx-pn a small { font-size: 11.5px; font-weight: 500; color: rgba(0,0,0,0.4); }
.gx-pn a:hover { color: #241775; }
.gx-pn a[rel="next"] { text-align: right; align-items: flex-end; }
.gx-pn .gx-pn-all { font-size: 12.5px; font-weight: 500; color: #241775; border: 1px solid rgba(36,23,117,0.25); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

.gx-cta { margin-top: 32px; padding: 22px 24px; border-radius: 14px; background: linear-gradient(135deg, #241775, #4b33b8); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.gx-term .gx-cta h2 { color: #fff; text-transform: none; letter-spacing: 0; font-size: 17px; margin: 0 0 4px; }
.gx-cta p { margin: 0; font-size: 13.5px; line-height: 1.5; color: rgba(255,255,255,0.78); }
.gx-cta .gx-btn { background: #fff; color: #241775; border-color: #fff; flex-shrink: 0; }
.gx-cta .gx-btn:hover { background: #ECE8FF; }
.gx-back { margin: 20px 0 0; font-size: 13.5px; }
.gx-back a { color: #241775; text-decoration: none; }
.gx-back a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gx-msg { text-align: center; }
.gx-msg .gx-actions { justify-content: center; }

/* Mục lục */
.gx-idx-head { margin-bottom: 8px; }
.gx-idx-head .gx-lead { max-width: 720px; }
.gx-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.gx-jump a { font-size: 13px; color: #241775; text-decoration: none; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid rgba(36,23,117,0.18); }
.gx-group { margin-top: 40px; scroll-margin-top: 96px; }
.gx-group h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0 0 14px; color: #111; }
.gx-group h2 small { font-size: 12px; font-weight: 500; color: rgba(0,0,0,0.35); }
.gx-group h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(0,0,0,0.4); margin: 22px 0 10px; }
.gx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gx-item { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid rgba(0,0,0,0.07); border-radius: 12px; padding: 14px 16px;
  text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
.gx-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); border-color: rgba(36,23,117,0.3); }
.gx-item b { font-size: 14px; color: #111; line-height: 1.3; }
.gx-item span { font-size: 12.5px; color: rgba(0,0,0,0.52); line-height: 1.55; }
.gx-item em { font-style: normal; font-size: 11px; color: rgba(0,0,0,0.3); }

@media (max-width: 900px) { .gx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) {
  #gx { padding: 76px 16px 96px; }
  .gx-term { padding: 22px 18px; border-radius: 14px; }
  .gx-lead { font-size: 16px; }
  .gx-actions .gx-btn { flex: 1 1 100%; }
  .gx-card { padding: 16px; }
  .gx-pn { grid-template-columns: 1fr 1fr; }
  .gx-pn .gx-pn-all { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .gx-cta { flex-direction: column; align-items: stretch; }
  .gx-grid { grid-template-columns: 1fr; }
}

/* Dark mode */
body.dark { color: rgba(255,255,255,0.9); }
body.dark .gx-crumbs { color: rgba(255,255,255,0.4); }
body.dark .gx-crumbs a, body.dark .gx-back a, body.dark .gx-jump a, body.dark .gx-pn .gx-pn-all { color: #A99BFF; }
body.dark .gx-crumbs span[aria-current] { color: rgba(255,255,255,0.75); }
body.dark .gx-lang, body.dark .gx-jump a { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }
body.dark .gx-term, body.dark .gx-item { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); box-shadow: none; }
body.dark .gx-term h1, body.dark .gx-idx-head h1, body.dark .gx-group h2, body.dark .gx-item b, body.dark .gx-pn a { color: rgba(255,255,255,0.92); }
body.dark .gx-lead, body.dark .gx-card p, body.dark .gx-card dd { color: rgba(255,255,255,0.7); }
body.dark .gx-term h2, body.dark .gx-group h3, body.dark .gx-pn a small, body.dark .gx-group h2 small { color: rgba(255,255,255,0.4); }
body.dark .gx-item span { color: rgba(255,255,255,0.5); }
body.dark .gx-item em { color: rgba(255,255,255,0.3); }
body.dark .gx-card { background: rgba(123,107,245,0.08); border-color: rgba(123,107,245,0.18); }
body.dark .gx-card dt, body.dark .gx-card dd a { color: #A99BFF; }
body.dark .gx-chip { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); color: rgba(255,255,255,0.85); }
body.dark .gx-chip:hover, body.dark .gx-item:hover { border-color: #7B6BF5; color: #fff; }
body.dark .gx-btn-ghost { color: #C9C0FF; border-color: rgba(201,192,255,0.35); }
body.dark .gx-btn-ghost:hover { background: rgba(201,192,255,0.08); color: #fff; }
body.dark .gx-btn.is-disabled { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.4); }
body.dark .gx-pn { border-color: rgba(255,255,255,0.08); }
body.dark #tab-pill { background: rgba(30,28,60,0.97); }
body.dark .gx-term .gx-cta h2 { color: #fff; }
