/*
 * ngay-tot-xau.css
 * ═══════════════════════════════════════════════════════════════════
 * Giao diện "Xem Ngày Tốt Xấu" — khoahoctuvi.vn / TUVIAIMOI
 * Phong cách: Huyền học cổ điển · Mobile-first · Dark theme
 *
 * Tông màu chủ đạo:
 *   --bg-deep    : #0b0f19  (nền tối huyền bí)
 *   --gold       : #dfb15b  (vàng hoàng kim)
 *   --gold-dark  : #b8892e  (vàng đồng cổ)
 *   --green-jade : #27ae60  (xanh ngọc — cát)
 *   --red-son    : #c0392b  (đỏ son — hung)
 *   --text-main  : #e8dfc8  (chữ chính kem nhạt)
 *   --text-muted : #8b9094  (chữ phụ xám)
 * ═══════════════════════════════════════════════════════════════════
 */

/* ── Reset & CSS Variables ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:       #0b0f19;
  --bg-panel:      #131929;
  --bg-panel-2:    #1a2236;
  --bg-panel-3:    #0f1520;
  --gold:          #dfb15b;
  --gold-dark:     #b8892e;
  --gold-glow:     rgba(223, 177, 91, 0.18);
  --gold-glow-md:  rgba(223, 177, 91, 0.32);
  --green-jade:    #27ae60;
  --green-dark:    #1d8449;
  --green-glow:    rgba(39, 174, 96, 0.15);
  --red-son:       #c0392b;
  --red-dark:      #96281b;
  --red-glow:      rgba(192, 57, 43, 0.15);
  --amber:         #e8a020;
  --text-main:     #e8dfc8;
  --text-muted:    #7a8494;
  --text-gold:     #dfb15b;
  --border-gold:   rgba(223, 177, 91, 0.3);
  --border-panel:  rgba(255, 255, 255, 0.06);
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --shadow-card:   0 4px 24px rgba(0,0,0,0.5);
  --shadow-gold:   0 0 20px rgba(223,177,91,0.25), 0 4px 16px rgba(0,0,0,0.4);
  --transition:    all 0.3s ease;
  --font-main:     'Segoe UI', 'Be Vietnam Pro', system-ui, sans-serif;
  --font-serif:    Georgia, 'Times New Roman', serif;
}

/* ── Base ───────────────────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Hoa văn nền trang trí */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(223,177,91,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 90%, rgba(39,174,96,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Header Trang ───────────────────────────────────────────────── */
/* Header riêng đã được thay bằng <PublicHeader> (StickyHeader toàn cục).
   Các class .ntx-header* bên dưới được giữ lại phòng khi rollback. */

.ntx-header {
  display: none; /* ẩn — không dùng nữa */
}

.ntx-nav-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-left: 1px solid var(--border-gold);
  padding-left: 1rem;
}

/* ── Main Wrapper ───────────────────────────────────────────────── */
.ntx-main {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

/* ── Tiêu đề trang ──────────────────────────────────────────────── */
.ntx-page-title {
  text-align: center;
  margin-bottom: 2rem;
}

.ntx-page-title h1 {
  max-width: none;          /* override h1{max-width:760px} toàn cục → căn giữa đúng */
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-family: var(--font-serif);
  color: var(--gold);
  text-shadow: 0 0 30px rgba(223,177,91,0.4);
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.ntx-page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Đường trang trí vàng */
.ntx-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 auto 2rem;
  max-width: 400px;
}
.ntx-divider::before,
.ntx-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-gold));
}
.ntx-divider::after { background: linear-gradient(to left, transparent, var(--border-gold)); }
.ntx-divider span { color: var(--gold); font-size: 1rem; }

/* ── Form Chọn Ngày ─────────────────────────────────────────────── */
.ntx-form-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.ntx-form-card__title {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ntx-form-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.ntx-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 80px;
}

.ntx-form-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ntx-form-group select,
.ntx-form-group input[type="number"] {
  background: var(--bg-panel-3);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  font-family: var(--font-main);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: var(--transition);
}

.ntx-form-group select:hover,
.ntx-form-group input[type="number"]:hover {
  border-color: var(--border-gold);
}

.ntx-form-group select:focus,
.ntx-form-group input[type="number"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

/* Select wrapper (mũi tên tùy chỉnh) */
.ntx-select-wrap {
  position: relative;
}
.ntx-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  font-size: 0.75rem;
  pointer-events: none;
}
.ntx-select-wrap select { padding-right: 2rem; }

