/* NewbieNeuro — thư viện guideline: trang danh mục, trang guideline và trình đọc PDF. Dùng token của article.css. */

/* ---------- trình đọc PDF ---------- */
.pdfv { margin: 34px 0 0; border: 1px solid var(--hair); border-radius: 2px; background: var(--panel); display: flex; flex-direction: column; height: min(88vh, 1100px); min-height: 520px; scroll-margin-top: 12px; }
.pdfv:fullscreen { height: 100vh; border: 0; border-radius: 0; }
.pdfv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 0; }
.pdfv-head h2 { margin: 0; font-family: var(--display); font-variation-settings: 'wdth' 112, 'wght' 700; font-size: 19px; letter-spacing: -0.015em; }
.pdfv-head p { margin: 0; font-size: 13px; color: var(--meta); }

.pdfv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--hair); font-size: 13.5px; }
.pdfv-grp { display: flex; align-items: center; gap: 4px; }
.pdfv-bar button, .pdfv-bar .pdfv-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; padding: 0 9px; justify-content: center; background: var(--bg); border: 1px solid var(--hair); border-radius: 2px; color: var(--ink); font-size: 13.5px; line-height: 1; }
.pdfv-bar button:hover:not(:disabled), .pdfv-bar .pdfv-btn:hover { border-color: var(--ink2); text-decoration: none; color: var(--ink); }
.pdfv-bar button:disabled { opacity: .4; cursor: default; }
.pdfv-bar button[aria-expanded="true"], .pdfv-bar button[aria-pressed="true"] { background: var(--coreBg); border-color: var(--core); color: var(--core); }
.pdfv-bar svg { width: 16px; height: 16px; flex-shrink: 0; }
.pdfv-page-in { width: 54px; height: 34px; padding: 0 6px; text-align: center; font: 500 13.5px var(--mono); background: var(--bg); color: var(--ink); border: 1px solid var(--hair); border-radius: 2px; -moz-appearance: textfield; }
.pdfv-page-in::-webkit-inner-spin-button, .pdfv-page-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.pdfv-of { color: var(--meta); font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.pdfv-zoom { min-width: 46px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--ink2); }
.pdfv-search { display: flex; flex: 1 1 200px; max-width: 320px; margin-left: auto; }
.pdfv-search input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; font: inherit; font-size: 13.5px; background: var(--bg); color: var(--ink); border: 1px solid var(--hair); border-right: 0; border-radius: 2px 0 0 2px; }
.pdfv-search button { border-radius: 0 2px 2px 0 !important; }
.pdfv-search input:focus { outline: 2px solid var(--core); outline-offset: -1px; }

.pdfv-body { position: relative; flex: 1; display: flex; min-height: 0; }
.pdfv-side { display: none; width: 290px; flex-shrink: 0; overflow: auto; border-right: 1px solid var(--hair); background: var(--panel); font-size: 13.5px; padding: 10px 0 20px; }
.pdfv.side-open .pdfv-side { display: block; }
.pdfv-side h3 { margin: 6px 14px 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--meta); text-transform: uppercase; }
.pdfv-side ul, .pdfv-side ol { list-style: none; margin: 0; padding: 0; }
.pdfv-side ul ul { padding-left: 12px; }
.pdfv-side button { display: block; width: 100%; padding: 6px 14px; text-align: left; background: none; border: 0; color: var(--ink2); line-height: 1.4; }
.pdfv-side button:hover { background: var(--rowHover); color: var(--ink); }
.pdfv-outline > ul > li > button { color: var(--ink); font-weight: 500; }
.pdfv-results { border-bottom: 1px solid var(--hair); padding-bottom: 10px; margin-bottom: 10px; }
.pdfv-results .mono { display: block; font-size: 11.5px; color: var(--core); margin-bottom: 2px; }
.pdfv-results .snip { display: block; font-size: 12.5px; color: var(--ink2); }
.pdfv-results mark { background: var(--amberBg); color: var(--ink); padding: 0 1px; }
.pdfv-note { margin: 4px 14px 8px; color: var(--meta); font-size: 13px; }

