/* Agenda user manual pages. Palette from the app's DESIGN.md:
   accent #FFB500, paper #FEFBF5, text #1A1A1A / #5C5A56. */

.manual-page {
	font-family: "Avenir Next", "Muli", "Helvetica Neue", sans-serif;
	/* main_v12.css sets a 24px/300-weight marketing style; use a reading
	   size and weight here. */
	font-size: 17px;
	font-weight: 400;
	color: #1A1A1A;
	background: #FEFBF5;
	max-width: 46em;
	margin: 0 auto;
	padding: 0 1.25em 3em;
	line-height: 1.6;
}

body:has(.manual-page) {
	background: #FEFBF5;
}

.manual-header {
	display: flex;
	align-items: center;
	gap: 1em;
	padding: 1.1em 0 0.9em;
	border-bottom: 2px solid #FFB500;
	margin-bottom: 1.5em;
	position: sticky;
	top: 0;
	background: #FEFBF5;
	z-index: 50;
}

.manual-jump {
	position: relative;
	margin-left: auto;
}

.manual-search-button {
	background: none;
	border: none;
	color: #B87E00;
	cursor: pointer;
	padding: 0.3em;
	line-height: 1;
}

.manual-search-button svg {
	width: 18px;
	height: 18px;
	display: block;
}

.manual-search-button:hover {
	color: #1A1A1A;
}

.manual-search-overlay {
	position: fixed;
	inset: 0;
	background: rgba(26, 26, 26, 0.35);
	z-index: 100;
	padding: 9vh 1em 0;
}

.manual-search-panel {
	max-width: 34em;
	margin: 0 auto;
	background: #FFFDF8;
	border: 1px solid #E8E2D6;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

.manual-search-input {
	width: 100%;
	box-sizing: border-box;
	border: none;
	outline: none;
	background: transparent;
	font: inherit;
	font-size: 1.1em;
	color: #1A1A1A;
	padding: 0.85em 1em;
	border-bottom: 2px solid #FFB500;
}

.manual-search-results {
	max-height: 55vh;
	overflow-y: auto;
}

.manual-search-results:not(:empty) {
	padding: 0.4em 0;
}

.manual-search-hit {
	display: block;
	padding: 0.45em 1em;
	color: #1A1A1A;
	text-decoration: none;
	font-size: 0.95em;
}

.manual-search-hit:hover {
	background: #F6F0E4;
}

.manual-search-page {
	font-weight: 600;
}

.manual-search-chapter {
	color: #5C5A56;
	font-size: 0.9em;
}

.manual-search-none {
	padding: 0.7em 1em;
	color: #5C5A56;
}

.manual-jump summary {
	list-style: none;
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 600;
	color: #1A1A1A;
	padding: 0.45em 0.8em;
	border: 1px solid #E0C583;
	border-radius: 6px;
	white-space: nowrap;
	user-select: none;
}

.manual-jump summary::-webkit-details-marker { display: none; }

.manual-jump summary::after {
	content: " ▾";
	color: #B87E00;
}

.manual-jump-icon {
	vertical-align: -0.15em;
	margin-right: 0.45em;
	color: #B87E00;
}

.manual-jump[open] summary {
	background: #F6F0E4;
}

.manual-jump-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 0.5em);
	background: #FFFDF8;
	border: 1px solid #E8E2D6;
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	min-width: 16em;
	max-width: 22em;
	max-height: 60vh;
	overflow-y: auto;
	padding: 0.7em 1em;
	font-size: 0.9em;
}

.manual-jump-panel ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.manual-jump-panel ul ul {
	padding-left: 1em;
	font-size: 0.93em;
}

.manual-jump-panel li {
	margin: 0.15em 0;
}

.manual-jump-panel a {
	color: #1A1A1A;
	text-decoration: none;
	display: block;
	padding: 0.22em 0.3em;
	border-radius: 4px;
}

.manual-jump-panel a:hover {
	background: #F6F0E4;
	color: #B87E00;
}

.manual-header .manual-home img {
	height: 34px;
	display: block;
}

