/* ==========================================================================
   DengeCudi — History page overhaul (loaded after king-history.css)
   - compact hero (text + map side by side)
   - era sidebar instead of the floating "Table of contents" box
   - one-column timeline with horizontal cards (~3x shorter page)
   - neutral controls in line with the rest of the site
   ========================================================================== */

body .king-history-page {
	background: transparent;
	--hx-text: #0d0c22;
	--hx-body: #3f4350;
	--hx-muted: #6b6f7b;
	--hx-line: #e7e8ec;
	--hx-soft: #f3f4f7;
	--hx-surface: #fff;
	--hx-hover: #eceef2;
	--hx-accent: #0d0c22;
	--hx-accent-ink: #fff;
	--hx-rail: #d4d7de;
	--hx-major: #d63e3d;
	--hx-battle: #b91c1c;
	--hx-treaty: #b45309;
	--hx-person: #2563eb;
	--hx-dynasty: #059669;
	--hx-map: #0891b2;
	--hx-minor: #9aa0ad;
	max-width: 1440px;
	margin: 0 auto;
	padding: 24px 2% 48px;
}
html.king-night body .king-history-page {
	--hx-text: #f5f5f7;
	--hx-body: #c9cbd3;
	--hx-muted: #9a9ea9;
	--hx-line: #2c2c37;
	--hx-soft: #24242e;
	--hx-surface: #1b1b23;
	--hx-hover: #2e2e3a;
	--hx-accent: #f5f5f7;
	--hx-accent-ink: #0d0c22;
	--hx-rail: #33333f;
	--hx-battle: #f87171;
	--hx-treaty: #fbbf24;
	--hx-person: #60a5fa;
	--hx-dynasty: #34d399;
	--hx-map: #22d3ee;
	--hx-minor: #6b6f7b;
}