/* Nút tra cứu */
.ntx-btn-primary {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: #0b0f19;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(223,177,91,0.3);
  align-self: flex-end;
  flex-shrink: 0;
}

.ntx-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
  filter: brightness(1.08);
}

.ntx-btn-primary:active { transform: translateY(0); }

.ntx-btn-today {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  align-self: flex-end;
  flex-shrink: 0;
}
.ntx-btn-today:hover {
  background: var(--gold-glow);
  box-shadow: 0 0 10px var(--gold-glow-md);
}

/* ── Kết quả ────────────────────────────────────────────────────── */
.ntx-result {
  display: none; /* ẩn cho đến khi có dữ liệu */
  animation: fadeInUp 0.5s ease;
}
.ntx-result.visible { display: block; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Nhãn Ngày & Điểm Tổng ──────────────────────────────────────── */
.ntx-score-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}

/* Vòng tròn tiến trình (Radial Progress) */
.ntx-radial {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}

.ntx-radial svg {
  transform: rotate(-90deg);
  width: 130px;
  height: 130px;
}

.ntx-radial__track {
  fill: none;
  stroke: rgba(255,255,255,0.07);
  stroke-width: 10;
}

.ntx-radial__bar {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 345.4; /* 2π × 55 */
  stroke-dashoffset: 345.4;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              stroke 0.5s ease;
}

/* Màu bar theo điểm */
.ntx-radial__bar.xuat-sac { stroke: #27ae60; }
.ntx-radial__bar.tot      { stroke: #2ecc71; }
.ntx-radial__bar.trung    { stroke: var(--gold); }
.ntx-radial__bar.xau      { stroke: #e67e22; }
.ntx-radial__bar.dai-xau  { stroke: #c0392b; }

.ntx-radial__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ntx-radial__pct {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.ntx-radial__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

/* Thông tin bên phải vòng tròn */
.ntx-score-info { flex: 1; min-width: 200px; }

.ntx-score-info__date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ntx-score-info__name {
  font-size: clamp(1.4rem, 3.5vw, 2rem);
  font-weight: 800;
  font-family: var(--font-serif);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

/* Màu tên theo loại ngày */
.ntx-score-info__name.xuat-sac { color: #27ae60; text-shadow: 0 0 20px rgba(39,174,96,0.4); }
.ntx-score-info__name.tot      { color: #2ecc71; }
.ntx-score-info__name.trung    { color: var(--gold); }
.ntx-score-info__name.xau      { color: #e67e22; }
.ntx-score-info__name.dai-xau  { color: var(--red-son); text-shadow: 0 0 20px rgba(192,57,43,0.4); }

.ntx-score-info__badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ntx-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.ntx-badge--hoang-dao {
  background: rgba(39,174,96,0.15);
  border: 1px solid rgba(39,174,96,0.4);
  color: #2ecc71;
}
.ntx-badge--hac-dao {
  background: rgba(192,57,43,0.15);
  border: 1px solid rgba(192,57,43,0.4);
  color: #e74c3c;
}
.ntx-badge--truc {
  background: rgba(223,177,91,0.12);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}
.ntx-badge--tu {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-panel);
  color: var(--text-muted);
}

/* ── Grid kết quả ───────────────────────────────────────────────── */
.ntx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .ntx-grid { grid-template-columns: 1fr 1fr; }
  .ntx-grid--full { grid-column: 1 / -1; }
}

/* ── Panel chung ────────────────────────────────────────────────── */
.ntx-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ntx-panel:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 1px rgba(223,177,91,0.08), var(--shadow-card);
}

.ntx-panel__title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ntx-panel__title::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Bảng Can Chi ───────────────────────────────────────────────── */
.ntx-canchi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.ntx-canchi-item {
  background: var(--bg-panel-3);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  text-align: center;
  transition: var(--transition);
}

.ntx-canchi-item:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 12px var(--gold-glow);
}

.ntx-canchi-item__label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
}

.ntx-canchi-item__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  font-family: var(--font-serif);
}

.ntx-canchi-item__sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Dòng thông tin Âm lịch */
.ntx-amlich-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel-3);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.ntx-amlich-row .label { color: var(--text-muted); font-size: 0.8rem; }
.ntx-amlich-row .value { color: var(--text-main); font-weight: 600; }

/* ── Thông tin Trực ─────────────────────────────────────────────── */
.ntx-truc-box {
  background: var(--bg-panel-3);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0;
}

.ntx-truc-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.ntx-truc-box__name {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-serif);
}
.ntx-truc-box__name.tot  { color: var(--green-jade); }
.ntx-truc-box__name.trung { color: var(--gold); }
.ntx-truc-box__name.xau  { color: var(--red-son); }

.ntx-truc-box__loai {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}
.ntx-truc-box__loai.tot  {
  background: var(--green-glow);
  border: 1px solid rgba(39,174,96,0.3);
  color: #2ecc71;
}
.ntx-truc-box__loai.trung {
  background: var(--gold-glow);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}
.ntx-truc-box__loai.xau {
  background: var(--red-glow);
  border: 1px solid rgba(192,57,43,0.3);
  color: #e74c3c;
}

/* ── 28 Tú Panel ────────────────────────────────────────────────── */
.ntx-tu-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-panel-3);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-panel);
  transition: var(--transition);
}