.manual-header .manual-title {
	font-weight: 600;
	font-size: 1.05em;
	color: #1A1A1A;
	text-decoration: none;
	flex: 1;
}

.manual-header .manual-pdf {
	background: #FFB500;
	color: #1A1A1A;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9em;
	padding: 0.45em 0.9em;
	border-radius: 6px;
	white-space: nowrap;
}

/* Jumped-to headings must not hide beneath the sticky header. rem, not em:
   an em offset scales with the heading's own size, so small headings would
   get less clearance than the bar is tall. Measured bar: ~77px desktop. */
.manual-chapter h1, .manual-chapter h2, .manual-chapter h3, .manual-chapter h4 {
	scroll-margin-top: 6rem;
}

.manual-chapter h1 {
	font-size: 2em;
	font-weight: 600;
	line-height: 1.25;
	margin: 0.6em 0 0.5em;
}

.manual-chapter h2 {
	font-size: 1.4em;
	font-weight: 600;
	margin-top: 1.6em;
}

.manual-chapter h3 {
	font-size: 1.1em;
	font-weight: 500;
	color: #5C5A56;
	margin-top: 1.3em;
}

.manual-chapter img {
	max-width: 100%;
	height: auto;
	border: 1px solid #E8E2D6;
	border-radius: 8px;
	display: block;
	margin: 1.2em auto;
}

.manual-chapter p {
	margin: 0.8em 0;
}

/* The site's global reset strips list styling; restore it for manual prose. */
.manual-chapter ul {
	list-style: disc;
	padding-left: 1.6em;
	margin: 0.8em 0;
}

.manual-chapter ol {
	list-style: decimal;
	padding-left: 1.6em;
	margin: 0.8em 0;
}

.manual-chapter li {
	margin: 0.45em 0;
	line-height: 1.45;
	padding-left: 0.2em;
}

/* Small, amber markers make the steps easier to scan than full-size
   black bullets and numbers. */
.manual-chapter ul li::marker {
	color: #E5A300;
	font-size: 0.7em;
}

.manual-chapter ol li::marker {
	color: #B87E00;
	font-size: 0.85em;
	font-weight: 600;
}

.manual-chapter li > ul, .manual-chapter li > ol {
	margin: 0.2em 0;
}

.manual-chapter blockquote {
	border-left: 3px solid #FFB500;
	margin: 1em 0;
	padding: 0.1em 1em;
	color: #5C5A56;
}

.manual-chapter table {
	border-collapse: collapse;
	width: 100%;
	margin: 1.2em 0;
	font-size: 0.95em;
	display: block;
	overflow-x: auto;
}

.manual-chapter th, .manual-chapter td {
	border: 1px solid #D8D4CC;
	padding: 0.4em 0.7em;
	text-align: left;
}

.manual-chapter th {
	background: #F6F0E4;
}

.manual-chapter code {
	background: #F6F0E4;
	border-radius: 4px;
	padding: 0.1em 0.35em;
	font-size: 0.92em;
}

.manual-chapter pre {
	background: #F6F0E4;
	border-radius: 8px;
	padding: 0.9em 1.1em;
	overflow-x: auto;
}

.manual-chapter pre code {
	background: none;
	padding: 0;
}

.manual-chapter a {
	color: #B87E00;
}

.manual-toc {
	padding-left: 1.4em;
}

.manual-toc li {
	margin: 0.35em 0;
}

.manual-toc a, .manual-languages a {
	color: #1A1A1A;
	text-decoration: none;
	border-bottom: 1px solid #FFB500;
}

.manual-languages {
	list-style: none;
	padding: 0;
	columns: 3;
}

.manual-languages li {
	margin: 0.4em 0;
}

.manual-pagenav {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	margin: 2.5em 0 1.5em;
	font-weight: 600;
}

.manual-pagenav a {
	color: #1A1A1A;
	text-decoration: none;
}

.manual-pagenav a:hover {
	color: #B87E00;
}

.manual-langbar {
	border-top: 1px solid #E8E2D6;
	padding-top: 1em;
	font-size: 0.85em;
	color: #5C5A56;
	line-height: 2;
}

