/* ==========================================================================
   CEGER Uganda Governance Map — Frontend Styles
   1.4.0: a full-screen dashboard (after the Johns Hopkins COVID-19 dashboard): dark panels around a
   large map; totals and districts on the left, timeline under the map, killed and arrested on the right.
   ========================================================================== */

.ceger-ugm-app {
	--ugm-bg: #0f1412;
	--ugm-panel: #1a211e;
	--ugm-line: #2c3631;
	--ugm-text: #f2f5f3;
	--ugm-muted: #a8b3ad;
	--ugm-events: #39b54a;
	--ugm-deaths: #ff7b6e;
	--ugm-arrests: #d7df23;
	--ugm-accent: #21b9a2;
	font-family: 'Plus Jakarta Sans', 'Nunito Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	color: var(--ugm-text);
	background: var(--ugm-bg);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: max(640px, 85vh);
}

/* Full screen: the template (Settings › Map page layout), the browser's full screen, or the overlay. */
.ceger-ugm-app.--fullscreen {
	height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
	border-radius: 0;
}

.ceger-ugm-app.--overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	height: 100%;
}

.ceger-ugm-app:fullscreen {
	height: 100%;
}

body.ceger-ugm-fullscreen-page {
	margin: 0;
	background: #0f1412;
}

.ceger-ugm-app .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ceger-ugm-app button:focus-visible,
.ceger-ugm-app a:focus-visible,
.ceger-ugm-app select:focus-visible,
.ceger-ugm-app input:focus-visible {
	outline: 2px solid var(--ugm-arrests);
	outline-offset: 2px;
}

/* ---------- Header (full-screen template) ---------- */
.ceger-ugm-header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 8px 16px;
	background: #006838;
	color: #fff;
	flex: none;
}

.ceger-ugm-header-home img {
	display: block;
	width: 36px;
	height: 36px;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
	padding: 3px;
}

.ceger-ugm-header-title {
	flex: 1;
	min-width: 0;
}

.ceger-ugm-header-title h1 {
	margin: 0;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.2;
	color: #fff;
}

.ceger-ugm-header-title p {
	margin: 1px 0 0;
	font-size: 12px;
	color: #e3efe8;
}

.ceger-ugm-header-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: 12px;
	white-space: nowrap;
}

.ceger-ugm-header-meta a {
	color: #f5f5b7;
	font-weight: 700;
	text-decoration: none;
}

.ceger-ugm-header-meta a:hover {
	text-decoration: underline;
}

/* ---------- Controls bar ---------- */
.ceger-ugm-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px 2px;
	flex: none;
}

.ceger-ugm-filters {
	display: flex;
	gap: 6px;
	flex: 1;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: thin;
	padding-bottom: 4px;
}