.ntx-tu-card:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 14px var(--gold-glow);
}

.ntx-tu-card__han {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-family: 'Noto Serif SC', var(--font-serif);
}
.ntx-tu-card__han.cat  { background: var(--green-glow);  color: #2ecc71; }
.ntx-tu-card__han.hung { background: var(--red-glow);    color: #e74c3c; }

.ntx-tu-card__info { flex: 1; }
.ntx-tu-card__ten  { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.ntx-tu-card__loai { font-size: 0.72rem; color: var(--text-muted); margin: 0.15rem 0; }
.ntx-tu-card__mo   { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ── Danh sách Cát/Hung tinh ────────────────────────────────────── */
.ntx-star-list { display: flex; flex-direction: column; gap: 0.5rem; }

.ntx-star-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}

.ntx-star-item:hover {
  transform: translateX(3px);
}

.ntx-star-item.cat {
  background: rgba(39,174,96,0.08);
  border-color: rgba(39,174,96,0.2);
}
.ntx-star-item.cat:hover { box-shadow: 0 0 12px var(--green-glow); }

.ntx-star-item.hung {
  background: rgba(192,57,43,0.08);
  border-color: rgba(192,57,43,0.2);
}
.ntx-star-item.hung:hover { box-shadow: 0 0 12px var(--red-glow); }

.ntx-star-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.cat .ntx-star-item__icon  { background: rgba(39,174,96,0.2);  }
.hung .ntx-star-item__icon { background: rgba(192,57,43,0.2);  }

.ntx-star-item__name {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.15rem;
}
.cat  .ntx-star-item__name { color: #2ecc71; }
.hung .ntx-star-item__name { color: #e74c3c; }

.ntx-star-item__mo {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Khi không có sao */
.ntx-star-empty {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* ── Công việc Nên Làm / Nên Tránh ─────────────────────────────── */
.ntx-work-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .ntx-work-grid { grid-template-columns: 1fr 1fr; }
}

.ntx-work-col {
  border-radius: var(--radius-md);
  padding: 1rem;
}

.ntx-work-col--nen {
  background: rgba(39,174,96,0.07);
  border: 1px solid rgba(39,174,96,0.2);
}
.ntx-work-col--tranh {
  background: rgba(192,57,43,0.07);
  border: 1px solid rgba(192,57,43,0.2);
}

.ntx-work-col__title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.ntx-work-col--nen    .ntx-work-col__title { color: #2ecc71; }
.ntx-work-col--tranh  .ntx-work-col__title { color: #e74c3c; }

.ntx-work-list { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }

.ntx-work-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
}

.ntx-work-item__dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.ntx-work-col--nen   .ntx-work-item__dot {
  background: rgba(39,174,96,0.25);
  color: #2ecc71;
}
.ntx-work-col--tranh .ntx-work-item__dot {
  background: rgba(192,57,43,0.25);
  color: #e74c3c;
}

/* ── Thanh tháng điều hướng ─────────────────────────────────────── */
.ntx-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.ntx-month-nav__btn {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  flex-shrink: 0;
}
.ntx-month-nav__btn:hover {
  background: var(--gold-glow);
  box-shadow: 0 0 10px var(--gold-glow-md);
}

.ntx-month-nav__label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold);
}

/* ── Lịch tháng nhỏ (mini calendar) ────────────────────────────── */
.ntx-mini-cal {
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.5rem;
}

.ntx-mini-cal__header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 0.5rem;
}

.ntx-mini-cal__dayname {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0;
}

.ntx-mini-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.ntx-mini-cal__cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  padding: 2px;
  border: 1px solid transparent;
  min-height: 40px;
}

.ntx-mini-cal__cell:hover {
  background: var(--gold-glow);
  border-color: var(--border-gold);
}

.ntx-mini-cal__cell.today {
  border-color: var(--gold);
  background: rgba(223,177,91,0.1);
}

.ntx-mini-cal__cell.selected {
  background: var(--gold);
  border-color: var(--gold);
}
.ntx-mini-cal__cell.selected .ntx-mini-cal__solar { color: #0b0f19; }
.ntx-mini-cal__cell.selected .ntx-mini-cal__lunar { color: #0b0f19; opacity: 0.7; }

.ntx-mini-cal__cell.empty { cursor: default; }
.ntx-mini-cal__cell.empty:hover { background: none; border-color: transparent; }

.ntx-mini-cal__solar {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1;
}

.ntx-mini-cal__lunar {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Màu chấm điểm trên lịch */
.ntx-mini-cal__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 2px;
}
.ntx-mini-cal__dot.xuat-sac,
.ntx-mini-cal__dot.tot   { background: #27ae60; }
.ntx-mini-cal__dot.trung { background: var(--gold); }
.ntx-mini-cal__dot.xau,
.ntx-mini-cal__dot.dai-xau { background: var(--red-son); }

/* ── Loading spinner ────────────────────────────────────────────── */
.ntx-loading {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  gap: 0.75rem;
  color: var(--text-muted);
}
.ntx-loading.active { display: flex; }

.ntx-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-gold);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Tooltip ────────────────────────────────────────────────────── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2236;
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 50;
}
[data-tooltip]:hover::after { opacity: 1; }

/* ── Tab điều hướng ─────────────────────────────────────────────── */
.ntx-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-panel-3);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-panel);
}

.ntx-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: var(--font-main);
  transition: var(--transition);
  text-align: center;
}