/* ---------- Hero ---------- */
body .king-history-page .king-history-hero {
	display: block;
	max-width: none;
	width: auto;
	margin: 0 0 18px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
body .king-history-page .king-history-hero::before,
body .king-history-page .king-history-hero .king-body-search-particles { display: none; }
body .king-history-page .king-history-hero-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	align-items: center;
	gap: 40px;
	text-align: left;
}
body .king-history-page .king-history-hero-copy { max-width: 560px; }
body .king-history-page .king-history-hero-copy::before {
	content: "History";
	display: block;
	margin: 0 0 10px;
	font-size: 12.5px;
	font-weight: 650;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--hx-muted);
}
body .king-history-page .king-history-hero h1,
body .king-history-page .king-history-hero-copy h1 {
	margin: 0;
	font-size: clamp(32px, 1.2rem + 2.2vw, 52px);
	line-height: 1.05;
	font-weight: 800;
	letter-spacing: -.03em;
	color: var(--hx-text);
}
body .king-history-page .king-history-hero h1::after { display: none; }
body .king-history-page .king-history-hero-copy .king-history-lead {
	max-width: 52ch;
	margin: 14px 0 0;
	font-size: 16.5px;
	line-height: 1.6;
	color: var(--hx-muted);
}
body .king-history-page .king-history-hero-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	gap: 10px;
	margin: 24px 0 0;
}
body .king-history-page .king-history-hero-action {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 44px;
	padding: 0 18px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: var(--hx-surface);
	color: var(--hx-text);
	font-size: 14.5px;
	font-weight: 650;
	box-shadow: none;
	transform: none;
	transition: background-color .15s ease, border-color .15s ease;
}
body .king-history-page .king-history-hero-action:hover {
	background: var(--hx-hover);
	border-color: var(--hx-hover);
	box-shadow: none;
	transform: none;
}
body .king-history-page .king-history-hero-action:first-child {
	background: var(--hx-accent);
	border-color: var(--hx-accent);
	color: var(--hx-accent-ink);
}
body .king-history-page .king-history-hero-action:first-child:hover { opacity: .88; }
body .king-history-page .king-history-hero-action i { font-size: 13px; }
body .king-history-page .king-history-hero-media {
	width: 100%;
	margin: 0;
	border-radius: 20px;
	overflow: hidden;
	background: var(--hx-soft);
	border: 1px solid var(--hx-line);
	aspect-ratio: 16 / 10;
}
body .king-history-page .king-history-hero-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
/* Era chips under the hero: phones/tablets only (desktop has the sidebar) */
body .king-history-page .king-history-hero-eras {
	justify-content: flex-start;
	max-width: none;
	margin: 18px 0 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
body .king-history-page .king-history-hero-eras-label { display: none; }
body .king-history-page .king-history-hero-eras-list { justify-content: flex-start; }

/* Shared pill style for era buttons (hero + sidebar) */
body .king-history-page .king-history-hero-eras-list button,
body .king-history-page .king-history-toc-list button {
	border: 0;
	background: transparent;
	color: var(--hx-muted);
	font-weight: 600;
	box-shadow: none;
}
body .king-history-page .king-history-hero-eras-list button {
	height: 34px;
	min-height: 34px;
	padding: 0 14px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: var(--hx-surface);
	color: var(--hx-text);
}
body .king-history-page .king-history-hero-eras-list button.is-active,
body .king-history-page .king-history-toc-list button.is-active {
	background: var(--hx-accent);
	border-color: var(--hx-accent);
	color: var(--hx-accent-ink);
	box-shadow: none;
}

/* ---------- Era overview table ---------- */
body .king-history-page .king-history-overview {
	max-width: none;
	width: auto;
	margin: 0 0 22px;
	padding: 20px 22px;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-radius: 18px;
	box-shadow: none;
}
body .king-history-page .king-history-overview h2 {
	text-align: left;
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 750;
	letter-spacing: -.01em;
	color: var(--hx-text);
}
body .king-history-page .king-history-eras-table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
	background: transparent;
	box-shadow: none;
	border: 0;
	font-size: 14px;
}
body .king-history-page .king-history-eras-table th {
	padding: 0 12px 8px 0;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--hx-line);
	color: var(--hx-muted);
	font-size: 12px;
	font-weight: 650;
	letter-spacing: .05em;
	text-transform: uppercase;
	text-align: left;
}
body .king-history-page .king-history-eras-table td {
	padding: 10px 12px 10px 0;
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--hx-line);
	color: var(--hx-body);
}
body .king-history-page .king-history-eras-table tr:last-child td { border-bottom: 0; }
body .king-history-page .king-history-eras-table td:first-child,
body .king-history-page .king-history-eras-table td:first-child a,
body .king-history-page .king-history-eras-table td:first-child button {
	color: var(--hx-text);
	font-weight: 650;
}
body .king-history-page .king-history-eras-table td:nth-child(2) {
	color: var(--hx-muted);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
body .king-history-page .king-history-eras-row { cursor: pointer; }
body .king-history-page .king-history-eras-row:hover td { background: var(--hx-soft); }

/* ---------- Shell: era sidebar + content ---------- */
body .king-history-page .king-history-shell {
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
body .king-history-page .king-history-body { min-width: 0; }

/* Sticky filter bar */
body .king-history-page .king-history-sticky-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	padding: 12px;
	background: color-mix(in srgb, var(--hx-surface) 92%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
	border: 1px solid var(--hx-line);
	border-radius: 16px;
	box-shadow: none;
}
body .king-history-page .king-history-sticky-search {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 260px;
	margin: 0;
}
body .king-history-page .king-history-sticky-search i {
	position: absolute;
	left: 14px;
	color: var(--hx-muted);
	font-size: 14px;
	pointer-events: none;
}
body .king-history-page .king-history-sticky-search input {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 14px 0 38px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: var(--hx-soft);
	box-shadow: none;
	color: var(--hx-text);
	-webkit-text-fill-color: var(--hx-text);
	font-size: 14.5px;
	outline: none;
}
body .king-history-page .king-history-sticky-search input::placeholder { color: var(--hx-muted); -webkit-text-fill-color: var(--hx-muted); opacity: 1; }
body .king-history-page .king-history-sticky-search input:focus {
	background: var(--hx-surface);
	border-color: var(--hx-text);
}
body .king-history-page .king-history-sticky-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
body .king-history-page .king-history-sticky-select {
	height: 40px;
	min-width: 0;
	margin: 0;
	padding: 0 32px 0 14px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background-color: var(--hx-surface);
	box-shadow: none;
	color: var(--hx-text);
	font-size: 14px;
	font-weight: 550;
}
body .king-history-page .king-history-sticky-select:focus { outline: 2px solid var(--hx-text); outline-offset: 1px; }
body .king-history-page .king-history-view-tabs {
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	padding: 3px;
	background: var(--hx-soft);
	border: 0;
	border-radius: 999px;
	overflow-x: auto;
	scrollbar-width: none;
}
body .king-history-page .king-history-view-tabs::-webkit-scrollbar { display: none; }
body .king-history-page .king-history-view-tabs button {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	flex: 0 0 auto;
	height: 34px;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--hx-muted);
	font-size: 13.5px;
	font-weight: 650;
	box-shadow: none;
}
body .king-history-page .king-history-view-tabs button:hover { color: var(--hx-text); background: transparent; }
body .king-history-page .king-history-view-tabs button.is-active {
	background: var(--hx-surface);
	color: var(--hx-text);
	box-shadow: 0 1px 2px rgba(13, 12, 34, .08), 0 1px 6px rgba(13, 12, 34, .06);
}
body .king-history-page .king-history-view-tabs button i,
body .king-history-page .king-history-view-tabs button:hover i,
body .king-history-page .king-history-view-tabs button.is-active i { font-size: 12.5px; color: inherit; }
body .king-history-page .king-history-sticky-results {
	margin-left: auto;
	color: var(--hx-muted);
	font-size: 13px;
	font-variant-numeric: tabular-nums;
}
body .king-history-page .king-history-sticky-results strong,
body .king-history-page .king-history-sticky-results b { color: var(--hx-text); }
body .king-history-page .king-history-sticky-filter-toggle,
body .king-history-page .king-history-sticky-reset {
	height: 36px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: var(--hx-surface);
	color: var(--hx-text);
	box-shadow: none;
}

/* ---------- Timeline: one column, rail on the left ---------- */
body .king-history-page .king-history-timeline {
	display: block;
	position: relative;
	margin: 0;
	padding: 0 0 8px 26px;
}
body .king-history-page .king-history-timeline::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 7px;
	width: 2px;
	transform: none;
	background: var(--hx-rail);
	border-radius: 2px;
}
body .king-history-page .king-history-timeline:has(.king-history-events-table-wrap),
body .king-history-page .king-history-timeline:has(.king-history-dynasty-timeline) { padding-left: 0; }
body .king-history-page .king-history-timeline:has(.king-history-events-table-wrap)::before,
body .king-history-page .king-history-timeline:has(.king-history-dynasty-timeline)::before { content: none; }