.pdfv-scroll { flex: 1; overflow: auto; background: var(--sunk); overscroll-behavior: contain; }
.pdfv-scroll:focus-visible { outline-offset: -2px; }
.pdfv-pages { padding: 20px 24px 40px; }
.pdfv-page { position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 1px 3px var(--shadow); }
.pdfv-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pdfv-page.flash { animation: pdfv-flash 1.4s ease-out; }
@keyframes pdfv-flash { 0%, 30% { box-shadow: 0 0 0 3px var(--core); } 100% { box-shadow: 0 1px 3px var(--shadow); } }
.pdfv-link { position: absolute; z-index: 2; }
.pdfv-link:hover { background: rgba(168, 17, 79, .12); text-decoration: none; }
.pdfv-msg { padding: 40px 20px; text-align: center; color: var(--ink2); }
.pdfv:not(.ready) .pdfv-bar > * { visibility: hidden; }
.pdfv-loading { padding: 60px 20px; text-align: center; color: var(--meta); font-size: 14px; }

/* Lớp chữ của PDF.js (rút gọn từ pdf_viewer.css) để chọn và sao chép chữ. */
.textLayer { position: absolute; text-align: initial; inset: 0; overflow: clip; opacity: 1; line-height: 1; letter-spacing: normal; word-spacing: normal; text-size-adjust: none; -webkit-text-size-adjust: none; forced-color-adjust: none; transform-origin: 0 0; caret-color: CanvasText; z-index: 0;
  --min-font-size: 1; --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size)); --min-font-size-inv: calc(1 / var(--min-font-size)); --scale-round-x: 1px; --scale-round-y: 1px; }
.textLayer :is(span, br) { color: transparent; position: absolute; white-space: pre; cursor: text; transform-origin: 0% 0%; user-select: text; }
.textLayer > :not(.markedContent), .textLayer .markedContent span:not(.markedContent) { z-index: 1; --font-height: 0; font-size: calc(var(--text-scale-factor) * var(--font-height)); --scale-x: 1; --rotate: 0deg; transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv)); }
.textLayer .markedContent { display: contents; }
.textLayer span[role="img"] { user-select: none; cursor: default; }
.textLayer ::selection { background: rgba(0, 0, 255, .25); color: transparent; }
.textLayer br::selection { background: transparent; }
.textLayer .endOfContent { display: block; position: absolute; inset: 100% 0 0; z-index: 0; cursor: default; user-select: none; }

@media (max-width: 899px) {
  .pdfv { height: 82vh; }
  .pdfv-side { position: absolute; inset: 0 auto 0 0; z-index: 5; width: min(320px, 86%); box-shadow: 4px 0 18px var(--shadow); }
  .pdfv-hide-sm { display: none !important; }
  .pdfv-pages { padding: 10px 8px 30px; }
  .pdfv-search { max-width: none; order: 10; flex-basis: 100%; }
}

/* ---------- trang guideline ---------- */
.gl-status { display: inline-block; padding: 3px 9px; font-size: 12.5px; font-weight: 600; border-radius: 2px; }
.gl-status--ok { color: var(--pen); background: var(--penBg); }
.gl-status--warn { color: var(--amber); background: var(--amberBg); }
.gl-status--off { color: var(--meta); background: var(--sunk); }
.gl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.gl-actions a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: 14px; font-weight: 500; border: 1px solid var(--hair); border-radius: 2px; color: var(--ink); background: var(--panel); }
.gl-actions a:hover { border-color: var(--core); color: var(--core); text-decoration: none; }
.gl-actions a.primary { background: var(--core); border-color: var(--core); color: var(--coreOn); }
.gl-actions a.primary:hover { background: var(--coreH); color: var(--coreOn); }
.gl-body { max-width: 820px; margin-top: 10px; }
.gl-body .rel-list ul { padding-left: 0; list-style: none; }
.gl-rel li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--hair); margin: 0; }
.gl-rel .code-ref { flex-shrink: 0; min-width: 88px; }
.gl-rel .soon { color: var(--meta); font-size: 13px; margin-left: auto; white-space: nowrap; }

