/* Teacher Library: usable on desktop, tablet and mobile with the certified shell. */
.teacher-library-filters .field{min-width:0}
.teacher-library-filters select,.teacher-library-filters input{width:100%}
.teacher-library-day-grid{display:flex;flex-wrap:wrap;gap:9px;margin:16px 0}
.teacher-library-check{display:inline-flex;align-items:center;gap:9px;padding:10px 13px;border:1px solid #d5dfe9;border-radius:12px;background:#f7fafe;color:#183550;font-weight:550;cursor:pointer;line-height:1.35}
.teacher-library-check input{accent-color:#1754a5;width:17px;height:17px;flex-shrink:0}
.teacher-library-check:has(input:checked){background:#e9f2ff;border-color:#85aad4;color:#123b72}
.teacher-library-check:has(input:focus-visible){outline:3px solid #9ac3f2;outline-offset:2px}
.teacher-library-week-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:14px 0 18px}
.teacher-library-week-fields .field:last-of-type,.teacher-library-week-fields>.teacher-library-check,.teacher-library-week-fields>.help-text{grid-column:1/-1}
.teacher-library-week-fields textarea,.teacher-library-lesson-fields textarea{width:100%;min-height:86px;padding:12px;line-height:1.5;font:inherit;resize:vertical;border:1px solid #c4d2e2;border-radius:10px;background:#fff;color:#142438}
.teacher-library-week-fields textarea:focus,.teacher-library-lesson-fields textarea:focus{outline:2px solid #7fb3ee;outline-offset:1px}
.teacher-library-lesson-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:8px 1px}
.teacher-library-lesson-fields .field{min-width:0}
.teacher-library-lesson-fields .field:nth-child(n+7){grid-column:1/-1}
#teacherLibraryAlert{padding:11px 14px;margin:12px 0;border-radius:10px;border:1px solid #c6d8ed;background:#f2f7ff;color:#254467}
#teacherLibraryAlert[data-kind="error"]{border-color:#edc6c5;background:#fff2f2;color:#9f2727}
#teacherLibraryAlert[data-kind="success"]{border-color:#a9dfb8;background:#f3fff6;color:#226335}
#teacherLibraryAlert[data-kind="warning"]{border-color:#e9d19d;background:#fffaec;color:#7a5300}
#teacherLibraryAlert[hidden]{display:none}
#content .panel.pad>h4:first-child{margin-top:0}
#content .panel.pad{margin-bottom:17px}
#content .panel.pad>.help-text{max-width:920px}
#content .teacher-library-week-fields>.help-text{margin:3px 0}
#content table small{display:block;color:#657384;font-weight:normal;margin-top:5px}
#content .table-wrap .button-row{flex-wrap:wrap;gap:5px}
@media(max-width:880px){
  .teacher-library-week-fields,.teacher-library-lesson-fields{grid-template-columns:1fr}
  .teacher-library-week-fields .field,.teacher-library-lesson-fields .field{grid-column:1/-1}
}
@media(max-width:620px){
  .teacher-library-day-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .teacher-library-check{font-size:.88rem}
  #content .panel.pad{padding:15px}
  #content .panel.pad .button-row>.button{max-width:100%}
}


/* Teacher Library workspace navigation. Scoped to avoid changing certified app UI. */
.teacher-workspace-hidden{display:none!important}
.teacher-workspace-tabs{display:flex;align-items:center;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;
  padding:11px 2px 14px;margin:0 0 19px;border-bottom:1px solid #dbe6f2;scrollbar-width:thin}
.teacher-workspace-tab{flex:0 0 auto;min-height:42px;padding:10px 17px;border:1px solid transparent;
  border-radius:12px;background:transparent;color:#506681;font:inherit;font-size:.92rem;font-weight:650;
  cursor:pointer;white-space:nowrap;transition:background .16s,border-color .16s}
.teacher-workspace-tab:hover{background:#f0f5fc;border-color:#d5e2f3;color:#144278}
.teacher-workspace-tab.is-active,.teacher-workspace-tab[aria-selected="true"]{
  color:#13488a;background:linear-gradient(145deg,#edf5ff,#f8fbff);border-color:#b4cfef;
  box-shadow:0 2px 8px rgba(22,77,146,.08)}
.teacher-workspace-tab:focus-visible{outline:3px solid #88b8f3;outline-offset:2px}
.teacher-library-welcome{background:linear-gradient(125deg,#f4f8ff 0%,#fff 70%)}
.teacher-library-welcome>p{max-width:760px;color:#52647a;font-size:1rem;line-height:1.6}
.teacher-library-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:17px 0 19px}
.teacher-library-metric{display:flex;flex-direction:column;gap:4px;min-height:116px;padding:20px;
  background:#fff;border:1px solid #dce7f4;border-radius:16px;box-shadow:0 3px 16px rgba(19,49,83,.04)}
.teacher-library-metric strong{color:#154d90;font-size:2rem;line-height:1.12;font-variant-numeric:tabular-nums}
.teacher-library-metric span{color:#1f3853;font-size:.91rem;font-weight:700}
.teacher-library-metric small{color:#6a7a8e;font-size:.79rem}
.teacher-library-shortcuts{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.teacher-library-category-filter{max-width:250px;margin:12px 0 16px}
.teacher-library-category-filter select{width:100%}
#content [data-library-extra]>.panel.pad{margin-bottom:17px}
/* Keep wide status/audit tables scrollable inside their panels on mobile. */
#content [data-library-extra] .table-wrap{display:block;width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
#content [data-library-extra] .table-wrap td{vertical-align:middle}
#content [data-library-extra] .panel-header{align-items:center}
#content [data-library-extra] .panel-header .button{flex-shrink:0}
@media(max-width:1100px){
  .teacher-library-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:620px){
  .teacher-workspace-tabs{margin-left:-3px;margin-right:-3px;gap:4px}
  .teacher-workspace-tab{font-size:.85rem;padding:9px 12px}
  .teacher-library-metric{padding:15px;min-height:105px}
  .teacher-library-metric strong{font-size:1.6rem}
  .teacher-library-shortcuts .button{width:100%}
  #content [data-library-extra] .panel-header{flex-wrap:wrap}
}
@media(max-width:390px){.teacher-library-metrics{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.teacher-workspace-tab{transition:none}}

.teacher-library-plan-filter{min-width:175px;max-width:220px;margin-left:auto}
.teacher-library-plan-filter select{width:100%}
.teacher-library-template-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;margin:13px 0}
.teacher-library-template{display:flex;flex-direction:column;gap:8px;background:#f9fbff;border:1px solid #dce6f1;
  border-radius:14px;padding:15px;min-width:0}
.teacher-library-template strong{font-size:.95rem;overflow-wrap:anywhere}
.teacher-library-template small{color:#697d91}
.teacher-library-template .button{align-self:start}
@media(max-width:620px){.teacher-library-plan-filter{max-width:none;width:100%;margin:9px 0}}