.ceger-ugm-cat-btn,
.ceger-ugm-fs-btn {
	padding: 5px 12px;
	border: 1px solid var(--ugm-line);
	border-radius: 20px;
	background: var(--ugm-panel);
	color: var(--ugm-muted);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	font-family: inherit;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.ceger-ugm-cat-btn:hover,
.ceger-ugm-fs-btn:hover {
	border-color: var(--ugm-events);
	color: var(--ugm-text);
}

.ceger-ugm-cat-btn.--active {
	background: #006838;
	border-color: #39b54a;
	color: #fff;
}

/* Each category's colour, as on the map and the timeline: the buttons are the legend. */
.ceger-ugm-cat-btn[data-cat]:not([data-cat=""])::before {
	content: "";
	display: inline-block;
	width: 9px;
	height: 9px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--ugm-cat);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.ceger-ugm-cat-btn[data-cat="election"] { --ugm-cat: #006838; }
.ceger-ugm-cat-btn[data-cat="electoral_malpractice"] { --ugm-cat: #8e44ad; }
.ceger-ugm-cat-btn[data-cat="violence"] { --ugm-cat: #c0392b; }
.ceger-ugm-cat-btn[data-cat="protest"] { --ugm-cat: #f39c12; }
.ceger-ugm-cat-btn[data-cat="civic_space"] { --ugm-cat: #c71585; }
.ceger-ugm-cat-btn[data-cat="corruption"] { --ugm-cat: #d35400; }
.ceger-ugm-cat-btn[data-cat="court_ruling"] { --ugm-cat: #7f8c8d; }
.ceger-ugm-cat-btn[data-cat="policy"] { --ugm-cat: #21b9a2; }
.ceger-ugm-cat-btn[data-cat="international_relations"] { --ugm-cat: #4f7396; }
.ceger-ugm-cat-btn[data-cat="international_actions"] { --ugm-cat: #e74c3c; }
.ceger-ugm-cat-btn[data-cat="humanitarian"] { --ugm-cat: #2980b9; }
.ceger-ugm-cat-btn[data-cat="environmental"] { --ugm-cat: #39b54a; }

.ceger-ugm-fs-btn {
	border-radius: 8px;
	color: var(--ugm-text);
}

.ceger-ugm-date-range,
.ceger-ugm-search {
	padding: 5px 10px;
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
	font-size: 12px;
	font-family: inherit;
	background: var(--ugm-panel);
	color: var(--ugm-text);
	margin-bottom: 4px;
}

.ceger-ugm-search {
	width: 170px;
}

.ceger-ugm-search::placeholder {
	color: var(--ugm-muted);
}

/* ---------- Dashboard grid ---------- */
.ceger-ugm-dash {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(220px, 18%) minmax(0, 1fr) minmax(250px, 21%);
	grid-template-rows: auto minmax(0, 1fr) minmax(170px, 27%);
	grid-template-areas:
		"summary map side"
		"districts map side"
		"districts chart side";
	gap: 6px;
	padding: 6px 10px 4px;
}

.ceger-ugm-panel {
	background: var(--ugm-panel);
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
	padding: 10px 12px;
	min-height: 0;
}

.ceger-ugm-summary { grid-area: summary; }
.ceger-ugm-districts { grid-area: districts; display: flex; flex-direction: column; }
.ceger-ugm-map { grid-area: map; }
.ceger-ugm-chart { grid-area: chart; display: flex; flex-direction: column; }
.ceger-ugm-side { grid-area: side; display: flex; flex-direction: column; padding: 0; overflow: hidden; }

.ceger-ugm-panel-label {
	display: block;
	margin: 0 0 4px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--ugm-muted);
	line-height: 1.3;
}

.ceger-ugm-big {
	display: block;
	font-size: 34px;
	font-weight: 800;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.ceger-ugm-big.--events { color: var(--ugm-events); font-size: 42px; }
.ceger-ugm-big.--deaths { color: var(--ugm-deaths); }
.ceger-ugm-big.--arrests { color: var(--ugm-arrests); }

.ceger-ugm-minis {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	margin-top: 8px;
}

.ceger-ugm-minis div {
	border-top: 1px solid var(--ugm-line);
	padding-top: 6px;
}

.ceger-ugm-minis strong {
	display: block;
	font-size: 17px;
	color: var(--ugm-text);
	font-variant-numeric: tabular-nums;
}

.ceger-ugm-minis span {
	font-size: 11px;
	color: var(--ugm-muted);
}

/* ---------- Ranked lists ---------- */
.ceger-ugm-rank {
	list-style: none;
	margin: 4px 0 0;
	padding: 0;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
	scrollbar-width: thin;
	scrollbar-color: var(--ugm-line) transparent;
}

.ceger-ugm-rank li {
	border-bottom: 1px solid var(--ugm-line);
}

.ceger-ugm-rank li.--empty {
	padding: 8px 0;
	font-size: 12px;
	color: var(--ugm-muted);
	border: 0;
}

.ceger-ugm-rank button {
	display: flex;
	align-items: baseline;
	gap: 8px;
	width: 100%;
	padding: 6px 4px;
	background: none;
	border: 0;
	color: var(--ugm-text);
	font: inherit;
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.ceger-ugm-rank button:hover {
	background: rgba(255, 255, 255, 0.05);
}

.ceger-ugm-rank .n {
	min-width: 34px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.ceger-ugm-rank.--events .n { color: var(--ugm-events); }
.ceger-ugm-rank.--deaths .n { color: var(--ugm-deaths); }
.ceger-ugm-rank.--arrests .n { color: var(--ugm-arrests); }

.ceger-ugm-rank .name {
	font-weight: 600;
}

.ceger-ugm-national-note {
	margin: 8px 0 0;
	font-size: 11px;
	line-height: 1.45;
	color: var(--ugm-muted);
}

/* ---------- Right column: tallies, or the detail panel ---------- */
.ceger-ugm-tallies {
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
}

.ceger-ugm-tally {
	display: flex;
	flex-direction: column;
	min-height: 0;
	padding: 10px 12px;
}

.ceger-ugm-tally + .ceger-ugm-tally {
	border-top: 1px solid var(--ugm-line);
}

.ceger-ugm-detail {
	display: none;
	position: relative;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 12px 14px;
	background: #fff;
	color: #1a1a1a;
}

.ceger-ugm-app.--detail-open .ceger-ugm-tallies {
	display: none;
}

.ceger-ugm-app.--detail-open .ceger-ugm-detail {
	display: block;
}

.ceger-ugm-detail-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #555;
	line-height: 1;
	padding: 4px 8px;
}

.ceger-ugm-detail-close:hover {
	color: #1a1a1a;
}

.ceger-ugm-detail-more a {
	color: #006838;
	font-weight: 700;
}

/* Detail content elements */
.ceger-ugm-detail-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 8px;
	padding-right: 24px;
}

.ceger-ugm-detail-meta {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 12px;
}

.ceger-ugm-cat-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 10px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}

.ceger-ugm-severity-badge {
	font-size: 12px;
	color: #555;
}

.ceger-ugm-detail-desc {
	font-size: 14px;
	line-height: 1.6;
	color: #333;
	margin-bottom: 12px;
}

.ceger-ugm-detail-info {
	font-size: 13px;
	color: #555;
	margin-bottom: 4px;
}

.ceger-ugm-detail-source a {
	color: #006838;
}

.ceger-ugm-detail-share {
	display: flex;
	gap: 6px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.ceger-ugm-detail-share a,
.ceger-ugm-detail-share button {
	padding: 5px 10px;
	border-radius: 5px;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	color: #fff;
	border: none;
	cursor: pointer;
	font-family: inherit;
}

.ceger-ugm-detail-share .--x { background: #000; }
.ceger-ugm-detail-share .--fb { background: #1877f2; }
.ceger-ugm-detail-share .--wa { background: #25d366; }
.ceger-ugm-detail-share .--copy { background: #555; }

/* District detail in panel */
.ceger-ugm-district-detail-title {
	font-size: 18px;
	font-weight: 700;
	margin: 0 0 4px;
	padding-right: 24px;
}

.ceger-ugm-district-detail-region {
	font-size: 13px;
	color: #888;
	margin-bottom: 12px;
}

.ceger-ugm-district-events-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ceger-ugm-district-events-list li {
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
}

.ceger-ugm-district-events-list li:hover {
	background: #f9fdf9;
}

.ceger-ugm-district-events-list .ev-title {
	font-weight: 600;
	font-size: 13px;
}

.ceger-ugm-district-events-list .ev-date {
	font-size: 12px;
	color: #888;
}


/* ---------- Map ---------- */
.ceger-ugm-map {
	position: relative;
	min-height: 0;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid var(--ugm-line);
	background: #121816;
}

.ceger-ugm-map.leaflet-container {
	background: #121816;
	font-family: inherit;
}

.ceger-ugm-map .leaflet-bar a,
.ceger-ugm-map .leaflet-control-layers {
	background: var(--ugm-panel);
	color: var(--ugm-text);
	border-color: var(--ugm-line);
}

.ceger-ugm-map .leaflet-bar a:hover {
	background: #26302b;
}

.ceger-ugm-map .leaflet-control-layers-toggle {
	filter: invert(1);
	background-color: transparent;
}

.ceger-ugm-map .leaflet-control-attribution {
	background: rgba(15, 20, 18, 0.75);
	color: var(--ugm-muted);
}

.ceger-ugm-map .leaflet-control-attribution a {
	color: var(--ugm-arrests);
}

.ceger-ugm-back-btn {
	position: absolute;
	top: 10px;
	left: 54px;
	z-index: 1000;
	padding: 6px 14px;
	background: var(--ugm-panel);
	border: 1px solid var(--ugm-events);
	border-radius: 8px;
	color: var(--ugm-text);
	font-weight: 700;
	font-size: 13px;
	cursor: pointer;
	display: none;
	font-family: inherit;
}

.ceger-ugm-back-btn:hover {
	background: #006838;
}

.ceger-ugm-legend {
	background: rgba(26, 33, 30, 0.92);
	color: var(--ugm-text);
	padding: 8px 12px;
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
	font-size: 12px;
	line-height: 20px;
}

.ceger-ugm-legend i {
	width: 14px;
	height: 14px;
	display: inline-block;
	margin-right: 6px;
	border-radius: 3px;
	vertical-align: middle;
}

.ceger-ugm-tooltip {
	font-family: 'Plus Jakarta Sans', sans-serif;
	font-size: 13px;
	font-weight: 600;
}

/* ---------- Timeline ---------- */
.ceger-ugm-chart-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex: none;
}

.ceger-ugm-chart-tabs {
	display: flex;
	gap: 4px;
}

.ceger-ugm-chart-tabs button {
	padding: 3px 10px;
	border: 1px solid var(--ugm-line);
	border-radius: 6px;
	background: transparent;
	color: var(--ugm-muted);
	font: inherit;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
}

.ceger-ugm-chart-tabs button.--active {
	background: var(--ugm-line);
	color: var(--ugm-text);
}

.ceger-ugm-chart-canvas {
	position: relative;
	flex: 1;
	min-height: 0;
}

.ceger-ugm-credit {
	margin: 0;
	padding: 2px 12px 6px;
	font-size: 11px;
	color: var(--ugm-muted);
	flex: none;
}

/* ---------- Sub-category badge ---------- */
.ceger-ugm-sub-cat-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 8px;
	background: #f0f0f0;
	color: #555;
	font-size: 11px;
	font-weight: 600;
}

/* ---------- Casualty badges ---------- */
.ceger-ugm-casualties {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin: 8px 0 12px;
}

.ceger-ugm-casualty {
	display: inline-block;
	padding: 3px 8px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
}

.ceger-ugm-casualty.--death { background: #c0392b; }
.ceger-ugm-casualty.--injury { background: #e67e22; }
.ceger-ugm-casualty.--arrest { background: #2c3e50; }
.ceger-ugm-casualty.--disqual { background: #8e44ad; }


/* ---------- Smaller screens: the page scrolls; map first, then the figures ---------- */
@media screen and (max-width: 1099px) {
	.ceger-ugm-app,
	.ceger-ugm-app.--fullscreen {
		height: auto;
		overflow: visible;
	}

	.ceger-ugm-app.--overlay {
		overflow-y: auto;
	}

	.ceger-ugm-dash {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		grid-template-areas:
			"summary"
			"map"
			"side"
			"chart"
			"districts";
	}

	.ceger-ugm-map {
		height: clamp(340px, 62vh, 640px);
	}

	.ceger-ugm-chart {
		height: 260px;
	}

	.ceger-ugm-districts .ceger-ugm-rank,
	.ceger-ugm-tally .ceger-ugm-rank {
		max-height: 300px;
	}

	.ceger-ugm-tallies {
		grid-template-rows: none;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	}

	.ceger-ugm-tally + .ceger-ugm-tally {
		border-top: 0;
		border-left: 1px solid var(--ugm-line);
	}

	/* The detail panel becomes a bottom sheet; the tallies stay. */
	.ceger-ugm-app.--detail-open .ceger-ugm-tallies {
		display: grid;
	}

	.ceger-ugm-app.--detail-open .ceger-ugm-detail {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		max-height: 62vh;
		z-index: 100001;
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
		animation: ugm-slide-up 0.25s ease;
	}

	.ceger-ugm-header-title p,
	.ceger-ugm-header-meta span {
		display: none;
	}
}

@media screen and (max-width: 640px) {
	.ceger-ugm-header {
		padding: 8px 12px;
	}

	.ceger-ugm-header-title h1 {
		font-size: 16px;
	}

	.ceger-ugm-controls {
		flex-wrap: wrap;
	}

	.ceger-ugm-filters {
		flex-basis: 100%;
	}

	.ceger-ugm-date-range,
	.ceger-ugm-search {
		flex: 1;
		width: auto;
	}

	.ceger-ugm-tally + .ceger-ugm-tally {
		border-left: 0;
		border-top: 1px solid var(--ugm-line);
	}

	.ceger-ugm-dash {
		padding: 6px 8px 4px;
	}

	.ceger-ugm-big.--events {
		font-size: 36px;
	}
}

@keyframes ugm-slide-up {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.ceger-ugm-app.--detail-open .ceger-ugm-detail {
		animation: none;
	}
}

/* ---------- Loading state ---------- */
.ceger-ugm-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	color: #888;
	font-size: 14px;
}

.ceger-ugm-loading::after {
	content: '';
	width: 24px;
	height: 24px;
	border: 3px solid #ddd;
	border-top-color: #006838;
	border-radius: 50%;
	animation: ugm-spin 0.8s linear infinite;
	margin-left: 10px;
}

@keyframes ugm-spin {
	to { transform: rotate(360deg); }
}

/* Editors' preview with pending events (Governance Map › Map Page). */
.ceger-ugm-preview-note {
	margin: 0;
	padding: 8px 14px;
	background: #fff4e5;
	border-left: 4px solid #b54708;
	color: #1a1a1a;
	font-size: 13px;
	flex: none;
}

/* Detail panel text inside the full-screen template, where the theme's paragraph spacing does not apply. */
.ceger-ugm-detail p,
.ceger-ugm-district-events-list li {
	line-height: 1.4;
}

.ceger-ugm-district-events-list li {
	padding: 8px 0;
}

/* ==========================================================================
   1.5.0 Uganda Governance Monitor: Map / Data / About views, evidence flags, the Data table.
   ========================================================================== */
.ceger-ugm-view[hidden] {
	display: none !important;
}

/* ---------- View switch (in the header; above the controls when embedded) ---------- */
.ceger-ugm-views {
	display: flex;
	gap: 2px;
	background: rgba(0, 0, 0, 0.22);
	border-radius: 9px;
	padding: 3px;
	flex: none;
}

.ceger-ugm-views a {
	padding: 5px 14px;
	border-radius: 7px;
	color: #e3efe8;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.ceger-ugm-views a:hover {
	color: #fff;
	background: rgba(255, 255, 255, 0.1);
}

.ceger-ugm-views a.--active {
	background: #f5f5b7;
	color: #1a1a1a;
}

.ceger-ugm-embedded-nav {
	padding: 8px 10px 0;
	flex: none;
}

.ceger-ugm-embedded-nav .ceger-ugm-views {
	display: inline-flex;
	background: var(--ugm-panel);
}

.ceger-ugm-embedded-nav .ceger-ugm-views a {
	color: var(--ugm-muted);
}

/* The category buttons and the map's search have no use on the About view. */
.ceger-ugm-app[data-view="about"] .ceger-ugm-controls {
	display: none;
}

/* ---------- "Verified only" switch ---------- */
.ceger-ugm-verified-switch {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
	background: var(--ugm-panel);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	margin-bottom: 4px;
}

.ceger-ugm-verified-switch input {
	accent-color: var(--ugm-events);
	margin: 0;
}

.ceger-ugm-verified-switch:has(input:checked) {
	border-color: var(--ugm-events);
	color: var(--ugm-events);
}

/* ---------- Evidence flags ---------- */
.ceger-ugm-flag {
	display: inline-block;
	padding: 1px 8px;
	border: 1px solid var(--ugm-flag, #999);
	border-radius: 10px;
	color: var(--ugm-flag, #ccc);
	background: color-mix(in srgb, var(--ugm-flag, #999) 14%, transparent);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
}

.ceger-ugm-flag.--corrected {
	--ugm-flag: #a8b3ad;
}

.ceger-ugm-evidence {
	margin: 8px 0 10px;
}

.ceger-ugm-caveat {
	margin: 6px 0 0;
	padding: 6px 10px;
	border-left: 3px solid var(--ugm-line);
	background: rgba(255, 255, 255, 0.04);
	color: var(--ugm-muted);
	font-size: 12px;
	line-height: 1.45;
}

.ceger-ugm-caveat.--correction {
	border-left-color: #a8b3ad;
}

.ceger-ugm-sources {
	margin: 8px 0;
	font-size: 12px;
}

.ceger-ugm-sources ul {
	margin: 4px 0 0;
	padding-left: 16px;
}

.ceger-ugm-sources li {
	margin: 3px 0;
	line-height: 1.4;
}

.ceger-ugm-sources a,
.ceger-ugm-row-links a,
.ceger-ugm-linkbtn {
	color: #8fe09b;
}

.ceger-ugm-sources .d,
.ceger-ugm-sources .st {
	color: var(--ugm-muted);
}

/* ---------- Data view ---------- */
.ceger-ugm-data {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	padding: 6px 10px 4px;
	gap: 6px;
}

.ceger-ugm-data-head {
	display: flex;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 10px 16px;
	flex: none;
}

.ceger-ugm-data-title {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	color: var(--ugm-text);
}

.ceger-ugm-data-count {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--ugm-muted);
}

.ceger-ugm-flag-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	flex: 1;
}

.ceger-ugm-flag-filter button {
	padding: 4px 10px;
	border: 1px solid var(--ugm-line);
	border-radius: 14px;
	background: var(--ugm-panel);
	color: var(--ugm-text);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.ceger-ugm-flag-filter button[data-flag]:not([data-flag=""])::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--ugm-flag);
	margin-right: 5px;
}

.ceger-ugm-flag-filter button.--active {
	background: #f5f5b7;
	border-color: #f5f5b7;
	color: #1a1a1a;
}

.ceger-ugm-flag-filter .n {
	opacity: 0.7;
}

.ceger-ugm-download {
	padding: 5px 12px;
	border: 1px solid var(--ugm-events);
	border-radius: 8px;
	color: var(--ugm-events);
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

.ceger-ugm-download:hover {
	background: var(--ugm-events);
	color: #0f1412;
}

.ceger-ugm-table-wrap {
	flex: 1;
	min-height: 0;
	overflow: auto;
	background: var(--ugm-panel);
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
}

.ceger-ugm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.ceger-ugm-table thead th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #222b27;
	text-align: left;
	padding: 0;
	border-bottom: 1px solid var(--ugm-line);
}

.ceger-ugm-table th button {
	width: 100%;
	padding: 9px 10px;
	border: 0;
	background: none;
	color: var(--ugm-muted);
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: inherit;
	cursor: pointer;
	white-space: nowrap;
}

.ceger-ugm-table th button[aria-sort]::after {
	content: ' \2193';
	color: var(--ugm-events);
}

.ceger-ugm-table th button[aria-sort="ascending"]::after {
	content: ' \2191';
}

.ceger-ugm-table th.--num,
.ceger-ugm-table td.--num {
	text-align: right;
}

.ceger-ugm-table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--ugm-line);
	vertical-align: top;
	line-height: 1.4;
}

.ceger-ugm-table td.--msg {
	padding: 24px;
	text-align: center;
	color: var(--ugm-muted);
}

.ceger-ugm-row {
	cursor: pointer;
}

.ceger-ugm-row:hover,
.ceger-ugm-row[aria-expanded="true"] {
	background: rgba(255, 255, 255, 0.04);
}

.ceger-ugm-row .--date {
	white-space: nowrap;
	color: var(--ugm-muted);
	font-variant-numeric: tabular-nums;
}

.ceger-ugm-row .--title {
	font-weight: 600;
	min-width: 260px;
}

.ceger-ugm-row .dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 7px;
	vertical-align: 1px;
}

.ceger-ugm-row .--cat,
.ceger-ugm-row .--district {
	color: var(--ugm-muted);
}

.ceger-ugm-row .--deaths {
	color: var(--ugm-deaths);
	font-weight: 700;
}

.ceger-ugm-row .--arrests {
	color: var(--ugm-arrests);
	font-weight: 700;
}

.ceger-ugm-row-detail > td {
	background: #151b18;
	padding: 4px 14px 12px 28px;
}

.ceger-ugm-row-body {
	max-width: 860px;
}

.ceger-ugm-row-links {
	display: flex;
	gap: 16px;
	align-items: center;
	margin: 8px 0 0;
	font-size: 12px;
	font-weight: 700;
}

.ceger-ugm-linkbtn {
	border: 0;
	padding: 0;
	background: none;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.ceger-ugm-pager {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 14px;
	font-size: 12px;
	color: var(--ugm-muted);
	flex: none;
}

.ceger-ugm-pager:empty {
	display: none;
}

.ceger-ugm-pager button {
	padding: 4px 12px;
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
	background: var(--ugm-panel);
	color: var(--ugm-text);
	font: inherit;
	cursor: pointer;
}

.ceger-ugm-pager button:disabled {
	opacity: 0.4;
	cursor: default;
}

/* ---------- About view ---------- */
.ceger-ugm-about {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 12px 10px;
}

.ceger-ugm-about-body {
	max-width: 760px;
	margin: 0 auto;
	padding: 8px 24px 24px;
	background: var(--ugm-panel);
	border: 1px solid var(--ugm-line);
	border-radius: 8px;
	font-size: 15px;
	line-height: 1.65;
	color: #dfe6e2;
}

.ceger-ugm-about-body h2 {
	margin: 22px 0 6px;
	font-size: 18px;
	color: #fff;
}

.ceger-ugm-about-body p,
.ceger-ugm-about-body ul {
	margin: 0 0 12px;
}

.ceger-ugm-about-body li {
	margin-bottom: 6px;
}

.ceger-ugm-about-body strong {
	color: #fff;
}

.ceger-ugm-about-body a {
	color: #8fe09b;
}

.ceger-ugm-about-link {
	font-size: 13px;
	border-top: 1px solid var(--ugm-line);
	padding-top: 12px;
}

@media screen and (max-width: 1099px) {
	.ceger-ugm-data,
	.ceger-ugm-about {
		flex: none;
	}

	.ceger-ugm-table-wrap {
		max-height: none;
		overflow: visible;
	}
}

/* Phones: the views go under the title; table rows become cards. */
@media screen and (max-width: 760px) {
	.ceger-ugm-header {
		flex-wrap: wrap;
	}

	.ceger-ugm-header .ceger-ugm-views {
		order: 3;
		flex-basis: 100%;
	}

	.ceger-ugm-header .ceger-ugm-views a {
		flex: 1;
		text-align: center;
	}

	.ceger-ugm-table thead {
		display: none;
	}

	.ceger-ugm-table,
	.ceger-ugm-table tbody,
	.ceger-ugm-table tr,
	.ceger-ugm-table td {
		display: block;
	}

	.ceger-ugm-row {
		display: grid !important;
		grid-template-columns: 1fr auto;
		gap: 2px 8px;
		padding: 10px 12px;
		border-bottom: 1px solid var(--ugm-line);
	}

	.ceger-ugm-row td {
		padding: 0;
		border: 0;
	}

	.ceger-ugm-row .--title {
		grid-column: 1 / -1;
		min-width: 0;
		order: -1;
	}

	.ceger-ugm-row .--date,
	.ceger-ugm-row .--district,
	.ceger-ugm-row .--cat {
		font-size: 12px;
	}

	.ceger-ugm-row .--num:empty {
		display: none;
	}

	.ceger-ugm-row .--deaths:not(:empty)::after {
		content: ' killed';
		font-weight: 400;
	}

	.ceger-ugm-row .--arrests:not(:empty)::after {
		content: ' arrested';
		font-weight: 400;
	}

	.ceger-ugm-row .--flag {
		grid-column: 1 / -1;
	}

	.ceger-ugm-row-detail > td {
		padding: 4px 12px 12px;
	}

	.ceger-ugm-about-body {
		padding: 4px 16px 16px;
		font-size: 14px;
	}
}

/* The detail panel is light: darker text for the flags, caveats and sources there. */
.ceger-ugm-detail .ceger-ugm-flag {
	color: #1a1a1a;
	background: color-mix(in srgb, var(--ugm-flag, #999) 30%, #fff);
}

.ceger-ugm-detail .ceger-ugm-caveat {
	background: #f4f6f5;
	border-left-color: #c7cfca;
	color: #3b4540;
}

.ceger-ugm-detail .ceger-ugm-sources a {
	color: #006838;
}

.ceger-ugm-detail .ceger-ugm-sources .d,
.ceger-ugm-detail .ceger-ugm-sources .st {
	color: #5c6661;
}

/* The table's opened rows are dark. */
.ceger-ugm-row-detail .ceger-ugm-detail-desc {
	color: #dfe6e2;
	margin: 8px 0;
}

.ceger-ugm-row-detail .ceger-ugm-detail-info {
	color: var(--ugm-muted);
}

.ceger-ugm-about-body,
.ceger-ugm-about-body p,
.ceger-ugm-about-body li {
	text-align: left;
	hyphens: none;
}

@media screen and (max-width: 760px) {
	.ceger-ugm-data-head {
		flex-direction: column;
		align-items: stretch;
	}

	.ceger-ugm-download {
		align-self: flex-start;
	}
}

/* 1.6.0: figures behind the numbers, overall tolls and their local incidents. */
.ceger-ugm-figures,
.ceger-ugm-relation {
	margin: 8px 0;
	font-size: 12px;
	line-height: 1.45;
}

.ceger-ugm-figures ul,
.ceger-ugm-relation ul {
	margin: 4px 0 0;
	padding-left: 16px;
}

.ceger-ugm-figures li,
.ceger-ugm-relation li {
	margin: 3px 0;
}

.ceger-ugm-figures .k,
.ceger-ugm-figures .d,
.ceger-ugm-relation .d {
	color: var(--ugm-muted);
}

.ceger-ugm-range {
	margin: 4px 0;
	font-weight: 600;
}

.ceger-ugm-relation a {
	color: #8fe09b;
}

.ceger-ugm-detail .ceger-ugm-relation a {
	color: #006838;
}

.ceger-ugm-detail .ceger-ugm-figures .k,
.ceger-ugm-detail .ceger-ugm-figures .d,
.ceger-ugm-detail .ceger-ugm-relation .d {
	color: #5c6661;
}

.ceger-ugm-toll {
	display: inline-block;
	margin-right: 4px;
	padding: 0 6px;
	border-radius: 3px;
	background: #d7df23;
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.ceger-ugm-event-figures {
	margin: 24px 0;
}

.ceger-ugm-event-numbers {
	font-size: 1.1em;
	font-weight: 600;
}

.ceger-ugm-event-figure-list {
	padding-left: 20px;
}

.ceger-ugm-event-figure-list .kind,
.ceger-ugm-event-figure-list .date,
.ceger-ugm-event-figures-rule {
	color: #5c6661;
	font-size: 0.9em;
}

.ceger-ugm-event-relation {
	padding: 10px 14px;
	border-left: 3px solid #d7df23;
	background: #f9faea;
}
