:root {
  --ink: #eef7ff;
  --muted: rgba(238, 247, 255, .72);
  --line: rgba(255, 255, 255, .18);
  --glass: rgba(255, 255, 255, .12);
  --blue: #55a5ff;
  --cyan: #71ebff;
  --green: #52e0a3;
  --gold: #f7c948;
  --dark: #07162b;
  --shadow: 0 30px 90px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    linear-gradient(180deg, #07162b 0%, #0d2744 52%, #0f3a48 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0 58%, rgba(118, 212, 255, .16) 58%, rgba(255, 255, 255, .06) 100%),
    repeating-linear-gradient(100deg, rgba(255,255,255,.06) 0 1px, transparent 1px 92px);
  opacity: .42;
}
.library-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.library-shell.shell-embed { padding: 32px 24px 24px; }
.library-shell.shell-full { padding: 52px 30px 30px; }
.library-shell::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -170px;
  height: 380px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(126, 220, 255, .2), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0));
  transform: perspective(900px) rotateX(64deg);
}
.library-top {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 22px;
  align-items: end;
  max-width: 1240px;
  margin: 0 auto 22px;
}
.brand-head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.brand-logo {
  flex: 0 0 auto;
  width: clamp(58px, 8vw, 86px);
  height: clamp(58px, 8vw, 86px);
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: 0 16px 42px rgba(0,0,0,.2);
}
.brand-copy {
  min-width: 0;
}
.kicker {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 64px);
  line-height: .98;
  letter-spacing: 0;
  max-width: 760px;
}
h1.h1-embed { font-size: clamp(32px, 5vw, 54px); }
.intro {
  margin: 14px 0 0;
  max-width: 740px;
  color: var(--muted);
  font-size: 17px;
}
.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  max-width: 760px;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--ink);
  background: rgba(255,255,255,.1);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  text-decoration: none;
  font-weight: 950;
  white-space: nowrap;
  font: inherit;
  cursor: pointer;
}
.hero-action.primary {
  color: #03111f;
  background: #f7c948;
  box-shadow: 0 16px 34px rgba(177, 120, 24, .24);
}
.hero-action.secondary {
  border: 1px solid rgba(255,255,255,.22);
  color: var(--ink);
  background: rgba(255,255,255,.1);
}
.hero-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.library-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 10px;
  min-width: 360px;
}
.stat {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.07));
  border-radius: 8px;
  padding: 14px;
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 45px rgba(0,0,0,.18);
}
.stat strong { display: block; font-size: 28px; line-height: 1; }
.stat span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}
.browser {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}
.browser-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
}
.browser-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.crumb {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: var(--ink);
  min-height: 34px;
  padding: 0 12px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}
