/* Portal styles — picker + book hub. Engine styles live in engine/book.css.
   book.css locks body to a flex column for the lesson view; the portal
   views scroll normally, and the lesson view re-establishes the column. */
body{display:block; overflow-y:auto; height:auto; min-height:100dvh}
.view{display:none}
#viewPicker.on, #viewBook.on{display:block}
#viewLesson.on{display:flex; flex-direction:column; height:100dvh; overflow:hidden}

/* ---------- picker ---------- */
.pk-wrap{max-width:1060px; margin:0 auto; padding:22px 14px 40px}
.pk-hero{text-align:center; padding:10px 0 20px}
.pk-emoji{font-size:64px}
.pk-hero h1{font-size:clamp(28px,6vw,40px); color:#7c4a03; margin:6px 0 4px}
.pk-sub{color:#a97a20; font-weight:800; font-size:clamp(14px,3.4vw,18px)}
.pk-total{
  display:inline-block; margin-top:12px; background:#fff3d6; border:2px dashed #f0c475;
  border-radius:99px; padding:6px 20px; font-weight:900; color:#b97e10; font-size:19px;
}
.pk-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px}
.pk-card{
  position:relative; text-decoration:none; background:#fff; border:3px solid #f0c475; border-radius:20px;
  padding:18px 14px; color:#5b3400; display:flex; flex-direction:column; align-items:center; gap:5px;
  box-shadow:0 3px 10px rgba(124,74,3,.12); text-align:center; min-height:170px; justify-content:center;
}
a.pk-card:active{transform:scale(.97); background:#fff8ea}
.pk-card .pk-ic{font-size:46px}
.pk-card b{font-size:19px}
.pk-card span{font-size:13px; color:#a97a20; font-weight:800}
.pk-card .pk-stars{font-size:14px; color:#b97e10; font-weight:900}
.pk-card.soon{opacity:.62; border-style:dashed; cursor:default}
.pk-soon{
  position:absolute; top:10px; inset-inline-start:10px; background:#ffb703; color:#5b3400;
  border-radius:99px; padding:2px 12px; font-size:13px; font-weight:900;
}
.pk-card .pk-cover{width:74px; height:104px; object-fit:cover; border-radius:8px; border:2px solid #f0c475}

/* ---------- book hub ---------- */
.bk-wrap{max-width:1060px; margin:0 auto; padding:16px 14px 44px}
.bk-back{
  background:#fff; border:2px solid #f0c475; border-radius:99px; padding:9px 18px;
  font-weight:900; color:#7c4a03; font-size:15px; margin-bottom:14px;
}
.bk-head{display:flex; gap:16px; align-items:center; background:#fff; border:3px solid #f0c475; border-radius:20px; padding:16px; box-shadow:0 3px 10px rgba(124,74,3,.12)}
.bk-cover{width:96px; height:136px; object-fit:cover; border-radius:10px; border:2px solid #f0c475; flex:0 0 auto}
.bk-head-tx h1{font-size:clamp(20px,5vw,30px); color:#7c4a03}
.bk-head-tx p{color:#a97a20; font-weight:800; margin-top:3px}
.bk-total{display:inline-block; margin-top:9px; background:#fff3d6; border:2px dashed #f0c475; border-radius:99px; padding:4px 16px; font-weight:900; color:#b97e10; font-size:17px}
.bk-unit{margin-top:26px}
.bk-unit h2{color:#b97e10; font-size:clamp(18px,4.4vw,23px); margin:0 4px 12px}
.ls-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:13px}
.ls-card{background:#fff; border:3px solid #f0c475; border-radius:18px; padding:14px; display:flex; flex-direction:column; gap:9px; box-shadow:0 3px 9px rgba(124,74,3,.1)}
.ls-card h3{font-size:16.5px; color:#5b3400; line-height:1.35}
.ls-card .ls-meta{display:flex; justify-content:space-between; font-size:12.5px; color:#a97a20; font-weight:800}
.ls-card .ls-stars{color:#b97e10; font-weight:900; font-size:14px}
.ls-acts{display:grid; grid-template-columns:repeat(3,1fr); gap:7px}
.ls-acts button{
  min-height:52px; border-radius:13px; background:#fff8ea; border:2px solid #f0c475;
  font-size:12.5px; font-weight:900; color:#7c4a03; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:1px; padding:5px 2px; line-height:1.2;
}
.ls-acts button .ic{font-size:19px}
.ls-acts button:active{background:#ffe1a1}
.ls-acts button:disabled{opacity:.38}
.ls-acts button.main{grid-column:span 3; background:#ffb703; border-color:#e09f00; font-size:15px; min-height:46px; flex-direction:row; gap:8px}
.bk-note{color:#a97a20; font-weight:800; font-size:13.5px; margin:10px 4px 0}
.pk-err{background:#ffe3e3; border:2px solid #e0483e; color:#8c1d16; border-radius:14px; padding:14px; font-weight:800; text-align:center; margin:16px 0}
