/* ABCL TECH — Platinum eBooks (ebook.html, js/ebook.js). Screen UI in the Gold Standard palette
   (navy #0d1f3c, gold #c9a227/#f5d76e, green #39b549); print rules turn the assembled book into a clean A4 PDF. */
.eb { --eb-navy: #0d1f3c; --eb-gold: #c9a227; --eb-gold-l: #f5d76e; --eb-green: #39b549; --eb-green-d: #2d8c3a; --eb-ink: #0f172a; --eb-mute: #64748b; --eb-line: #e2e8f0;
  width: 100%; font-family: 'Anek Bangla', 'Roboto', sans-serif; color: #334155; }
.eb * { box-sizing: border-box; }
.eb-wrap { max-width: 1400px; margin: 0 auto; padding: 36px 2rem 40px; }
.eb-loading { padding: 3rem 0; text-align: center; color: var(--eb-mute); }

.eb-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.4rem; border-radius: 12px; border: 1.5px solid transparent; font: 700 1rem 'Anek Bangla', sans-serif; text-decoration: none; cursor: pointer; }
.eb-btn:focus-visible { outline: 3px solid var(--eb-gold); outline-offset: 2px; }
.eb-btn-gold { color: var(--eb-navy) !important; background: linear-gradient(180deg, #fff1b8, var(--eb-gold-l) 45%, var(--eb-gold)); box-shadow: 0 8px 20px rgba(201, 162, 39, .32); }
.eb-btn-green { color: #fff !important; background: linear-gradient(180deg, #43c454, var(--eb-green) 55%, var(--eb-green-d)); }
.eb-btn-line { color: var(--eb-navy) !important; border-color: #cbd5e1; background: #fff; }
.eb-btn-sm { padding: .5rem .9rem; font-size: .92rem; border-radius: 10px; }
.eb-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0; }
.eb-fine { color: var(--eb-mute); font-size: .92rem; line-height: 1.7; }

.eb-gem { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 26px; color: var(--eb-navy); background: linear-gradient(145deg, #fff1b8, var(--eb-gold-l) 45%, var(--eb-gold)); box-shadow: 0 8px 22px rgba(201, 162, 39, .4); }
.eb-gem-sm { width: 52px; height: 52px; font-size: 21px; flex: none; }
.eb-head { display: flex; gap: 14px; align-items: center; margin-bottom: 1rem; }
.eb-head h1 { margin: 0; font-size: 1.6rem; color: var(--eb-ink); }
.eb-head p { margin: .25rem 0 0; line-height: 1.7; }

.eb-gate { text-align: center; padding: 34px 22px; border-radius: 22px; color: #fff; background: radial-gradient(120% 140% at 50% -20%, #1d3a63 0%, var(--eb-navy) 60%, #081428 100%); border-bottom: 4px solid var(--eb-gold); margin-bottom: 2rem; }
.eb-gate .eb-gem { margin: 0 auto 10px; }
.eb-kick { margin: 0; color: var(--eb-gold-l); font-weight: 700; }
.eb-gate h1 { margin: .3rem 0 .6rem; color: #fff; font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
.eb-gate p { max-width: 660px; margin: 0 auto; color: #cbd5e1; line-height: 1.75; }
.eb-gate .eb-actions { justify-content: center; }
.eb-gate .eb-btn-line { color: #fff !important; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.eb-gate .eb-fine { color: #a5b4c8; }

.eb-lib h2 { font-size: 1.3rem; color: var(--eb-ink); margin: .5rem 0 1rem; }
.eb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.eb-item { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--eb-line); border-radius: 14px; background: #fff; }
.eb-cover-mini { flex: none; display: grid; place-items: center; width: 54px; height: 72px; border-radius: 6px 10px 10px 6px; color: var(--eb-gold-l); background: linear-gradient(135deg, #1d3a63, var(--eb-navy)); border-left: 5px solid var(--eb-gold); font-size: 20px; }
.eb-item h3 { margin: 0; font-size: 1.02rem; color: var(--eb-ink); line-height: 1.4; }
.eb-item p { margin: .2rem 0 .55rem; font-size: .88rem; color: var(--eb-mute); }
.eb-mods { margin-top: .5rem; font-size: .88rem; }
.eb-mods summary { cursor: pointer; color: var(--eb-mute); font-weight: 600; }
.eb-mods ol { margin: .4rem 0 0; padding-left: 1.3rem; line-height: 1.8; }
.eb-mods a { color: var(--eb-green-d); text-decoration: none; }
.eb-mods small { color: var(--eb-mute); }
.eb-cover-mod { margin: 0 0 .8rem; color: #fff; font-size: 1.35rem; font-weight: 700; }
.eb-soon { display: inline-flex; gap: .35rem; align-items: center; padding: .25rem .65rem; border-radius: 999px; font-size: .82rem; font-weight: 700; color: #7a5c06; background: #fff6d6; border: 1px solid #f1df9c; }
.eb-lock { display: inline-flex; gap: .35rem; align-items: center; font-size: .85rem; font-weight: 700; color: #9a7b12; }

.eb-how { margin: 1rem 0; border: 1px solid var(--eb-line); border-radius: 12px; background: #fff; }
.eb-how summary { padding: 12px 16px; font-weight: 700; color: var(--eb-ink); cursor: pointer; }
.eb-how ul { margin: 0; padding: 0 16px 14px 34px; line-height: 1.75; }

.eb-prog { height: 12px; border-radius: 99px; background: #eef1f4; overflow: hidden; margin-top: 1rem; }
.eb-prog span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--eb-gold), var(--eb-gold-l)); transition: width .25s; }
.eb-prog-t { margin: .5rem 0 0; color: var(--eb-mute); font-weight: 600; }

/* ---------------- the book (screen preview + print) ---------------- */
.eb-book { max-width: 900px; margin: 0 auto 60px; padding: 0 20px; }
.eb-book .lx-caps { display: block; }
.eb-book .lx-term-out:empty, .eb-book .lx-code-out:empty { display: none; }
.eb-cover { border-radius: 18px; overflow: hidden; margin: 0 0 30px; color: #fff; background: radial-gradient(120% 120% at 70% 0%, #1d3a63 0%, #0d1f3c 55%, #081428 100%); border-bottom: 6px solid #c9a227; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.eb-cover-in { min-height: 520px; padding: 60px 48px; display: flex; flex-direction: column; justify-content: center; }
.eb-cover img { width: 170px; height: auto; margin-bottom: 40px; }
.eb-cover-k { margin: 0; color: #f5d76e; font-weight: 700; font-size: 1.05rem; }
.eb-cover h1 { margin: .4rem 0 .4rem; font-size: 3rem; line-height: 1.2; color: #fff; }
.eb-cover-en { margin: 0 0 1.4rem; color: #cbd5e1; font-family: Roboto, sans-serif; line-height: 1.6; }
.eb-cover-meta { margin: 0; color: #f5d76e; font-weight: 600; }
.eb-cover-who { margin: 2.4rem 0 0; padding: .7rem 1rem; border: 1px solid rgba(245, 215, 110, .4); border-radius: 10px; color: #fff; font-weight: 600; align-self: flex-start; }
.eb-cover-foot { margin: auto 0 0; padding-top: 2.4rem; color: #94a3b8; font-size: .85rem; }

.eb-toc { margin: 0 0 30px; }
.eb-toc h2 { font-size: 1.8rem; color: #0f172a; border-bottom: 3px solid #c9a227; padding-bottom: .4rem; }
.eb-toc-m h3 { margin: 1.2rem 0 .4rem; font-size: 1.05rem; color: #2d8c3a; }
.eb-toc ol { list-style: none; margin: 0; padding: 0; }
.eb-toc li a { display: flex; gap: .7rem; padding: .28rem 0; color: #1f2937; text-decoration: none; border-bottom: 1px dotted #e2e8f0; line-height: 1.5; }
.eb-toc li a span { flex: none; min-width: 3.2rem; color: #64748b; font-weight: 600; }

.eb-ch { margin: 0 0 40px; padding-top: 10px; }
.eb-ch-h { margin: 0 auto 1.2rem; max-width: var(--lx-measure, 820px); padding: 0 0 .9rem; border-bottom: 3px solid #c9a227; }
.eb-ch-k { margin: 0 0 .3rem; color: #2d8c3a; font-weight: 700; font-size: .92rem; }
.eb-ch-t { margin: 0; font-size: 1.85rem; line-height: 1.35; color: #0f172a; }
.eb-ch-en { margin: .35rem 0 0; color: #64748b; font-family: Roboto, sans-serif; }
.eb-miss { color: #b91c1c; }
.eb-term { color: var(--lx-accent-dark, #1f6e2a); border-bottom: 1px dotted currentColor; }

.eb-book .lx-opts { list-style: none; margin-left: 0; }
.eb-book .lx-opts li { padding: .3rem .5rem; border-radius: 8px; }
.eb-book .lx-opts li.eb-right { background: #e9f7ea; font-weight: 600; }
.eb-opt-k { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; margin-right: .5rem; border-radius: 50%; border: 1px solid #cbd5e1; font-size: .85em; font-weight: 700; }
.eb-right .eb-opt-k { background: #2d8c3a; border-color: #2d8c3a; color: #fff; }
.eb-answer { margin: .6rem 0 0; padding: .55rem .8rem; border-radius: 8px; background: #f0f9f1; border-left: 4px solid #39b549; font-size: .92em; line-height: 1.7; }
.eb-tab-h { margin: .8rem 0 .4rem; font-weight: 700; color: #0d1f3c; }
.eb-gloss { margin: 1.6rem 0 0; padding: 1rem 1.1rem; border-radius: 12px; background: #fffaeb; border: 1px solid #f1e7c4; }
.eb-gloss h3 { margin: 0 0 .5rem; font-size: 1rem; color: #9a7b12; }
.eb-gloss dl { margin: 0; display: grid; gap: .45rem; }
.eb-gloss dt { font-weight: 700; color: #0f172a; }
.eb-gloss dd { margin: 0; font-size: .92em; line-height: 1.65; }
.eb-gloss dd small { color: #64748b; }
.eb-end { margin-top: 30px; padding: 1rem; text-align: center; color: #64748b; border-top: 1px solid #e2e8f0; }
.eb-runfoot { display: none; }

@media (max-width: 640px) {
  .eb-wrap { padding: 24px 16px 30px; }
  .eb-cover-in { padding: 40px 24px; min-height: 420px; }
  .eb-cover h1 { font-size: 2.1rem; }
  .eb-ch-t { font-size: 1.45rem; }
}

@media print {
  @page { size: A4; margin: 16mm 14mm 18mm; }
  @page :first { margin: 0; }
  html, body { background: #fff !important; }
  body { padding-top: 0 !important; display: block !important; }
  .site-header, .site-footer, .eb-ui, .rd-left, .rd-nudge, .rd-wall, .live-search-results, .lx-pop { display: none !important; }
  .eb-book { max-width: none; margin: 0; padding: 0; }
  .eb-cover { border-radius: 0; margin: 0; break-after: page; }
  .eb-cover-in { min-height: 291mm; padding: 30mm 22mm; }
  .eb-cover { border-bottom-width: 0; }
  .eb-toc { break-after: page; }
  .eb-toc li { break-inside: avoid; }
  .eb-ch { break-before: page; margin: 0; padding: 0; }
  .eb-ch-h, .eb-book .lx-article { max-width: none; }
  .eb-book .lx-article { font-size: 10.5pt; }
  /* keep only short blocks together; tall diagrams and long code may break, so no half-empty pages */
  .lx-quiz, .eb-gloss div, .lx-note, .lx-warn, .lx-analogy, .lx-code-head, .lx-flow-node, .lx-card { break-inside: avoid; }
  .eb-ch-h, h2, h3, h4 { break-after: avoid; }
  .lx-code pre, .lx-code code { white-space: pre-wrap !important; word-break: break-word; overflow: visible !important; }
  .lx-table-wrap { overflow: visible !important; }
  .eb-book * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none !important; text-shadow: none !important; filter: none !important; backdrop-filter: none !important; }
  .eb-book a { color: inherit; }
}

/* screen preview: long code lines and wide tables scroll inside their box */
@media screen {
  .eb-book { overflow-x: hidden; }
  .eb-book .lx-code pre { overflow-x: auto; }
  .eb-book .lx-table-wrap { overflow-x: auto; }
}
