/* Kid-minimal layer (loaded last): calm, big touch targets, fewer competing elements.
   Phones (<=640px): one big flip card per row on every shelf, no chip row / long subtitles, icon-only reader chip,
   big-icon bottom tabs, the panorama as the hero. Tablets/desktops: 2-3 larger cards per row. */
body{background:#FFFBEF}
body.lib-mode{background:#FFFDF8}
/* shelves: larger cards everywhere */
.lb-cgrid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px;padding:12px 16px}
.lb-rib b{font-size:1.2rem}
.lb-tar{font-size:1.35rem}.lb-ten{font-size:1.1rem}.lb-bin p{font-size:.98rem}
.lb-acts .btn.small{padding:10px 16px;font-size:1rem}
.lb-acts .lb-spk{width:48px;height:48px}
@media (max-width:640px){
  /* small header: logo + reader icon + EN toggle */
  .topbar{gap:8px}
  .student-chip{max-width:none;width:44px;height:44px;padding:0;display:grid;place-items:center;font-size:1.25rem}
  .student-chip .sc-name{display:none}
  .lang-toggle{min-width:56px;height:44px}
  /* bottom level bar stays as the fixed picture tabs from style.css */
  /* home: the panorama is the hero */
  .lb-head{padding:8px 14px 0}
  .lb-head h1{font-size:1.45rem}
  .lb-head h1 small,.lb-head p,.lb-swipe{display:none}
  .lb-bar{padding:6px 12px}
  .lb-pano{height:clamp(320px,calc(100svh - var(--topH,64px) - 170px),640px)}
  .lb-pan{width:46px;height:46px;font-size:1.05rem}
  .lb-shelves h2 small{display:none}
  .lb-sgrid{grid-template-columns:repeat(2,1fr);gap:12px}
  .lb-stile{min-height:64px}
  /* shelf: no chip row or long blurb, one big card per row */
  .lb-sbar{display:none}
  .lb-shead{padding:14px 16px 4px;gap:12px}
  .lb-sh-e{width:60px;height:60px;font-size:2.3rem;border-radius:20px}
  .lb-shead h1{font-size:1.5rem}
  .lb-shead h1 small,.lb-shead p{display:none}
  .lb-cgrid{grid-template-columns:1fr;gap:20px;padding:10px 16px}
  .lb-tile{aspect-ratio:4/5}
  .lb-kind{font-size:.9rem;padding:4px 12px;top:12px;inset-inline-start:12px}
  .lb-rib{padding:40px 14px 40px}
  .lb-rib b{font-size:1.55rem}
  .lb-front .lb-hint{font-size:1rem;bottom:12px}
  .lb-tar{font-size:1.7rem}.lb-ten{font-size:1.3rem}.lb-bin{padding:20px 18px;gap:10px}.lb-bin p{font-size:1.08rem}
  .lb-acts{gap:10px}.lb-acts .btn.small{padding:12px 20px;font-size:1.08rem}.lb-acts .lb-spk{width:54px;height:54px;font-size:1.3rem}
  /* decks: already one card per row; a calmer, smaller intro */
  .lb-dintro{padding:10px 16px 2px}.lb-dintro h1 small{display:none}
  .lb-dstrip{padding:6px 14px 30px;gap:18px}
}
/* ---------- 3 big categories ---------- */
.lb-sgrid{grid-template-columns:repeat(4,1fr);gap:16px;max-width:1000px;margin:0 auto}
.lb-sec.solo .lb-sech,.lb-sec.solo .lb-secp{display:none}
.lb-stile.lb-big{flex-direction:column;justify-content:center;text-align:center;gap:6px;padding:22px 10px 18px;border-radius:28px;min-height:170px}
.lb-big .lb-se{font-size:3.6rem;line-height:1}
.lb-big .lb-st{flex:none;align-items:center}
.lb-big .lb-st b{font-size:1.35rem}
.lb-big .lb-st small{font-size:.9rem}
.lb-big .lb-sn{position:absolute;top:10px;inset-inline-end:10px;font-size:.8rem;opacity:.8}
/* level / topic tabs */
.lb-tabs{display:flex;gap:10px;max-width:1150px;margin:6px auto 4px;padding:0 16px}
.lb-tab{flex:1;min-width:0;display:flex;flex-direction:column;align-items:center;gap:1px;border:0;cursor:pointer;padding:10px 4px 9px;border-radius:22px;font-family:inherit;color:inherit;position:relative;
  background:color-mix(in srgb,var(--c) 18%,#fff);box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--c) 45%,#fff)}
.lb-tab.on{background:var(--c);box-shadow:0 4px 0 color-mix(in srgb,var(--c) 65%,#3B2A1E)}
.lb-tabe{font-size:1.8rem;line-height:1.1}
.lb-tab b{font-size:1.02rem;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.lb-tab small{font-size:.74rem;font-weight:600;opacity:.75;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.lb-tabn{position:absolute;top:5px;inset-inline-end:8px;font-style:normal;font-size:.72rem;font-weight:800;opacity:.7}
.lb-sec{max-width:1150px;margin:0 auto}
.lb-sech{margin:14px 16px 0;font-size:1.3rem}
.lb-sech small{font-size:.7em;font-weight:600;color:var(--muted,#7A6656)}
.lb-secp{margin:2px 16px 4px;color:var(--muted,#7A6656);font-weight:600}
.has-tabs .lb-sech{display:none}
.has-tabs .lb-secp{text-align:center;margin-top:8px}
.f-parents{color:inherit;text-decoration:none;font-weight:700}
@media (max-width:640px){
  .lb-sgrid{grid-template-columns:repeat(2,1fr);gap:12px}
  .lb-stile.lb-big{min-height:140px;padding:18px 6px 14px;border-radius:24px}
  .lb-big .lb-se{font-size:3rem}
  .lb-big .lb-st b{font-size:1.45rem}
  .lb-big .lb-st small{font-size:.9rem}
  .lb-tabs{gap:8px;padding:0 12px}
  .lb-tab{padding:9px 2px 8px;border-radius:20px}
  .lb-tab small{display:none}
  .lb-tabn{display:none}
  .lb-shelves h2{text-align:center}
}

/* Story topic shelf: same-size cards; number badge must not cover the kind label */
.lb-topic1 .lb-num{inset-inline-start:auto;inset-inline-end:8px}
.lb-topic1 .lb-star{top:36px;inset-inline-end:8px}
@media (min-width:641px){
  .lb-topic1 .lb-cgrid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (min-width:641px) and (max-width:1000px){
  .lb-topic1 .lb-cgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