/* Era headings: a slim banner */
body .king-history-page .king-history-era-heading {
	position: relative;
	display: flex;
	align-items: flex-end;
	justify-content: flex-start;
	height: 110px;
	min-height: 0;
	margin: 26px 0 14px -26px;
	padding: 0 20px 16px;
	border-radius: 16px;
	overflow: hidden;
	background: var(--hx-text);
	grid-column: auto;
	scroll-margin-top: 150px;
}
body .king-history-page .king-history-timeline > .king-history-era-heading:first-child { margin-top: 0; }
body .king-history-page .king-history-era-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: .8;
	filter: saturate(.9);
	border-radius: 0;
}
body .king-history-page .king-history-era-heading::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgba(10, 10, 20, .78) 0%, rgba(10, 10, 20, .35) 55%, rgba(10, 10, 20, .1) 100%);
}
body .king-history-page .king-history-era-label {
	position: relative;
	z-index: 3;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: #fff;
	font-size: clamp(22px, 1rem + 1vw, 30px);
	font-weight: 800;
	letter-spacing: -.02em;
	text-transform: none;
	line-height: 1.1;
	transform: none;
	left: auto;
	top: auto;
	width: auto;
	text-align: left;
	opacity: 1;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

/* Items */
body .king-history-page .king-history-item {
	display: block;
	position: relative;
	width: auto;
	margin: 0 0 12px;
	padding: 0;
	grid-template-columns: none;
	scroll-margin-top: 150px;
}
body .king-history-page .king-history-item:last-child { margin-bottom: 0; }
body .king-history-page .king-history-marker {
	display: block;
	position: absolute;
	left: -24px;
	top: 24px;
	width: 12px;
	height: 12px;
	margin: 0;
	border: 2px solid var(--hx-surface);
	border-radius: 50%;
	background: var(--hx-type, var(--hx-minor));
	box-shadow: 0 0 0 1px var(--hx-rail);
	transform: none;
	z-index: 2;
}
body .king-history-page .king-history-marker::before,
body .king-history-page .king-history-marker::after { display: none; }
body .king-history-page .king-history-item:hover .king-history-marker { transform: scale(1.2); box-shadow: 0 0 0 1px var(--hx-rail); }

body .king-history-page .king-history-item { --hx-type: var(--hx-minor); }
body .king-history-page .king-history-item.is-card-major { --hx-type: var(--hx-major); }
body .king-history-page .king-history-item.is-card-battle { --hx-type: var(--hx-battle); }
body .king-history-page .king-history-item.is-card-treaty { --hx-type: var(--hx-treaty); }
body .king-history-page .king-history-item.is-card-person { --hx-type: var(--hx-person); }
body .king-history-page .king-history-item.is-card-dynasty { --hx-type: var(--hx-dynasty); }
body .king-history-page .king-history-item.is-card-map-change { --hx-type: var(--hx-map); }

/* Card: text on the left, picture on the right */
body .king-history-page .king-history-item .king-history-card,
body .king-history-page .king-history-item .king-history-card[class*="is-card-"] {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-auto-rows: auto;
	align-content: start;
	column-gap: 22px;
	row-gap: 0;
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 16px 20px;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-left: 1px solid var(--hx-line);
	border-radius: 16px;
	box-shadow: none;
	color: var(--hx-body);
	text-align: left;
	cursor: pointer;
	transform: none;
	transition: border-color .15s ease, box-shadow .2s ease;
}
body .king-history-page .king-history-item .king-history-card::before,
body .king-history-page .king-history-item .king-history-card::after { display: none; }
body .king-history-page .king-history-item .king-history-card:hover {
	border-color: color-mix(in srgb, var(--hx-type) 40%, var(--hx-line));
	box-shadow: 0 10px 28px rgba(13, 12, 34, .07);
	transform: none;
}
body .king-history-page .king-history-item .king-history-card:focus-visible {
	outline: 2px solid var(--hx-text);
	outline-offset: 2px;
}
body .king-history-page .king-history-item .king-history-card:has(.king-history-card-image) {
	grid-template-columns: minmax(0, 1fr) 220px;
}
body .king-history-page .king-history-item .king-history-card > * { grid-column: 1; }
body .king-history-page .king-history-item .king-history-card > .king-history-card-image {
	grid-column: 2;
	grid-row: 1 / span 6;
	align-self: stretch;
	width: 100%;
	height: 100%;
	min-height: 130px;
	max-height: 170px;
	margin: 0;
	object-fit: cover;
	border-radius: 12px;
	background: var(--hx-soft);
}
body .king-history-page .king-history-item .king-history-card-year {
	margin: 0 0 4px;
	color: var(--hx-type);
	font-size: 13px;
	font-weight: 750;
	letter-spacing: .01em;
	font-variant-numeric: tabular-nums;
	line-height: 1.3;
}
body .king-history-page .king-history-item.is-card-minor .king-history-card-year { color: var(--hx-muted); }
/* The era is already shown by the banner above */
body .king-history-page .king-history-item .king-history-card-era { display: none; }
body .king-history-page .king-history-item .king-history-card-title-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0 0 6px;
}
body .king-history-page .king-history-item .king-history-card-title-row h3 {
	margin: 0;
	font-size: 17.5px;
	line-height: 1.3;
	font-weight: 750;
	letter-spacing: -.01em;
	color: var(--hx-text);
}
body .king-history-page .king-history-item.is-card-major .king-history-card-title-row h3 { font-size: 19px; }
body .king-history-page .king-history-item .king-history-title-media { display: none; }
body .king-history-page .king-history-item .king-history-card > p {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin: 0 0 10px;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--hx-muted);
}
body .king-history-page .king-history-item .king-history-card-meta { margin: 0; }
body .king-history-page .king-history-item .king-history-meta-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}
body .king-history-page .king-history-item .king-history-chip,
body .king-history-page .king-history-item .king-history-region {
	display: inline-flex;
	align-items: center;
	height: 24px;
	margin: 0;
	padding: 0 9px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: var(--hx-soft);
	color: var(--hx-body);
	font-size: 11.5px;
	font-weight: 650;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
}
body .king-history-page .king-history-item .king-history-region { background: transparent; color: var(--hx-muted); }
body .king-history-page .king-history-item .king-history-source-note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 10px 0 0;
	color: var(--hx-muted);
	font-size: 12px;
}
body .king-history-page .king-history-item .king-history-source-note i { font-size: 11px; }

