.resource-library{margin-top:2.5rem;border-top:1px solid #dbe3ef;padding-top:1.5rem}.resource-library h2{font-size:1.45rem;margin:0}.resource-card h3{font-size:1.3rem;line-height:1.5;margin:1rem 0 .4rem}.resource-card>small{display:block;color:#536078;margin-bottom:1rem;font-size:.875rem}.resource-badges{display:flex;gap:.5rem;flex-wrap:wrap}.lesson-badge.muted{background:#eef0f4;color:#596278}.resource-admin-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:1.25rem;padding-top:1rem;border-top:1px solid #e2e8f0}.danger{color:#a52d36!important}.resource-status:empty{display:none}.resource-status[role=alert]{background:#fff2ed;border:1px solid #ecb5a5;padding:1rem;border-radius:12px;color:#813121}.resource-empty{border:1px dashed #bbc9dc;border-radius:14px;padding:2rem;color:#536078}.resource-dialog{width:min(1000px,95vw);max-width:95vw;max-height:94dvh;border:1px solid #cfdbeb;border-radius:20px;padding:0;color:#172943;background:#fff;box-shadow:0 24px 90px #10294c40;direction:rtl}.resource-dialog::backdrop{background:#0d193b99;backdrop-filter:blur(3px)}.resource-dialog-head{position:sticky;top:0;z-index:2;display:flex;gap:1rem;align-items:center;justify-content:space-between;border-bottom:1px solid #e3e9f2;background:#fff;padding:1rem 1.5rem}.resource-dialog-head h2{margin:0;font-size:1.3rem}.resource-dialog-body{padding:1.5rem}.resource-viewer{width:min(1180px,96vw)}.resource-viewer iframe{border:1px solid #dce4ef;border-radius:10px;width:100%;height:68dvh;display:block;background:#eef2f7}.resource-file-tools{display:flex;justify-content:space-between;gap:1rem;margin-bottom:.75rem;font-size:.875rem}.resource-notes{white-space:pre-wrap;background:#edf5ff;border-right:3px solid #2370b7;padding:1rem}.resource-form-grid,.resource-answer-fields{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.resource-editor label{display:block;font-size:1rem;font-weight:600;margin-bottom:1rem}.resource-editor input:not([type=radio]),.resource-editor select,.resource-editor textarea{font:inherit;display:block;width:100%;box-sizing:border-box;border:1px solid #bfcbdc;background:#fff;color:#172943;border-radius:10px;min-height:46px;padding:.7rem;margin-top:.4rem}.resource-editor textarea{resize:vertical;line-height:1.7}.resource-editor input[type=file]{font-size:.875rem;font-weight:400}.resource-upload{border:1px dashed #95aecd;border-radius:12px;padding:1rem;background:#f6f9fd;min-width:0}.resource-upload p{overflow-wrap:anywhere;font-size:.875rem}.resource-upload small{color:#536078;font-size:.875rem}.resource-quiz-import{border-top:1px solid #dce4ef;margin-top:1.5rem;padding-top:1rem}.resource-question{border:1px solid #c8d8eb;border-radius:14px;padding:1.25rem;margin-top:1.2rem;background:#f8faff;min-width:0}.resource-question legend{font-size:1rem;font-weight:700;padding:0 .5rem;color:#1a568d}.resource-save-actions{position:sticky;bottom:-1.5rem;background:#fff;padding:1rem 0;border-top:1px solid #dce4ef;display:flex;gap:.75rem;flex-wrap:wrap}.resource-save-status{font-size:1rem;color:#174e7c}.resource-save-status[role=alert]{color:#a52d36}.resource-practice .lesson-stage{min-height:unset}.resource-practice .lesson-player{padding:0}.resource-practice .lesson-toolbar h1{font-size:1.4rem}.resource-practice .quiz-options{display:grid;gap:.7rem}.resource-practice input[type=radio]{width:1.15rem;min-width:1.15rem;height:1.15rem;min-height:0;padding:0;margin:0;flex:none;accent-color:#1f65a4}.resource-practice .quiz-option{display:flex;align-items:center;gap:.75rem;padding:1rem}.resource-practice .quiz-heading h2{font-size:1.3rem}.resource-page-heading{margin:2rem 0 0}.resource-page-heading h1{font-size:2rem}.resource-card .actions{flex-wrap:wrap}.resource-card{overflow-wrap:anywhere}
@media(max-width:650px){.resource-form-grid,.resource-answer-fields{grid-template-columns:1fr}.resource-dialog{width:96vw;max-width:96vw;border-radius:12px}.resource-dialog-head,.resource-dialog-body{padding:1rem}.resource-viewer iframe{height:65dvh}.resource-file-tools{flex-wrap:wrap}.resource-save-actions{bottom:-1rem}.resource-question{padding:.85rem}.resource-dialog-head h2{font-size:1.15rem}.resource-upload{padding:.8rem}.resource-library .lesson-toolbar{align-items:flex-start;gap:1rem}.resource-card .button{min-height:44px}}
/* A fixed lesson window: one complete PDF page and persistent navigation. */
.resource-viewer{height:92dvh;max-height:92dvh;overflow:hidden}
.resource-viewer[open]{display:flex;flex-direction:column}
.resource-viewer .resource-dialog-head{flex:none;position:static}
.resource-viewer .resource-dialog-body{flex:1;min-height:0;display:flex;flex-direction:column;gap:.65rem;padding:1rem}
.resource-reading-pane,.resource-pdf-host{display:flex;flex-direction:column;flex:1;min-height:0}
.resource-reading-pane[hidden],.resource-viewer [data-quiz-pane][hidden],.resource-lesson-tabs button[hidden],.pdf-reader [hidden]{display:none!important}
.resource-viewer [data-quiz-pane]{flex:1;min-height:0;overflow:auto}
.resource-reading-pane .article{overflow:auto}
.resource-file-tools{flex:none;margin:0 0 .5rem;align-items:center;overflow-wrap:anywhere}
.resource-lesson-tabs{display:flex;justify-content:flex-end;flex:none;gap:.5rem}
.resource-file-info{flex:none;max-height:8rem;overflow:auto;margin-bottom:.5rem}
.resource-file-info summary{cursor:pointer;font-size:.875rem;color:#245c92}
.resource-file-info p{margin:.5rem 0}
.pdf-reader{display:flex;flex-direction:column;flex:1;min-height:0;gap:.65rem;position:relative}
.pdf-page-viewport{display:flex;flex:1;min-height:100px;align-items:center;justify-content:center;overflow:hidden;background:#eaf0f7;border:1px solid #cdd8e8;border-radius:12px;outline-offset:2px}
.pdf-page-surface{line-height:0;max-width:100%;max-height:100%}
.pdf-page-surface canvas{display:block;background:#fff;box-shadow:0 2px 14px #1729431a;max-width:100%;max-height:100%}
.pdf-page-controls{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.75rem;flex:none;min-height:46px}
.pdf-page-controls [data-pdf-prev]{grid-column:1;grid-row:1;justify-self:start}
.pdf-page-count{grid-column:2;grid-row:1;font-size:.95rem;color:#233d60;white-space:nowrap;text-align:center}
.pdf-page-controls [data-pdf-next]{grid-column:3;grid-row:1;justify-self:end}
.pdf-reader-status{margin:0;font-size:.875rem;flex:none;color:#344e70}
.pdf-reader-status:empty{display:none}.pdf-reader-status[role=alert]{color:#a52d36}
.pdf-accessible-text{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:pre-wrap;border:0}
#resource-subjects{font-size:1rem;color:#245c92;margin-top:.75rem}
@media(max-width:650px){.resource-viewer{height:94dvh;max-height:94dvh}.resource-viewer .resource-dialog-body{padding:.65rem;gap:.5rem}.resource-viewer .resource-dialog-head{padding:.7rem}.pdf-page-controls{gap:.4rem}.pdf-page-controls .button{min-height:44px;padding:.55rem .9rem}.pdf-page-count{font-size:.875rem}}
/* Loading overlays do not resize the page and trigger a render/resize loop. */
.pdf-reader-status{position:absolute;top:.75rem;inset-inline:1rem;z-index:1;width:fit-content;max-width:calc(100% - 2rem);margin:auto;padding:.4rem .7rem;border-radius:8px;background:#fffffff2;text-align:center}
.pdf-reader [data-pdf-retry]{position:absolute;top:4.5rem;left:50%;transform:translateX(-50%);z-index:1}
/* Lessons stay in the page; only the current page image occupies the reading area. */
.resource-inline{direction:rtl;width:min(1180px,calc(100% - 2rem));height:min(940px,calc(100dvh - 2rem));margin:1rem auto 2rem;display:flex;flex-direction:column;min-height:0;border:1px solid #cfdbeb;border-radius:16px;background:#fff;overflow:hidden;scroll-margin-top:1rem}
.resource-inline-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.25rem;border-bottom:1px solid #e3e9f2;flex:none}
.resource-inline-head h1{font-size:clamp(1.25rem,2.8vw,1.7rem);line-height:1.35;letter-spacing:0;margin:0;min-width:0;overflow-wrap:anywhere}
.resource-inline-head .resource-close{flex:none;padding:.6rem 1rem;min-height:44px}
.resource-inline>.resource-dialog-body{display:flex;flex-direction:column;flex:1;min-height:0;gap:.65rem;padding:1rem}
.resource-inline [data-quiz-pane]{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.resource-inline [hidden],.resource-editor [hidden]{display:none!important}
.resource-inline .pdf-page-viewport{min-height:0}
.pdf-page-surface:has(>img){display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-width:0;min-height:0}
.pdf-page-surface>img{display:block;width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;object-position:center}
.resource-inline .resource-file-tools{font-size:.8rem;max-height:2.8em;overflow:hidden;margin:0 0 .3rem}
.resource-inline .resource-reading-pane{overflow:hidden}
.resource-inline .resource-file-info{max-height:6rem}
.resource-inline .resource-lesson-tabs .button{min-height:44px;padding:.6rem 1rem}
/* Keep the upload state and an actionable stop button visible while the form is locked. */
.resource-editor[open]{display:flex;flex-direction:column;overflow:hidden}
.resource-editor>.resource-dialog-head{position:static;flex:none}
.resource-editor>.resource-dialog-body{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain}
.resource-save-banner{position:sticky;top:-1.5rem;z-index:3;background:#fff;border-bottom:1px solid #e3e9f2;padding:.65rem 0;margin:0 0 1rem}
.resource-save-banner:not(:has(.resource-save-status:not(:empty))):not(:has(progress:not([hidden]))):not(:has([data-stop]:not([hidden]))){display:none}
.resource-save-banner .resource-save-status{margin:0;line-height:1.55;overflow-wrap:anywhere}
.resource-save-banner .resource-upload-progress{height:12px;margin:.6rem 0;accent-color:#305f85}
.resource-save-banner [data-stop]{width:auto;min-height:44px;margin:.6rem 0 0;padding:.5rem 1rem}
.resource-local-preview{display:flex;flex-direction:column;height:clamp(260px,50dvh,520px);min-height:0;margin-top:1rem}
.resource-local-preview .pdf-page-controls .button{width:auto;margin:0;padding:.55rem .9rem;min-height:44px}
@media(max-width:650px){.resource-inline{width:calc(100% - 1rem);margin:.5rem auto 1rem;height:calc(100dvh - 1rem);border-radius:12px;scroll-margin-top:.5rem}.resource-inline-head{padding:.7rem;gap:.6rem}.resource-inline-head h1{font-size:1.15rem}.resource-inline-head .resource-close{font-size:.875rem;padding:.5rem .7rem}.resource-inline>.resource-dialog-body{padding:.65rem;gap:.5rem}.resource-inline .resource-lesson-tabs .button{font-size:.875rem;padding:.5rem .8rem}.resource-save-banner{top:-1rem}.resource-local-preview{height:48dvh}.resource-inline .resource-file-info{max-height:4.5rem}}
/* The quiz grows with the current question, without a fixed-height scroll pane. */
.resource-inline.is-quiz{height:auto;max-height:none;overflow:visible;max-width:960px}
.resource-inline.is-quiz>.resource-dialog-body,.resource-inline.is-quiz [data-quiz-pane]{flex:none;overflow:visible}
.resource-inline.is-quiz .resource-lesson-tabs:not(:has(button:not([hidden]))){display:none}
.resource-inline.is-quiz .lesson-stage.quiz{height:auto;min-height:0;overflow:visible}
.resource-inline.is-quiz .lesson-status:empty{display:none}
.resource-inline .lesson-player{width:100%;min-width:0}
.resource-reading-status{flex:none;font-size:.8rem;color:#344e70}
.resource-reading-status p{margin:.25rem 0 0}
.resource-card .resource-completion{color:#205e49;background:#edf7f1;border-radius:8px;padding:.6rem .8rem;width:fit-content}
