/* ============================================================================
   BIN TỬ VI — HỆ THỐNG GIAO DIỆN & HIỆU ỨNG "THIÊN BÀN · NGỰ LÃM 2026"
   Sáng: Sứ trắng son đỏ (#f3ede2 / #fbf8f2 / #9a2a1e / #a47b2a / #1c5e40)
   Tối:  Ngự Lãm đen-vàng (#0b0a08 / #16130e / #e0bd72 / #c9a45c / #8fcca4)
   ============================================================================ */

/* ===== 1. BẢNG MÀU CHUẨN THIÊN BÀN (SÁNG & TỐI) ===== */
:root,
html[data-theme="dark"] {
  --tb-nen: #0b0a08;
  --tb-nen-2: #12100c;
  --tb-the: #16130e;
  --tb-the-2: #1d1912;
  --tb-chu: #f1e7d0;
  --tb-chu-2: #c3b59a;
  --tb-chu-3: #9a8f7a;
  --tb-nhan: #e0bd72;
  --tb-nhan-rgb: 224, 189, 114;
  --tb-kim: #c9a45c;
  --tb-kim-rgb: 201, 164, 92;
  --tb-tot: #8fcca4;
  --tb-tot-rgb: 143, 204, 164;
  --tb-xau: #e27d6f;
  --tb-vien: #30291d;
  --tb-vien-2: rgba(201, 164, 92, 0.28);
  --tb-vach: rgba(201, 164, 92, 0.32);
  --tb-nut-chu: #1d1305;
  --tb-tassel-grad: linear-gradient(115deg, #9a6f2c 0%, #c99a4b 28%, #f1d995 52%, #d4a652 74%, #9a6f2c 100%);
  --tb-tassel-shadow: 0 12px 26px -10px rgba(201, 164, 92, 0.55);
  --tb-tassel-cord: #c9a45c;
  --tb-tassel-silk: #d4a652;
  --tb-menu-bg: #110f0b;
  --tb-menu-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.85);
  --tb-grid-line: rgba(201, 164, 92, 0.055);
  --tb-paper-line: rgba(201, 164, 92, 0.045);

  /* Đồng bộ token cũ để toàn bộ 51 công cụ tự động hòa quyện */
  --muc: var(--tb-nen);
  --tram: var(--tb-nen-2);
  --nen: var(--tb-the);
  --nen-2: var(--tb-the-2);
  --surface-card: var(--tb-the);
  --surface-solid: var(--tb-the);
  --chu: var(--tb-chu);
  --chu-2: var(--tb-chu-2);
  --chu-3: var(--tb-chu-3);
  --kim: var(--tb-kim);
  --kim-sang: #f1d995;
  --kim-chu: #e0bd72;
  --nen-kim: #c9a45c;
  --kim-rgb: 201, 164, 92;
  --son: #c9a45c;
  --son-sang: #e0bd72;
  --tot: var(--tb-tot);
  --tot-rgb: 143, 204, 164;
  --vien: var(--tb-vien-2);
  --vien-mo: rgba(201, 164, 92, 0.14);
  --vien-nga: var(--tb-vien);
  --menu-con: var(--tb-menu-bg);
  --menu-bong: var(--tb-menu-shadow);
}

html[data-theme="light"] {
  --tb-nen: #f3ede2;
  --tb-nen-2: #ebe3d4;
  --tb-the: #fbf8f2;
  --tb-the-2: #f6f0e4;
  --tb-chu: #2a2420;
  --tb-chu-2: #5f554d;
  --tb-chu-3: #7a6f64;
  --tb-nhan: #9a2a1e;
  --tb-nhan-rgb: 154, 42, 30;
  --tb-kim: #a47b2a;
  --tb-kim-rgb: 164, 123, 42;
  --tb-tot: #1c5e40;
  --tb-tot-rgb: 28, 94, 64;
  --tb-xau: #9a2a1e;
  --tb-vien: #dcd1bf;
  --tb-vien-2: rgba(164, 123, 42, 0.34);
  --tb-vach: rgba(120, 90, 40, 0.35);
  --tb-nut-chu: #ffffff;
  --tb-tassel-grad: linear-gradient(115deg, #741a11 0%, #9a2a1e 48%, #b13325 76%, #7d1e15 100%);
  --tb-tassel-shadow: 0 12px 26px -10px rgba(154, 42, 30, 0.48);
  --tb-tassel-cord: #c99a4b;
  --tb-tassel-silk: #9a2a1e;
  --tb-menu-bg: #fbf8f2;
  --tb-menu-shadow: 0 24px 48px -24px rgba(80, 40, 10, 0.35);
  --tb-grid-line: rgba(120, 90, 40, 0.065);
  --tb-paper-line: rgba(164, 123, 42, 0.06);

  /* Đồng bộ token cũ */
  --muc: var(--tb-nen);
  --tram: var(--tb-nen-2);
  --nen: var(--tb-the);
  --nen-2: var(--tb-the-2);
  --surface-card: var(--tb-the);
  --surface-solid: #ffffff;
  --chu: var(--tb-chu);
  --chu-2: var(--tb-chu-2);
  --chu-3: var(--tb-chu-3);
  --kim: #a47b2a;
  --kim-sang: #8a6326;
  --kim-chu: #8a6326;
  --nen-kim: #9a2a1e;
  --kim-rgb: 164, 123, 42;
  --son: #9a2a1e;
  --son-sang: #b13325;
  --tot: var(--tb-tot);
  --tot-rgb: 28, 94, 64;
  --vien: var(--tb-vien);
  --vien-mo: rgba(42, 36, 32, 0.09);
  --vien-nga: #dcd1bf;
  --menu-con: var(--tb-menu-bg);
  --menu-bong: var(--tb-menu-shadow);
}

body {
  background: var(--tb-nen);
  color: var(--tb-chu);
  font-family: var(--font-body);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.005em;
}
h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--tb-nhan);
}