/* ---------- Sidebar (desktop): eras next to the timeline ---------- */
@media (min-width: 1200px) {
	body .king-history-page .king-history-shell {
		display: grid;
		grid-template-columns: 210px minmax(0, 1fr);
		align-items: start;
		gap: 28px;
	}
	body .king-history-page .king-history-shell > .king-history-toc,
	body .king-history-page .king-history-shell > .king-history-toc.is-collapsed {
		position: sticky;
		top: 90px;
		right: auto;
		bottom: auto;
		z-index: 1;
		display: block;
		width: auto;
		max-height: calc(100vh - 110px);
		margin: 0;
		padding: 0;
		background: transparent;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		overflow: auto;
	}
	body .king-history-page .king-history-toc .king-history-toc-face,
	body .king-history-page .king-history-toc .king-history-toc-toggle { display: none !important; }
	body .king-history-page .king-history-toc .king-history-toc-inner,
	body .king-history-page .king-history-toc.is-collapsed .king-history-toc-inner { display: flex; gap: 8px; }
	body .king-history-page .king-history-toc-head { padding: 0 12px; }
	body .king-history-page .king-history-toc-title {
		display: block;
		color: var(--hx-muted);
		font-size: 12px;
		font-weight: 650;
		letter-spacing: .06em;
	}
	body .king-history-page .king-history-toc-list { gap: 2px; }
	body .king-history-page .king-history-toc-list button {
		min-height: 36px;
		padding: 8px 12px;
		border-radius: 10px;
		font-size: 14px;
		line-height: 1.3;
	}
	body .king-history-page .king-history-toc-list button:hover:not(.is-active) {
		background: var(--hx-hover);
		color: var(--hx-text);
	}
	body .king-history-page .king-history-hero-eras { display: none; }
}

/* ---------- Below the sidebar breakpoint: keep the floating era button tidy ---------- */
@media (max-width: 1199px) {
	body .king-history-page .king-history-toc {
		background: var(--hx-surface);
		border: 1px solid var(--hx-line);
		box-shadow: 0 10px 30px rgba(13, 12, 34, .12);
	}
	body .king-history-page .king-history-toc-list button { border-radius: 10px; }
	body .king-history-page .king-history-hero-main { gap: 28px; }
}

/* ---------- Glossary + FAQ ---------- */
body .king-history-page .king-history-glossary,
body .king-history-page .king-history-faq {
	margin: 28px 0 0;
	padding: 22px;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-radius: 18px;
	box-shadow: none;
}
body .king-history-page .king-history-glossary h2,
body .king-history-page .king-history-faq h2 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 750;
	letter-spacing: -.01em;
	color: var(--hx-text);
}
body .king-history-page .king-history-glossary-intro { margin: 0 0 14px; color: var(--hx-muted); font-size: 14.5px; }
body .king-history-page .king-history-glossary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 8px;
}
body .king-history-page .king-history-glossary-term {
	min-height: 40px;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid var(--hx-line);
	border-radius: 12px;
	background: var(--hx-surface);
	color: var(--hx-text);
	font-size: 14px;
	font-weight: 600;
	text-align: left;
	box-shadow: none;
	transform: none;
}
body .king-history-page .king-history-glossary-term:hover { background: var(--hx-hover); border-color: var(--hx-hover); transform: none; }
body .king-history-page .king-history-faq details {
	border: 0;
	border-bottom: 1px solid var(--hx-line);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	margin: 0;
	padding: 0;
}
body .king-history-page .king-history-faq details:last-of-type { border-bottom: 0; }
body .king-history-page .king-history-faq summary {
	padding: 14px 0;
	color: var(--hx-text);
	font-size: 15.5px;
	font-weight: 650;
	cursor: pointer;
}
body .king-history-page .king-history-faq details p,
body .king-history-page .king-history-faq details div { color: var(--hx-body); font-size: 15px; line-height: 1.65; }

/* ---------- People cards ---------- */
body .king-history-page .king-history-person-card {
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-radius: 16px;
	box-shadow: none;
	transform: none;
}
body .king-history-page .king-history-person-card:hover { box-shadow: 0 10px 28px rgba(13, 12, 34, .07); transform: none; }

/* ---------- Event modal: wider, easier to read ---------- */
body .king-history-modal .king-history-modal-panel {
	width: min(780px, calc(100vw - 32px));
	max-width: 780px;
	border-radius: 20px;
	border-top: 0;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}