.ntx-tab.active {
  background: var(--bg-panel-2);
  color: var(--gold);
  box-shadow: 0 0 0 1px var(--border-gold);
}
.ntx-tab:hover:not(.active) { color: var(--text-main); }

/* ── Footer ─────────────────────────────────────────────────────── */
.ntx-footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border-panel);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3rem;
}
.ntx-footer a { color: var(--gold); text-decoration: none; }
.ntx-footer a:hover { text-decoration: underline; }

/* ── Scrollbar tùy chỉnh ────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(223,177,91,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Responsive fine-tune ───────────────────────────────────────── */
@media (max-width: 480px) {
  .ntx-score-wrap { flex-direction: column; align-items: center; text-align: center; }
  .ntx-score-info__badges { justify-content: center; }
  .ntx-canchi-grid { grid-template-columns: repeat(2, 1fr); }
  .ntx-form-row { flex-direction: column; }
  .ntx-btn-primary, .ntx-btn-today { width: 100%; }
  .ntx-mini-cal__cell { min-height: 32px; }
  .ntx-mini-cal__solar { font-size: 0.75rem; }
}

@media (min-width: 1024px) {
  .ntx-grid { grid-template-columns: 1fr 1fr 1fr; }
  .ntx-grid .ntx-panel:first-child { grid-column: 1 / 2; }
}

/* ═══════════════════════════════════════════════════════════════════
   PHẦN MỞ RỘNG: GIỜ HOÀNG ĐẠO · NGŨ HÀNH · LA BÀN · GIỜ XUẤT HÀNH
   ═══════════════════════════════════════════════════════════════════ */

/* ── Cảnh báo Ngày Kỵ ── */
.ntx-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(192,57,43,0.18), rgba(192,57,43,0.08));
  border: 1px solid rgba(192,57,43,0.55);
  border-left: 4px solid var(--red-son);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  animation: ntx-pulse-warn 2.2s ease-in-out infinite;
}
@keyframes ntx-pulse-warn {
  0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); }
  50%      { box-shadow: 0 0 14px 3px rgba(192,57,43,0.22); }
}
.ntx-warning__icon { font-size: 1.3rem; flex-shrink: 0; line-height: 1.4; }
.ntx-warning__body {}
.ntx-warning__title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ff6b6b;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}
.ntx-warning__desc {
  font-size: 0.78rem;
  color: rgba(255,200,180,0.85);
  line-height: 1.55;
}

