/* Biblioteca del portal (libros EPUB) — Fase BJ. Mismo lenguaje de portal-app.css. */
html.pb-lock,html.pb-lock body{overflow:hidden!important;}
#bib-legacy{display:none!important;}
#pb-root{padding-bottom:12px;}
.pb-tools{margin:2px 0 12px;}
.pb-search{display:flex; align-items:center; gap:10px; background:#f7f7f7; border:2px solid var(--pa-edge,#e5e5e5); border-radius:14px; padding:0 14px; min-height:50px;}
.pb-search:focus-within{border-color:#f06c9c; background:#fff;}
.pb-search i{color:#afafaf; font-size:15px;}
.pb-search input{flex:1; min-width:0; border:0!important; background:transparent!important; box-shadow:none!important; padding:12px 0!important; font-size:16px; font-weight:700; outline:none; border-radius:0!important; -webkit-appearance:none; appearance:none;}
.pb-cats{display:flex; gap:8px; overflow-x:auto; padding:2px 0 12px; margin:0 -12px; padding-left:12px; padding-right:12px; scrollbar-width:none; -webkit-overflow-scrolling:touch;}
.pb-cats::-webkit-scrollbar{display:none;}
.pb-cat{flex:none; min-height:40px; padding:0 14px; border:2px solid var(--pa-edge,#e5e5e5); border-bottom-width:4px; border-radius:12px; background:#fff; color:#777; font-weight:900; font-size:12.5px; line-height:1; font-family:inherit; letter-spacing:.5px; text-transform:uppercase; cursor:pointer; touch-action:manipulation;}
.pb-cat.on{background:var(--pa-rose-l,#ffe3ee); border-color:#f6b5cd; color:var(--pa-rose,#d12f6e);}
.pb-h{margin:22px 0 12px; font-size:21px; font-weight:900; color:var(--pa-rose,#d12f6e); text-transform:lowercase;}
.pb-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:16px 14px;}
.pb-row{display:flex; gap:14px; overflow-x:auto; padding:2px 12px 10px; margin:0 -12px; scroll-snap-type:x proximity; scrollbar-width:none; -webkit-overflow-scrolling:touch;}
.pb-row::-webkit-scrollbar{display:none;}
.pb-row .pb-card{flex:none; width:128px; scroll-snap-align:start;}
.pb-card{display:flex; flex-direction:column; gap:4px; text-align:left; padding:0; border:0; background:transparent; font-family:inherit; color:inherit; cursor:pointer; min-width:0; touch-action:manipulation; -webkit-tap-highlight-color:transparent;}
.pb-cov{position:relative; display:block; aspect-ratio:2/3; border-radius:14px; overflow:hidden; background:#ffe3ee; border:2px solid var(--pa-edge,#e5e5e5); border-bottom-width:6px; transition:transform .1s;}
.pb-card:active .pb-cov{transform:translateY(3px); border-bottom-width:3px;}
@media (hover:hover){.pb-card:hover .pb-cov{border-color:#f6b5cd; transform:translateY(-2px);}}
.pb-cov img{width:100%; height:100%; object-fit:cover; display:block;}
.pb-cov-ph{position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; padding:12px; text-align:center; color:var(--pa-rose,#d12f6e);}
.pb-cov-ph i{font-size:30px;} .pb-cov-ph b{font-size:13px; line-height:1.2; font-weight:900;}
.pb-chip{position:absolute; right:6px; bottom:8px; background:var(--pa-rose,#d12f6e); color:#fff; font-size:11px; font-weight:900; padding:3px 8px; border-radius:99px;}
.pb-chip.ok{background:#46a302;}
.pb-bar{display:block; height:8px; border-radius:99px; background:#e5e5e5; overflow:hidden; margin-top:4px;}
.pb-bar i{display:block; height:100%; background:var(--pa-rose,#d12f6e); border-radius:99px;}
.pb-bar.big{height:12px; margin-top:10px;}
.pb-t{font-size:13.5px; font-weight:900; line-height:1.2; margin-top:4px; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color:var(--ink,#3c3c3c);}
.pb-a{font-size:12px; font-weight:700; color:#9a9a9a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.pb-vacio{text-align:center; padding:26px 12px; color:#777; font-weight:700;}
.pb-vacio img{height:130px; width:auto; margin-bottom:8px; animation:pa-bob 4.4s ease-in-out infinite;}
.pb-vacio p{margin:0 0 14px; font-size:15px; line-height:1.4;}
/* cargando */
.pb-sk{display:flex; flex-direction:column; gap:8px;}
.pb-sk i{display:block; aspect-ratio:2/3; border-radius:14px; background:linear-gradient(100deg,#f1f1f1 30%,#fafafa 50%,#f1f1f1 70%); background-size:200% 100%; animation:pb-sh 1.3s linear infinite;}
.pb-sk b{display:block; height:11px; border-radius:6px; background:#f1f1f1; width:80%;} .pb-sk b+b{width:50%;}
@keyframes pb-sh{to{background-position:-200% 0}}
/* ficha */
.pb-ov{position:fixed; inset:0; z-index:2500; background:rgba(60,60,60,.55); display:flex; align-items:flex-end; justify-content:center; animation:pb-f .18s ease-out both;}
.pb-ov.out{opacity:0; transition:opacity .15s;}
@keyframes pb-f{from{opacity:0}}
.pb-sheet{position:relative; width:min(560px,100%); max-height:90vh; max-height:90dvh; overflow-y:auto; background:#fff; border:2px solid var(--pa-edge,#e5e5e5); border-bottom:0; border-radius:24px 24px 0 0; padding:22px 20px calc(20px + env(safe-area-inset-bottom)); animation:pb-up .28s cubic-bezier(.3,1.2,.4,1) both;}
@keyframes pb-up{from{transform:translateY(40px); opacity:0}}
@media (min-width:640px){.pb-ov{align-items:center}.pb-sheet{border-radius:24px; border-bottom:2px solid var(--pa-edge,#e5e5e5); border-bottom-width:6px;}}
.pb-x{position:absolute; top:12px; right:12px; width:38px; height:38px; border:2px solid var(--pa-edge,#e5e5e5); border-bottom-width:4px; border-radius:12px; background:#fff; color:#777; cursor:pointer; font-size:15px;}
.pb-sh{display:flex; gap:16px; padding-right:40px;}
.pb-cov.big{flex:none; width:120px; border-radius:12px;}
.pb-si{min-width:0; flex:1;}
.pb-si h2{margin:0; font-size:21px; line-height:1.15; font-weight:900; color:var(--pa-rose,#d12f6e);}
.pb-sa{margin:5px 0 0; font-weight:800; color:#777; font-size:14px;}
.pb-tags{display:flex; gap:6px; flex-wrap:wrap; margin-top:10px;}
.pb-tags span{background:#f0f0f0; color:#777; font-size:11px; font-weight:900; letter-spacing:.5px; text-transform:uppercase; padding:4px 9px; border-radius:9px;}
.pb-pc{display:block; margin-top:5px; font-weight:800; color:var(--pa-rose,#d12f6e); font-size:12.5px;}
.pb-d{margin:16px 0 4px; font-size:14.5px; line-height:1.55; font-weight:600; color:#555;}
.pb-leer{margin-top:18px; width:100%;}
@media (max-width:640px){
  .pb-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .pb-cov.big{width:98px;}
}
@media (min-width:900px){.pb-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));}}
@media (prefers-reduced-motion:reduce){.pb-vacio img,.pb-sk i,.pb-ov,.pb-sheet{animation:none!important;}}