/* ===== 2. KEYFRAMES CHUẨN THIÊN BÀN ===== */
@keyframes tvtb-loe {
  0%, 72% { transform: translateX(-140%) skewX(-24deg); opacity: 0; }
  80% { opacity: 0.42; }
  100% { transform: translateX(260%) skewX(-24deg); opacity: 0; }
}
@keyframes tvtb-len {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes tvtb-nhay {
  0%, 100% { opacity: 0.16; transform: scale(0.9); }
  50% { opacity: 0.9; transform: scale(1.25); }
}
@keyframes tvtb-xoay {
  to { transform: rotate(360deg); }
}
@keyframes tvtb-xoay-nguoc {
  to { transform: rotate(-360deg); }
}
@keyframes tvtb-ve {
  from { stroke-dashoffset: 680; opacity: 0.35; }
  to { stroke-dashoffset: 0; opacity: 1; }
}
@keyframes tvv-cd-dua {
  0%, 100% { transform: rotate(-0.8deg); }
  50% { transform: rotate(0.8deg); }
}
@keyframes tb-coin-toss {
  0% { transform: translateY(0) rotateY(0deg) rotateX(0deg) scale(1); }
  35% { transform: translateY(-28px) rotateY(360deg) rotateX(180deg) scale(1.12); }
  75% { transform: translateY(-8px) rotateY(720deg) rotateX(360deg) scale(1.03); }
  100% { transform: translateY(0) rotateY(1080deg) rotateX(360deg) scale(1); }
}
@keyframes tb-pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--tb-tot-rgb), 0.55); }
  60% { box-shadow: 0 0 0 7px rgba(var(--tb-tot-rgb), 0); }
}

/* Scroll reveal mượt */
.tvtb-ra {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.72s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.72s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tvtb-ra.is-vao {
  opacity: 1;
  transform: none;
}

/* Eyebrow vạch vàng 30px */
.tvtb-nhan {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tb-kim);
  margin: 0 0 14px;
}
.tvtb-nhan::before {
  content: "";
  width: 30px;
  height: 1px;
  background: var(--tb-kim);
  flex-shrink: 0;
}

/* ===== 3. NÚT THẺ TUA RUA ĐẶC TRƯNG (.tb-tassel & .th-cta) ===== */
.tb-tassel,
.tool-hero .th-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px 0 38px;
  margin-left: 12px;
  border: 1px solid rgba(var(--tb-kim-rgb), 0.45);
  border-radius: 999px 5px 5px 999px;
  background: var(--tb-tassel-grad);
  color: var(--tb-nut-chu) !important;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--tb-tassel-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  overflow: visible;
  text-decoration: none;
}
.tb-tassel:hover,
.tool-hero .th-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 32px -12px rgba(var(--tb-nhan-rgb), 0.52);
}
/* Lớp ánh sáng quét chéo bên trong nút */
.tb-tassel-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}
.tb-tassel-shine::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: tvtb-loe 3.6s ease-in-out infinite;
}
/* Khoen tròn vàng đính bên trái thẻ */
.tb-tassel::before,
.tool-hero .th-cta::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--tb-nen);
  border: 2.5px solid #e6c173;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
  z-index: 2;
}
/* Dây và chùm tua rua đung đưa nhẹ */
.tb-tassel::after,
.tool-hero .th-cta::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 24px;
  height: 28px;
  transform-origin: 22px 0;
  background:
    /* Dây nối ngang từ khoen ra tua */
    linear-gradient(90deg, var(--tb-tassel-cord), var(--tb-tassel-cord)) 3px 0 / 20px 2px no-repeat,
    /* Nút thắt tròn vàng */
    radial-gradient(circle, #f1d995 0%, var(--tb-tassel-cord) 70%, transparent 72%) 1px 1px / 6px 6px no-repeat,
    /* Chùm tua lụa rủ dọc */
    repeating-linear-gradient(90deg, var(--tb-tassel-silk) 0 1.5px, rgba(0,0,0,0.18) 1.5px 2.4px) 1px 6px / 7px 20px no-repeat;
  animation: tvv-cd-dua 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 3;
}
.tb-tassel.is-sm {
  min-height: 42px;
  padding: 0 20px 0 34px;
  font-size: 0.88rem;
}
.tb-tassel.is-sm::after {
  height: 22px;
}

/* Nút viền pill phụ (.tb-pill-btn) */
.tb-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px 5px 5px 999px;
  border: 1px solid rgba(var(--tb-kim-rgb), 0.45);
  background: rgba(var(--tb-kim-rgb), 0.06);
  color: var(--tb-chu);
  font-size: 0.94rem;
  font-weight: 500;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
}
.tb-pill-btn:hover {
  border-color: var(--tb-nhan);
  background: rgba(var(--tb-nhan-rgb), 0.08);
  color: var(--tb-nhan);
}
.tb-pill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--tb-nhan);
  flex-shrink: 0;
}

/* ===== 4. TOPBAR & HEADER CHUẨN THIÊN BÀN ===== */
.topbar {
  background: var(--tb-nen-2);
  border-bottom: 1px solid var(--tb-vien);
  color: var(--tb-chu-2);
  font-size: 0.8125rem;
}
.topbar-inner {
  min-height: 36px;
}
.topbar strong {
  color: var(--tb-chu);
  font-weight: 600;
}
.topbar-badge.is-tot i {
  background: var(--tb-tot);
  animation: tb-pulse-dot 2.6s infinite;
}
.topbar-right a {
  color: var(--tb-chu-2);
}
.topbar-right a:hover {
  color: var(--tb-nhan);
}

.site-header {
  background: color-mix(in srgb, var(--tb-the) 92%, transparent);
  border-bottom: 1px solid var(--tb-vien);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
html[data-theme="dark"] .site-header {
  background: rgba(11, 10, 8, 0.9);
  border-bottom-color: rgba(201, 164, 92, 0.2);
}

/* Dấu triện hình thoi chuẩn Thiên Bàn */
.logo-an {
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: #9a2a1e;
  border: 1.5px solid #d4a652;
  outline: 2px solid #9a2a1e;
  outline-offset: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 8px 0 4px;
}
.logo-an span {
  transform: rotate(-45deg);
  font-family: var(--font-han);
  font-size: 17px;
  font-weight: 600;
  color: #fbf8f2;
  line-height: 1;
}
html[data-theme="dark"] .logo-an {
  background: transparent;
  border: 1.5px solid #e0bd72;
  outline: 1px solid rgba(224, 189, 114, 0.45);
  outline-offset: 3px;
}
html[data-theme="dark"] .logo-an span {
  color: #f1d995;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 400;
  color: var(--tb-chu);
  line-height: 1.05;
}
.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--tb-chu-3);
}