/* ── Giờ Hoàng Đạo / Hắc Đạo strip ── */
.ntx-gio-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
}
.ntx-gio-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: calc(16.666% - 6px); /* 6 per row on desktop */
  min-width: 44px;
  padding: 0.45rem 0.3rem;
  border-radius: var(--radius-sm);
  cursor: default;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ntx-gio-item.hoang-dao {
  background: rgba(223,177,91,0.12);
  border: 1px solid rgba(223,177,91,0.4);
}
.ntx-gio-item.hac-dao {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.ntx-gio-item:hover { transform: translateY(-3px); }
.ntx-gio-item.hoang-dao:hover { box-shadow: 0 4px 14px rgba(223,177,91,0.3); }

.ntx-gio-item__chi {
  font-size: 0.78rem;
  font-weight: 700;
}
.ntx-gio-item.hoang-dao .ntx-gio-item__chi { color: var(--gold); }
.ntx-gio-item.hac-dao   .ntx-gio-item__chi { color: var(--text-muted); }

.ntx-gio-item__gio {
  font-size: 0.58rem;
  line-height: 1.1;
}
.ntx-gio-item.hoang-dao .ntx-gio-item__gio { color: rgba(223,177,91,0.65); }
.ntx-gio-item.hac-dao   .ntx-gio-item__gio { color: rgba(255,255,255,0.2); }

/* Badge HD / HĐ */
.ntx-gio-item__badge {
  font-size: 0.52rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.ntx-gio-item.hoang-dao .ntx-gio-item__badge {
  background: rgba(223,177,91,0.2);
  color: var(--gold);
}
.ntx-gio-item.hac-dao .ntx-gio-item__badge {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.25);
}

/* Tooltip */
.ntx-gio-item::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a2236;
  border: 1px solid var(--border-gold);
  color: var(--text-main);
  font-size: 0.68rem;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.ntx-gio-item:hover::after { opacity: 1; }

/* Legend */
.ntx-gio-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.6rem;
}
.ntx-gio-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.ntx-gio-legend-item span {
  width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0;
}
.ntx-gio-legend-item.hd span   { background: rgba(223,177,91,0.6); }
.ntx-gio-legend-item.hack span { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); }

/* ── Row: Ngũ Hành + La Bàn ── */
.ntx-hanh-compass-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* Ngũ Hành Nạp Âm */
.ntx-hanh-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}
.ntx-hanh-symbol {
  width: 70px; height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0.5rem 0;
  transition: all 0.5s ease;
  position: relative;
}
.ntx-hanh-symbol::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.3;
  animation: ntx-hanh-spin 8s linear infinite;
}
@keyframes ntx-hanh-spin { to { transform: rotate(360deg); } }

.ntx-hanh-name {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.ntx-hanh-element {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* ── La Bàn Compass ── */
.ntx-compass-box { display: flex; flex-direction: column; }
.ntx-compass-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.ntx-compass-svg {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 0 10px rgba(223,177,91,0.15));
  transition: filter 0.5s ease;
}
.ntx-compass-svg:hover {
  filter: drop-shadow(0 0 18px rgba(223,177,91,0.3));
}
/* Needle transition */
#compass-needle-hy, #compass-needle-tai {
  transition: transform 0.8s cubic-bezier(.34,1.56,.64,1);
}

.ntx-compass-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}
.ntx-compass-dir {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ntx-compass-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ntx-compass-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ntx-compass-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ── Giờ Xuất Hành grid ── */
.ntx-gio-xh-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 0.75rem;
}
.ntx-gio-xh-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: transform 0.2s ease;
}
.ntx-gio-xh-item:hover { transform: translateY(-2px); }
.ntx-gio-xh-item.cat {
  background: rgba(39,174,96,0.08);
  border: 1px solid rgba(39,174,96,0.3);
}
.ntx-gio-xh-item.hung {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.ntx-gio-xh-item__chi {
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1px;
}
.ntx-gio-xh-item.cat  .ntx-gio-xh-item__chi { color: var(--green-jade); }
.ntx-gio-xh-item.hung .ntx-gio-xh-item__chi { color: var(--text-muted); }
.ntx-gio-xh-item__gio {
  font-size: 0.55rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.ntx-gio-xh-item__than {
  font-size: 0.65rem;
  font-weight: 600;
}
.ntx-gio-xh-item.cat  .ntx-gio-xh-item__than { color: var(--green-jade); }
.ntx-gio-xh-item.hung .ntx-gio-xh-item__than { color: rgba(255,255,255,0.25); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .ntx-gio-item { width: calc(25% - 6px); } /* 4 per row on mobile */
  .ntx-hanh-compass-row { grid-template-columns: 1fr; }
  .ntx-gio-xh-grid { grid-template-columns: repeat(3, 1fr); }
  .ntx-compass-svg { width: 110px; height: 110px; }
}

/* ═══════════════════════════════════════════════════════════════════
   FORM COMPACT (MOBILE-FIRST) — ntx-form-inline layout
   Thay thế ntx-form-row / ntx-form-group bằng layout 1 dòng gọn hơn
   ═══════════════════════════════════════════════════════════════════ */

/* Override card padding về compact hơn */
.ntx-form-card {
  padding: 0.65rem 1rem 0.85rem;
  margin-bottom: 1.25rem;
}

/* ── Topbar: dòng tiêu đề nhỏ gọn ── */
.ntx-form-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid rgba(223,177,91,0.12);
}

.ntx-form-topbar__title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  opacity: 0.85;
}

