/* Compact workspace library: real courses and existing document/exam routes. */
body.sc-library-page { background: #f6f8fc; }
body.sc-library-page #sc-library-workspace[data-sidebar-main] { width: auto; max-width: none; }
body.sc-library-page #sc-library-workspace > div { max-width: 100rem; padding-top: 1.75rem !important; }
body.sc-library-page #sc-library-workspace h1 { font-size: 30px !important; font-weight: 650; line-height: 1.25 !important; color: var(--sc-theme-text,#14233f); margin-bottom: 0 !important; }
body.sc-library-page #sc-library-workspace > div > .mb-16 { margin-bottom: 1.2rem !important; }
body.sc-library-page #sc-library-workspace > div > .mb-16 > p { display: none; }
.sc-library-filterbar { align-items: start !important; gap: .8rem !important; margin-bottom: .6rem !important; }
.sc-library-filterbar > .group { flex: 1; max-width: none; min-width: 0; }
.sc-library-filterbar input { min-height: 44px; height: 3rem; border: 1px solid #dce3ef; background: white; box-shadow: none; }
.sc-library-legacy-grades { display: none !important; }
.sc-library-select { min-height: 3rem; width: 12rem; max-width: 100%; border: 1px solid #dce3ef; border-radius: .65rem; padding: .65rem 2rem .65rem .8rem; background: white; color: #14233f; font: inherit; }
.sc-library-collection-tabs { display: flex; gap: 1rem; align-items: center; border-bottom: 1px solid #e1e7f0; margin-bottom: 1.2rem; }
.sc-library-collection-tabs button { padding: .8rem .3rem; min-height: 44px; border-bottom: 2px solid transparent; color: #536482; font-weight: 600; }
.sc-library-collection-tabs button[aria-pressed="true"] { color: var(--sc-theme-primary,#176dce); border-bottom-color: var(--sc-theme-primary,#176dce); }
.sc-library-collection-tabs > span { margin-left: auto; color: #697a95; font-size: .85rem; }
.sc-library-resume { display: flex; align-items: center; gap: 1rem; padding: 1rem; margin-bottom: 1.2rem; border: 1px solid #e1e7f0; border-radius: .7rem; background: white; }
.sc-library-resume > span:nth-child(2) { flex: 1; min-width: 0; }
.sc-library-resume small,.sc-library-resume strong { display: block; overflow-wrap: anywhere; }
.sc-library-resume small { color: #697a95; }
body.sc-library-page #sc-library-workspace [data-subject-grid] { gap: 1.1rem !important; align-items: stretch; }
body.sc-library-page #sc-library-workspace [data-subject-grid] > .group { background: white; border: 1px solid #e1e7f0; border-radius: .8rem; box-shadow: 0 3px 9px #14233f05; }
body.sc-library-page #sc-library-workspace [data-subject-grid] > .group > div:has(> img) { height: 8rem !important; aspect-ratio: auto !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] img { object-fit: cover !important; opacity: 1; padding: 0 !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] .p-8.flex.flex-col.flex-grow { padding: 1.1rem !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] h3 { font-size: 1.2rem !important; line-height: 1.3 !important; color: #14233f; margin-bottom: .5rem; }
body.sc-library-page #sc-library-workspace [data-subject-grid] p { font-size: .9rem; line-height: 1.55; margin-bottom: 1rem; }
body.sc-library-page #sc-library-workspace [data-subject-grid] .font-label.text-xs { color: #64748b; font-size: .7rem; letter-spacing: .035em; margin-bottom: .4rem; }
body.sc-library-page [data-document-quality-badges] { display: none; }
body.sc-library-page .sc-content-mode-actions { display: flex; flex-wrap: wrap; width: 100%; gap: .4rem; padding-top: .8rem; border-top: 1px solid #e1e7f0; }
body.sc-library-page .sc-content-mode-action { min-height: 44px; padding: .5rem .65rem; font-size: .7rem; border-radius: .5rem; }
@media(max-width:767px) {
 body.sc-library-page #sc-library-workspace > div { padding-top: 1rem !important; }
 .sc-library-filterbar { flex-direction: row !important; flex-wrap: wrap; }
 .sc-library-filterbar > .group { flex-basis: 100%; }
 .sc-library-select { flex: 1; width: calc(50% - .4rem); min-width: 0; }
 body.sc-library-page #sc-library-workspace [data-subject-grid] { grid-template-columns: minmax(0,1fr) !important; }
 body.sc-library-page #sc-library-workspace [data-subject-grid] > .group > div:has(> img) { height: 7rem !important; }
 body.sc-library-page #sc-library-workspace [data-subject-grid] p.text-on-surface-variant { display: block !important; }
 .sc-library-collection-tabs { gap: .6rem; }
 .sc-library-collection-tabs button { font-size: .85rem; }
}
html[data-sc-theme="dark"] body.sc-library-page { background: #101827; }
html[data-sc-theme="dark"] body.sc-library-page #sc-library-workspace [data-subject-grid] > .group,
html[data-sc-theme="dark"] .sc-library-select,
html[data-sc-theme="dark"] .sc-library-resume { background: #182334; color: #e8edf7; border-color: #344258; }

body.sc-library-page #sc-library-workspace h1, body.sc-library-page #sc-library-workspace [data-subject-grid] h3 { color: var(--sc-theme-text,#14233f) !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] .p-8.flex.flex-col.flex-grow { background: white !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] > .group > div:has(> img) { border-radius: .75rem .75rem 0 0 !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] img { object-fit: contain !important; }
body.sc-library-page .sc-content-mode-action { font: 500 12px/1.3 var(--sc-font-ui,system-ui) !important; border-radius: var(--sc-radius-control,8px); text-transform: none !important; letter-spacing: 0 !important; }
body.sc-library-page #sc-library-workspace > div > .mb-16 > p { display: none !important; }
body.sc-library-page #sc-library-workspace .subject-search-results { text-transform: none; letter-spacing: 0; font-size: .8rem; color: #64748b; }
@media(max-width:767px) { body.sc-library-page #sc-library-workspace [data-subject-grid] { grid-template-columns: minmax(0,1fr) !important; } body.sc-library-page #sc-library-workspace [data-subject-grid] p { display: block !important; } body.sc-library-page #sc-library-workspace [data-subject-grid] .sc-content-mode-actions { display: flex !important; } }

body.sc-library-page #sc-library-workspace [data-subject-grid] > .group:not(.is-subject-hidden) { display: flex !important; flex-direction: column !important; min-width: 0; }
body.sc-library-page #sc-library-workspace [data-subject-grid] > .group > div:has(> img) { width: 100% !important; min-width: 0 !important; margin: 0 !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] img { object-fit: cover !important; }
body.sc-library-page #sc-library-workspace .sc-content-mode-actions { display: flex !important; }
body.sc-library-page #sc-library-workspace .sc-content-mode-action { display: inline-flex !important; }
html[data-sc-theme="dark"] body.sc-library-page #sc-library-workspace [data-subject-grid] .p-8.flex.flex-col.flex-grow { background: #182334 !important; }
html[data-sc-theme="dark"] body.sc-library-page #sc-library-workspace h1, html[data-sc-theme="dark"] body.sc-library-page #sc-library-workspace [data-subject-grid] h3 { color: var(--sc-theme-text,#e8edf7) !important; }

body.sc-library-page #sc-library-workspace .sc-library-legacy-grades { display: none !important; }
body.sc-library-page #sc-library-workspace [data-subject-grid] .flex.items-center.justify-between.mt-auto { display: flex !important; width: 100%; }
body.sc-library-page #sc-library-workspace [data-subject-grid] .sc-content-mode-actions { visibility: visible !important; max-height: none !important; }

/* Keep the illustrated banner’s central details visible without stretching. */
body.sc-library-page #sc-library-workspace [data-subject-grid] img { object-position: center; }

/* Mobile Library: shared course controls, compact illustrated cards. */
.sc-library-mobile-open { display: none; }
.sc-library-mobile-brand { display:none; }
body.sc-library-page #sc-library-workspace .sc-library-filterbar {
  display: grid !important; grid-template-columns: minmax(0,1fr) auto;
  align-items: start !important;
}
.sc-library-filter-selects { display: flex; gap: .75rem; grid-column: 2; grid-row: 1; }
.sc-library-collection-tabs { grid-column: 1 / -1; grid-row: 2; margin-bottom: .4rem; }
@media (max-width:767px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
  body.sc-library-page #sc-library-workspace { --sc-library-ink: var(--sc-theme-text,#142a43); }
  body.sc-library-page #sc-library-workspace > div { padding-inline: 16px !important; }
  body.sc-library-page #sc-library-workspace .sc-library-mobile-brand { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; min-height:44px; }
  .sc-library-mobile-brand a { display:flex; align-items:center; gap:8px; color:var(--sc-theme-text,#142a43); font:600 14px/1.3 Inter,system-ui,sans-serif; text-decoration:none; min-height:44px; }
  .sc-library-mobile-brand img { width:26px; height:30px; object-fit:contain; }
  .sc-library-mobile-brand button { display:grid; place-items:center; width:44px; min-height:44px; border:0; border-radius:50%; background:var(--sc-theme-primary-soft,#eaf4ff); color:var(--sc-theme-text,#142a43); }
  body.sc-library-page #sc-library-workspace .sc-library-filterbar { grid-template-columns: minmax(0,1fr); gap: 10px !important; }
  body.sc-library-page #sc-library-workspace .sc-library-filterbar > .group { width: 100%; max-width: none; }
  body.sc-library-page #sc-library-workspace .sc-library-filterbar input { font-size:16px !important; height:44px !important; min-height:44px; padding-block:8px !important; }
  body.sc-library-page #sc-library-workspace .subject-search-meta { display:none; }
  body.sc-library-page.sc-library-has-query #sc-library-workspace .subject-search-meta { display:flex; }
  body.sc-library-page #sc-library-workspace .sc-library-collection-tabs { grid-row:2; grid-column:1; display:grid; grid-template-columns:1fr 1fr; gap:3px; padding:3px; margin:0; border:1px solid var(--sc-theme-border,#e1e8ef); border-radius:12px; background:var(--sc-theme-primary-soft,#eaf4ff); }
  body.sc-library-page #sc-library-workspace .sc-library-collection-tabs button { min-height:44px; padding:8px; border:0; border-radius:9px; font-size:14px; color:var(--sc-theme-muted,#52677d); }
  body.sc-library-page #sc-library-workspace .sc-library-collection-tabs button[aria-pressed="true"] { color:var(--sc-theme-primary,#176dce); background:var(--sc-theme-surface,#fff); box-shadow:0 1px 3px #142a430d; }
  body.sc-library-page #sc-library-workspace .sc-library-collection-tabs > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .sc-library-filter-selects { grid-column:1; grid-row:3; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
  body.sc-library-page #sc-library-workspace .sc-library-select { width:100%; min-height:44px; font-size:16px; padding:8px 24px 8px 10px; }
  body.sc-library-page #sc-library-workspace .sc-library-resume { padding:12px; margin-block:12px; gap:10px; min-height:60px; font-size:14px; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:12px !important; align-items:stretch !important; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] > .group:not(.is-subject-hidden) { display:flex !important; flex-direction:column; height:auto !important; min-height:0 !important; grid-template-columns:none !important; grid-template-rows:none !important; border-radius:12px !important; box-shadow:0 2px 7px #142a4306 !important; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] > .group > div:first-of-type { width:100% !important; min-width:0 !important; height:96px !important; min-height:0 !important; margin:0 !important; border-radius:12px 12px 0 0 !important; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] .p-8.flex.flex-col.flex-grow { position:relative; display:flex !important; flex-direction:column; padding:10px 40px 10px 10px !important; min-height:74px !important; gap:6px; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] h3 { order:0; display:block !important; margin:0 !important; font-size:14px !important; line-height:1.35 !important; transform:none !important; overflow:visible; overflow-wrap:anywhere; -webkit-line-clamp:unset; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] .sc-library-grade-chip { order:1; display:block !important; width:fit-content; margin:0 !important; padding:3px 6px; border-radius:6px; background:var(--sc-theme-primary-soft,#eaf4ff); font-size:0 !important; line-height:1; letter-spacing:normal; }
  .sc-library-grade-chip::after { content:attr(data-mobile-grade); font:400 12px/1.3 Inter,system-ui,sans-serif; color:var(--sc-theme-muted,#52677d); text-transform:none; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] :is(p.text-on-surface-variant,.sc-content-mode-actions,.flex.items-center.justify-between.mt-auto,.sc-document-quality-badges,.subject-progress) { display:none !important; }
  body.sc-library-page #sc-library-workspace .sc-library-mobile-open { display:grid; place-items:center; position:absolute; right:0; bottom:10px; width:36px; height:44px; color:var(--sc-theme-primary,#176dce); pointer-events:none; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] .subject-star-button { width:44px !important; height:44px !important; min-width:44px !important; min-height:44px !important; right:4px !important; top:4px !important; border-radius:50% !important; z-index:4; }
  body.sc-library-page #sc-library-workspace [data-subject-empty-state] { grid-column:1 / -1; }
}
@media (max-width:359px) {
  body.sc-library-page #sc-library-workspace [data-subject-grid] { grid-template-columns:minmax(0,1fr) !important; }
}
@media (max-width:767px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
  body.sc-library-page #sc-library-workspace [data-subject-grid] { grid-auto-rows:auto !important; }
  body.sc-library-page #sc-library-workspace [data-subject-divider] { grid-column:1 / -1 !important; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] > .group:not(.is-subject-hidden) { align-self:start !important; }
  body.sc-library-page #sc-library-workspace [data-subject-grid] .p-8.flex.flex-col.flex-grow { height:auto !important; flex:0 0 auto !important; justify-content:flex-start !important; }
}
@media (prefers-reduced-motion:reduce) {
  body.sc-library-page #sc-library-workspace [data-subject-grid] > .group { transition:none; }
}