body .king-history-modal .king-history-modal-panel::before { display: none; }
body .king-history-modal .king-history-modal-header { text-align: left; align-items: flex-start; }
body .king-history-modal .king-history-modal-date {
	margin: 0 0 6px;
	padding: 0;
	background: transparent;
	border: 0;
	color: #d63e3d;
	font-size: 13px;
	font-weight: 750;
	font-variant-numeric: tabular-nums;
}
body .king-history-modal .king-history-modal-title {
	font-size: clamp(22px, 1rem + 1vw, 28px);
	line-height: 1.2;
	letter-spacing: -.02em;
}
body .king-history-modal .king-history-modal-image img { border-radius: 14px; }
body .king-history-modal .king-history-modal-summary {
	text-align: left;
	font-size: 17px;
	line-height: 1.55;
	font-weight: 600;
}
body .king-history-modal .king-history-modal-body,
body .king-history-modal .king-history-modal-body p {
	color: #34373f;
	font-size: 16px;
	line-height: 1.75;
}
html.king-night body .king-history-modal .king-history-modal-body,
html.king-night body .king-history-modal .king-history-modal-body p { color: #d4d6dc; }

/* ---------- Dark mode: beat the theme's own .king-night rules ---------- */
html.king-night body .king-history-page .king-history-hero,
html.king-night body .king-history-page .king-history-shell { background: transparent; box-shadow: none; }
html.king-night body .king-history-page .king-history-item .king-history-card,
html.king-night body .king-history-page .king-history-item.is-major .king-history-card,
html.king-night body .king-history-page .king-history-overview,
html.king-night body .king-history-page .king-history-glossary,
html.king-night body .king-history-page .king-history-faq,
html.king-night body .king-history-page .king-history-glossary-term,
html.king-night body .king-history-page .king-history-person-card {
	background: var(--hx-surface);
	border-color: var(--hx-line);
}
html.king-night body .king-history-page .king-history-sticky-bar {
	background: color-mix(in srgb, var(--hx-surface) 92%, transparent);
	border-color: var(--hx-line);
}
html.king-night body .king-history-page .king-history-item .king-history-card:hover { box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
html.king-night body .king-history-page .king-history-sticky-select,
html.king-night body .king-history-page .king-history-hero-action:not(:first-child),
html.king-night body .king-history-page .king-history-sticky-filter-toggle,
html.king-night body .king-history-page .king-history-sticky-reset {
	background-color: var(--hx-surface);
	border-color: var(--hx-line);
	color: var(--hx-text);
}
html.king-night body .king-history-page .king-history-hero-eras-list button:not(.is-active),
html.king-night body .king-history-page .king-history-item .king-history-chip { background: var(--hx-soft); border-color: var(--hx-line); color: var(--hx-body); }
html.king-night body .king-history-page .king-history-toc-list button.is-active,
html.king-night body .king-history-page .king-history-hero-eras-list button.is-active { background: var(--hx-accent); color: var(--hx-accent-ink); }
html.king-night body .king-history-page .king-history-eras-table td,
html.king-night body .king-history-page .king-history-eras-table th { background: transparent; border-color: var(--hx-line); }
html.king-night body .king-history-page .king-history-item .king-history-card-title-row h3 { color: var(--hx-text); }

/* ---------- Phone + small tablet ---------- */
@media (max-width: 991px) {
	body .king-history-page { padding: 14px 14px 40px; }
	body .king-history-page .king-history-hero-main {
		grid-template-columns: 1fr;
		gap: 18px;
	}
	body .king-history-page .king-history-hero-copy { max-width: none; }
	body .king-history-page .king-history-hero-media { order: -1; aspect-ratio: 16 / 9; border-radius: 16px; }
	body .king-history-page .king-history-hero h1,
	body .king-history-page .king-history-hero-copy h1 { font-size: 32px; }
	body .king-history-page .king-history-hero-copy .king-history-lead { font-size: 15px; }
	body .king-history-page .king-history-hero-actions { margin-top: 18px; gap: 8px; }
	body .king-history-page .king-history-hero-action { flex: 0 0 auto; height: 40px; padding: 0 15px; font-size: 13.5px; }
	body .king-history-page .king-history-hero-eras {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		margin-right: -14px;
		padding-right: 14px;
	}
	body .king-history-page .king-history-hero-eras-list { flex-wrap: nowrap; }
	body .king-history-page .king-history-hero-eras-list button { flex: 0 0 auto; }
	body .king-history-page .king-history-overview { padding: 16px; }
	body .king-history-page .king-history-eras-table td:nth-child(3),
	body .king-history-page .king-history-eras-table th:nth-child(3) { display: none; }
	body .king-history-page .king-history-sticky-bar { padding: 10px; gap: 8px; border-radius: 14px; }
	body .king-history-page .king-history-sticky-results { margin-left: 0; }
}
@media (max-width: 640px) {
	body .king-history-page .king-history-hero-copy .king-history-lead { display: block; margin-top: 10px; font-size: 14.5px; }
	/* Era table as a compact list: name left, period right */
	body .king-history-page .king-history-eras-table thead { display: none; }
	body .king-history-page .king-history-eras-table,
	body .king-history-page .king-history-eras-table tbody { display: block; }
	body .king-history-page .king-history-eras-table tr.king-history-eras-row {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 12px;
		margin: 0;
		padding: 11px 0;
		background: transparent;
		border: 0;
		border-bottom: 1px solid var(--hx-line);
		border-radius: 0;
		box-shadow: none;
	}
	body .king-history-page .king-history-eras-table tr.king-history-eras-row:last-child { border-bottom: 0; padding-bottom: 0; }
	body .king-history-page .king-history-eras-table tr.king-history-eras-row td {
		display: block;
		padding: 0;
		border: 0;
		background: transparent;
		font-size: 14px;
	}
	body .king-history-page .king-history-eras-table tr.king-history-eras-row td::before { display: none; content: none; }
	body .king-history-page .king-history-eras-table tr.king-history-eras-row td.king-history-eras-title { color: var(--hx-text); font-weight: 650; }
	body .king-history-page .king-history-eras-table tr.king-history-eras-row td.king-history-eras-period { font-size: 12.5px; text-align: right; }
	body .king-history-page .king-history-eras-table tr.king-history-eras-row td.king-history-eras-description { display: none; }
	/* Filter bar: compact and not sticky (it would cover the screen) */
	body .king-history-page .king-history-sticky-bar {
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}
	body .king-history-page .king-history-sticky-search { flex: 1 1 100%; width: 100%; height: auto; }
	body .king-history-page .king-history-sticky-filters {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
		flex: 1 1 100%;
		width: 100%;
	}
	body .king-history-page .king-history-sticky-select { width: 100%; height: 38px; font-size: 13.5px; }
	body .king-history-page .king-history-view-tabs { flex: 1 1 100%; width: 100%; }
	body .king-history-page .king-history-view-tabs button { flex: 1 1 0; justify-content: center; padding: 0 8px; }
	body .king-history-page .king-history-view-tabs button i { font-size: 14px; }
	body .king-history-page .king-history-sticky-filter-toggle,
	body .king-history-page .king-history-sticky-reset { flex: 0 0 auto; width: auto; padding: 0 14px; }
	body .king-history-page .king-history-sticky-results { flex: 1 1 auto; }
	body .king-history-page .king-history-timeline { padding-left: 20px; }
	body .king-history-page .king-history-timeline::before { left: 5px; }
	body .king-history-page .king-history-marker { left: -20px; top: 20px; width: 10px; height: 10px; }
	body .king-history-page .king-history-era-heading { height: 84px; margin-left: -20px; padding: 0 16px 12px; border-radius: 14px; }
	body .king-history-page .king-history-item .king-history-card,
	body .king-history-page .king-history-item .king-history-card[class*="is-card-"] { padding: 14px; border-radius: 14px; }
	/* Picture on top of the text on phones */
	body .king-history-page .king-history-item .king-history-card:has(.king-history-card-image) { grid-template-columns: minmax(0, 1fr); }
	body .king-history-page .king-history-item .king-history-card > .king-history-card-image {
		grid-column: 1;
		grid-row: 1;
		height: auto;
		aspect-ratio: 16 / 9;
		min-height: 0;
		max-height: none;
		margin: 0 0 12px;
		border-radius: 10px;
	}
	body .king-history-page .king-history-item .king-history-card-title-row h3 { font-size: 16.5px; }
	body .king-history-page .king-history-item .king-history-card > p { font-size: 14px; }
	body .king-history-page .king-history-glossary,
	body .king-history-page .king-history-faq { padding: 16px; }
	body .king-history-page .king-history-glossary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	body .king-history-page .king-history-item,
	body .king-history-page .king-history-item .king-history-card { transition: none; }
}

/* ==========================================================================
   Views: Map, People, Dynasties, Events
   ========================================================================== */

/* Shared section heading used by the People and Dynasties views */
body .king-history-page .king-history-people-head,
body .king-history-page .king-history-dynasties-head {
	margin: 0 0 16px;
	padding: 0;
	text-align: left;
}
body .king-history-page .king-history-people-title,
body .king-history-page .king-history-dynasties-title {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -.02em;
	color: var(--hx-text);
}
body .king-history-page .king-history-people-sub,
body .king-history-page .king-history-dynasties-sub {
	max-width: 64ch;
	margin: 4px 0 0;
	font-size: 14.5px;
	color: var(--hx-muted);
	text-align: left;
}

/* ---------- Map ---------- */
body .king-history-page .king-history-map-view {
	height: min(72vh, 720px);
	min-height: 460px;
	margin: 0;
	border: 1px solid var(--hx-line);
	border-radius: 18px;
	box-shadow: none;
	background: var(--hx-soft);
}
body .king-history-page .king-history-map-view .leaflet-control-zoom,
body .king-history-page .king-history-map-view .king-history-map-reset {
	border: 0;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(13, 12, 34, .14);
}
body .king-history-page .king-history-map-view .leaflet-control-zoom a {
	width: 36px;
	height: 36px;
	line-height: 36px;
	border: 0;
	border-bottom: 1px solid var(--hx-line);
	background: var(--hx-surface);
	color: var(--hx-text);
	font-size: 17px;
}
body .king-history-page .king-history-map-view .leaflet-control-zoom a:last-child { border-bottom: 0; }
body .king-history-page .king-history-map-view .leaflet-control-zoom a:hover { background: var(--hx-hover); }
body .king-history-page .king-history-map-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: var(--hx-surface);
	color: var(--hx-text);
	font-size: 15px;
	cursor: pointer;
}
body .king-history-page .king-history-map-reset:hover { background: var(--hx-hover); }
body .king-history-page .king-history-map-view .leaflet-popup-content-wrapper {
	border: 1px solid var(--hx-line);
	border-radius: 12px;
	background: var(--hx-surface);
	box-shadow: 0 12px 32px rgba(13, 12, 34, .18);
}
body .king-history-page .king-history-map-view .leaflet-popup-content {
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.4;
	color: var(--hx-text);
}
body .king-history-page .king-history-map-view .leaflet-popup-content strong { margin: 0 0 2px; font-weight: 750; }
body .king-history-page .king-history-map-popup-year { color: var(--hx-muted); font-size: 12.5px; font-weight: 650; }
body .king-history-page .king-history-map-view .leaflet-popup-tip { background: var(--hx-surface); border-color: var(--hx-line); }

/* ---------- People ---------- */
body .king-history-page .king-history-people-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
	gap: 14px;
}
body .king-history-page .king-history-person-card {
	display: flex;
	flex-direction: column;
	margin: 0;
	padding: 0;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-left: 1px solid var(--hx-line);
	border-radius: 16px;
	box-shadow: none;
	overflow: hidden;
	text-align: left;
	transform: none;
	transition: border-color .15s ease, box-shadow .2s ease;
}
body .king-history-page .king-history-person-card:hover {
	border-color: color-mix(in srgb, var(--hx-text) 18%, var(--hx-line));
	box-shadow: 0 12px 30px rgba(13, 12, 34, .08);
	transform: none;
}
body .king-history-page .king-history-person-image {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	margin: 0;
	border-radius: 0;
	overflow: hidden;
	background: var(--hx-soft);
}
body .king-history-page .king-history-person-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 22%;
	border-radius: 0;
	transition: transform .4s ease;
}
body .king-history-page .king-history-person-card:hover .king-history-person-image img { transform: scale(1.03); }
body .king-history-page .king-history-person-card > :not(.king-history-person-image) {
	margin-left: 16px;
	margin-right: 16px;
	text-align: left;
}
body .king-history-page .king-history-person-name {
	margin-top: 14px;
	margin-bottom: 2px;
	font-size: 17px;
	line-height: 1.25;
	font-weight: 750;
	letter-spacing: -.01em;
	color: var(--hx-text);
}
body .king-history-page .king-history-person-lifespan {
	margin-top: 0;
	margin-bottom: 8px;
	font-size: 12.5px;
	font-weight: 650;
	color: var(--hx-muted);
	font-variant-numeric: tabular-nums;
}
body .king-history-page .king-history-person-role {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin-top: 0;
	margin-bottom: 8px;
	font-size: 13.5px;
	line-height: 1.45;
	font-weight: 650;
	color: var(--hx-body);
}
body .king-history-page .king-history-person-summary {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	margin-top: 0;
	margin-bottom: 12px;
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--hx-muted);
}
body .king-history-page .king-history-person-readmore { display: none; }
body .king-history-page .king-history-person-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
	padding: 0 0 16px;
}
body .king-history-page .king-history-person-meta .king-history-chip {
	height: 22px;
	padding: 0 8px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: transparent;
	color: var(--hx-muted);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0;
	text-transform: none;
}
body .king-history-page .king-history-person-meta .king-history-chip:nth-child(n+3) { display: none; }

