.tbs-course-textbook {
	margin: 1.5rem 0 2rem;
	padding: 1.25rem;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.tbs-course-textbook__title {
	margin: 0 0 0.5rem;
	font-size: 1.35rem;
	color: #1a365d;
}

.tbs-course-textbook__intro {
	margin: 0 0 1rem;
	color: #4a5568;
	font-size: 0.95rem;
}

.tbs-textbook-viewer {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	width: 100%;
}

.tbs-textbook-viewer__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	background: #fff;
	border: 1px solid #cbd5e0;
	border-radius: 6px;
}

.tbs-textbook-viewer__btn {
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.5rem;
	border: 1px solid #cbd5e0;
	border-radius: 4px;
	background: #edf2f7;
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
}

.tbs-textbook-viewer__btn:hover {
	background: #e2e8f0;
}

.tbs-textbook-viewer__page {
	min-width: 4.5rem;
	text-align: center;
	font-size: 0.9rem;
	color: #2d3748;
}

.tbs-textbook-viewer__download {
	margin-left: auto;
	padding: 0.35rem 0.75rem;
	font-size: 0.85rem;
	text-decoration: none;
	color: #fff;
	background: #2b6cb0;
	border-radius: 4px;
}

.tbs-textbook-viewer__download:hover {
	background: #2c5282;
	color: #fff;
}

.tbs-textbook-viewer__canvas-wrap {
	position: relative;
	overflow: auto;
	min-height: min(70vh, 720px);
	max-height: 92vh;
	background: #718096;
	border-radius: 6px;
	text-align: center;
}

.tbs-textbook-viewer--compact .tbs-textbook-viewer__canvas-wrap {
	min-height: min(62vh, 640px);
	max-height: 88vh;
}

.tbs-textbook-viewer__canvas {
	display: block;
	margin: 0 auto;
	max-width: 100%;
	height: auto;
}

.tbs-textbook-viewer__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	color: #fff;
	font-size: 1rem;
	background: rgba(45, 55, 72, 0.6);
}

.tbs-textbook-viewer.is-ready .tbs-textbook-viewer__loading {
	display: none;
}

@media (max-width: 640px) {
	.tbs-textbook-viewer__toolbar {
		justify-content: center;
	}

	.tbs-textbook-viewer__download {
		margin-left: 0;
		width: 100%;
		text-align: center;
	}

	.tbs-textbook-viewer__canvas-wrap {
		min-height: 55vh;
		max-height: 80vh;
	}
}

@media (max-width: 640px) {
  .tbs-textbook-viewer:not(.is-ready) .tbs-textbook-viewer__canvas-wrap {
    min-height: 16rem;
    max-height: 70vh;
  }

  .tbs-course-textbook {
    margin-top: 1rem;
  }
}