.main-nav .nav-trigger {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--tb-chu);
}
.main-nav .nav-group:hover > .nav-trigger,
.main-nav .nav-trigger:hover {
  color: var(--tb-nhan);
}

/* Mega menu nâng cấp */
.mega-dropdown {
  background: var(--tb-menu-bg);
  border: 1px solid var(--tb-vien-2);
  border-radius: 14px;
  box-shadow: var(--tb-menu-shadow);
  padding: 18px 22px 22px;
}
.mega-head {
  font-size: 0.82rem;
  color: var(--tb-chu-3);
  border-bottom: 1px solid var(--tb-vien);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.mega-han {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--tb-vien-2);
  background: rgba(var(--tb-kim-rgb), 0.08);
  color: var(--tb-kim);
  font-family: var(--font-han);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mega-link {
  border-radius: 10px;
  padding: 8px 10px;
}
.mega-link:hover {
  background: rgba(var(--tb-kim-rgb), 0.1);
}
.mega-link-title {
  color: var(--tb-chu);
  font-weight: 600;
}
.mega-link-desc {
  color: var(--tb-chu-3);
}

/* Header right buttons khớp 1:1 ảnh chụp */
.btn-che-mo {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--tb-vien-2);
  background: rgba(var(--tb-kim-rgb), 0.08);
  color: var(--tb-chu);
  flex-shrink: 0;
}
.theme-menu {
  z-index: 320 !important;
}
.btn-header-member {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--tb-vien-2);
  background: transparent;
  color: var(--tb-chu);
  font-size: 0.86rem;
  font-weight: 500;
  flex-shrink: 0;
}
.btn-header-member svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn-header-member:hover {
  border-color: var(--tb-nhan);
  color: var(--tb-nhan);
}
.sq-btn {
  width: 38px;
  height: 38px;
  border-radius: 4px;
  border: 1px solid var(--tb-vien);
  background: transparent;
  color: var(--tb-chu);
}
.sq-btn:hover {
  border-color: var(--tb-nhan);
  color: var(--tb-nhan);
}
.btn-header-profile {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 4px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-the);
  color: var(--tb-chu);
  font-size: 0.87rem;
  font-weight: 500;
}
.btn-header-profile:hover {
  border-color: var(--tb-nhan);
  color: var(--tb-nhan);
}

/* ===== 5. TRANG CHỦ — BAND 1: HERO THIÊN BÀN ===== */
.tvtb-hero {
  position: relative;
  padding: 64px 0 84px;
  background:
    radial-gradient(740px 740px at 72% 48%, rgba(var(--tb-kim-rgb), 0.14), transparent 70%),
    var(--tb-nen);
  overflow: hidden;
  border-bottom: 1px solid var(--tb-vien);
}
/* Bầu trời sao lấp lánh nhẹ */
.tvtb-troi {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.tvtb-troi i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: var(--tb-kim);
  opacity: 0.25;
  animation: tvtb-nhay 4.2s ease-in-out infinite;
}
html[data-theme="dark"] .tvtb-troi i {
  background: #f6e3a6;
}

.tvtb-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
}
.tvtb-hero-copy > * {
  animation: tvtb-len 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.tvtb-hero-copy > *:nth-child(1) { animation-delay: 0.05s; }
.tvtb-hero-copy > *:nth-child(2) { animation-delay: 0.14s; }
.tvtb-hero-copy > *:nth-child(3) { animation-delay: 0.24s; }
.tvtb-hero-copy > *:nth-child(4) { animation-delay: 0.34s; }
.tvtb-hero-copy > *:nth-child(5) { animation-delay: 0.44s; }

.tvtb-hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.65rem, 5vw, 4.25rem);
  font-weight: 400;
  line-height: 1.08;
  color: var(--tb-chu);
  margin: 0 0 10px;
}
.tvtb-hero-sub-it {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.38rem, 2.3vw, 2rem);
  line-height: 1.25;
  color: var(--tb-nhan);
  margin: 0 0 22px;
}
.tvtb-hero-lead {
  max-width: 500px;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--tb-chu-2);
  margin: 0 0 30px;
}
.tvtb-hero-ctas {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}
.tvtb-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  padding-top: 8px;
}
.tvtb-hero-stats li {
  list-style: none;
}
.tvtb-hero-stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.05;
  color: var(--tb-nhan);
}
.tvtb-hero-stats span {
  display: block;
  font-size: 0.8125rem;
  color: var(--tb-chu-3);
  margin-top: 4px;
}

/* ===== THIÊN BÀN XOAY TƯƠNG TÁC ===== */
.tvtb-ban-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.tvtb-ban {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  user-select: none;
}
.tvtb-ban-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.tvtb-ban-ring {
  fill: none;
  stroke: var(--tb-vien-2);
  stroke-width: 1;
}
.tvtb-ban-ring-soft {
  fill: none;
  stroke: var(--tb-vien);
  stroke-width: 0.9;
}
.tvtb-ban-dash {
  fill: none;
  stroke: var(--tb-vach);
  stroke-width: 1.1;
  stroke-dasharray: 2 7;
  transform-origin: 260px 260px;
  animation: tvtb-xoay 120s linear infinite;
}
.tvtb-ban-orbit {
  transform-origin: 260px 260px;
  animation: tvtb-xoay 90s linear infinite;
}
.tvtb-ban-ticks {
  stroke: var(--tb-vach);
  stroke-width: 1;
  transform-origin: 260px 260px;
  animation: tvtb-xoay-nguoc 200s linear infinite;
}
.tvtb-ban-can {
  font-family: var(--font-han);
  font-size: 11px;
  fill: var(--tb-chu-3);
  opacity: 0.72;
}
.tvtb-ban-chi {
  font-family: var(--font-han);
  font-size: 17px;
  fill: var(--tb-chu-2);
}
html[data-theme="dark"] .tvtb-ban-chi {
  fill: rgba(241, 231, 208, 0.78);
}