/* ---------- Dynasties: grid of cards grouped by era ---------- */
body .king-history-page .king-history-dynasty-timeline {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 12px;
	max-width: none;
	margin: 0;
	padding: 0;
}
body .king-history-page .king-history-dynasty-timeline::before { content: none; display: none; }
body .king-history-page .king-history-dynasty-era {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0 2px;
	padding: 0;
	border: 0;
}
body .king-history-page .king-history-dynasty-era:first-child { margin-top: 0; }
body .king-history-page .king-history-dynasty-era::before { content: none; display: none; }
body .king-history-page .king-history-dynasty-era::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--hx-line);
}
body .king-history-page .king-history-dynasty-era-label {
	font-size: 12.5px;
	font-weight: 750;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--hx-text);
}
body .king-history-page .king-history-dynasty-item {
	display: flex;
	margin: 0;
	padding: 0;
	gap: 0;
}
body .king-history-page .king-history-dynasty-marker { display: none; }
body .king-history-page .king-history-dynasty-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	margin: 0;
	padding: 16px 18px;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-left: 1px solid var(--hx-line);
	border-radius: 16px;
	box-shadow: none;
	color: var(--hx-body);
	text-align: left;
	cursor: pointer;
	transform: none;
	transition: border-color .15s ease, box-shadow .2s ease;
}
body .king-history-page .king-history-dynasty-card:hover {
	border-color: color-mix(in srgb, var(--hx-dynasty) 45%, var(--hx-line));
	box-shadow: 0 10px 28px rgba(13, 12, 34, .07);
	transform: none;
}
body .king-history-page .king-history-dynasty-card:focus-visible { outline: 2px solid var(--hx-text); outline-offset: 2px; }
body .king-history-page .king-history-dynasty-year {
	display: block;
	margin: 0 0 4px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	color: var(--hx-dynasty);
	font-size: 12.5px;
	font-weight: 750;
	font-variant-numeric: tabular-nums;
}
body .king-history-page .king-history-dynasty-name {
	margin: 0 0 6px;
	font-size: 16.5px;
	line-height: 1.3;
	font-weight: 750;
	letter-spacing: -.01em;
	color: var(--hx-text);
}
body .king-history-page .king-history-dynasty-summary {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
	margin: 0 0 12px;
	font-size: 14px;
	line-height: 1.55;
	color: var(--hx-muted);
}
body .king-history-page .king-history-dynasty-card .king-history-card-meta {
	display: block;
	margin: auto 0 0;
}
body .king-history-page .king-history-dynasty-card .king-history-meta-tags { display: flex; flex-wrap: wrap; gap: 6px; }
body .king-history-page .king-history-dynasty-card .king-history-chip,
body .king-history-page .king-history-dynasty-card .king-history-region {
	display: inline-flex;
	align-items: center;
	height: 22px;
	margin: 0;
	padding: 0 8px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: var(--hx-soft);
	color: var(--hx-body);
	font-size: 11px;
	font-weight: 650;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
}
body .king-history-page .king-history-dynasty-card .king-history-region { background: transparent; color: var(--hx-muted); }