.crumb.active {
  color: #041326;
  background: linear-gradient(135deg, #ffffff, #9ee9ff);
  border-color: rgba(255,255,255,.6);
}
.search {
  width: min(320px, 100%);
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(4, 19, 38, .54);
  outline: 0;
  font: inherit;
}
.search::placeholder { color: rgba(238, 247, 255, .54); }
.sound-toggle {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255,255,255,.1);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.sound-toggle[aria-pressed="true"] {
  color: #03111f;
  border-color: transparent;
  background: var(--gold);
}
.folder-info {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 6px;
}
.folder-info h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.05;
  letter-spacing: 0;
}
.folder-info p { margin: 8px 0 0; color: var(--muted); }
.folder-counts {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  padding: 0 12px;
  font-weight: 900;
  white-space: nowrap;
}
.shelf {
  padding: 18px 22px 34px;
}
.shelf-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.shelf-title h3 { margin: 0; font-size: 18px; }
.rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  padding: 8px 0 20px;
  perspective: 1200px;
}
.tile {
  position: relative;
  min-height: 350px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  box-shadow: 0 22px 50px rgba(0,0,0,.28);
  overflow: hidden;
  transform-style: preserve-3d;
  opacity: 0;
  transform: translateY(24px) scale(.98) rotateY(0deg);
  filter: blur(8px);
  animation: tileArrive .72s cubic-bezier(.16, 1, .3, 1) forwards;
  animation-delay: var(--load-delay, 0ms);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, filter .22s ease;
  cursor: pointer;
}
.tile:hover, .tile:focus-within {
  transform: translateY(-9px) rotateY(-4deg);
  border-color: rgba(113, 235, 255, .72);
  box-shadow: 0 26px 70px rgba(85, 165, 255, .25);
  filter: blur(0);
}
.tile.anim-rise { transform: translateY(30px) scale(.96); }
.tile.anim-slide { transform: translateX(34px) scale(.97); }
.tile.anim-tilt { transform: translateY(24px) rotateY(10deg) scale(.97); }
.tile.anim-soft { transform: translateY(12px) scale(.94); }
@keyframes tileArrive {
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotateY(0deg);
    filter: blur(0);
  }
}
.folder-tile {
  border-color: rgba(247, 201, 72, .32);
}
.cover {
  position: relative;
  width: 100%;
  height: 246px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.22), rgba(255,255,255,.08)),
    radial-gradient(circle at 30% 20%, rgba(113,235,255,.32), transparent 34%),
    linear-gradient(135deg, #12375c, #07162b);
  overflow: hidden;
}
.loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(110deg, rgba(255,255,255,.06) 8%, rgba(255,255,255,.2) 18%, rgba(255,255,255,.06) 33%),
    radial-gradient(circle at 30% 25%, rgba(113,235,255,.25), transparent 34%),
    linear-gradient(135deg, rgba(18,55,92,.94), rgba(7,22,43,.94));
  background-size: 220% 100%, 100% 100%, 100% 100%;
  animation: shimmer 1.25s linear infinite;
  z-index: 1;
  transition: opacity .28s ease, visibility .28s ease;
}
.loader::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: var(--cyan);
  box-shadow: 0 0 24px rgba(113,235,255,.28);
  animation: spin .8s linear infinite;
}
.cover.loaded .loader {
  opacity: 0;
  visibility: hidden;
}
.cover.failed .loader::before {
  content: "!";
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  font-weight: 950;
  animation: none;
}
@keyframes shimmer {
  to { background-position: -220% 0, 0 0, 0 0; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.cover img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .32s ease;
}
.cover.loaded img {
  opacity: 1;
}
.folder-icon {
  height: 246px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.92);
  font-size: 92px;
  font-weight: 950;
  letter-spacing: 0;
}
.tile::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 246px;
  height: 104px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0));
  transform: scaleY(-1);
  opacity: .34;
  pointer-events: none;
}
.tile-copy {
  position: relative;
  min-height: 104px;
  padding: 16px;
  background: rgba(5, 18, 34, .6);
  backdrop-filter: blur(12px);
}
.tile-copy strong {
  display: block;
  font-size: 18px;
  line-height: 1.18;
  max-height: 44px;
  overflow: hidden;
}
.tile-copy span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.note-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #03111f;
  background: #9ee9ff;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 950;
  width: fit-content;
}
.progress-status {
  display: inline-flex !important;
  align-items: center;
  width: fit-content;
  margin-top: 10px !important;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff !important;
  background: #1f6f5f;
  font-size: 12px !important;
  font-weight: 950;
}
.note-excerpt {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 34px;
  overflow: hidden;
}
.lock-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  color: #fff;
  background: #1f6f5f;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 950;
  width: fit-content;
}
.locked-tile {
  cursor: pointer;
}
.locked-tile .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(180deg, rgba(3, 13, 25, .08), rgba(3, 13, 25, .48));
  pointer-events: none;
}
.lock-cover {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 8px 10px;
  color: #fff;
  font-weight: 950;
  background: rgba(3, 13, 25, .72);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
}
.lock-cover strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #03111f;
  background: #f7c948;
  font-size: 15px;
  line-height: 1;
}
.lock-cover span {
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.locked-meta {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px !important;
}
.locked-meta span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(31, 111, 95, .12);
  color: #1f3a34;
  font-size: 12px;
  font-weight: 900;
}
.unlock-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  margin-top: 12px;
  border-radius: 8px;
  padding: 0 11px;
  color: #03111f !important;
  background: #f7c948;
  text-decoration: none;
  font-size: 13px !important;
  font-weight: 950;
}
.access-banner {
  max-width: 1240px;
  margin: -8px auto 22px;
  border: 1px solid rgba(31, 111, 95, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 12px 34px rgba(23, 51, 60, .08);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #1b2f2b;
}
.access-banner strong { display: block; }
.access-banner span { color: rgba(24, 36, 52, .68); font-size: 14px; }
.access-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.access-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  background: #1f6f5f;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}
.access-btn.primary {
  min-height: 42px;
  padding-inline: 16px;
  color: #03111f;
  background: #f7c948;
  box-shadow: 0 12px 28px rgba(177, 120, 24, .18);
}
.access-btn.secondary {
  background: #fff;
  color: #1f3a34;
  border: 1px solid rgba(31,111,95,.22);
}
.folder-cta {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 18px 18px;
  border: 1px solid rgba(31, 111, 95, .2);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(244, 250, 246, .9);
  color: #1b2f2b;
}
.folder-cta.visible { display: flex; }
.folder-cta strong {
  display: block;
  font-size: 15px;
  line-height: 1.25;
}
.folder-cta span {
  display: block;
  margin-top: 4px;
  color: rgba(24, 36, 52, .68);
  font-size: 13px;
}
.folder-cta .access-btn {
  flex: 0 0 auto;
  min-height: 34px;
  padding-inline: 10px;
  font-size: 13px;
}
.open-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  background: rgba(4, 19, 38, .72);
  color: #fff;
  padding: 8px 10px;
  font-weight: 900;
  font-size: 12px;
  backdrop-filter: blur(10px);
  cursor: pointer;
}
.empty {
  margin: 18px 22px 34px;
  border: 1px dashed rgba(255,255,255,.24);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 8, 18, .88);
}
.modal.open { display: flex; }
.modal-inner {
  width: min(1320px, 100%);
  max-height: calc(100vh - 44px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
}
.modal-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.modal-title { font-weight: 900; }
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.quiz-progress {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
.tool-btn:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.download-btn {
  padding: 0 12px;
  text-decoration: none;
}
.close {
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  min-width: 40px;
  min-height: 38px;
  font-size: 20px;
  cursor: pointer;
}
.modal-image-wrap {
  min-height: 0;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0,0,0,.26);
  overscroll-behavior: contain;
  cursor: grab;
  touch-action: none;
}
.modal-image-wrap.dragging {
  cursor: grabbing;
  user-select: none;
}
.modal.locked-preview .modal-image-wrap {
  cursor: default;
  position: relative;
}
.modal.locked-preview #viewerImage {
  filter: blur(14px) saturate(.75) contrast(.72) brightness(.9);
  transform: scale(1.04);
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}
.modal.locked-preview .modal-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.16) 0 2px, transparent 2px 12px),
    radial-gradient(circle at 50% 42%, rgba(255,255,255,.18), transparent 36%),
    linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,.54));
  pointer-events: none;
}
.modal.locked-preview .modal-image-wrap::before {
  content: "Preview locked";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(3, 13, 25, .72);
  color: #fff;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 18px 42px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
  flex: 1 1 auto;
  height: calc(100vh - 120px);
  min-height: 0;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}