/* 12 nút công cụ tròn trên vành ngoài Thiên Bàn */
.tvtb-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  box-shadow: 0 8px 20px -10px rgba(42, 30, 12, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  color: var(--tb-chu);
  transition: transform 0.26s ease, border-color 0.26s ease, background 0.26s ease, box-shadow 0.26s ease;
  z-index: 4;
}
html[data-theme="dark"] .tvtb-node {
  background: #14110c;
  border-color: rgba(201, 164, 92, 0.34);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.85);
}
.tvtb-node:hover,
.tvtb-node:focus-visible,
.tvtb-node.is-active {
  transform: translate(-50%, -50%) scale(1.1);
  border-color: var(--tb-nhan);
  box-shadow: 0 12px 28px -10px rgba(var(--tb-nhan-rgb), 0.45);
  z-index: 6;
}
.tvtb-node b {
  font-family: var(--font-han);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tb-kim);
  line-height: 1.1;
}
.tvtb-node:hover b,
.tvtb-node.is-active b {
  color: var(--tb-nhan);
}
.tvtb-node span {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--tb-chu-2);
  line-height: 1.1;
  max-width: 60px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tâm tròn Thiên Bàn hiển thị ngày âm lịch & preview công cụ */
.tvtb-tam {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 39.5%;
  height: 39.5%;
  border-radius: 50%;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien-2);
  box-shadow:
    0 0 0 8px rgba(var(--tb-kim-rgb), 0.06),
    0 18px 40px -18px rgba(42, 30, 12, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  z-index: 5;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
html[data-theme="dark"] .tvtb-tam {
  background: radial-gradient(circle at 50% 35%, #1d1811, #0e0c09);
  border-color: rgba(201, 164, 92, 0.42);
  box-shadow: 0 0 0 8px rgba(201, 164, 92, 0.06), 0 24px 44px -16px #000;
}
.tvtb-tam.is-swap {
  opacity: 0.4;
  transform: translate(-50%, -50%) scale(0.97);
}
.tvtb-tam-kicker {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tb-kim);
  margin: 0 0 2px;
}
.tvtb-tam-big {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.2vw, 3.15rem);
  line-height: 1;
  color: var(--tb-nhan);
  margin: 2px 0 4px;
}
.tvtb-tam-sub {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--tb-chu);
  margin: 0 0 4px;
}
.tvtb-tam-meta {
  font-size: 0.71rem;
  line-height: 1.45;
  color: var(--tb-chu-3);
  margin: 0;
}
.tvtb-tam-han {
  font-family: var(--font-han);
  font-size: 2.2rem;
  color: var(--tb-nhan);
  line-height: 1.1;
  margin-bottom: 4px;
}
.tvtb-ban-cap {
  margin: 14px 0 0;
  font-size: 0.8rem;
  color: var(--tb-chu-3);
  text-align: center;
}

/* ===== 6. BAND 2: HƠN 50 CÁCH XEM VẬN (6 THẺ DANH MỤC 2 CỘT) ===== */
.tvtb-sec {
  padding: 84px 0;
  background: var(--tb-nen);
  border-bottom: 1px solid var(--tb-vien);
}
.tvtb-sec.is-alt {
  background: var(--tb-nen-2);
}
.tvtb-sec-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 46px;
}
.tvtb-sec-head.is-left {
  text-align: left;
  margin: 0 0 36px;
}
.tvtb-sec-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 400;
  color: var(--tb-chu);
  margin: 0 0 10px;
}
.tvtb-sec-desc {
  font-size: 1rem;
  color: var(--tb-chu-2);
  margin: 0;
}

.tvtb-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.tvtb-cat-card {
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 16px;
  padding: 24px 26px 22px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.tvtb-cat-card:hover {
  border-color: var(--tb-vien-2);
  box-shadow: 0 18px 40px -28px rgba(42, 30, 12, 0.28);
}
.tvtb-cat-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--tb-vien);
}
.tvtb-cat-medallion {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(var(--tb-nhan-rgb), 0.11);
  border: 1px solid rgba(var(--tb-nhan-rgb), 0.2);
  color: var(--tb-nhan);
  font-family: var(--font-han);
  font-size: 1.25rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tvtb-cat-top h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--tb-chu);
  margin: 0 0 2px;
}
.tvtb-cat-top p {
  font-size: 0.84rem;
  color: var(--tb-chu-3);
  margin: 0;
}
.tvtb-tool-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
}
.tvtb-tool-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--tb-chu);
  line-height: 1.3;
  transition: background 0.2s, color 0.2s;
}
.tvtb-tool-list a:hover {
  background: rgba(var(--tb-nhan-rgb), 0.08);
  color: var(--tb-nhan);
}
.tvtb-tool-han {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--tb-nen-2);
  border: 1px solid var(--tb-vien);
  color: var(--tb-kim);
  font-family: var(--font-han);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tvtb-tool-list a:hover .tvtb-tool-han {
  border-color: rgba(var(--tb-nhan-rgb), 0.35);
  color: var(--tb-nhan);
}
.tvtb-cat-more {
  display: none;
  width: 100%;
  margin-top: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px dashed var(--tb-vien-2);
  background: transparent;
  color: var(--tb-kim);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
}

/* ===== 7. BAND 3: MẶT TRỜI ĐI QUA MƯỜI HAI CANH GIỜ ===== */
.tvtb-today-card {
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 18px;
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.45fr);
  gap: 32px;
  align-items: center;
}
.tvtb-today-left {
  border-right: 1px solid var(--tb-vien);
  padding-right: 28px;
}
.tvtb-today-num-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}
.tvtb-today-lunar-box {
  width: 78px;
  height: 78px;
  border-radius: 14px;
  border: 1.5px solid rgba(var(--tb-nhan-rgb), 0.45);
  background: rgba(var(--tb-nhan-rgb), 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tvtb-today-lunar-box b {
  font-family: var(--font-display);
  font-size: 2.3rem;
  line-height: 1;
  color: var(--tb-nhan);
}
.tvtb-today-lunar-box small {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tb-chu-3);
}
.tvtb-today-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.tvtb-today-facts div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tb-nen);
  border: 1px solid var(--tb-vien);
}
.tvtb-today-facts dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--tb-chu-3);
}
.tvtb-today-facts dd {
  margin: 2px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tb-chu);
}

