/* Nhật Phúc · Số liệu */
.npsl [hidden], .npsl-tip[hidden] { display: none !important; }
.npsl { display: inline-flex; flex-wrap: wrap; gap: 2px 12px; align-items: center; font-size: 13px; font-weight: 600; }
.npsl > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.npsl b { font-weight: 800; }
.npsl-top-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #b91c1c; color: #fff; font-size: 12px; font-weight: 800; }

/* Bảng xếp hạng */
.npsl-boards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; margin: 0 0 22px; }
.npsl-board { border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; color: #111827; padding: 14px 16px 8px; }
.npsl-board .npsl-board__h { margin: 0 0 6px; padding: 0; border: 0; font-size: 16px; line-height: 1.3; font-weight: 800; letter-spacing: 0; color: inherit; }
.npsl-board ol { margin: 0; padding: 0; list-style: none; }
.npsl-board li { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; border-top: 1px solid rgba(127, 127, 127, .2); font-size: 14.5px; }
.npsl-board li:first-child { border-top: 0; }
.npsl-board li::marker { content: none; }
.npsl-board__rank { flex: 0 0 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: #f3f4f6; color: #111827; font-size: 13px; font-weight: 800; }
.npsl-board li a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; font-weight: 700; text-decoration: none; padding: 9px 0; }
.npsl-board li a:hover { text-decoration: underline; }
.npsl-board li a:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.npsl-board__val { flex: 0 0 auto; font-size: 13px; color: #4b5563; }
.npsl-board__val b { color: #111827; }
.npsl-boards--dark .npsl-board { background: #111827; border-color: #263244; color: #f3f4f6; }
.npsl-boards--dark .npsl-board__rank { background: #1f2937; color: #facc15; }
.npsl-boards--dark .npsl-board__val { color: #b9c0cc; }
.npsl-boards--dark .npsl-board__val b { color: #fff; }
.npsl-boards--paper .npsl-board { background: #fffaf0; border-color: #d9cfbd; color: #1b1a17; }
.npsl-boards--paper .npsl-board__rank { background: #ff8a3d; color: #1b1a17; }
.npsl-boards--paper .npsl-board__val { color: #5a544a; }
.npsl-boards--paper .npsl-board__val b { color: #1b1a17; }

/* Màu: mặc định nền sáng (wp-admin); trang công khai dùng nền tối như site. Cặp cột đã kiểm bằng validate_palette (sáng + tối #111827). */
.npsl-admin { --sf: #fff; --bd: #e5e7eb; --tx: #111827; --mu: #4b5563; --hl: #ececea; --base: #c9c9c4; --tick: #5f5e58; --lk: #1d4ed8; --s1: #2a78d6; --s2: #eb6834; }
.npsl-page, .npsl-home { --sf: #111827; --bd: #263244; --tx: #f3f4f6; --mu: #b9c0cc; --hl: #222c3d; --base: #46536a; --tick: #9aa4b6; --lk: #7cc4ff; --s1: #3987e5; --s2: #d95926; }

/* Dải tổng ở trang chủ */
.npsl-home { padding: 28px 0 0; }
.npsl-home .np-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; }
.npsl-home ul { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.npsl-home li { display: flex; align-items: baseline; gap: 6px; margin: 0; padding: 8px 14px; border: 1px solid var(--bd); border-radius: 12px; background: var(--sf); color: var(--mu); font-size: 14px; }
.npsl-home li strong { font-size: 20px; font-weight: 900; color: var(--tx); }
.npsl-home a { font-weight: 800; color: var(--lk); text-decoration: none; padding: 8px 0; }
.npsl-home a:hover { text-decoration: underline; }
@media (max-width: 560px) { .npsl-home ul { display: grid; grid-template-columns: 1fr 1fr; width: 100%; } }

/* Trang /so-lieu/ và wp-admin */
.npsl-page { max-width: 1000px; margin: 0 auto; padding: 28px 16px 56px; color: var(--tx); }
.npsl-page h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.2; font-weight: 900; letter-spacing: -.02em; color: #fff; }
.npsl-page > p { color: var(--mu); max-width: 68ch; }
.npsl-page h2.npsl-h2 { margin: 34px 0 12px; font-size: 1.35rem; font-weight: 900; color: #fff; }
.npsl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 18px 0; }
.npsl-card { border: 1px solid var(--bd); border-radius: 16px; background: var(--sf); padding: 14px 18px; color: var(--tx); }
.npsl-card h2 { margin: 0; padding: 0; font-size: 15px; font-weight: 800; color: var(--mu); }
.npsl-card p { margin: 6px 0 0; font-size: 14px; color: var(--mu); line-height: 1.7; }
.npsl-card p.npsl-big { font-size: 40px; line-height: 1.15; font-weight: 800; color: var(--tx); }
.npsl-big small { font-size: 15px; font-weight: 600; color: var(--mu); }
.npsl-card b { color: var(--tx); }
.npsl-card a { font-weight: 700; color: var(--lk); }

.npsl-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin: 0 0 18px; }
.npsl-chart { margin: 0; border: 1px solid var(--bd); border-radius: 16px; background: var(--sf); padding: 14px 16px; color: var(--tx); min-width: 0; }
.npsl-chart figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; font-size: 15px; }
.npsl-chart figcaption b { color: var(--tx); }
.npsl-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mu); }
.npsl-legend i, .npsl-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.npsl-legend .npsl-k2 { margin-left: 8px; }
.npsl-k1 { background: var(--s1); }
.npsl-k2 { background: var(--s2); }
.npsl-plot { position: relative; }
.npsl-plot svg { display: block; width: 100%; height: auto; }
.npsl-s1 { fill: var(--s1); }
.npsl-s2 { fill: var(--s2); }
.npsl-grid { stroke: var(--hl); stroke-width: 1; }
.npsl-grid.is-base { stroke: var(--base); }
.npsl-tick { fill: var(--tick); font-size: 11px; font-family: system-ui, sans-serif; }
.npsl-hit { fill: transparent; }
.npsl-col:hover .npsl-hit, .npsl-col:focus-visible .npsl-hit { fill: rgba(127, 140, 160, .14); }
.npsl-col:focus { outline: none; }
.npsl-col:focus-visible .npsl-hit { stroke: var(--tx); stroke-width: 1.5; }
.npsl-tip { position: absolute; top: 0; z-index: 2; display: flex; flex-direction: column; gap: 2px; min-width: 120px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--bd); background: var(--sf); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); font-size: 13px; color: var(--mu); pointer-events: none; }
.npsl-tip em { font-style: normal; font-size: 12px; }
.npsl-tip span { display: flex; align-items: center; gap: 6px; }
.npsl-tip b { color: var(--tx); font-weight: 800; }
.npsl-chart details { margin-top: 8px; font-size: 13.5px; }
.npsl-chart summary, .npsl-more summary { cursor: pointer; font-weight: 700; padding: 8px 0; color: var(--tx); }
.npsl-chart table { width: 100%; border-collapse: collapse; margin: 4px 0 0; }
.npsl-chart th, .npsl-chart td { padding: 4px 6px; border: 0; border-bottom: 1px solid var(--hl); text-align: right; font-variant-numeric: tabular-nums; background: none; color: var(--tx); }
.npsl-chart tr > :first-child { text-align: left; }

.npsl-tablewrap { overflow-x: auto; border: 1px solid var(--bd); border-radius: 16px; background: var(--sf); }
.npsl-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 14.5px; }
.npsl-table th, .npsl-table td { padding: 9px 12px; border: 0; border-bottom: 1px solid var(--hl); text-align: right; font-variant-numeric: tabular-nums; color: var(--tx); background: none; }
.npsl-table th:first-child, .npsl-table td:first-child { text-align: left; }
.npsl-table thead th { font-size: 13px; color: var(--mu); font-weight: 700; }
.npsl-table a { font-weight: 700; color: var(--lk); text-decoration: none; }
.npsl-table a:hover { text-decoration: underline; }
.npsl-more { margin-top: 10px; }
.npsl-more ul { columns: 3 200px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 14px; line-height: 2.1; }
.npsl-more a { color: var(--lk); text-decoration: none; }
.npsl-how { padding-left: 20px; color: var(--mu); line-height: 1.75; }
.npsl-how b { color: var(--tx); }

.npsl-admin .num { text-align: right; font-variant-numeric: tabular-nums; }
.npsl-admin th.num a { justify-content: flex-end; }
.npsl-admin .npsl-chart summary { font-size: 13px; }

/* Trang thư viện: điện thoại chỉ hiện 3 dòng đầu mỗi bảng để danh sách chính không bị đẩy xa */
@media (max-width: 560px) {
  .npsl-boards { grid-template-columns: 1fr; }
  .npsl-boards--paper .npsl-board li:nth-child(n+4), .npsl-boards--dark .npsl-board li:nth-child(n+4) { display: none; }
}

/* Công cụ */
.npsl-tool { gap: 2px 10px; }
.npsl-card h3 { margin: 0; padding: 0; font-size: 15px; font-weight: 800; color: var(--mu); }
.npsl-hub { margin: 0 0 28px; }
.npsl-home.npsl-home--hub { padding: 0 0 14px; }
.npsl-home--hub li span { font-size: 14px; }
.npsl-hub .npsl-boards { margin: 0; }
.npsl-calc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 16px !important; padding: 10px 14px; border: 1px solid #263244; border-radius: 12px; background: #111827; color: #b9c0cc !important; font-size: 13.5px; }
.npsl-calc .npsl b { color: #fff; }
.npsl-calc > a { margin-left: auto; color: #7cc4ff !important; font-weight: 700; }
.npsl-calc .npsl:not(:has(> span:not([hidden]))) { display: none; }
@media (max-width: 560px) { .npsl-hub .npsl-board li:nth-child(n+4) { display: none; } }

/* Khóa kiểu: /cong-cu/ và bảng tính nằm trong vùng nội dung bài (theme tự kẻ số, gạch chân, phóng to h2) */
.npsl-hub ul, .npsl-hub ol { list-style: none !important; margin: 0 !important; padding: 0 !important; counter-reset: none !important; }
.npsl-hub li { margin: 0 !important; line-height: 1.4 !important; }
.npsl-hub li::before, .npsl-hub li::marker, .npsl-hub h2::before, .npsl-hub h2::after { content: none !important; display: none !important; }
.npsl-hub .npsl-home--hub li { padding: 8px 14px !important; }
.npsl-hub .npsl-board li { padding: 0 !important; }
.npsl-hub .npsl-board { padding: 14px 16px 8px !important; }
.npsl-hub .npsl-board__h { margin: 0 0 6px !important; padding: 0 !important; border: 0 !important; font-size: 16px !important; line-height: 1.3 !important; }
.npsl-hub a { text-decoration: none !important; border: 0 !important; box-shadow: none !important; }
.npsl-hub a:hover { text-decoration: underline !important; }
.npsl-hub .npsl-home--hub > a { font-size: 15px !important; }
.npsl-calc:not(:has(.npsl > span:not([hidden]))) { display: none !important; }
.npsl-calc a { font-size: 13.5px !important; line-height: 1.5 !important; text-decoration: none !important; border: 0 !important; box-shadow: none !important; }
.npsl-calc a:hover { text-decoration: underline !important; }