.modal img {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  object-fit: contain;
  flex: 0 0 auto;
}
.notes-panel {
  border-left: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  padding: 22px;
  overscroll-behavior: contain;
}
.notes-kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.content-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.content-tab {
  min-height: 38px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 7px;
  color: var(--ink);
  background: rgba(255,255,255,.08);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.content-tab.active {
  color: #062c2d;
  border-color: transparent;
  background: linear-gradient(135deg, var(--cyan), var(--green));
}
.content-tab:disabled {
  opacity: .42;
  cursor: not-allowed;
}
.notes-panel h1,
.notes-panel h2,
.notes-panel h3,
.notes-panel h4 {
  margin: 18px 0 10px;
  line-height: 1.15;
  letter-spacing: 0;
}
.notes-panel h1 { font-size: 28px; }
.notes-panel h2 { font-size: 23px; }
.notes-panel h3 { font-size: 19px; }
.notes-panel p,
.notes-panel li {
  color: rgba(238, 247, 255, .82);
  line-height: 1.6;
  font-size: 15px;
}
.notes-panel code {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 5px;
  background: rgba(0,0,0,.25);
  padding: 2px 5px;
}
.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.quiz-meta span {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  padding: 7px 10px;
  color: rgba(238,247,255,.78);
  background: rgba(255,255,255,.07);
  font-size: 12px;
}
.quiz-list {
  display: grid;
  gap: 12px;
}
.quiz-card {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.06);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.quiz-one-at-a-time {
  align-items: stretch;
}
.quiz-one-at-a-time .quiz-card {
  display: none;
  min-height: 360px;
  transform-origin: center;
}
.quiz-one-at-a-time .quiz-card.active {
  display: block;
}
.quiz-one-at-a-time .quiz-card.queued {
  display: none;
}
.quiz-one-at-a-time .quiz-card.entering.quiz-shift,
.quiz-complete.active.quiz-shift {
  animation: quizEnterShift .38s cubic-bezier(.16, 1, .3, 1);
}
.quiz-one-at-a-time .quiz-card.entering.quiz-lift,
.quiz-complete.active.quiz-lift {
  animation: quizEnterLift .38s cubic-bezier(.16, 1, .3, 1);
}
.quiz-one-at-a-time .quiz-card.entering.quiz-turn,
.quiz-complete.active.quiz-turn {
  animation: quizEnterTurn .42s cubic-bezier(.16, 1, .3, 1);
}
.quiz-one-at-a-time .quiz-card.entering.quiz-snap,
.quiz-complete.active.quiz-snap {
  animation: quizEnterSnap .34s cubic-bezier(.16, 1, .3, 1);
}
.quiz-one-at-a-time .quiz-card.leaving.quiz-shift { animation: quizExitShift .28s ease forwards; }
.quiz-one-at-a-time .quiz-card.leaving.quiz-lift { animation: quizExitLift .28s ease forwards; }
.quiz-one-at-a-time .quiz-card.leaving.quiz-turn { animation: quizExitTurn .28s ease forwards; }
.quiz-one-at-a-time .quiz-card.leaving.quiz-snap { animation: quizExitSnap .28s ease forwards; }
@keyframes quizEnterShift {
  from { opacity: 0; transform: translateX(36px); filter: blur(6px); }
  to { opacity: 1; transform: translateX(0); filter: blur(0); }
}
@keyframes quizEnterLift {
  from { opacity: 0; transform: translateY(24px) scale(.98); filter: blur(5px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes quizEnterTurn {
  from { opacity: 0; transform: perspective(700px) rotateY(-10deg) translateX(18px); filter: blur(5px); }
  to { opacity: 1; transform: perspective(700px) rotateY(0) translateX(0); filter: blur(0); }
}
@keyframes quizEnterSnap {
  from { opacity: 0; transform: scale(.94); }
  70% { opacity: 1; transform: scale(1.015); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes quizExitShift {
  to { opacity: 0; transform: translateX(-34px); filter: blur(6px); }
}
@keyframes quizExitLift {
  to { opacity: 0; transform: translateY(-22px) scale(.98); filter: blur(5px); }
}
@keyframes quizExitTurn {
  to { opacity: 0; transform: perspective(700px) rotateY(10deg) translateX(-18px); filter: blur(5px); }
}
@keyframes quizExitSnap {
  to { opacity: 0; transform: scale(.96); }
}
.quiz-card.correct {
  border-color: rgba(82, 224, 163, .58);
  box-shadow: 0 12px 28px rgba(82, 224, 163, .14);
}
.quiz-card.wrong {
  border-color: rgba(224, 82, 82, .52);
  box-shadow: 0 12px 28px rgba(224, 82, 82, .12);
}
.quiz-card h3 {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 0;
  font-size: 16px;
}
.quiz-card h3 span {
  flex: 0 0 auto;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #062c2d;
  background: var(--cyan);
  font-size: 13px;
  font-weight: 950;
}
.quiz-options {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
}
.quiz-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--ink);
  background: rgba(255,255,255,.08);
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.quiz-choice:hover,
.quiz-choice:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(113, 235, 255, .54);
  outline: 0;
}
.quiz-choice:disabled {
  cursor: default;
}
.quiz-choice span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: #062c2d;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 950;
}
.quiz-choice.answer-correct,
.quiz-choice.selected-correct {
  color: #08291f;
  border-color: rgba(82, 224, 163, .7);
  background: rgba(82, 224, 163, .22);
}
.quiz-choice.selected-wrong {
  color: #3a1010;
  border-color: rgba(224, 82, 82, .62);
  background: rgba(224, 82, 82, .18);
}
.quiz-feedback {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}
.quiz-complete {
  display: none;
  min-height: 260px;
  border: 1px solid rgba(82, 224, 163, .36);
  border-radius: 8px;
  padding: 18px;
  background: rgba(82, 224, 163, .12);
}
.quiz-complete.active {
  display: block;
}
.quiz-complete h3 {
  margin: 0 0 10px;
  font-size: 22px;
}
.quiz-complete-score {
  margin: 0 0 16px;
  font-weight: 900;
}
.quiz-restart {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #03111f;
  background: var(--gold);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}
.quiz-answer {
  display: none !important;
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 10px;
  color: var(--muted);
  font-size: 14px;
}
.quiz-answer summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 900;
}
.notes-empty {
  color: var(--muted);
  line-height: 1.55;
}
.locked-preview-box {
  border: 1px solid rgba(247, 201, 72, .38);
  border-radius: 8px;
  padding: 16px;
  background: rgba(247, 201, 72, .1);
}
.locked-preview-box h3 {
  margin: 0 0 10px;
  font-size: 22px;
}
.locked-preview-box p {
  margin: 0 0 12px;
}
.locked-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.notes-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-top: 14px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,.1);
}