/* ---------- trang danh mục /guideline/ ---------- */
.gl-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 28px 0 14px; }
.gl-filters button { padding: 7px 13px; font-size: 13.5px; background: var(--panel); border: 1px solid var(--hair); border-radius: 2px; }
.gl-filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.gl-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--strong); }
.gl-item a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; padding: 18px 4px; border-bottom: 1px solid var(--hair); color: var(--ink); }
.gl-item a:hover { background: var(--rowHover); text-decoration: none; }
.gl-item .gl-code { font-size: 12.5px; color: var(--core); }
.gl-item b { display: block; font-family: var(--display); font-variation-settings: 'wdth' 108, 'wght' 650; font-size: 19px; line-height: 1.3; margin: 3px 0 4px; }
.gl-item .gl-sub { font-size: 14px; color: var(--meta); }
.gl-item .gl-side { text-align: right; font-size: 13px; color: var(--ink2); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.gl-count { margin-top: 18px; }
@media (max-width: 640px) { .gl-item a { grid-template-columns: 1fr; } .gl-item .gl-side { align-items: flex-start; text-align: left; flex-direction: row; flex-wrap: wrap; } }

/* Liên kết nhanh tới app giải phẫu (nhãn HOT) */
.gl-app { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 16px; border: 1px solid var(--core); border-radius: 2px; background: var(--coreBg); color: var(--ink); font-size: 15px; }
.gl-app:hover { text-decoration: none; background: var(--panel); }
.gl-app b { font-weight: 600; color: var(--core); }
.gl-app:hover b { text-decoration: underline; }
.gl-app-go { margin-left: auto; font-size: 13.5px; color: var(--core); white-space: nowrap; }
.gl-hot { flex: none; padding: 3px 8px; border-radius: 2px; background: #d92d20; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; animation: gl-hot 1.6s ease-in-out infinite; }
@keyframes gl-hot { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .gl-hot { animation: none; } }
@media (max-width: 560px) { .gl-app { flex-wrap: wrap; } .gl-app-go { margin-left: 0; } }

/* Bộ công cụ bỏ túi Premium (20/11/2026): dải liên kết ở đầu trang và hộp ngay dưới "Điểm chính". Front matter bo_cong_cu: <slug>. */
.gl-kit { border-color: var(--pen); background: var(--penBg); }
.gl-kit + .gl-app { margin-top: 10px; }
.gl-actions a.gl-kit-btn { border-color: var(--core); color: var(--core); font-weight: 600; }
.kitbox { scroll-margin-top: 16px; }
.gl-kit b { color: var(--ink); }
.gl-kit .gl-app-go { color: var(--pen); font-weight: 600; }
.gl-kit-tag { flex: none; padding: 3px 8px; border-radius: 2px; background: var(--core); color: var(--coreOn); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; }
.kitbox { margin: 14px 0 0; padding: 22px 26px 24px; background: var(--panel); border: 2px solid var(--core); border-radius: 2px; }
.kitbox-tag { display: inline-block; margin: 0 0 8px; padding: 4px 9px; border-radius: 2px; background: var(--core); color: var(--coreOn); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.kitbox h2 { margin: 0 0 6px; font-family: var(--display); font-variation-settings: 'wdth' 110, 'wght' 720; font-size: clamp(20px, 2.4vw, 25px); line-height: 1.2; letter-spacing: -0.015em; }
.kitbox-lead { margin: 0 0 12px; color: var(--ink2); font-size: 15.5px; }
.kitbox ul { margin: 0 0 14px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 24px; font-size: 15px; }
.kitbox li { position: relative; padding-left: 20px; }
.kitbox li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 5px; border-left: 2px solid var(--pen); border-bottom: 2px solid var(--pen); transform: rotate(-45deg); }
.kitbox-gia { margin: 0; font-size: 15px; color: var(--ink2); }
.kitbox-gia b { color: var(--ink); }
.kitbox-gia s { color: var(--meta); }
.kitbox-nut { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.kitbox-nut a { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 20px; border-radius: 2px; border: 1px solid var(--strong); color: var(--ink); font-weight: 600; font-size: 15.5px; }
.kitbox-nut a:hover { background: var(--rowHover); text-decoration: none; }
.kitbox-nut a.chinh { background: var(--core); border-color: var(--core); color: var(--coreOn); }
.kitbox-nut a.chinh:hover { background: var(--coreH); border-color: var(--coreH); }
@media (max-width: 640px) {
  .kitbox { padding: 18px 18px 20px; }
  .kitbox ul { grid-template-columns: minmax(0, 1fr); }
  .kitbox-nut a { flex: 1 1 100%; }
}
.kitbox[hidden] { display: none; }

/* Hộp mời đăng ký Premium giữa "Điểm chính" và trình đọc (21/11/2026) */
.gl-prem { display: flex; align-items: center; gap: 16px 24px; margin: 14px 0 0; padding: 16px 20px; background: var(--panel); border: 2px solid var(--core); border-radius: 2px; }
.gl-prem-txt { margin: 0; flex: 1 1 auto; font-size: 15px; color: var(--ink2); }
.gl-prem-txt .kitbox-tag { margin: 0 10px 0 0; vertical-align: 1px; }
.gl-prem-txt b { color: var(--ink); }
.gl-prem-txt s { color: var(--meta); }
.gl-prem-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 22px; border-radius: 2px; background: var(--core); color: var(--coreOn); font-weight: 600; font-size: 15.5px; white-space: nowrap; }
.gl-prem-btn:hover { background: var(--coreH); text-decoration: none; }
.gl-prem[hidden] { display: none; }
@media (max-width: 560px) { .gl-prem { flex-direction: column; align-items: stretch; padding: 16px; } }

/* Popup mời Premium cho tài khoản Free khi mở trang đọc PDF (22/11/2026).
   Nền ảnh não 3D (moi-premium-nao.jpg, chụp từ NeuroAtlas 3D) mờ dần về phía chữ. Ảnh nền đen nên hộp luôn dùng
   bảng màu tối ở cả hai giao diện (thẻ nổi bật kiểu --inv, HUONG-DAN-STYLE.md): token được đặt lại ngay trong hộp. */
.gl-moi {
  --ink: #E3E9E5; --ink2: #C4CEC9; --meta: #95A19D; --hair: #2F3A3D; --sunk: rgba(255,255,255,.08);
  --core: #FF74A8; --coreH: #FFA3C6; --coreOn: #24050F;
  overflow: hidden; width: min(640px, calc(100vw - 32px)); min-height: 400px; margin: auto;
  padding: 34px 34px 30px; color: var(--ink); background: #0A1013; border: 1px solid #2F3A3D; border-top: 4px solid var(--core);
  border-radius: 2px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
/* Lớp ảnh: não nằm bên phải, mờ dần sang trái (phía chữ) và xuống dưới (phía nút). */
.gl-moi::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url("moi-premium-nao.jpg") left 95px center / auto 100% no-repeat; opacity: .92;
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, rgba(0,0,0,.35) 34%, #000 70%);
          mask-image: linear-gradient(90deg, transparent 4%, rgba(0,0,0,.35) 34%, #000 70%);
}
.gl-moi::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(10,16,19,.92) 0%, rgba(10,16,19,.7) 42%, rgba(10,16,19,.12) 78%),
              linear-gradient(0deg, rgba(10,16,19,.85) 0%, rgba(10,16,19,0) 40%);
}
.gl-moi > * { position: relative; z-index: 1; }
.gl-moi > :not(.gl-moi-x):not(.gl-moi-nut) { max-width: 56%; }
.gl-moi::backdrop { background: rgba(8, 12, 14, .6); }
.gl-moi[open] { animation: gl-moi-vao .25s ease-out; }
@keyframes gl-moi-vao { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .gl-moi[open] { animation: none; } }
.gl-moi h2 { margin: 4px 0 12px; font-family: var(--display); font-size: 28px; line-height: 1.2; color: var(--ink); text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.gl-moi p { margin: 0 0 12px; font-size: 16px; line-height: 1.6; color: var(--ink2); text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.gl-moi .kitbox-tag { margin-bottom: 8px; text-shadow: none; }
.gl-moi-gia b { color: var(--ink); }
.gl-moi-gia span { color: var(--meta); font-size: 14px; }
.gl-moi-nut { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 26px; }
.gl-moi-sau { min-height: 46px; padding: 0 18px; background: rgba(10,16,19,.55); color: var(--ink2); border: 1px solid #4A585C; border-radius: 2px; font: inherit; font-size: 15px; cursor: pointer; }
.gl-moi-sau:hover { background: var(--sunk); color: var(--ink); }
.gl-moi-x { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; display: grid; place-items: center; background: rgba(10,16,19,.55); color: var(--ink2); border: 0; border-radius: 2px; font-size: 26px; line-height: 1; cursor: pointer; }
.gl-moi-x:hover { background: rgba(255,255,255,.12); color: var(--ink); }
/* Điện thoại: não lên phần trên của hộp, chữ ở dưới trên nền tối dần. */
@media (max-width: 560px) {
  .gl-moi { min-height: 0; padding: 190px 20px 20px; }
  .gl-moi::before { background-position: 60% 0; background-size: auto 250px;
    -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 82%); mask-image: linear-gradient(180deg, #000 45%, transparent 82%); }
  .gl-moi::after { background: linear-gradient(180deg, rgba(10,16,19,0) 0%, rgba(10,16,19,.15) 30%, rgba(10,16,19,.9) 62%, #0A1013 80%); }
  .gl-moi > :not(.gl-moi-x):not(.gl-moi-nut) { max-width: none; }
  .gl-moi h2 { font-size: 24px; }
  .gl-moi p { font-size: 15px; }
  .gl-moi-nut > * { flex: 1 1 auto; }
}
.gl-moi .nn-dem { white-space: nowrap; text-shadow: none; background: rgba(10,16,19,.6); }
