html {
	font-size: 14px;
	position: relative;
	min-height: 100%;
}

@media (min-width: 768px) {
	html {
		font-size: 16px;
	}
}

body {
	margin-bottom: 60px;
	padding-top: 80px;
}

/* Bootstrap focus behavior */

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
	box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
	color: var(--bs-secondary-color);
	text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
	text-align: start;
}

/* Navbar */

.eotu-navbar-brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.eotu-navbar-logo {
	width: 28px;
	height: 28px;
	object-fit: contain;
}

/* Main page width */

.eotu-main-container {
	width: 100%;
	padding-left: 5rem;
	padding-right: 5rem;
}

/* EOTU general page elements */

.eotu-hero {
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

.eotu-subtitle {
	color: green;
}

.eotu-section {
	margin-top: 1.5rem;
	margin-bottom: 1.5rem;
}

.section-heading {
	font-size: 1.05rem;
	font-weight: 600;
	margin-top: 1.5rem;
	margin-bottom: 0.35rem;
}

.eotu-author {
	margin-top: 1.75rem;
}

.eotu-closing-line {
	margin-top: 1.5rem;
	font-weight: 600;
}

/* Two-column page layout with left section navigation */

.eotu-page-layout {
	display: grid;
	grid-template-columns: 300px minmax(0, 1fr);
	gap: 1.5rem;
	align-items: start;
}

.eotu-sidebar {
	min-width: 0;
}

.eotu-page-content {
	min-width: 0;
}

.eotu-side-nav {
	position: sticky;
	top: 5rem;
	align-self: start;
	padding: 1rem;
	border-radius: 0.75rem;
	background: #f8f9fa;
	border: 1px solid #e5e5e5;
}

.eotu-side-nav-title {
	font-weight: 700;
	margin-bottom: 0.75rem;
	color: #222;
}

.eotu-side-nav a {
	display: block;
	padding: 0.35rem 0;
	text-decoration: none;
	color: #222;
	line-height: 1.35;
}

	.eotu-side-nav a:hover {
		text-decoration: underline;
	}

.eotu-side-nav .active {
	font-weight: 700;
	color: #000;
}
.eotu-page-next-nav {
	display: flex;
	justify-content: flex-start;
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid #d6d6d6;
}

.eotu-next-page-link {
	display: block;
	width: 100%;
	max-width: 460px;
	padding: 1rem 1.25rem;
	border: 2px solid #222;
	border-radius: 0.75rem;
	background: #f8f9fa;
	color: #111;
	text-decoration: none;
	line-height: 1.35;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

	.eotu-next-page-link:hover {
		background: #eeeeee;
		color: #000;
		text-decoration: none;
		transform: translateY(-1px);
	}

.eotu-page-next-nav-label {
	display: block;
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #555;
	margin-bottom: 0.35rem;
}

.eotu-page-next-nav-title {
	display: block;
	font-size: 1.1rem;
	font-weight: 800;
}

.eotu-page-layout + .eotu-page-next-nav {
	margin-left: calc(320px + 1.5rem);
}

/* Figures */
.figure-grid > * {
	min-width: 0;
}

.figure-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.5rem;
	align-items: start;
	margin-top: 1rem;
}

	.figure-grid figure {
		margin: 0;
		padding: 0.75rem;
		border: 1px solid #ddd;
		border-radius: 6px;
		background-color: #fff;
	}

	.figure-grid img {
		width: 100%;
		height: auto;
		display: block;
	}
		/* Small technical diagram image inside figure grids */
		.figure-grid img.eotu-figure-small-img,
		.eotu-figure img.eotu-figure-small-img {
			display: block;
			width: 320px;
			max-width: 100%;
			height: auto;
			margin: 0 auto;
			object-fit: contain;
		}

	.figure-grid figcaption {
		margin-top: 0.6rem;
		font-size: 0.9rem;
		line-height: 1.35;
		color: #444;
	}
/* Standard single figure */

.eotu-figure {
	margin: 1.5rem 0 2rem 0;
	padding: 0.75rem;
	border: 1px solid #ddd;
	border-radius: 0.5rem;
	background: #fff;
}

	.eotu-figure img {
		display: block;
		width: 100%;
		max-width: 1100px;
		height: auto;
		max-height: 640px;
		object-fit: contain;
		margin: 0 auto;
		border-radius: 0.25rem;
	}

	.eotu-figure figcaption {
		margin-top: 0.75rem;
		font-size: 0.95rem;
		line-height: 1.35;
		color: #555;
		text-align: center;
	}


/* Quotes, summaries, and interpretation boxes */

.eotu-quote {
	margin: 1rem 0 1.5rem 0;
	padding: 1rem 1.25rem;
	border-left: 4px solid #444;
	background-color: #f8f8f8;
	font-size: 1.05rem;
	line-height: 1.5;
}

	.eotu-quote span {
		display: inline-block;
		margin-top: 0.5rem;
		font-size: 0.95rem;
		color: #555;
	}

.eotu-summary-box {
	margin-top: 1rem;
	padding: 1rem 1.25rem;
	border: 1px solid #d8e6d8;
	border-left: 4px solid green;
	border-radius: 6px;
	background-color: #f7fbf7;
}

	.eotu-summary-box h4 {
		margin-top: 0;
		margin-bottom: 0.5rem;
		font-size: 1rem;
		font-weight: 600;
	}

	.eotu-summary-box ul {
		margin-bottom: 0;
	}

.eotu-interpretation-box {
	margin-top: 1.25rem;
	padding: 1rem 1.25rem;
	border: 1px solid #ddd;
	border-left: 4px solid #555;
	border-radius: 6px;
	background-color: #fafafa;
}

	.eotu-interpretation-box h4 {
		margin-top: 0;
		margin-bottom: 0.5rem;
		font-size: 1rem;
		font-weight: 600;
	}

/* Equations */

.eotu-equation {
	margin: 1rem 0;
	padding: 0.75rem 1rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	background-color: #fafafa;
	text-align: center;
	overflow-x: auto;
}

	.eotu-equation mjx-container {
		margin: 0 !important;
	}

.eotu-equation-small {
	font-size: 0.92rem;
}

.eotu-equation-line {
	text-align: center;
	margin: 1rem 0;
	overflow-x: auto;
}

/* Ledger tables */

.ledger-table-wrapper {
	width: 100%;
	overflow-x: auto;
	margin-top: 1rem;
}

.ledger-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	background-color: #fff;
}

	.ledger-table th,
	.ledger-table td {
		vertical-align: top;
		padding: 0.65rem 0.75rem;
		border: 1px solid #ddd;
		line-height: 1.45;
		font-size: 0.95rem;
	}

	.ledger-table th {
		background: #f2f2f2;
		font-weight: 700;
	}

	.ledger-table td {
		overflow-wrap: anywhere;
	}

	.ledger-table mjx-container {
		margin: 0 !important;
		max-width: 100%;
		overflow-x: auto;
		overflow-y: hidden;
	}

