:root {
  color-scheme: light;
  --background: #f7f5fa;
  --ink: #241a35;
  --muted: #655b73;
  --purple: #573d82;
  --line: #e5deed;
  --soft: #eee7f8;
  font: 100% / 1.55 Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
}
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 1.25rem; height: 1.25rem; flex: none; }
:focus-visible { outline: 3px solid #926dc4; outline-offset: 3px; }
.skip { position: fixed; z-index: 3; inset: .5rem auto auto .5rem; background: white; padding: .5rem 1rem; }
.skip:not(:focus) { clip-path: inset(50%); }
.container { max-width: 88rem; margin-inline: auto; padding-inline: clamp(.85rem, 3vw, 2rem); }
.topbar { background: #271b42; color: white; }
.top-inner { min-height: 3.75rem; display: flex; justify-content: space-between; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-size: 1.3rem; font-weight: bold; }
.brand-mark { width: 1rem; height: 1.25rem; background: #d8bbfc; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 73%, 0 100%); }
.top-link { border: 1px solid #725999; border-radius: .45rem; padding: .32rem .68rem; font-size: .9rem; }
.top-link:hover { background: #493460; }
main { padding-block: clamp(1.05rem, 3vw, 2rem) 2rem; }
main:focus { outline: none; }
.home-heading { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; justify-content: space-between; margin-bottom: 1rem; }
h1 { font-size: clamp(1.55rem, 3vw, 2.25rem); line-height: 1.3; }
.search { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: .55rem; background: white; padding-inline: .65rem; color: var(--muted); }
.search input { color: var(--ink); min-width: 0; width: 15rem; background: transparent; font: inherit; border: 0; min-height: 2.55rem; }
.search:focus-within { outline: 2px solid #926dc4; }
.search input:focus { outline: none; }
.search svg { width: 1rem; height: 1rem; }
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.purple { --tint: #ede5fa; --accent: #5d3a8a; }
.mint { --tint: #e1f0e7; --accent: #226444; }
.blue { --tint: #e4ecfc; --accent: #3e58a4; }
.rose { --tint: #f7e4ed; --accent: #8c3e63; }
.orange { --tint: #f7e8d5; --accent: #804f20; }
.course-card { display: flex; align-items: center; min-width: 0; gap: .62rem; min-height: 5rem; padding: .73rem; border: 1px solid var(--line); border-radius: .64rem; background: white; }
.course-card:hover { border-color: var(--accent); background: #fcfaff; }
.course-icon, .file-icon { display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem; border-radius: .56rem; background: var(--tint, var(--soft)); color: var(--accent, var(--purple)); }
.course-card h2 { font-size: 1rem; line-height: 1.4; }
.course-title b, .subject-heading b { color: var(--accent); font-size: .88rem; }
.count { margin-inline-start: auto; font-size: .84rem; color: var(--muted); flex: none; }
.subject-heading { display: flex; align-items: center; gap: .68rem; margin-block-end: .95rem; }
.subject-heading .course-icon { width: 3rem; height: 3rem; }
.subject-layout { display: grid; grid-template-columns: minmax(10.5rem, 15.8rem) minmax(0, 1fr); gap: .85rem; align-items: start; }
.file-list { display: grid; gap: .45rem; }
.file-list a { display: flex; align-items: center; gap: .59rem; padding: .49rem .6rem; border: 1px solid var(--line); border-radius: .55rem; background: white; min-width: 0; }
.file-list a:hover, .file-list a[aria-current="page"] { border-color: #b99bd8; background: #f5edf9; }
.file-list b, .file-list small { display: block; }
.file-list b { font-size: .95rem; }
.file-list small { color: var(--muted); font-size: .75rem; }
.file-icon { width: 1.9rem; height: 1.9rem; }
.file-icon svg { width: 1rem; height: 1rem; }
.reader { border: 1px solid var(--line); border-radius: .62rem; overflow: hidden; background: white; }
.reader-head { display: flex; align-items: center; justify-content: space-between; gap: .65rem; flex-wrap: wrap; padding: .68rem .8rem; }
.reader-head h2 { font-size: 1rem; }
.download { padding: .35rem .65rem; border-radius: .43rem; color: white; background: var(--purple); font-size: .88rem; }
.download:hover { background: #452b69; }
.reader iframe { width: 100%; height: clamp(26rem, 72vh, 70rem); display: block; border: 0; background: #eeeaf3; }
.open-file { display: block; padding: .43rem .8rem; font-size: .88rem; color: var(--purple); text-decoration: underline; }
.no-results { padding: .75rem; color: var(--muted); }
@media (max-width: 60rem) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 40rem) {
  .home-heading { align-items: stretch; flex-direction: column; }
  .search input { width: 100%; }
  .course-grid, .subject-layout { grid-template-columns: minmax(0, 1fr); }
  .file-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 23rem) {
  .file-list { grid-template-columns: minmax(0, 1fr); }
}