/* ---------- Events: a clean, scannable table ---------- */
body .king-history-page .king-history-events-table-wrap {
	padding: 0;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	border-radius: 18px;
	overflow: auto;
}
body .king-history-page .king-history-events-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
}
body .king-history-page .king-history-events-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	padding: 12px 16px;
	background: var(--hx-surface);
	border: 0;
	border-bottom: 1px solid var(--hx-line);
	border-radius: 0;
	color: var(--hx-muted);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	text-align: left;
}
body .king-history-page .king-history-events-table tbody tr {
	border-bottom: 1px solid var(--hx-line);
	cursor: pointer;
}
body .king-history-page .king-history-events-table tbody tr:last-child { border-bottom: 0; }
body .king-history-page .king-history-events-table tbody tr:hover { background: var(--hx-soft); }
body .king-history-page .king-history-events-table tbody td {
	padding: 11px 16px;
	vertical-align: middle;
	text-align: left;
	color: var(--hx-body);
	border: 0;
	background: transparent;
}
body .king-history-page .king-history-events-table .king-history-events-col-year {
	width: 1%;
	white-space: nowrap;
	color: var(--hx-muted);
	font-size: 13px;
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}
body .king-history-page .king-history-events-table .king-history-events-col-title { width: auto; }
body .king-history-page .king-history-events-table .king-history-events-title {
	display: block;
	width: 100%;
	padding: 0;
	background: transparent;
	border: 0;
	color: var(--hx-text);
	font-size: 14.5px;
	font-weight: 650;
	line-height: 1.4;
	text-align: left;
	white-space: normal;
}
body .king-history-page .king-history-events-table .king-history-events-title:hover { color: var(--hx-text); text-decoration: underline; text-underline-offset: 3px; }
body .king-history-page .king-history-events-table .king-history-region {
	display: inline-flex;
	align-items: center;
	height: 22px;
	padding: 0 8px;
	border: 1px solid var(--hx-line);
	border-radius: 999px;
	background: transparent;
	color: var(--hx-muted);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}