/* Compact ledger variant */

.ledger-table-compact {
	table-layout: auto;
}

	.ledger-table-compact th,
	.ledger-table-compact td {
		padding: 0.5rem 0.65rem;
		line-height: 1.35;
		font-size: 0.92rem;
		height: auto;
		min-height: 0;
	}

		.ledger-table-compact th:nth-child(1),
		.ledger-table-compact td:nth-child(1) {
			width: 16%;
		}

		.ledger-table-compact th:nth-child(2),
		.ledger-table-compact td:nth-child(2) {
			width: 24%;
		}

	.ledger-table-compact mjx-container {
		margin: 0 !important;
		padding: 0 !important;
		line-height: 1.2 !important;
	}

.derived-value-cell div {
	margin-bottom: 0.2rem;
	white-space: nowrap;
}

/* Discovery highlights */

.discovery-highlight-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.discovery-highlight-card {
	display: block;
}

	.discovery-highlight-card h4 {
		margin-bottom: 0.5rem;
	}

	.discovery-highlight-card p {
		margin-bottom: 0.75rem;
	}

/* Document cards and lists */

.document-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-top: 1rem;
}

	.document-list.two-column {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

.eotu-described-list {
	margin-top: 1rem;
	padding-left: 1.5rem;
}

	.eotu-described-list li {
		margin-bottom: 0.75rem;
		line-height: 1.55;
	}

.document-card {
	display: block;
	padding: 1rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	background-color: #fff;
	color: inherit;
	text-decoration: none;
}

	.document-card:hover {
		color: inherit;
		text-decoration: none;
	}

	.document-card h3,
	.document-card h4 {
		color: inherit;
		text-decoration: none;
		margin-top: 0;
		margin-bottom: 0.5rem;
		font-size: 1rem;
		font-weight: 600;
	}

	.document-card p {
		color: inherit;
		text-decoration: none;
		font-size: 0.95rem;
		line-height: 1.45;
		margin-bottom: 0;
	}

	.document-card:hover h3,
	.document-card:hover h4,
	.document-card:hover p {
		text-decoration: none;
	}

/* Document card states */

.document-card-released {
	border-left: 4px solid green;
	background-color: #ffffff;
}

	.document-card-released h4 {
		color: #000;
	}

	.document-card-released:hover {
		background-color: #f7fbf7;
		border-color: #198754;
	}

.document-card-muted {
	background-color: #f8f9fa;
	border-left: 4px solid #d6d6d6;
}

	.document-card-muted h4,
	.document-card-muted p:not(.document-status) {
		color: #666;
	}

.document-card p.document-status {
	font-size: 0.85rem;
	font-weight: 600;
	margin-top: 0.35rem;
	margin-bottom: 0;
	color: #8a4b00;
}

/* Legacy chapter navigation, used only if a page still has horizontal previous/next chapter links */

.chapter-nav {
	margin: 1rem 0 1.75rem 0;
	padding: 0.75rem 1rem;
	border: 1px solid #ddd;
	border-radius: 6px;
	background-color: #fafafa;
	text-align: center;
	font-size: 0.95rem;
}

	.chapter-nav a {
		margin: 0 0.35rem;
		text-decoration: none;
		font-weight: 500;
	}

		.chapter-nav a:hover {
			text-decoration: underline;
		}

	.chapter-nav span {
		color: #aaa;
	}

	.chapter-nav a.active {
		font-weight: 700;
		color: green;
	}

/* Revision log */

.revision-log-table {
	table-layout: auto;
	width: 100%;
}

	.revision-log-table th,
	.revision-log-table td {
		vertical-align: top;
	}

		.revision-log-table th:nth-child(1),
		.revision-log-table td:nth-child(1) {
			white-space: nowrap;
			width: 8rem;
		}

		.revision-log-table th:nth-child(2),
		.revision-log-table td:nth-child(2) {
			white-space: nowrap;
			width: 11rem;
		}

		.revision-log-table th:nth-child(3),
		.revision-log-table td:nth-child(3) {
			white-space: nowrap;
			width: 10rem;
		}

		.revision-log-table th:nth-child(4),
		.revision-log-table td:nth-child(4) {
			min-width: 24rem;
		}

		.revision-log-table th:nth-child(5),
		.revision-log-table td:nth-child(5) {
			white-space: nowrap;
			width: 10rem;
		}

/* Responsive behavior */

@media (max-width: 900px) {
	.eotu-main-container {
		padding-left: 1rem;
		padding-right: 1rem;
	}

	.eotu-page-layout {
		display: block;
	}

	.eotu-sidebar {
		margin-bottom: 1.5rem;
	}

	.eotu-side-nav {
		position: static;
	}

	.discovery-highlight-list {
		grid-template-columns: 1fr;
	}

	.ledger-table {
		min-width: 850px;
	}
}

@media (max-width: 900px) {
	.eotu-page-layout {
		display: block;
	}

	.eotu-sidebar {
		display: none;
	}

	.eotu-page-content {
		width: 100%;
	}

	.eotu-side-nav {
		position: static;
	}

	.eotu-page-layout + .eotu-page-next-nav {
		margin-left: 0;
	}
}

@media (max-width: 700px) {
	.eotu-page-next-nav {
		display: block;
	}

		.eotu-page-next-nav a {
			max-width: 100%;
			margin-bottom: 0.75rem;
		}
}

@media (max-width: 768px) {
	.figure-grid {
		grid-template-columns: 1fr;
	}

	.document-list.two-column {
		grid-template-columns: 1fr;
	}

	.ledger-table th,
	.ledger-table td {
		font-size: 0.9rem;
		padding: 0.55rem 0.65rem;
	}

	.chapter-nav {
		text-align: left;
		line-height: 1.8;
	}

		.chapter-nav a {
			display: inline-block;
		}
}
