:root {
  --black: #000000;
  --warm: #ffffff;
  --warm-2: #ffffff;
  --muted: rgba(255, 255, 255, .72);
  --line: rgba(255, 255, 255, .2);
  --line-strong: rgba(255, 255, 255, .36);
  --shadow: 0 28px 90px rgba(0, 0, 0, .55);
  --radius: 28px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--black);
  color: var(--warm);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--black); color: var(--warm); font-weight: 700; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 4%, rgba(255, 255, 255, .13), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(255, 255, 255, .08), transparent 26%);
}
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, .86);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 14px; font-family: Montserrat, Inter, sans-serif; font-weight: 900; letter-spacing: -.04em; font-size: clamp(18px, 3vw, 28px); }
.brandIcon { width: 48px; height: 48px; border: 1px solid var(--line-strong); border-radius: 16px; display: grid; place-items: center; background: var(--warm); color: var(--black); }
.brandIcon svg, .iconButton svg { width: 25px; height: 25px; }
.iconButton { width: 48px; height: 48px; border-radius: 16px; border: 1px solid var(--line-strong); background: transparent; display: grid; place-items: center; transition: .2s ease; }
.iconButton:hover { background: var(--warm); color: var(--black); transform: translateY(-1px); }
.iconButton.small { width: 42px; height: 42px; font-size: 30px; line-height: 1; }
.drawerOverlay { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.52); backdrop-filter: blur(3px); }
.drawer {
  position: fixed;
  z-index: 31;
  top: 0;
  right: 0;
  width: min(390px, 86vw);
  height: 100vh;
  padding: 24px;
  background: var(--black);
  border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .24s ease;
}
.drawer.open { transform: translateX(0); }
.drawerHead { display: flex; justify-content: space-between; align-items: center; font-family: Montserrat, Inter, sans-serif; font-size: 24px; }
.drawerNav { display: grid; gap: 12px; margin-top: 32px; }
.drawerNav a { padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.05); font-family: Montserrat, Inter, sans-serif; font-weight: 800; transition: .18s ease; }
.drawerNav a:hover, .drawerNav a.active { background: var(--warm); color: var(--black); }
.pageShell { position: relative; z-index: 1; width: min(1220px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 72px; }
.hero { min-height: 290px; border: 1px solid var(--line); border-radius: 36px; padding: clamp(28px, 6vw, 64px); background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.035)); display: grid; align-content: end; overflow: hidden; }
.eyebrow { margin: 0 0 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 800; }
h1, h2, h3 { font-family: Montserrat, Inter, sans-serif; letter-spacing: -.055em; margin: 0; }
h1 { max-width: 940px; font-size: clamp(40px, 7vw, 88px); line-height: .9; }
h2 { font-size: clamp(28px, 5vw, 54px); line-height: .95; }
h3 { font-size: 22px; line-height: 1.1; }
.heroText, .subtle { color: var(--muted); line-height: 1.65; }
.heroText { max-width: 660px; margin: 22px 0 0; font-size: 16px; }
.panel { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); background: rgba(255,255,255,.055); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.searchBox { display: flex; align-items: center; gap: 10px; min-width: min(360px, 100%); height: 52px; padding: 0 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.06); }
.searchBox input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--warm); direction: ltr; text-align: left; unicode-bidi: plaintext; }
.searchBox input::placeholder { color: rgba(255,255,255,.46); }
.btn { border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--warm); padding: 12px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; transition: .18s ease; }
.btn:hover, .btn.primary { background: var(--warm); color: var(--black); }
.btn.ghost { border-color: var(--line); }
.batchGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.batchCard { min-height: 210px; border: 1px solid var(--line); border-radius: 26px; padding: 20px; background: var(--black); display: grid; gap: 16px; align-content: space-between; text-align: left; transition: .2s ease; position: relative; overflow: hidden; }
.batchCard::after { content: ""; position: absolute; inset: auto -15% -35% 35%; height: 130px; background: rgba(255,255,255,.09); filter: blur(30px); transform: rotate(-12deg); }
.batchCard:hover { transform: translateY(-4px); border-color: var(--warm); }
.batchMeta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.batchTitle { position: relative; z-index: 1; min-height: 72px; font-family: Montserrat, Inter, sans-serif; font-size: 18px; line-height: 1.25; font-weight: 900; }
.cardFoot { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.bookmark { width: 42px; height: 42px; border-radius: 14px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); color: var(--warm); display: grid; place-items: center; transition: .18s ease; }
.bookmark svg { width: 22px; height: 22px; display: block; }
.bookmark:hover { border-color: var(--warm); background: rgba(255,255,255,.1); transform: translateY(-1px); }
.bookmark.saved { background: var(--warm); color: var(--black); border-color: var(--warm); }
.courseHeader { display: grid; grid-template-columns: 1fr auto; gap: 22px; align-items: end; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stats span { border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; color: var(--muted); }
.stats strong { display: block; color: var(--warm); font-size: 24px; font-family: Montserrat, Inter, sans-serif; }
.folderTools { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.folderList { margin-top: 16px; display: grid; gap: 12px; }
.folderCard { border: 1px solid var(--line); border-radius: 22px; background: var(--black); overflow: hidden; }
.folderCard summary { list-style: none; padding: 18px 20px; display: flex; align-items: center; gap: 12px; font-family: Montserrat, Inter, sans-serif; font-weight: 900; cursor: pointer; }
.folderCard summary::-webkit-details-marker { display: none; }
.folderCard summary .chev { transition: transform .18s ease; }
.folderCard[open] summary .chev { transform: rotate(90deg); }
.folderCard summary em { margin-left: auto; font-style: normal; color: var(--muted); font-family: Inter, sans-serif; font-size: 13px; }
.resourceList { border-top: 1px solid var(--line); padding: 12px; display: grid; gap: 8px; }
.resourceRow { border: 1px solid transparent; border-radius: 16px; padding: 14px; background: rgba(255,255,255,.055); display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; transition: .18s ease; }
.resourceRow:hover { border-color: var(--line-strong); background: rgba(255,255,255,.1); }
.resourceIcon { width: 32px; height: 32px; border-radius: 10px; background: var(--warm); color: var(--black); display: grid; place-items: center; }
.resourceName { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewerPanel { min-height: calc(100vh - 190px); display: grid; gap: 16px; }
.viewerTop { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.viewerFrame { width: 100%; min-height: 72vh; border: 1px solid var(--line); border-radius: 24px; background: #111; overflow: hidden; }
.viewerFrame video, .viewerFrame iframe { width: 100%; height: 72vh; border: 0; display: block; background: #111; }
.errorBox, .empty, .loading { margin-top: 18px; border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: rgba(255,255,255,.08); color: var(--warm); }
.loading { display: flex; align-items: center; gap: 10px; }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }
#scrollSentinel[hidden] { display: none !important; }
.pdfFrame { height: auto; min-height: 72vh; overflow: auto; padding: 12px; background: #1f2024; }
.pdfViewer { width: 100%; min-height: 72vh; display: grid; gap: 14px; align-content: start; }
.pdfPage { width: fit-content; max-width: 100%; margin: 0 auto; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 12px 36px rgba(0,0,0,.35); }
.pdfPage canvas { display: block; max-width: 100%; height: auto; }
.pdfFallback { min-height: 52vh; display: grid; place-content: center; gap: 10px; text-align: center; padding: 24px; }

@media (max-width: 760px) {
  .topbar { min-height: 68px; padding: 10px 14px; }
  .brandIcon, .iconButton { width: 44px; height: 44px; }
  .brand { font-size: 17px; gap: 10px; }
  .pageShell { width: min(100% - 20px, 1220px); padding-top: 16px; }
  .hero { min-height: 230px; border-radius: 26px; }
  .toolbar, .courseHeader { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .searchBox { min-width: 100%; }
  .stats { justify-content: flex-start; }
  .viewerFrame, .viewerFrame video, .viewerFrame iframe { min-height: 64vh; height: 64vh; }
}


.batchCount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 12px;
  margin-left: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--black);
  background: var(--warm);
  font-size: .55em;
  line-height: 1;
  vertical-align: middle;
  letter-spacing: 0;
}