body .king-history-page .king-history-events-table .king-history-region-more { border-style: dashed; }
/* Type as a coloured dot + label instead of faded pills */
body .king-history-page .king-history-events-table .king-history-chip {
	--hx-chip: var(--hx-minor);
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--hx-body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}
body .king-history-page .king-history-events-table .king-history-chip::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hx-chip);
}
body .king-history-page .king-history-events-table .king-history-chip.major { --hx-chip: var(--hx-major); background: transparent; color: var(--hx-body); }
body .king-history-page .king-history-events-table .king-history-chip.minor { --hx-chip: var(--hx-minor); background: transparent; color: var(--hx-body); }
body .king-history-page .king-history-events-table .king-history-chip.battle { --hx-chip: var(--hx-battle); background: transparent; color: var(--hx-body); }
body .king-history-page .king-history-events-table .king-history-chip.treaty { --hx-chip: var(--hx-treaty); background: transparent; color: var(--hx-body); }
body .king-history-page .king-history-events-table .king-history-chip.person { --hx-chip: var(--hx-person); background: transparent; color: var(--hx-body); }
body .king-history-page .king-history-events-table .king-history-chip.dynasty { --hx-chip: var(--hx-dynasty); background: transparent; color: var(--hx-body); }
body .king-history-page .king-history-events-table .king-history-chip.map-change { --hx-chip: var(--hx-map); background: transparent; color: var(--hx-body); }

/* ---------- Dark mode for the views ---------- */
html.king-night body .king-history-page .king-history-map-view,
html.king-night body .king-history-page .king-history-person-card,
html.king-night body .king-history-page .king-history-dynasty-card,
html.king-night body .king-history-page .king-history-events-table-wrap {
	background: var(--hx-surface);
	border-color: var(--hx-line);
}
html.king-night body .king-history-page .king-history-events-table thead th { background: var(--hx-surface); border-color: var(--hx-line); }
html.king-night body .king-history-page .king-history-events-table tbody tr { border-color: var(--hx-line); }
html.king-night body .king-history-page .king-history-events-table tbody tr:hover { background: var(--hx-soft); }
html.king-night body .king-history-page .king-history-dynasty-card .king-history-chip { background: var(--hx-soft); border-color: var(--hx-line); color: var(--hx-body); }
html.king-night body .king-history-page .king-history-map-view .leaflet-control-zoom a,
html.king-night body .king-history-page .king-history-map-reset { background: var(--hx-surface); color: var(--hx-text); border-color: var(--hx-line); }

/* ---------- Phone ---------- */
@media (max-width: 640px) {
	body .king-history-page .king-history-map-view { height: 64vh; min-height: 360px; border-radius: 14px; }
	body .king-history-page .king-history-people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	body .king-history-page .king-history-person-card > :not(.king-history-person-image) { margin-left: 12px; margin-right: 12px; }
	body .king-history-page .king-history-person-name { margin-top: 10px; font-size: 15px; }
	body .king-history-page .king-history-person-role { font-size: 12.5px; }
	body .king-history-page .king-history-person-summary { display: none; }
	body .king-history-page .king-history-person-meta { padding-bottom: 12px; }
	body .king-history-page .king-history-person-meta .king-history-chip:nth-child(n+2) { display: none; }
	body .king-history-page .king-history-dynasty-timeline { grid-template-columns: 1fr; gap: 10px; }
	body .king-history-page .king-history-dynasty-card { padding: 14px; border-radius: 14px; }
	/* Events table becomes a list: year above title, type + region below */
	body .king-history-page .king-history-events-table-wrap { border-radius: 14px; }
	body .king-history-page .king-history-events-table thead { display: none; }
	body .king-history-page .king-history-events-table,
	body .king-history-page .king-history-events-table tbody { display: block; }
	body .king-history-page .king-history-events-table tbody tr {
		display: grid;
		grid-template-columns: auto 1fr;
		gap: 4px 12px;
		padding: 12px 14px;
	}
	body .king-history-page .king-history-events-table tbody td { display: block; padding: 0; width: auto; }
	body .king-history-page .king-history-events-table .king-history-events-col-year { grid-column: 1 / -1; width: auto; font-size: 12.5px; }
	body .king-history-page .king-history-events-table .king-history-events-col-title { grid-column: 1 / -1; }
	body .king-history-page .king-history-events-table .king-history-events-title { font-size: 15px; }
	body .king-history-page .king-history-events-table .king-history-events-col-type { grid-column: 1; grid-row: 3; }
	body .king-history-page .king-history-events-table .king-history-events-col-region { grid-column: 2; grid-row: 3; white-space: nowrap; overflow: hidden; }
}

/* People without a portrait: initials on a soft tile */
body .king-history-page .king-history-person-image.is-initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--hx-major) 14%, transparent) 0%, transparent 60%),
		var(--hx-soft);
}
body .king-history-page .king-history-person-image.is-initials span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--hx-surface);
	border: 1px solid var(--hx-line);
	color: var(--hx-text);
	font-size: 24px;
	font-weight: 800;
	letter-spacing: .02em;
}
body .king-history-page .king-history-person-card:focus-visible { outline: 2px solid var(--hx-text); outline-offset: 2px; }
@media (max-width: 640px) {
	body .king-history-page .king-history-person-image.is-initials span { width: 54px; height: 54px; font-size: 19px; }
}
body .king-history-page .king-history-dynasty-card .king-history-chip.major {
	height: 22px;
	padding: 0 8px;
	border: 1px solid color-mix(in srgb, var(--hx-major) 35%, var(--hx-line));
	background: color-mix(in srgb, var(--hx-major) 8%, var(--hx-surface));
	color: var(--hx-major);
	font-size: 11px;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
}