/* ── Inline row: tất cả controls 1 hàng ── */
.ntx-form-inline {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex-wrap: nowrap;   /* KHÔNG bao giờ wrap — giữ 1 dòng */
}

/* ── Nhóm field (label + input) ── */
.ntx-fi {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

/* Mini floating label */
.ntx-fi__lbl {
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-left: 2px;
  white-space: nowrap;
  line-height: 1;
}

/* Inputs trong ntx-fi */
.ntx-fi select,
.ntx-fi input[type="number"] {
  background: var(--bg-panel-3);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  height: 36px;
  padding: 0 0.5rem;
  font-size: 0.88rem;
  font-family: var(--font-main);
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  /* Xóa spinner số trên input[number] */
  -moz-appearance: textfield;
}
.ntx-fi input[type="number"]::-webkit-outer-spin-button,
.ntx-fi input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ntx-fi select:focus,
.ntx-fi input[type="number"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}
.ntx-fi select:hover,
.ntx-fi input[type="number"]:hover {
  border-color: rgba(223,177,91,0.4);
}

/* Độ rộng cứng cho Ngày (2 chữ số) */
.ntx-fi--ngay { flex: 0 0 68px; }

/* Độ rộng cứng cho Tháng */
.ntx-fi--thang { flex: 0 0 76px; }

/* Năm rộng hơn — chứa input + icon */
.ntx-fi--nam { flex: 1 1 100px; min-width: 88px; }

/* Dòng ngang: year input + today icon */
.ntx-fi__nam-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ntx-fi__nam-row input { flex: 1; }

/* ── Nút Hôm Nay — icon only ── */
.ntx-btn-today {
  /* Override existing full-text style */
  all: unset;
  box-sizing: border-box;    /* all:unset resets box-sizing — khôi phục lại */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 36px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--gold);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}
.ntx-btn-today:hover {
  background: var(--gold-glow);
  box-shadow: 0 0 8px var(--gold-glow-md);
  transform: translateY(-1px);
}
.ntx-btn-today:active { transform: translateY(0); }

/* ── Nút Tra cứu — chiều cao khớp với inputs ── */
.ntx-form-inline .ntx-btn-primary {
  height: 36px;
  padding: 0 1.1rem;
  font-size: 0.88rem;
  align-self: flex-end;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Responsive ≤ 480px: nút Tra cứu tự xuống dòng riêng ───────────
 * Root cause: tổng min-width các field (68+76+88px) + nút (~100px) +
 * gaps = ~350px > không gian thực của card trên phones ≤ 430px.
 * Fix: flex-wrap + nút có flex-basis 100% → tự rớt xuống hàng 2.
 * ─────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .ntx-form-inline {
    flex-wrap: wrap;
    gap: 6px;
  }
  /* Hàng 1: 3 field giữ nguyên, thu nhỏ tý để vừa */
  .ntx-fi--ngay  { flex: 0 0 62px; }
  .ntx-fi--thang { flex: 0 0 72px; }
  .ntx-fi--nam   { flex: 1; min-width: 80px; }
  /* Hàng 2: nút rộng full — flex-basis 100% ép xuống dòng mới */
  .ntx-form-inline .ntx-btn-primary {
    flex: 1 1 100%;
    height: 40px;
    font-size: 0.9rem;
    align-self: auto;
    justify-content: center;
    margin-top: 2px;
  }
}

/* ── Responsive: màn hình rất nhỏ (≤ 340px) — xuống nhiều dòng ── */
@media (max-width: 340px) {
  .ntx-fi--ngay, .ntx-fi--thang { flex: 1 1 calc(50% - 6px); }
  .ntx-fi--nam { flex: 1 1 100%; }
}