/* Light theme overrides */
body {
  color: #182434;
  background:
    linear-gradient(180deg, #f7faf7 0%, #eef5ef 52%, #e5f0eb 100%);
}
body::before {
  background:
    linear-gradient(180deg, rgba(25, 78, 94, .05), rgba(201, 147, 56, .08)),
    repeating-linear-gradient(90deg, rgba(32, 58, 67, .05) 0 1px, transparent 1px 76px);
}
.library-shell::after {
  background: linear-gradient(180deg, rgba(35, 94, 77, .08), rgba(255, 255, 255, 0));
}
.kicker,
.notes-kicker {
  color: #1e7463;
}
.intro,
.folder-info p,
.tile-copy span,
.notes-empty {
  color: rgba(24, 36, 52, .68);
}
.hero-pill {
  border-color: rgba(31, 111, 95, .18);
  color: #1b2f2b;
  background: rgba(255,255,255,.72);
}
.hero-action.secondary {
  border-color: rgba(31, 111, 95, .22);
  color: #1f3a34;
  background: rgba(255,255,255,.78);
}
.hero-note {
  color: rgba(24, 36, 52, .68);
}
.stat,
.browser,
.tile,
.modal-inner {
  border-color: rgba(33, 54, 64, .12);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 22px 70px rgba(23, 51, 60, .14);
}
.stat span {
  color: #1b2f2b;
}
.browser-bar,
.modal-bar {
  border-color: rgba(33, 54, 64, .1);
  background: rgba(246, 250, 246, .92);
}
.crumb,
.count-pill {
  border-color: rgba(33, 54, 64, .15);
  background: rgba(255, 255, 255, .86);
  color: #182434;
}
.crumb.active {
  color: #fff;
  background: #1f6f5f;
  border-color: #1f6f5f;
}
.search {
  color: #182434;
  background: #fff;
  border-color: rgba(33, 54, 64, .18);
}
.sound-toggle {
  color: #1b2f2b;
  border-color: rgba(33, 54, 64, .14);
  background: rgba(255, 255, 255, .86);
}
.sound-toggle[aria-pressed="true"] {
  color: #03111f;
  background: #f7c948;
}
.search::placeholder {
  color: rgba(24, 36, 52, .46);
}
.cover,
.loader {
  background:
    linear-gradient(145deg, rgba(231, 240, 230, .94), rgba(255, 255, 255, .78)),
    linear-gradient(135deg, #dfeadf, #f7faf7);
}
.tile-copy {
  background: rgba(255, 255, 255, .9);
}
.open-btn,
.tool-btn,
.close,
.notes-link {
  color: #fff;
  border-color: rgba(31, 111, 95, .2);
  background: #1f6f5f;
}
.note-status {
  color: #fff;
  background: #b17818;
}
.modal {
  background: rgba(17, 29, 37, .72);
}
.modal-image-wrap {
  background: rgba(234, 239, 235, .74);
}
.notes-panel {
  border-color: rgba(33, 54, 64, .12);
  background: #fff;
}
.notes-panel p,
.notes-panel li {
  color: rgba(24, 36, 52, .78);
}
.notes-panel code {
  border-color: rgba(33, 54, 64, .14);
  background: rgba(31, 111, 95, .08);
}
.content-tab {
  color: #1b2f2b;
  border-color: rgba(33, 54, 64, .12);
  background: rgba(31, 111, 95, .06);
}
.content-tab.active {
  color: #fff;
  background: #1f6f5f;
}
.quiz-meta span,
.quiz-card {
  border-color: rgba(33, 54, 64, .12);
  background: rgba(31, 111, 95, .05);
}
.quiz-card.correct {
  border-color: rgba(31, 111, 95, .38);
  background: rgba(82, 224, 163, .16);
}
.quiz-card.wrong {
  border-color: rgba(170, 62, 62, .3);
  background: rgba(224, 82, 82, .1);
}
.quiz-choice {
  color: #182434;
  border-color: rgba(33, 54, 64, .14);
  background: #fff;
}
.quiz-choice:hover,
.quiz-choice:focus-visible {
  border-color: rgba(31, 111, 95, .42);
}
.quiz-choice.answer-correct,
.quiz-choice.selected-correct {
  color: #0c3328;
  border-color: rgba(31, 111, 95, .42);
  background: rgba(82, 224, 163, .2);
}
.quiz-choice.selected-wrong {
  color: #4f1515;
  border-color: rgba(170, 62, 62, .34);
  background: rgba(224, 82, 82, .13);
}
.quiz-complete {
  border-color: rgba(31, 111, 95, .22);
  background: rgba(82, 224, 163, .14);
}
.quiz-meta span,
.quiz-answer,
.quiz-feedback,
.quiz-progress {
  color: rgba(24, 36, 52, .72);
}
.quiz-answer {
  border-color: rgba(33, 54, 64, .1);
}
.quiz-answer summary {
  color: #1f6f5f;
}
.empty {
  color: rgba(24, 36, 52, .65);
  border-color: rgba(31, 111, 95, .24);
  background: rgba(255, 255, 255, .62);
}

@media (max-width: 760px) {
  .library-shell { padding: 30px 14px 18px; }
  .library-top { grid-template-columns: 1fr; align-items: start; }
  .brand-head { align-items: flex-start; gap: 12px; }
  .hero-action { width: 100%; }
  .library-stats { min-width: 0; }
  .browser-bar, .folder-info { align-items: stretch; flex-direction: column; }
  .browser-tools { width: 100%; align-items: stretch; flex-direction: column; }
  .sound-toggle { width: 100%; }
  .access-banner { align-items: stretch; flex-direction: column; }
  .access-actions { justify-content: stretch; }
  .access-btn { width: 100%; }
  .folder-cta { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .folder-counts { justify-content: flex-start; }
  .shelf { padding-inline: 14px; }
  .rail { grid-template-columns: 1fr; }
  .quiz-one-at-a-time .quiz-card { min-height: 0; }
  .tile { min-height: 326px; }
  .cover, .folder-icon { height: 224px; }
  .tile::after { top: 224px; }
  .viewer-layout { grid-template-columns: 1fr; height: calc(100vh - 116px); max-height: calc(100vh - 116px); }
  .notes-panel { border-left: 0; border-top: 1px solid rgba(255,255,255,.14); }
}
@media (prefers-reduced-motion: reduce) {
  .tile {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
    transition: none;
  }
  .quiz-one-at-a-time .quiz-card,
  .quiz-complete.active {
    animation: none !important;
  }
  .loader, .loader::before { animation: none; }
}