.tvtb-hours-grid {
  list-style: none;
  margin: 16px 0 14px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.tvtb-hours-grid li {
  position: relative;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}
.tvtb-hours-grid li.is-tot {
  background: rgba(var(--tb-tot-rgb), 0.11);
  border-color: rgba(var(--tb-tot-rgb), 0.42);
}
.tvtb-hours-grid li.is-now {
  border-color: var(--tb-nhan);
  box-shadow: 0 0 0 2px rgba(var(--tb-nhan-rgb), 0.22);
}
.tvtb-hours-grid li b {
  display: block;
  font-size: 0.9rem;
  color: var(--tb-chu);
}
.tvtb-hours-grid li.is-tot b {
  color: var(--tb-tot);
}
.tvtb-hours-grid li small {
  display: block;
  font-size: 0.72rem;
  color: var(--tb-chu-3);
}
.tvtb-now-pill {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--tb-nhan);
  color: var(--tb-nut-chu);
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
}

/* ===== 8. BAND 4: 12 THẺ CON GIÁP LẬT 3D XEM VẬN 2027 ===== */
.tvtb-giap-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}
.tvtb-flip {
  perspective: 950px;
  height: 224px;
}
.tvtb-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.22, 0.75, 0.25, 1);
  cursor: pointer;
}
.tvtb-flip:hover .tvtb-flip-inner,
.tvtb-flip.is-flipped .tvtb-flip-inner,
.tvtb-flip:focus-within .tvtb-flip-inner {
  transform: rotateY(180deg);
}
.tvtb-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-the);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.tvtb-flip-front.is-cur {
  border-color: rgba(var(--tb-nhan-rgb), 0.55);
}
.tvtb-flip-han {
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: var(--font-han);
  font-size: 1.05rem;
  color: rgba(var(--tb-kim-rgb), 0.45);
}
.tvtb-flip-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(var(--tb-nhan-rgb), 0.12);
  color: var(--tb-nhan);
  font-size: 0.66rem;
  font-weight: 600;
}
.tvtb-flip-icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid var(--tb-vien-2);
  background: rgba(var(--tb-kim-rgb), 0.08);
  color: var(--tb-kim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.tvtb-flip-icon svg {
  width: 34px;
  height: 34px;
}
.tvtb-flip-front b {
  font-family: var(--font-display);
  font-size: 1.28rem;
  color: var(--tb-chu);
  margin-bottom: 4px;
}
.tvtb-flip-years {
  font-size: 0.72rem;
  color: var(--tb-chu-3);
}
.tvtb-flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, var(--tb-the), var(--tb-nen-2));
  border-color: var(--tb-vien-2);
  justify-content: space-between;
  padding: 16px 14px;
}
.tvtb-flip-status {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}
.tvtb-flip-status.is-tot {
  background: rgba(var(--tb-tot-rgb), 0.15);
  color: var(--tb-tot);
}
.tvtb-flip-status.is-luuy {
  background: rgba(var(--tb-nhan-rgb), 0.14);
  color: var(--tb-nhan);
}
.tvtb-flip-status.is-binh {
  background: rgba(var(--tb-kim-rgb), 0.15);
  color: var(--tb-kim);
}
.tvtb-flip-sum {
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--tb-chu-2);
  margin: 0;
}
.tvtb-flip-go {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tb-nhan);
}

/* ===== 9. BAND 5: LÁ SỐ 4×4 TƯƠNG TÁC ("MỖI CUNG KHÔNG ĐỨNG MỘT MÌNH") ===== */
.tvtb-laso-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 42px;
  align-items: center;
}
.tvtb-xet-card {
  position: relative;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-left: 3.5px solid var(--tb-nhan);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 22px 0 28px;
}
.tvtb-xet-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tb-kim);
  margin: 0 0 6px;
}
.tvtb-xet-card h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--tb-chu);
  margin: 0 0 8px;
}
.tvtb-xet-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--tb-chu-2);
  margin: 0;
}
.tvtb-sample-stage {
  position: relative;
}
.tvtb-sample-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}
.tvtb-ray-tri {
  fill: rgba(var(--tb-kim-rgb), 0.07);
  stroke: var(--tb-kim);
  stroke-width: 1.6;
  stroke-dasharray: 680;
  animation: tvtb-ve 0.65s ease both;
}
.tvtb-ray-opp {
  stroke: var(--tb-nhan);
  stroke-width: 1.6;
  stroke-dasharray: 5 5;
}
.tvtb-sample-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tvtb-sample-board .tuvi-center {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  border-radius: 12px;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
}
.tvtb-sample-board .tuvi-cell {
  border-radius: 12px;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  padding: 10px 10px 8px;
  min-height: 112px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.tvtb-sample-board .tuvi-cell:hover {
  border-color: var(--tb-vien-2);
}
.tvtb-sample-board .tuvi-cell.is-selected {
  border-color: var(--tb-nhan);
  background: rgba(var(--tb-nhan-rgb), 0.08);
}
.tvtb-sample-board .tuvi-cell.is-tamhop {
  border-color: var(--tb-kim);
  background: rgba(var(--tb-kim-rgb), 0.09);
}
.tvtb-sample-board .tuvi-cell.is-xung {
  border-color: var(--tb-tot);
  background: rgba(var(--tb-tot-rgb), 0.09);
}

/* ===== 10. BAND 6: THƯ PHÒNG / BÀI VIẾT MỚI NHẤT ===== */
.tvtb-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.tvtb-post-card {
  display: flex;
  flex-direction: column;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 14px;
  padding: 22px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.tvtb-post-card:hover {
  transform: translateY(-3px);
  border-color: var(--tb-vien-2);
}
.tvtb-post-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.tvtb-post-han {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(var(--tb-nhan-rgb), 0.09);
  color: var(--tb-nhan);
  font-family: var(--font-han);
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tvtb-post-cat {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tb-kim);
}
.tvtb-post-card h3 {
  font-family: var(--font-display);
  font-size: 1.38rem;
  color: var(--tb-chu);
  margin: 0 0 8px;
}
.tvtb-post-card p {
  font-size: 0.89rem;
  line-height: 1.62;
  color: var(--tb-chu-2);
  margin: 0 0 16px;
  flex: 1;
}
.tvtb-post-more {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--tb-nhan);
}

/* ===== 11. FOOTER 7 VÒNG TRÒN TƯƠNG TÁC ===== */
.tb-footer {
  position: relative;
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, var(--tb-paper-line) 23px 24px),
    var(--tb-nen-2);
  border-top: 1px solid var(--tb-vien-2);
  padding: 54px 0 36px;
}
.tb-footer-diamond {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 20px;
  height: 20px;
  background: var(--tb-nen-2);
  border: 1.2px solid var(--tb-kim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-footer-diamond::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--tb-kim);
}
.tb-footer-brand {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 30px;
}
.tb-footer-brand .brand-link {
  justify-content: center;
  margin-bottom: 12px;
}
.tb-footer-brand p {
  font-size: 0.92rem;
  color: var(--tb-chu-2);
  margin: 0;
}

