/* ==========================================================
   NGAZI — PAPERS  (v4 · 2026-09-17)
   Two jobs in one file: the library on screen, and the
   examination document itself, which must survive being
   printed to PDF. The print rules at the bottom are the real
   typesetting engine — the screen styles only preview them.
   ========================================================== */

/* ------------------------------------------------ library */

.pp-badge{
  display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:800;
  letter-spacing:.04em;text-transform:uppercase;padding:4px 8px;border-radius:999px;white-space:nowrap;
  background:var(--surface-2);color:var(--muted);line-height:1.3;
}
.pp-badge.is-need{color:#92400E;background:#FEF3C7}
.pp-badge.is-owned{color:#065F46;background:#D1FAE5}
.pp-badge.is-844{color:#92400E;background:#FFEDD5}

/* a paper card — the catalogue's main object.
   Row layout by default; a product tile inside .pgrid and .shelf. */
.pp-card{
  display:flex;gap:14px;align-items:flex-start;position:relative;
  background:#fff;border:1px solid var(--line);border-radius:var(--r-m);
  padding:12px;text-decoration:none;min-width:0;box-shadow:var(--sh-1);
  transition:border-color var(--t-fast),box-shadow var(--t-fast),transform var(--t-fast);
}
a.pp-card:hover{border-color:var(--line-strong);box-shadow:var(--sh-2)}
a.pp-card:active{transform:scale(.985)}
.pp-card.is-need{opacity:.72;box-shadow:none}
.pp-card-body{min-width:0;flex:1;display:block}
.pp-card-t{font-weight:750;font-size:15.5px;letter-spacing:-.015em;display:block;overflow-wrap:anywhere;color:var(--navy);line-height:1.3}
.pp-card-m{font-size:13px;color:var(--muted);margin-top:3px;display:block;line-height:1.4}
.pp-card-b{margin-top:10px;display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.pp-price{font-weight:800;font-size:14.5px;color:var(--navy)}
.pp-price.is-free{color:#065F46;background:#D1FAE5;padding:2px 9px;border-radius:999px;font-size:13px}

.pgrid{display:grid;gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:720px){ .pgrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px} }
@media(min-width:1024px){ .pgrid{grid-template-columns:repeat(4,minmax(0,1fr))} }
.pgrid .pp-card,.shelf .pp-card{flex-direction:column;gap:0;padding:8px 8px 12px;border-radius:var(--r-l)}
.pgrid .pp-card-body,.shelf .pp-card-body{padding:10px 4px 0;width:100%}
.pgrid .pp-card-t,.shelf .pp-card-t{font-size:14.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.pgrid .pp-card-m,.shelf .pp-card-m{font-size:12.5px}
.pgrid .pp-card-b,.shelf .pp-card-b{margin-top:8px;gap:5px}
.pgrid .pp-badge,.shelf .pp-badge{font-size:10px;padding:3px 7px}
.shelf .pp-card{width:clamp(154px,44vw,196px)}
.pgrid-compact{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:620px){ .hres .pgrid-compact{grid-template-columns:repeat(4,minmax(0,1fr))} }
.hres .pp-card{box-shadow:none}

/* ---- the cover system ----
   One lightweight cover, drawn in CSS and sized in em so the same
   markup works as a thumbnail or a full tile. The band colour is the
   subject; the three bars are the Ngazi steps. Official papers Ngazi
   does not hold get a dashed outline. No images. */
.pc{
  font-size:10px;
  flex:0 0 6.8em;width:6.8em;height:9.2em;border-radius:.8em;position:relative;overflow:hidden;
  display:flex;flex-direction:column;padding:0 .65em .55em;
  background:
    radial-gradient(circle at 105% 108%,var(--h-soft,#E0F2FE) 0 34%,transparent 35%),
    linear-gradient(180deg,#FFFFFF,#F8FAFC);
  color:#0B1F3A;
  border:1px solid rgba(11,31,58,.12);box-shadow:0 .6em 1.2em -.9em rgba(11,31,58,.55);
  font-family:var(--font);line-height:1.12;
}
.pc>span{position:relative;z-index:1}
.pc-official{border-style:dashed;background:#F4F5F8}
.pc-top{display:flex;justify-content:space-between;align-items:center;margin:0 -.65em .65em;padding:.45em .65em;background:var(--h-ink,#1D4ED8);color:#fff}
.pc-top b{font-size:.72em;font-weight:800;letter-spacing:.14em}
.pc-top i{font-style:normal;font-size:.95em;font-weight:800;background:rgba(255,255,255,.2);border-radius:.4em;padding:0 .3em}
.pc-sub{font-size:.95em;font-weight:800;text-transform:uppercase;letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pc-type{font-size:.85em;font-weight:650;color:#475569;margin-top:.25em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pc-foot{font-size:.8em;font-weight:800;color:#334155;margin-top:auto;font-variant-numeric:tabular-nums}
.pc-kind{font-size:.62em;font-weight:800;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:clip;text-transform:uppercase;color:var(--h-ink,#1D4ED8);margin-top:.2em}
.pc-art{
  position:absolute!important;right:.7em;bottom:2.6em;width:2.4em;height:2.1em;z-index:0!important;opacity:.95;
  background:
    linear-gradient(var(--h,#3B82F6),var(--h,#3B82F6)) 0 100%/.6em .75em no-repeat,
    linear-gradient(var(--h,#3B82F6),var(--h,#3B82F6)) .9em 100%/.6em 1.35em no-repeat,
    linear-gradient(var(--h,#3B82F6),var(--h,#3B82F6)) 1.8em 100%/.6em 2.1em no-repeat;
}
.pc-official .pc-art{opacity:.35}
.pgrid .pc,.shelf .pc{font-size:clamp(14px,4.1vw,17px);width:100%;flex:none;height:auto;aspect-ratio:4 / 3.4;border-radius:.75em}
@media(min-width:720px){ .pgrid .pc{font-size:16px} }
.shelf .pc{font-size:15px}
.hres .pc{font-size:13px}

.pp-head{display:flex;gap:18px;align-items:center}
.pp-head>div{min-width:0}
.pp-head .pc{font-size:13px}
@media(min-width:620px){ .pp-head .pc{font-size:16px} }
.pp-sub{margin:6px 0 0;color:var(--muted);font-size:15.5px}

.pp-buy{margin-top:20px}
.price-line{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.price-line b{font-size:30px;font-weight:800;letter-spacing:-.03em;color:var(--navy)}
.price-line s{color:var(--faint)}
.ticks{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:8px;font-size:15px}
.ticks li{padding-left:28px;position:relative}
.ticks li::before{content:"✓";position:absolute;left:0;top:2px;width:19px;height:19px;border-radius:50%;background:#D1FAE5;color:#047857;font-weight:800;font-size:11px;display:grid;place-items:center}

.pp-meta{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px 16px;font-size:14.5px}
.pp-meta dt{color:var(--faint);font-size:13px}
.pp-meta dd{margin:0;font-weight:650}

.pp-notice{
  border-left:4px solid #F59E0B;background:#FFFBEB;
  border-radius:0 14px 14px 0;padding:13px 15px;margin-top:16px;
}
.pp-notice h3{font-size:14.5px;margin:0 0 5px;color:#92400E}
.pp-notice p{margin:0;font-size:14px;color:#57534E;line-height:1.55}

/* ------------------------------------------------ checkout sheet */
body.has-sheet{overflow:hidden}
.sheet-wrap{position:fixed;inset:0;z-index:90;display:flex;align-items:flex-end;justify-content:center}
.sheet-bg{position:absolute;inset:0;background:rgba(11,31,58,.5)}
.sheet-card{
  position:relative;width:100%;max-width:480px;max-height:92dvh;overflow:auto;
  background:#fff;border-radius:24px 24px 0 0;
  padding:20px 18px calc(20px + var(--sab));box-shadow:var(--shadow);
  animation:rise .22s cubic-bezier(.2,.8,.2,1) both;
}
@media(min-width:620px){ .sheet-wrap{align-items:center} .sheet-card{border-radius:24px} }
.sheet-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.sheet-head h2{font-size:20px;margin-right:auto}
.demo-tag{font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;
  padding:4px 9px;border-radius:999px;color:#422006;background:var(--yellow)}
.steps{margin:16px 0 0;padding:0;list-style:none;display:grid;gap:8px}
.steps li{padding:11px 13px;border-radius:12px;background:var(--bg);border:1px solid var(--line);font-size:14.5px}
.steps li b{display:block;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--sky-ink)}

/* ------------------------------------------- the paper itself
   Rendered on a light "sheet" even in dark mode: an examination
   is read as paper, and inverting it would make the printed and
   on-screen versions two different documents. */

.sheet{
  background:#FCFCFA;color:#14181F;border-radius:10px;
  padding:clamp(18px,5vw,44px);
  box-shadow:0 24px 50px -30px rgba(11,31,58,.45);
  border:1px solid rgba(12,22,48,.12);
  font-family:Georgia,"Times New Roman",serif;
  line-height:1.42;font-size:15px;
  max-width:100%;overflow-wrap:break-word;
}
.sheet *{border-color:rgba(12,22,48,.18)}
.sheet.cover-only{max-width:560px}

/* ---- premium cover ---- */
.cov{--covink:#0E7490;position:relative;text-align:center;padding:6px 0 2px}
.cov-primary{--covink:#047857}
.cov-secondary{--covink:#6D28D9}
.cov-archive{--covink:#B45309}
.cov::before,.cov::after{content:"";display:block;height:1px;background:rgba(12,22,48,.22)}
.cov-inner{border:1px solid rgba(12,22,48,.22);border-top:none;border-bottom:none;padding:26px 16px 30px;position:relative}
.cov-corner{position:absolute;width:14px;height:14px;border:1.5px solid var(--covink)}
.cov-corner.tl{top:-1px;left:-1px;border-right:none;border-bottom:none}
.cov-corner.tr{top:-1px;right:-1px;border-left:none;border-bottom:none}
.cov-corner.bl{bottom:-1px;left:-1px;border-right:none;border-top:none}
.cov-corner.br{bottom:-1px;right:-1px;border-left:none;border-top:none}

.cov-brand{display:flex;align-items:center;justify-content:center;gap:9px;margin-bottom:4px}
.cov-mark{display:flex;align-items:flex-end;gap:3px;height:22px}
.cov-mark i{display:block;width:5px;border-radius:1.5px;background:var(--covink)}
.cov-mark i:nth-child(1){height:9px}
.cov-mark i:nth-child(2){height:15px}
.cov-mark i:nth-child(3){height:22px;background:#14181F}
.cov-word{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-weight:800;font-size:20px;letter-spacing:-.02em;color:#14181F}

.cov-eyebrow{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:10px;font-weight:800;letter-spacing:.20em;text-transform:uppercase;
  color:var(--covink);margin:14px 0 20px;
}
.cov-exam{font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:#4A5A78;margin-bottom:4px}
.cov-year{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:13px;font-weight:700;letter-spacing:.14em;color:#4A5A78;margin-bottom:22px}
.cov-rule{height:1px;background:rgba(12,22,48,.22);margin:0 auto 22px;max-width:180px}
.cov-subject{font-size:clamp(22px,6.9vw,38px);font-weight:700;letter-spacing:.01em;line-height:1.1;margin:0;overflow-wrap:anywhere}
.cov-paper{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:14px;font-weight:700;letter-spacing:.18em;color:var(--covink);margin-top:10px}
.cov-level{font-size:14px;color:#4A5A78;margin-top:16px}

.cov-facts{display:flex;justify-content:center;gap:10px 0;margin-top:26px;flex-wrap:wrap}
.cov-fact{padding:0 16px;border-left:1px solid rgba(12,22,48,.18)}
.cov-fact:first-child{border-left:none}
.cov-fact span{display:block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:9.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#5E6E8A}
.cov-fact b{display:block;font-size:16px;font-weight:700;margin-top:3px}

.cov-desig{
  display:inline-block;margin-top:26px;font-size:11px;letter-spacing:.05em;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  border:1px solid rgba(12,22,48,.22);border-radius:3px;padding:5px 12px;color:#4A5A78;
}
.cov-ref{margin-top:14px;font-size:10.5px;letter-spacing:.10em;color:#6B7890;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

/* ---- examination body ---- */
.pdoc-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;
  border-bottom:1px solid rgba(12,22,48,.22);padding-bottom:8px;margin:22px 0 16px;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;font-size:11px;
  letter-spacing:.06em;text-transform:uppercase;color:#4A5A78}

.pdoc-fields{display:grid;gap:12px;margin-bottom:18px}
@media(min-width:520px){.pdoc-fields{grid-template-columns:1fr 1fr}}
.pdoc-field{display:flex;align-items:baseline;gap:8px;font-size:13.5px}
.pdoc-field span{color:#4A5A78;white-space:nowrap}
.pdoc-field i{flex:1;border-bottom:1px solid rgba(12,22,48,.35);height:15px;display:block}

.pdoc-instr{border:1px solid rgba(12,22,48,.22);border-radius:4px;padding:14px 16px;margin-bottom:20px}
.pdoc-instr h2{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:11px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;margin:0 0 8px;color:#0E7490}
.pdoc-instr ul{margin:0;padding-left:18px}
.pdoc-instr li{margin:4px 0;font-size:13.5px}

.psec{margin-top:22px}
.psec-h{display:flex;justify-content:space-between;align-items:baseline;gap:12px;
  border-top:1.5px solid rgba(12,22,48,.4);border-bottom:1px solid rgba(12,22,48,.22);
  padding:7px 0;margin-bottom:4px}
.psec-t{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:13px;font-weight:800;letter-spacing:.14em}
.psec-m{font-size:12px;color:#4A5A78;white-space:nowrap}
.psec-note{font-size:13px;font-style:italic;color:#4A5A78;margin:6px 0 12px}

.pq{display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:4px 8px;
  margin:0 0 13px;page-break-inside:avoid;break-inside:avoid}
.pq-n{font-weight:700;font-size:14.5px}
.pq-t{font-size:14.5px}
.pq-m{font-size:13px;color:#4A5A78;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.pq-parts{grid-column:2 / -1;margin-top:6px}
.ppart{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:3px 8px;margin-bottom:8px}
.ppart-l{font-size:14px}
.ppart-t{font-size:14px}
.ppart-m{font-size:12.5px;color:#4A5A78;text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}

.sheet .kbdp{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;white-space:nowrap;
  background:rgba(12,22,48,.05);border-radius:3px;padding:0 4px}

.ptable{width:100%;border-collapse:collapse;margin:8px 0;font-size:13.5px}
.ptable th,.ptable td{border:1px solid rgba(12,22,48,.35);padding:6px 9px;text-align:left}
.ptable th{background:rgba(12,22,48,.05);font-weight:700}

.pdoc-end{text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:11px;letter-spacing:.16em;color:#4A5A78;margin-top:26px;
  border-top:1px solid rgba(12,22,48,.22);padding-top:12px}

.pscheme{margin-top:30px;padding:14px 14px 4px;border:1.5px dashed rgba(4,120,87,.55);border-radius:6px;background:rgba(4,120,87,.04)}
.pscheme .psec-h{border-top:none;margin-bottom:10px}
.pscheme .psec-t{color:#047857}

.pdoc-foot{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:10.5px;color:#6B7890;
  margin-top:14px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}

/* preview cut */
.pp-cut{position:relative;margin-top:-90px;padding-top:90px;
  background:linear-gradient(180deg,rgba(252,252,250,0),#FCFCFA 70%)}
.pp-lock{text-align:center;padding:22px 16px 6px}
.pp-lock h3{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:16px;margin:0 0 6px;color:#14181F}
.pp-lock p{margin:0 auto;max-width:44ch;font-size:14px;color:#4A5A78;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}

/* =============================================== PRINT / PDF
   Everything that is not the sheet is removed, the sheet loses
   its screen chrome, and the cover is the only forced page
   break. Questions simply flow: a question that fits below the
   previous one is set there. */
@media print{
  @page{size:A4;margin:14mm 15mm 16mm}
  html,body{background:#fff!important;margin:0!important;padding:0!important}
  body::before{display:none!important}
  .topbar,.tabs,.crumb,.btnrow,.foot,.toast,.pp-lock,.pp-cut,.skip,.pp-actions,.pp-noprint,.sheet-wrap{display:none!important}
  .main,.view{max-width:none!important;margin:0!important;padding:0!important}
  .view>*{animation:none!important}
  .sheet{box-shadow:none!important;border:none!important;border-radius:0!important;
    padding:0!important;background:#fff!important;color:#000!important;font-size:10.7pt!important;
    line-height:1.34!important}
  .cov{page-break-after:always;break-after:page;padding-top:16mm}
  .cov-inner{padding:22mm 12mm 24mm}
  .psec,.pdoc-instr{page-break-inside:auto}
  .psec-h{page-break-after:avoid;break-after:avoid}
  .pq{page-break-inside:avoid;break-inside:avoid;margin-bottom:9pt}
  .ppart{page-break-inside:avoid;break-inside:avoid}
  .ptable{page-break-inside:avoid;break-inside:avoid}
  .pscheme{page-break-before:always;break-before:page;border:none;background:none}
  .pq-t,.ppart-t{font-size:10.7pt}
  .pdoc-instr li{font-size:10pt}
  a[href]::after{content:""!important}
}