.manual-langbar a {
	color: #5C5A56;
	margin-right: 0.7em;
	white-space: nowrap;
}

/* Dark mode: follow the system setting. Amber accent stays; surfaces and
   text invert to Agenda's dark-theme feel. */
@media (prefers-color-scheme: dark) {
	.manual-page, body:has(.manual-page) {
		background: #1E1D1B;
		color: #E8E6E1;
	}
	.manual-header {
		background: #1E1D1B;
	}
	/* The wordmark PNG is black text + amber bar; invert flips the text to
	   white and the hue-rotate turns the (now blue) bar back to amber. */
	.manual-header .manual-home img {
		filter: invert(1) hue-rotate(180deg);
	}
	.manual-header .manual-title, .manual-jump summary {
		color: #E8E6E1;
	}
	.manual-jump summary { border-color: #4A4436; }
	.manual-jump[open] summary { background: #2A2825; }
	.manual-jump-panel {
		background: #262421;
		border-color: #3A3833;
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
	}
	.manual-jump-panel a { color: #E8E6E1; }
	.manual-jump-panel a:hover { background: #33302B; color: #FFB500; }
	.manual-search-button { border-color: #4A4436; }
	.manual-search-overlay { background: rgba(0, 0, 0, 0.55); }
	.manual-search-panel { background: #262421; border-color: #3A3833; }
	.manual-search-input { color: #E8E6E1; }
	.manual-search-hit { color: #E8E6E1; }
	.manual-search-hit:hover { background: #33302B; }
	.manual-search-chapter, .manual-search-none { color: #A5A29B; }
	.manual-header .manual-pdf { color: #1A1A1A; }
	.manual-chapter h1, .manual-chapter h2 { color: #E8E6E1; }
	.manual-chapter h3 { color: #A5A29B; }
	.manual-chapter a { color: #E5A300; }
	.manual-chapter blockquote { color: #A5A29B; }
	.manual-chapter img {
		border-color: #3A3833;
		/* Light-UI screenshots glare on a dark page; dim them slightly and
		   restore full brightness on hover for a closer look. */
		filter: brightness(0.78);
		transition: filter 0.15s ease;
	}
	.manual-chapter img:hover { filter: brightness(1); }
	.manual-chapter code, .manual-chapter pre { background: #2A2825; }
	.manual-chapter th { background: #2A2825; }
	.manual-chapter th, .manual-chapter td { border-color: #3A3833; }
	.manual-toc a, .manual-languages a { color: #E8E6E1; }
	.manual-pagenav a { color: #E8E6E1; }
	.manual-pagenav a:hover { color: #FFB500; }
	.manual-langbar { border-color: #3A3833; color: #A5A29B; }
	.manual-langbar a { color: #A5A29B; }
}

@media (max-width: 600px) {
	.manual-page { font-size: 16px; }
	.manual-languages { columns: 2; }
	.manual-header { flex-wrap: wrap; gap: 0.7em; padding-top: 0.8em; }
	.manual-header .manual-home img { height: 26px; }
	.manual-header .manual-title { font-size: 0.95em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
	.manual-header .manual-pdf { flex-basis: 60%; flex-grow: 1; text-align: center; }
	.manual-jump { margin-left: 0; }
	/* Icon-only, borderless buttons on small screens. */
	.manual-jump-text { display: none; }
	.manual-jump-icon { margin-right: 0; width: 18px; height: 18px; display: block; }
	.manual-jump summary::after { content: ""; }
	.manual-jump summary { padding: 0.3em; border: none; }
	.manual-jump[open] summary { background: none; }
	.manual-jump-panel { position: fixed; left: 1em; right: 1em; max-width: none; top: 8em; }
	/* Measured two-row mobile bar: ~115px. */
	.manual-chapter h1, .manual-chapter h2, .manual-chapter h3, .manual-chapter h4 {
		scroll-margin-top: 8.5rem;
	}
	.manual-chapter h1 { font-size: 1.55em; }
	.manual-pagenav { flex-direction: column; gap: 0.6em; }
	.manual-pagenav .next { text-align: right; }
}