.tb-ft-tabs {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tb-ft-tab {
  position: relative;
  min-width: 112px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--tb-chu);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.22s, background 0.22s;
}
.tb-ft-tab:hover {
  background: rgba(var(--tb-kim-rgb), 0.08);
}
.tb-ft-tab.is-active {
  border-color: var(--tb-nhan);
  background: var(--tb-the);
}
.tb-ft-tab.is-active::after {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: var(--tb-the);
  border-left: 1px solid var(--tb-vien);
  border-top: 1px solid var(--tb-vien);
  transform: translateX(-50%) rotate(45deg);
  z-index: 2;
}
.tb-ft-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--tb-vien-2);
  background: var(--tb-the);
  color: var(--tb-chu);
  font-family: var(--font-han);
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.22s, color 0.22s, border-color 0.22s;
}
.tb-ft-tab.is-active .tb-ft-circle {
  background: rgba(var(--tb-nhan-rgb), 0.14);
  border-color: var(--tb-nhan);
  color: var(--tb-nhan);
}
.tb-ft-tab.is-accent .tb-ft-circle {
  background: var(--tb-nhan);
  border-color: var(--tb-nhan);
  color: var(--tb-nut-chu);
}
.tb-ft-tab span:last-child {
  font-size: 0.85rem;
  font-weight: 600;
}

.tb-ft-panel {
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 18px;
  padding: 26px 30px;
  margin-bottom: 28px;
}
.tb-ft-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--tb-vien);
}
.tb-ft-panel-head h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0;
  color: var(--tb-chu);
}
.tb-ft-panel-head span {
  font-size: 0.85rem;
  color: var(--tb-chu-3);
}
.tb-ft-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 26px;
}
.tb-ft-links a {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.2s;
}
.tb-ft-links a:hover {
  background: rgba(var(--tb-kim-rgb), 0.09);
}
.tb-ft-links b {
  display: block;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--tb-chu);
}
.tb-ft-links small {
  display: block;
  font-size: 0.82rem;
  color: var(--tb-chu-3);
  line-height: 1.45;
  margin-top: 2px;
}

.tb-ft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0 22px;
  border-top: 1px solid var(--tb-vien);
  border-bottom: 1px solid var(--tb-vien);
}
.tb-ft-search {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 240px;
  max-width: 420px;
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 999px;
  padding: 4px 6px 4px 16px;
}
.tb-ft-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--tb-chu);
  font-size: 0.9rem;
  outline: none;
}
.tb-ft-search button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--tb-kim-rgb), 0.14);
  color: var(--tb-chu);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.tb-ft-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  font-size: 0.82rem;
  color: var(--tb-chu-3);
}
.tb-ft-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.tb-ft-legal a:hover {
  color: var(--tb-nhan);
}

