
.anpqb-shell{max-width:1180px;margin:0 auto;padding:22px;font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#15243b}
.anpqb-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start;background:linear-gradient(135deg,#0e3157,#164d78);color:#fff;padding:26px 28px;border-radius:18px;box-shadow:0 8px 30px rgba(14,49,87,.12)}
.anpqb-kicker{font-size:11px;letter-spacing:.12em;font-weight:800;opacity:.82;margin-bottom:6px}.anpqb-head h1{margin:0 0 5px;font-size:30px;line-height:1.15}.anpqb-head p{margin:0;max-width:720px;font-size:14px;line-height:1.6;color:#e9f3fb}
.anpqb-count{min-width:92px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);border-radius:14px;padding:12px;text-align:center}.anpqb-count strong{font-size:26px;display:block}.anpqb-count span{font-size:11px;opacity:.85}
.anpqb-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) 220px 150px;gap:10px;margin:16px 0 8px}.anpqb-search{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid #d9e3ee;border-radius:10px;padding:0 12px}.anpqb-search input,.anpqb-toolbar select{width:100%;height:42px;border:0;background:#fff;color:#20344e;font-size:13px;outline:none}.anpqb-toolbar select{border:1px solid #d9e3ee;border-radius:10px;padding:0 10px}
.anpqb-summary{font-size:12px;color:#66788d;margin:9px 2px 12px}.anpqb-list{display:grid;grid-template-columns:1fr 1fr;gap:13px}.anpqb-card{background:#fff;border:1px solid #dfe7f0;border-radius:14px;padding:17px 18px;box-shadow:0 3px 15px rgba(23,54,93,.05);align-self:start}.anpqb-card:hover{border-color:#b9cadb;box-shadow:0 5px 20px rgba(23,54,93,.08)}
.anpqb-qtop{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.anpqb-num{width:35px;height:35px;border-radius:10px;background:#173f68;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px}.anpqb-meta{display:flex;gap:7px;align-items:center;font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#718198}.anpqb-meta span{background:#f3f6f9;padding:5px 7px;border-radius:7px}.anpqb-meta .anpqb-co{background:#e9f4ec;color:#18703b;font-weight:800}
.anpqb-question{font-size:15px;font-weight:700;line-height:1.55;color:#17283f;margin-bottom:14px}.anpqb-answer-toggle{width:100%;display:flex;align-items:center;gap:8px;justify-content:flex-start;background:#f5f8fc;border:1px solid #d7e2ee;color:#173f68;border-radius:9px;padding:9px 11px;font-size:12px;font-weight:800;cursor:pointer}.anpqb-answer-toggle:hover{background:#eaf2fa}.anpqb-chevron{margin-left:auto;font-size:16px;transition:.2s}.anpqb-answer-toggle[aria-expanded="true"] .anpqb-chevron{transform:rotate(180deg)}
.anpqb-answer{margin-top:11px;border-left:4px solid #1b7a57;background:#f1f8f4;border-radius:8px;padding:14px 15px}.anpqb-answer-label{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#17633f;font-weight:900;margin-bottom:7px}.anpqb-answer-text{font-size:13.5px;line-height:1.65;color:#25394d}.anpqb-answer-text p{margin:0 0 10px}.anpqb-answer-text p:last-child{margin-bottom:0}.anpqb-empty{background:#fff;border:1px dashed #c9d5e1;border-radius:12px;padding:30px;text-align:center;color:#6b7c90}
.anpqb-nav-link{display:flex!important;align-items:center;gap:12px;padding:11px 12px!important;margin:2px 0;border-radius:9px;text-decoration:none!important;color:inherit}.anpqb-nav-icon{width:25px;height:25px;border-radius:7px;background:#e9f0f8;color:#173f68;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:900}.anpqb-nav-active{background:#eef4ff!important;color:#174ca2!important}.anpqb-nav-active .anpqb-nav-icon{background:#174ca2;color:#fff}
.anpqb-portal-main{background:#eef4fb!important;min-height:calc(100vh - 80px)}
@media(max-width:850px){.anpqb-shell{padding:14px}.anpqb-head{padding:20px}.anpqb-head h1{font-size:25px}.anpqb-toolbar{grid-template-columns:1fr}.anpqb-list{grid-template-columns:1fr}.anpqb-count{display:none}}

/* Native portal navigation integration: layout comes from the cloned portal item. */
.anpqb-native-nav{text-decoration:none!important}
.anpqb-native-active{background:#edf3ff!important;color:#2456d8!important}
.anpqb-book-glyph{display:inline-flex;width:20px;justify-content:center;align-items:center;font-size:15px;line-height:1;color:currentColor}


/* Structured worked solutions */
.anpqb-solution-steps{display:flex;flex-direction:column;gap:9px}
.anpqb-step{display:grid;grid-template-columns:28px minmax(0,1fr);gap:10px;align-items:flex-start;background:#fff;border:1px solid #dfe9e4;border-radius:9px;padding:10px 11px}
.anpqb-step-no{width:26px;height:26px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:#e7f2ec;color:#17633f;font-size:11px;font-weight:900;line-height:1}
.anpqb-step-label{font-size:10px;line-height:1.25;text-transform:uppercase;letter-spacing:.065em;color:#39705a;font-weight:900;margin:1px 0 4px}
.anpqb-step-text{font-size:13px;line-height:1.62;color:#25394d;font-weight:450;overflow-wrap:anywhere}
.anpqb-step-final{background:#edf8f1;border-color:#bcdcca}
.anpqb-step-final .anpqb-step-no{background:#187347;color:#fff}
.anpqb-step-final .anpqb-step-label{color:#12643d}
@media(max-width:600px){.anpqb-step{grid-template-columns:25px minmax(0,1fr);padding:9px}.anpqb-step-no{width:24px;height:24px}.anpqb-step-text{font-size:12.5px}}

/* Lecture-note derivation / diagram support */
.anpqb-note-block{margin-top:14px;background:#fff;border:1px solid #d8e3ee;border-radius:10px;padding:12px}
.anpqb-note-label{font-size:10px;line-height:1.25;text-transform:uppercase;letter-spacing:.07em;color:#4c637d;font-weight:900;margin:0 0 9px}
.anpqb-fig-grid{display:grid;grid-template-columns:1fr;gap:12px}
.anpqb-figure{margin:0;background:#f8fbfd;border:1px solid #dbe6f0;border-radius:10px;overflow:hidden}
.anpqb-figure img{display:block;width:100%;height:auto;background:#fff}
.anpqb-figure figcaption{padding:9px 11px;font-size:12px;line-height:1.5;color:#42576c;background:#f8fbfd;border-top:1px solid #e0e8f0}


/* Lecture-note derivation summary */
.anpqb-lecture-block{margin-top:14px;background:#fffdf7;border:1px solid #ead9a7;border-radius:10px;padding:12px 14px}
.anpqb-note-points{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px}
.anpqb-note-points li{font-size:13px;line-height:1.65;color:#3a4652}


/* Expanded readable solution layout */
.anpqb-card.anpqb-expanded{grid-column:1 / -1}
.anpqb-card.anpqb-expanded .anpqb-answer{padding:18px 20px}
.anpqb-card.anpqb-expanded .anpqb-solution-steps{max-width:none}
.anpqb-card.anpqb-expanded .anpqb-lecture-block,.anpqb-card.anpqb-expanded .anpqb-note-block{width:100%;box-sizing:border-box}
.anpqb-fig-grid{grid-template-columns:minmax(0,1fr)!important}
.anpqb-figure{width:100%;max-width:none}
.anpqb-figure img{width:100%;max-width:100%;height:auto;object-fit:contain;cursor:zoom-in}
.anpqb-figure figcaption{font-size:13px;line-height:1.55}
.anpqb-image-lightbox{position:fixed;inset:0;background:rgba(8,18,32,.88);z-index:999999;display:flex;align-items:center;justify-content:center;padding:24px}
.anpqb-image-lightbox[hidden]{display:none!important}
.anpqb-image-lightbox img{max-width:94vw;max-height:90vh;width:auto;height:auto;background:#fff;border-radius:12px;box-shadow:0 20px 70px rgba(0,0,0,.35)}
.anpqb-image-lightbox button{position:fixed;top:18px;right:22px;width:42px;height:42px;border:0;border-radius:50%;background:#fff;color:#173f68;font-size:24px;font-weight:800;cursor:pointer}
@media(max-width:850px){.anpqb-card.anpqb-expanded{grid-column:auto}.anpqb-card.anpqb-expanded .anpqb-answer{padding:13px}.anpqb-figure figcaption{font-size:12px}}


/* v0.1.7 adaptive responsive layout — phone, tablet, laptop and desktop */
.anpqb-shell{width:100%;box-sizing:border-box;padding:clamp(12px,2vw,22px)}
.anpqb-head{padding:clamp(17px,2.4vw,26px) clamp(17px,2.6vw,28px)}
.anpqb-head h1{font-size:clamp(24px,2.4vw,30px)}
.anpqb-head p{font-size:clamp(12.5px,1.25vw,14px)}
.anpqb-toolbar{grid-template-columns:minmax(220px,1fr) minmax(160px,220px) minmax(120px,150px)}
.anpqb-list{grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr));gap:clamp(10px,1.3vw,14px)}
.anpqb-card{min-width:0;padding:clamp(13px,1.5vw,18px)}
.anpqb-question{font-size:clamp(13.5px,1.25vw,15px);overflow-wrap:anywhere;word-break:normal}
.anpqb-answer,.anpqb-step,.anpqb-lecture-block,.anpqb-note-block{min-width:0;box-sizing:border-box}
.anpqb-step-text,.anpqb-note-points li,.anpqb-figure figcaption{overflow-wrap:anywhere;word-break:normal}
.anpqb-card.anpqb-expanded{grid-column:1/-1;width:100%}
.anpqb-card.anpqb-expanded .anpqb-answer{width:100%;max-width:none}
.anpqb-figure img{display:block;width:100%;height:auto;max-width:100%;object-fit:contain}
.anpqb-figure::after{content:'Tap diagram to enlarge';display:none;padding:7px 10px;border-top:1px solid #e0e8f0;background:#f3f7fb;color:#64768a;font-size:11px;text-align:center}

/* Medium laptop / tablet */
@media (max-width:1100px){
  .anpqb-toolbar{grid-template-columns:minmax(200px,1fr) minmax(150px,190px) 130px}
  .anpqb-head{border-radius:15px}
}

/* Tablet and narrow portal content */
@media (max-width:820px){
  .anpqb-shell{padding:14px}
  .anpqb-head{gap:12px}
  .anpqb-count{min-width:72px;padding:9px}
  .anpqb-count strong{font-size:22px}
  .anpqb-toolbar{grid-template-columns:1fr 1fr;gap:8px}
  .anpqb-search{grid-column:1/-1}
  .anpqb-list{grid-template-columns:1fr}
  .anpqb-card.anpqb-expanded{grid-column:auto}
  .anpqb-card.anpqb-expanded .anpqb-answer{padding:14px}
}

/* Phones */
@media (max-width:600px){
  .anpqb-shell{padding:10px}
  .anpqb-head{display:block;padding:16px;border-radius:13px}
  .anpqb-kicker{font-size:9.5px;line-height:1.45;letter-spacing:.08em}
  .anpqb-head h1{font-size:23px;margin-bottom:6px}
  .anpqb-head p{font-size:12.5px;line-height:1.5}
  .anpqb-count{display:none}
  .anpqb-toolbar{grid-template-columns:1fr;margin-top:10px}
  .anpqb-search{grid-column:auto}
  .anpqb-search input,.anpqb-toolbar select{height:44px;font-size:13px}
  .anpqb-summary{margin:8px 2px 10px}
  .anpqb-card{padding:13px;border-radius:12px}
  .anpqb-qtop{align-items:flex-start;gap:8px}
  .anpqb-num{width:32px;height:32px;font-size:12px;flex:0 0 32px}
  .anpqb-meta{flex-wrap:wrap;justify-content:flex-end;font-size:9px}
  .anpqb-question{font-size:13.5px;line-height:1.55;margin-bottom:12px}
  .anpqb-answer-toggle{min-height:44px;padding:10px 11px;font-size:12px;touch-action:manipulation}
  .anpqb-answer{padding:11px!important;margin-top:9px;border-left-width:3px}
  .anpqb-step{grid-template-columns:24px minmax(0,1fr);gap:8px;padding:9px}
  .anpqb-step-no{width:24px;height:24px;font-size:10px}
  .anpqb-step-label{font-size:9px}
  .anpqb-step-text,.anpqb-note-points li{font-size:12.5px;line-height:1.6}
  .anpqb-lecture-block,.anpqb-note-block{padding:10px;margin-top:11px}
  .anpqb-note-label{font-size:9px;letter-spacing:.055em}
  .anpqb-figure{border-radius:8px}
  .anpqb-figure img{width:100%;max-width:none}
  .anpqb-figure figcaption{font-size:11.5px;line-height:1.45;padding:8px 9px}
  .anpqb-figure::after{display:block}
  .anpqb-image-lightbox{padding:8px;align-items:center}
  .anpqb-image-lightbox img{max-width:98vw;max-height:90vh;border-radius:8px}
  .anpqb-image-lightbox button{top:8px;right:8px;width:40px;height:40px;font-size:22px}
}

/* Very small phones */
@media (max-width:380px){
  .anpqb-shell{padding:7px}
  .anpqb-card{padding:11px}
  .anpqb-question{font-size:13px}
  .anpqb-meta span{padding:4px 6px}
  .anpqb-answer-toggle{font-size:11.5px}
}

/* v0.2.1 focus-question coding and Part A / Part B separation */
.anpqb-focus-legend{display:flex;align-items:center;flex-wrap:wrap;gap:7px 10px;margin:12px 2px 16px;padding:10px 12px;background:#fff;border:1px solid #dfe7f0;border-radius:10px;font-size:11px;color:#607087}
.anpqb-focus-dot{width:9px;height:9px;border-radius:50%;background:#1f5fbf;display:inline-block}
.anpqb-focus-legend strong{color:#1f5fbf}
.anpqb-regular-sample{margin-left:8px;color:#17283f;font-weight:800}
.anpqb-part{margin-top:18px}
.anpqb-part+.anpqb-part{margin-top:28px;padding-top:4px}
.anpqb-part-head{display:flex;align-items:end;justify-content:space-between;gap:12px;margin:0 2px 11px;padding:0 2px 9px;border-bottom:2px solid #dce6f1}
.anpqb-part-kicker{display:inline-block;font-size:11px;line-height:1;text-transform:uppercase;letter-spacing:.09em;font-weight:900;color:#173f68;margin-bottom:5px}
.anpqb-part-head h2{margin:0;font-size:18px;line-height:1.2;color:#17283f}
.anpqb-part-range{font-size:11px;color:#6a7b90;white-space:nowrap}
.anpqb-focus-card{border-color:#c9dbf4}
.anpqb-focus-question{color:#1f5fbf!important}
.anpqb-focus-card .anpqb-num{background:#1f5fbf}
@media(max-width:600px){
  .anpqb-focus-legend{font-size:10.5px;gap:6px 8px;padding:9px 10px;margin-bottom:13px}
  .anpqb-regular-sample{margin-left:2px}
  .anpqb-part{margin-top:14px}
  .anpqb-part+.anpqb-part{margin-top:22px}
  .anpqb-part-head{align-items:flex-start;margin-bottom:9px}
  .anpqb-part-kicker{font-size:10px}
  .anpqb-part-head h2{font-size:16px}
  .anpqb-part-range{font-size:10px;padding-top:2px}
}
