/* Library reading and collaboration, shared by desktop and mobile. */
.lp-library-shell{--lp-accent:#7d22ce;--lp-ink:#291735;--lp-line:#eadfee}
.lp-library-shell button:focus-visible,.lp-library-shell input:focus-visible,.pg-pdf-reader button:focus-visible,.pg-pdf-reader select:focus-visible{outline:3px solid #a860ed;outline-offset:3px}
.lp-library-shell .lp-library-hero{padding:clamp(22px,3vw,38px);border-radius:24px;gap:24px}
.lp-library-shell .lp-library-hero h1{font-size:clamp(30px,3.5vw,48px);line-height:1.08;letter-spacing:-.045em}
.lp-subnav .lp-refresh{margin-left:auto;color:#68358a;background:#f6effb}
.lp-library-shell .lp-unit-hero h1,.lp-library-shell .lp-reader-head h1{font-size:clamp(26px,3vw,42px);line-height:1.12;letter-spacing:-.04em}
.lp-library-shell .lp-unit-planning-hub{display:none}
.lp-library-shell .lp-empty-reader,.lp-library-shell .lp-empty-reader.unit{min-height:0;padding:28px 24px;gap:10px;border-radius:22px}
.lp-library-shell .lp-empty-reader h2{font-size:clamp(21px,2.4vw,30px);line-height:1.2}
.lp-library-shell .lp-empty-reader p{font-size:.92rem;line-height:1.55}
.lp-library-shell .lp-unit-complement-meter{display:none}
.lp-library-shell .lp-resource-card{min-width:0;min-height:0;display:grid;grid-template-columns:42px minmax(0,1fr);gap:12px;border-radius:18px;padding:16px;align-items:start}
.lp-library-shell .lp-resource-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:linear-gradient(135deg,#efe4ff,#fff1df);color:#652399;font-size:.65rem;font-weight:600}
.lp-library-shell .lp-resource-card h4{margin:5px 0;font-size:1rem;line-height:1.3;overflow-wrap:anywhere}
.lp-library-shell .lp-resource-card small{display:block;overflow-wrap:anywhere;line-height:1.4}
.lp-library-shell .lp-unit-lesson-complements:has(.lp-empty-inline){display:none}
.lp-library-shell .lp-resource-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));align-items:start}
.lp-library-shell .lp-resource-grid>.lp-resource-card{max-width:600px;width:100%}
.lp-library-shell .lp-resource-card.premium>.lp-resource-icon{width:42px;height:42px;min-width:0;border-radius:13px;font-size:.65rem}
.lp-library-shell .lp-resource-card>div:not(.lp-resource-icon){min-width:0}
.lp-library-shell .lp-review-inbox{padding:clamp(16px,2vw,24px);background:linear-gradient(130deg,#fff 65%,#faf6ff);border:1px solid var(--lp-line)}
.lp-library-shell .lp-review-inbox .panel-head{margin-bottom:18px;gap:12px}
.lp-library-shell .lp-review-inbox .panel-head>div{min-width:0}
.lp-library-shell .lp-review-inbox .panel-head small{display:block;max-width:680px;margin-top:6px;font-size:.86rem;line-height:1.5;white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
.lp-library-shell .lp-review-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch}
.lp-library-shell .lp-review-card{display:grid;grid-template-columns:42px minmax(0,1fr);grid-template-rows:1fr auto;gap:12px;padding:18px;min-width:0;border:1px solid #e8ddec;border-radius:18px;background:#fff;box-shadow:0 4px 16px #39204706}
.lp-library-shell .lp-review-card>.lp-resource-icon{width:42px;height:42px;font-size:.65rem;background:linear-gradient(135deg,#f0e6fc,#f8f1ff);color:#62248e;border:1px solid #e4d4f1}
.lp-review-copy{min-width:0}
.lp-review-labels{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:.7rem;color:#78627f}
.lp-review-labels>span:first-child{font-weight:600;letter-spacing:.06em;text-transform:uppercase}
.lp-review-status{padding:3px 8px;border-radius:6px;background:#fff4df;color:#855612;line-height:1.4}
.lp-library-shell .lp-review-copy h4{margin:8px 0 6px;font-size:1rem;line-height:1.4;color:var(--lp-ink);overflow-wrap:anywhere}
.lp-library-shell .lp-review-copy p{margin:0 0 7px;font-size:.86rem;line-height:1.5;color:#675671;overflow-wrap:anywhere}
.lp-review-meta{display:flex;gap:4px 10px;flex-wrap:wrap;font-size:.76rem;color:#84738d;line-height:1.5}
.lp-library-shell .lp-review-actions{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding-top:12px;border-top:1px solid #f0eaf3;margin:0;justify-content:flex-start}
.lp-library-shell .lp-review-actions .btn{min-height:40px;padding:9px 13px;font-size:.8rem;line-height:1.3;box-shadow:none;white-space:normal}
@media(max-width:1040px){.lp-library-shell .lp-review-grid{grid-template-columns:1fr}}
@media(max-width:760px){
  .lp-library-shell .lp-review-card{padding:14px;gap:10px;border-radius:15px}
  .lp-library-shell .lp-review-actions .btn{min-height:44px;flex:1 1 auto;text-align:center}
  .lp-library-shell .lp-review-actions .btn:last-child{flex-basis:100%;background:transparent}
}
.lp-library-shell .lp-cover.asset{background-repeat:no-repeat}
.lp-library-shell>.section-title{padding:18px 20px;background:linear-gradient(120deg,#fffaf4,#faf5ff);border:1px solid var(--lp-line);border-radius:20px;margin:16px 0}
.lp-library-shell .section-actions{flex-wrap:wrap;gap:8px}
.lp-library-shell .lp-document-toolbar{padding:16px;gap:12px}
.lp-library-shell .lp-document-toolbar h3{font-size:1rem;overflow-wrap:anywhere;margin:5px 0}
.lp-library-shell .lp-document-stage:has(.pg-pdf-reader){grid-template-rows:auto auto;gap:0;min-width:0}
.lp-viewer-shell:has(.pg-pdf-reader)>.lp-viewer-toolbar>button:not(:first-child),.lp-viewer-shell:has(.pg-pdf-reader)>.lp-viewer-toolbar>span{display:none}
.lp-viewer-shell:has(.pg-pdf-reader)>.lp-viewer-toolbar:not(.compact){display:none}
.lp-viewer-body:has(.pg-pdf-reader){padding:0;min-height:0;display:block;background:#f2edf6}
.pg-pdf-reader{width:100%;min-width:0;background:#f2edf6;color:#352043;overflow:hidden}
.pg-pdf-controls{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 16px;padding:10px 12px;background:linear-gradient(115deg,#faf5ff,#fff9f0);border-bottom:1px solid #e5d9ed}
.pg-pdf-pagination,.pg-pdf-page-field,.pg-pdf-tools,.pg-pdf-zoom,.pg-pdf-view-actions{display:flex;align-items:center;gap:7px;min-width:0}
.pg-pdf-tools{flex-wrap:wrap;gap:8px 12px}
.pg-pdf-zoom{padding:3px;border:1px solid #e2d5ec;border-radius:12px;background:#ffffffc9}
.pg-pdf-zoom>span{padding-left:6px;font-size:.78rem;font-weight:600;color:#653681}
.pg-pdf-controls select{width:78px;min-height:38px;padding:5px 3px;border:0;border-radius:8px;background:#fff;color:#442059;text-align:center;font-family:inherit;font-size:.86rem;font-weight:600;cursor:pointer}
.pg-pdf-controls label{display:flex;align-items:center;gap:6px;font-size:.8rem;font-weight:600;white-space:nowrap}
.pg-pdf-controls input{width:54px!important;min-height:36px!important;border:1px solid #d9cbe4;border-radius:9px;background:#fff;padding:5px;text-align:center;font:inherit}
.pg-pdf-controls [data-pdf-total]{font-size:.8rem;white-space:nowrap}
.pg-pdf-controls .btn{min-height:40px;box-shadow:none!important;white-space:nowrap;touch-action:manipulation}
.pg-pdf-zoom .btn{min-width:38px;padding:5px!important;font-size:1.15rem!important}
.pg-pdf-controls .btn:disabled{opacity:.45;cursor:default}
.pg-pdf-status{margin:0;padding:8px 14px;font-size:.8rem;color:#725e7e;line-height:1.5}
.pg-pdf-status.error{color:#a12626;background:#fff2f2;padding:15px}
.pg-pdf-surface{box-sizing:border-box;min-width:0;width:100%;max-height:76vh;overflow:auto;overscroll-behavior:contain;padding:12px;text-align:center;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#c7addd transparent}
.pg-pdf-surface canvas{display:block;margin:0 auto;background:white;box-shadow:0 5px 20px #36234418;max-width:none}
.pg-pdf-hint{margin:0;padding:8px 12px 10px;font-size:.72rem;line-height:1.5;color:#77647e;background:linear-gradient(110deg,#f6f0fb,#fff8f0)}
.pg-pdf-accessibility{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.pg-pdf-reader:fullscreen,.pg-pdf-reader.expanded{height:100dvh;display:flex;flex-direction:column;background:#f2edf6;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box}
.pg-pdf-reader:fullscreen .pg-pdf-surface,.pg-pdf-reader.expanded .pg-pdf-surface{flex:1;min-height:0;max-height:none}
.pg-pdf-reader.expanded{position:fixed;inset:0;z-index:9999;isolation:isolate}
@media(max-width:1000px){
  .lp-library-shell .lp-book-head,.lp-library-shell .lp-collection-head{grid-template-columns:140px minmax(0,1fr);padding:20px;gap:20px}
  .lp-library-shell .lp-cover.book-large,.lp-library-shell .lp-cover.collection-large{width:100%;height:auto;min-height:0}
  .lp-library-shell .lp-unit-hero,.lp-library-shell .lp-reader-head{grid-template-columns:1fr;gap:16px}
}
@media(max-width:760px){
  .main,.main-content,#pageContainer,.panel,.form-card,.form-grid,.field{min-width:0}
  .lp-library-shell .lp-subnav{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;overflow:visible!important;gap:5px!important}
  .lp-library-shell .lp-subnav button{min-width:0!important;min-height:42px;padding:9px 6px!important;font-size:.78rem!important;white-space:normal;line-height:1.2}
  .lp-library-shell .lp-subnav .lp-refresh{grid-column:1/-1;margin-left:0;background:transparent;padding:5px!important;min-height:32px;font-size:.73rem!important}
  .lp-library-shell .lp-library-hero h1,.lp-library-shell .lp-management-hero h1,.lp-library-shell .lp-unit-hero h1,.lp-library-shell .lp-book-head h1,.lp-library-shell .lp-collection-head h1{font-size:clamp(24px,7vw,32px)!important;line-height:1.1!important}
  .lp-library-shell .lp-library-hero p{font-size:.88rem;line-height:1.5;margin-bottom:0}
  .lp-library-shell .lp-library-hero .eyebrow{color:#dcc0f5;letter-spacing:.1em;font-size:.65rem}
  .lp-library-shell .lp-collection-head,.lp-library-shell .lp-book-head{grid-template-columns:90px minmax(0,1fr)!important;gap:12px!important;padding:14px!important;border-radius:20px!important}
  .lp-library-shell .lp-cover.collection-large{aspect-ratio:1;width:90px;min-height:0;background-repeat:no-repeat}
  .lp-library-shell .lp-cover.book-large{aspect-ratio:3/4;width:90px;min-height:0;background-repeat:no-repeat}
  .lp-library-shell .lp-collection-head p,.lp-library-shell .lp-book-head p{font-size:.82rem;line-height:1.4}
  .lp-library-shell .lp-unit-hero{padding:16px!important;border-radius:20px!important}
  .lp-library-shell .lp-unit-hero p{font-size:.88rem;line-height:1.5}
  .lp-library-shell .panel-head,.lp-library-shell .lp-document-toolbar{flex-wrap:wrap;align-items:flex-start;gap:12px}
  .lp-library-shell .panel-head h3{font-size:1.05rem;line-height:1.3}
  .lp-library-shell .panel-head .section-actions,.lp-library-shell .lp-unit-hero .section-actions{width:100%;justify-content:flex-start}
  .lp-library-shell .section-actions .btn{min-height:44px;padding:10px 13px;font-size:.8rem}
  .lp-library-shell .lp-asset-grid{grid-template-columns:1fr}
  .lp-library-shell .lp-crumbs{gap:5px;flex-wrap:wrap}
  .lp-library-shell .lp-crumbs button{font-size:.73rem;min-height:32px;padding:6px 10px}
  .lp-library-shell .lp-unit-admin-actions,.lp-library-shell .lp-book-admin-actions,.lp-library-shell .lp-collection-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .pg-pdf-controls{display:grid;grid-template-columns:minmax(0,1fr);justify-content:stretch;gap:8px;padding:10px 8px}
  .pg-pdf-pagination{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:5px}
  .pg-pdf-page-field{justify-content:center;gap:5px}
  .pg-pdf-controls label{gap:4px;font-size:.74rem}
  .pg-pdf-controls input{width:44px!important;min-height:44px!important;font-size:16px}
  .pg-pdf-controls .btn{min-height:44px!important;padding:8px!important;font-size:.74rem!important;border-radius:10px}
  .pg-pdf-tools{justify-content:space-between;gap:8px}
  .pg-pdf-zoom{flex:1;justify-content:space-between;gap:3px}
  .pg-pdf-zoom>span{font-size:.73rem;padding-left:4px}
  .pg-pdf-zoom .btn{min-width:40px;font-size:1.2rem!important}
  .pg-pdf-controls select{min-height:44px;width:80px;font-size:16px;flex:0 1 80px}
  .pg-pdf-view-actions{flex:1;justify-content:flex-end}
  .pg-pdf-view-actions .btn{flex:1}
  .pg-pdf-surface{max-height:72dvh;padding:6px;overscroll-behavior-y:auto}
  .pg-pdf-status{font-size:.75rem;padding:7px 10px}
  .pg-pdf-hint{font-size:.7rem;padding:7px 10px}
  .lp-library-shell .lp-document-stage:has(.pg-pdf-reader){border-radius:16px}
  #modalRoot:has(.lp-resource-editor) .modal,#modalRoot:has(.lp-upload-modal) .modal{width:min(560px,calc(100vw - 20px));max-height:calc(100dvh - 24px);padding:18px;overflow:auto;box-sizing:border-box}
  #modalRoot:has(.lp-resource-editor) .form-grid,#modalRoot:has(.lp-upload-modal) .form-grid{grid-template-columns:1fr}
  #modalRoot:has(.lp-resource-editor) .span-2,#modalRoot:has(.lp-upload-modal) .span-2{grid-column:auto}
  #modalRoot:has(.lp-resource-editor) input,#modalRoot:has(.lp-upload-modal) input,#modalRoot:has(.lp-resource-editor) textarea,#modalRoot:has(.lp-upload-modal) textarea{font-size:16px;max-width:100%;box-sizing:border-box}
  .lp-resource-editor input[type=file]{padding:12px;border:1px dashed #cab0dc;border-radius:12px;background:#faf5ff;min-height:54px;width:100%}
}
@media(max-width:430px){.pg-pdf-tools{display:grid;grid-template-columns:1fr}.pg-pdf-view-actions{justify-content:stretch}.pg-pdf-zoom{justify-content:center;gap:8px}}
@media(prefers-reduced-motion:reduce){.lp-library-shell *{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