/* ===== 12. NÚT NỔI "器 CÔNG CỤ" & BANNER HỒ SƠ TRANG CON ===== */
.tb-side-trigger {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 9px;
  border: 1px solid var(--tb-vien-2);
  border-right: none;
  border-radius: 12px 0 0 12px;
  background: var(--tb-the);
  color: var(--tb-chu);
  box-shadow: -6px 8px 24px -12px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, padding-right 0.2s;
}
.tb-side-trigger:hover {
  background: var(--tb-nhan);
  color: var(--tb-nut-chu);
  padding-right: 13px;
}
.tb-side-trigger b {
  font-family: var(--font-han);
  font-size: 1.05rem;
  line-height: 1;
}
.tb-side-trigger span {
  writing-mode: vertical-rl;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tb-side-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.tb-side-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.tb-side-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  z-index: 1210;
  background: var(--tb-the);
  border-left: 1px solid var(--tb-vien-2);
  transform: translateX(102%);
  transition: transform 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.tb-side-drawer.is-open {
  transform: translateX(0);
}
.tb-side-body {
  flex: 1;
  overflow-y: auto;
  margin-top: 14px;
  padding-right: 4px;
}

/* Banner nhắc lập hồ sơ trên trang công cụ */
.tb-prof-banner {
  margin: 0 auto 24px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--tb-vien-2);
  background: var(--tb-the);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.tb-prof-banner-l {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 240px;
}
.tb-prof-seal {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--tb-vien-2);
  background: rgba(var(--tb-kim-rgb), 0.1);
  color: var(--tb-kim);
  font-family: var(--font-han);
  font-size: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tb-prof-banner strong {
  display: block;
  font-size: 0.96rem;
  color: var(--tb-chu);
}
.tb-prof-banner small {
  color: var(--tb-chu-3);
  font-size: 0.82rem;
}
.tb-prof-banner-r {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tb-prof-close {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--tb-chu-3);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ===== 13. TOOL HERO CHUẨN THIÊN BÀN & THẺ LÁ MẪU ===== */
.tool-hero {
  background:
    linear-gradient(var(--tb-grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--tb-grid-line) 1px, transparent 1px) 0 0 / 48px 48px,
    var(--tb-the-2);
  border-bottom: 1px solid var(--tb-vien);
  padding: 52px 0 48px;
}
.tool-hero .th-eyebrow {
  color: var(--tb-kim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tool-hero .th-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.4vw, 3.6rem);
  font-weight: 400;
  color: var(--tb-chu);
}
.tool-hero .th-title em {
  color: var(--tb-nhan);
}
.tool-hero .th-sub {
  color: var(--tb-chu-2);
}
.tool-hero .th-chip {
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  color: var(--tb-chu);
  border-radius: 999px;
}
.tool-hero .th-chip i {
  background: var(--tb-nhan);
}
.tool-hero .th-pill {
  background: rgba(var(--tb-kim-rgb), 0.08);
  border: 1px solid var(--tb-vien-2);
  border-radius: 999px 6px 6px 999px;
  color: var(--tb-chu);
}

/* Thẻ LÁ MẪU / QUẺ MẪU bên phải Tool Hero */
.tb-sample-card {
  width: min(100%, 400px);
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 22px 48px -28px rgba(42, 30, 12, 0.32);
  color: var(--tb-chu);
  text-align: left;
}
html[data-theme="dark"] .tb-sample-card {
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.85);
  border-color: var(--tb-vien-2);
}
.tb-sc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tb-kim);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--tb-vien);
}
.tb-sc-date-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.tb-sc-date-box {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 1.5px solid rgba(var(--tb-nhan-rgb), 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.95rem;
  color: var(--tb-nhan);
  flex-shrink: 0;
}
.tb-sc-grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.tb-sc-mini {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--tb-nen);
  border: 1px solid var(--tb-vien);
}
.tb-sc-mini small {
  display: block;
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tb-chu-3);
}
.tb-sc-mini b {
  display: block;
  font-size: 0.84rem;
  margin: 2px 0;
  color: var(--tb-chu);
}
.tb-sc-mini span {
  display: block;
  font-size: 0.72rem;
  color: var(--tb-chu-3);
}
.tb-sc-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 10px;
}
.tb-sc-pills i {
  font-style: normal;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  font-size: 0.76rem;
  color: var(--tb-chu-2);
}
.tb-sc-rows {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}
.tb-sc-rows li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--tb-vien);
  font-size: 0.82rem;
}
.tb-sc-rows li:last-child { border-bottom: none; }
.tb-sc-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.tb-sc-dot.is-ok { color: var(--tb-tot); }
.tb-sc-dot.is-bad { color: var(--tb-nhan); }
.tb-sc-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.tb-sc-couple {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.tb-sc-person {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  text-align: center;
}
.tb-sc-person small { display: block; font-size: 0.65rem; letter-spacing: 0.1em; color: var(--tb-chu-3); }
.tb-sc-person b { display: block; font-family: var(--font-display); font-size: 1.05rem; margin: 2px 0; }
.tb-sc-person span { font-size: 0.72rem; color: var(--tb-chu-3); }
.tb-sc-hex-wrap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 0 10px;
  text-align: center;
}
.tb-sc-hex-han {
  font-family: var(--font-han);
  font-size: 1.55rem;
  color: var(--tb-nhan);
  margin-bottom: 8px;
}
.tb-sc-hex-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 84px;
  margin: 0 auto 10px;
}
.tb-sc-bar {
  height: 7px;
  border-radius: 2px;
  background: #b88c3a;
}
.tb-sc-bar.is-yin {
  background: transparent;
  display: flex;
  justify-content: space-between;
}
.tb-sc-bar.is-yin i {
  width: 44%;
  height: 100%;
  border-radius: 2px;
  background: #b88c3a;
}
.tb-sc-bar.is-mov {
  background: var(--tb-nhan);
}
.tb-sc-foot {
  text-align: center;
  font-size: 0.76rem;
  color: var(--tb-chu-3);
  padding-top: 8px;
  border-top: 1px solid var(--tb-vien);
}

/* ===== 14. NÂNG CẤP TƯƠNG TÁC CHUYÊN SÂU TRÊN CÁC CÔNG CỤ ===== */
/* A. Form Lá số đánh số Hán tự & Live Preview */
.tb-form-sec {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--tb-vien);
}
.tb-form-sec:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
}
.tb-form-sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.tb-form-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(var(--tb-nhan-rgb), 0.45);
  background: rgba(var(--tb-nhan-rgb), 0.08);
  color: var(--tb-nhan);
  font-family: var(--font-han);
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tb-form-sec-head h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
}
.tb-live-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(var(--tb-kim-rgb), 0.09);
  border: 1px solid var(--tb-vien-2);
  font-size: 0.9rem;
  color: var(--tb-chu);
  margin: 14px 0 18px;
}
.tb-live-preview b {
  color: var(--tb-nhan);
}

/* B. Gieo quẻ Kinh Dịch — Đĩa đá 3 đồng xu cổ 開元通寶 */
.tb-iching-stage {
  background: var(--tb-the);
  border: 1px solid var(--tb-vien);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 24px;
}
.tb-topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.tb-topic-chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  color: var(--tb-chu-2);
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.2s;
}
.tb-topic-chip.is-on,
.tb-topic-chip:hover {
  border-color: var(--tb-nhan);
  background: rgba(var(--tb-nhan-rgb), 0.1);
  color: var(--tb-nhan);
}
.tb-coin-bowl {
  position: relative;
  width: 240px;
  height: 150px;
  margin: 18px auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, var(--tb-nen-2), var(--tb-nen));
  border: 2px solid var(--tb-vien-2);
  box-shadow: inset 0 12px 26px rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.tb-brass-coin {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5df9c, #c59641 55%, #7e5a1d);
  border: 2px solid #8a6326;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #3a2608;
  font-family: var(--font-han);
  font-size: 0.65rem;
  font-weight: 700;
}
.tb-brass-coin::after {
  content: "";
  width: 14px;
  height: 14px;
  background: var(--tb-nen);
  border: 1.5px solid #7e5a1d;
}
.tb-brass-coin.is-tossing {
  animation: tb-coin-toss 0.72s cubic-bezier(0.22, 0.75, 0.25, 1);
}
.tb-brass-coin.is-tails {
  background: radial-gradient(circle at 35% 30%, #d4b46b, #8d682a 60%, #5c4014);
}
.tb-hex3-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.tb-hex3-box {
  background: var(--tb-nen);
  border: 1px solid var(--tb-vien);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
}
.tb-hex3-box.is-main {
  border-color: var(--tb-nhan);
}

/* C. Xem tuổi vợ chồng — Đồng hồ điểm tròn + Huy hiệu + 5 tiêu chí bấm mở */
.tb-vc-hero-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  text-align: center;
  padding: 18px 0 24px;
  border-bottom: 1px solid var(--tb-vien);
  margin-bottom: 20px;
}
.tb-vc-medallion {
  width: 86px;
  height: 86px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 1.5px dashed var(--tb-vien-2);
  background: rgba(var(--tb-kim-rgb), 0.08);
  color: var(--tb-kim);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tb-vc-medallion svg {
  width: 48px;
  height: 48px;
}
.tb-vc-gauge {
  position: relative;
  width: 136px;
  height: 136px;
  margin: 0 auto 10px;
}
.tb-vc-gauge svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tb-vc-gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tb-vc-gauge-text b {
  font-family: var(--font-display);
  font-size: 2.55rem;
  line-height: 1;
  color: var(--tb-nhan);
}
.tb-vc-gauge-text small {
  font-size: 0.74rem;
  color: var(--tb-chu-3);
  margin-top: 3px;
}
.tb-vc-verdict-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(var(--tb-kim-rgb), 0.14);
  color: var(--tb-kim);
  font-size: 0.84rem;
  font-weight: 600;
}
.tb-vc-crit-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.tb-vc-crit-btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  color: var(--tb-chu);
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.2s, background 0.2s;
}
.tb-vc-crit-btn.is-active {
  border-color: var(--tb-nhan);
  background: rgba(var(--tb-nhan-rgb), 0.1);
}
.tb-vc-crit-panel {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--tb-nen);
  border: 1px solid var(--tb-vien);
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--tb-chu-2);
}

/* D. Chọn ngày tốt — 6 thẻ sự kiện & 12 nút Địa Chi + Bộ lọc lịch */
.tb-event-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tb-event-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border-radius: 12px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  color: var(--tb-chu);
  text-align: center;
  transition: all 0.2s;
}
.tb-event-card:hover,
.tb-event-card.is-on {
  border-color: var(--tb-nhan);
  background: rgba(var(--tb-nhan-rgb), 0.09);
  color: var(--tb-nhan);
}
.tb-event-card b {
  font-family: var(--font-han);
  font-size: 1.25rem;
  color: var(--tb-kim);
}
.tb-event-card.is-on b { color: var(--tb-nhan); }
.tb-event-card span { font-size: 0.82rem; font-weight: 600; }

.tb-chi-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tb-chi-btn {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--tb-vien);
  background: var(--tb-nen);
  color: var(--tb-chu-2);
  font-size: 0.8rem;
  cursor: pointer;
}
.tb-chi-btn:hover,
.tb-chi-btn.is-on {
  border-color: var(--tb-nhan);
  background: rgba(var(--tb-nhan-rgb), 0.1);
  color: var(--tb-nhan);
}
.tb-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.86rem;
  color: var(--tb-chu-2);
}
.tb-filter-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.is-dimmed-day {
  opacity: 0.24 !important;
  filter: grayscale(0.7);
}

/* E. Thước Lỗ Ban — Verdict tổng hợp */
.tb-loban-verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
  background: rgba(var(--tb-tot-rgb), 0.14);
  color: var(--tb-tot);
}
.tb-loban-verdict.is-warn {
  background: rgba(var(--tb-kim-rgb), 0.16);
  color: var(--tb-kim);
}
.tb-loban-verdict.is-bad {
  background: rgba(var(--tb-nhan-rgb), 0.14);
  color: var(--tb-nhan);
}

/* Nâng cấp nút .btn-gold toàn hệ thống theo màu Sáng/Tối chuẩn */
.btn-gold {
  background: var(--tb-tassel-grad);
  color: var(--tb-nut-chu) !important;
  border-radius: 8px;
}

/* ===== 15. RESPONSIVE MOBILE & TABLET ===== */
@media (max-width: 1080px) {
  .btn-header-profile { display: none !important; }
  .tvtb-hero-grid { grid-template-columns: 1fr; text-align: left; }
  .tvtb-ban { max-width: 440px; }
  .tvtb-giap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tvtb-laso-grid { grid-template-columns: 1fr; }
  .tvtb-today-card { grid-template-columns: 1fr; }
  .tvtb-today-left { border-right: none; border-bottom: 1px solid var(--tb-vien); padding-right: 0; padding-bottom: 22px; }
  .tb-event-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .btn-header-member {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
  }
  .btn-header-member span { display: none; }
  .brand-name { font-size: 1.18rem; }
  .brand-sub { font-size: 0.58rem; letter-spacing: 0.14em; }
  .tvtb-hero { padding: 38px 0 54px; }
  .tvtb-sec { padding: 56px 0; }
  .tvtb-cat-grid { grid-template-columns: 1fr; }
  .tvtb-tool-list { grid-template-columns: 1fr; }
  .tvtb-cat-card.is-collapsed .tvtb-tool-list li:nth-child(n+7) { display: none; }
  .tvtb-cat-card.has-more .tvtb-cat-more { display: block; }
  .tvtb-giap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tvtb-posts-grid { grid-template-columns: 1fr; }
  .tvtb-hours-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tvtb-node { width: 54px; height: 54px; }
  .tvtb-node b { font-size: 0.88rem; }
  .tvtb-node span { font-size: 0.56rem; max-width: 48px; }
  .tvtb-tam { width: 43%; height: 43%; padding: 10px; }
  .tvtb-tam-big { font-size: 1.9rem; }
  .tb-ft-links { grid-template-columns: 1fr; }
  .tb-ft-tab { min-width: 82px; padding: 8px 6px; }
  .tb-ft-circle { width: 40px; height: 40px; font-size: 1.05rem; }
  .tb-vc-hero-score { grid-template-columns: 1fr; gap: 16px; }
  .tb-hex3-grid { grid-template-columns: 1fr; }
  .tb-side-trigger { display: none; }
  .tb-event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .tvtb-ra { opacity: 1; transform: none; transition: none; }
  .tvtb-tassel-shine::after, .tb-tassel::after, .tvtb-ban-dash, .tvtb-ban-orbit, .tvtb-ban-ticks, .tvtb-troi i {
    animation: none !important;
  }
}
