.diff-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 1000;
	overflow: auto;
}

.diff-panel {
	position: relative;
	width: 94%;
	max-width: 1400px;
	margin: 24px auto;
	background: #fff;
	padding: 20px 24px 24px;
	text-align: left;
	font-family: sans-serif;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.diff-panel h3 {
	margin-top: 0;
}

#diffSummary {
	margin: 8px 0 16px;
	color: #333;
}

.stale-warning {
	display: none;
	background: #fff3cd;
	border: 1px solid #f0c36d;
	color: #7a5b00;
	padding: 10px 12px;
	margin-bottom: 16px;
}

.diff-html {
	max-height: 520px;
	overflow: auto;
	border: 1px solid #ddd;
	padding: 12px;
	background: #fafafa;
}

.diff-actions {
	display: none;
	margin-top: 16px;
}

.confirm-btn {
	background-color: #2e7d32;
}

.confirm-btn:hover {
	background-color: #1b5e20;
}

.btn:disabled,
.btn:disabled:hover {
	background: #9ca3af;
	cursor: not-allowed;
	border-bottom: 2px solid transparent;
}

.diff-overlay.is-busy .diff-actions .btn {
	pointer-events: none;
}

.review-loader {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 5;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 12px;
	background: rgba(255, 255, 255, 0.78);
}

.diff-overlay.is-busy .review-loader {
	display: flex;
}

.review-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #d1d5db;
	border-top-color: #2874f0;
	border-radius: 50%;
	animation: review-spin 0.8s linear infinite;
}

.review-loader-text {
	font-family: sans-serif;
	font-size: 14px;
	font-weight: bold;
	color: #111;
}

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

.stale-help {
	margin: 8px 0 0;
	padding-left: 18px;
}

.stale-help li {
	margin-bottom: 4px;
}

.cancel-btn {
	background-color: #777;
}

.cancel-btn:hover {
	background-color: #555;
}

.push-target {
	display: none;
	background: #f3f4f6;
	color: #111;
	padding: 6px 8px;
	margin: 0 0 8px;
	border: 1px solid #d1d5db;
}

.push-target.mismatch {
	background: #fef2f2;
	border: 2px solid #f59e0b;
}

.mismatch-banner {
	font-weight: bold;
	font-size: 12px;
	letter-spacing: 0.02em;
	margin-bottom: 6px;
	color: #92400e;
	font-family: sans-serif;
}

.target-compare {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.target-card {
	flex: 1;
	min-width: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	padding: 6px 10px;
}

.target-card-warn {
	border-color: #f59e0b;
	box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.target-card-title {
	font-family: sans-serif;
	font-size: 10px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	margin-bottom: 4px;
}

.target-arrow {
	display: flex;
	align-items: center;
	font-size: 16px;
	color: #6b7280;
	flex: 0 0 auto;
}

.target-field {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 2px;
}

.target-field:last-child {
	margin-bottom: 0;
}

.target-field-label {
	font-family: sans-serif;
	font-size: 11px;
	color: #6b7280;
	margin-bottom: 0;
	min-width: 84px;
	flex: 0 0 auto;
}

.target-field-value {
	font-family: Consolas, Monaco, monospace;
	font-size: 13px;
	line-height: 1.2;
	word-break: break-all;
	color: #111;
}

.target-changed {
	background: #fbbf24;
	color: #7f1d1d;
	font-weight: bold;
	padding: 1px 4px;
}

@media (max-width: 800px) {
	.target-compare {
		flex-direction: column;
	}
	.target-arrow {
		justify-content: center;
		transform: rotate(90deg);
	}
}

.target-mismatch,
.sensitive-warning {
	display: none;
	background: #fef2f2;
	border: 1px solid #dc2626;
	color: #7f1d1d;
	padding: 10px 12px;
	margin-bottom: 12px;
}

#id_sensitiveConfirm {
	display: block;
	margin-top: 8px;
	width: 220px;
}

#diffSummary {
	margin: 8px 0 12px;
	color: #111;
}

.count-chip {
	display: inline-block;
	cursor: pointer;
	background: #e5e7eb;
	color: #111;
	padding: 3px 8px;
	margin-right: 6px;
	border-radius: 3px;
	text-decoration: none;
}

.count-chip.active {
	background: #1d4ed8;
	color: #fff;
}

.change-list-wrap {
	display: none;
	margin: 0 0 12px;
	border: 1px solid #d1d5db;
}

.change-list-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	text-align: left;
	background: #f3f4f6;
	border: 0;
	padding: 6px 10px;
	font-size: 12px;
	cursor: pointer;
	margin: 0;
	text-transform: none;
	color: #111;
}

.change-list-toggle:hover {
	background: #e5e7eb;
}

.change-list-arrow {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 8px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #374151;
}

.change-list-wrap:not(.collapsed) .change-list-arrow {
	border-top: none;
	border-bottom: 6px solid #374151;
}

.change-list {
	list-style: none;
	padding: 0;
	margin: 0;
	max-height: 132px;
	overflow: auto;
}

.change-list-wrap.collapsed .change-list {
	display: none;
}

.change-list li {
	cursor: pointer;
	padding: 3px 8px;
	border-bottom: 1px solid #e5e7eb;
	font-family: Consolas, Monaco, monospace;
	font-size: 11px;
	line-height: 1.35;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.change-list li:hover,
.change-list li.active {
	outline: 2px solid #93c5fd;
}

.change-list li.added {
	background: #ecfdf3;
}

.change-list li.removed {
	background: #fef2f2;
}

.change-list li.modified {
	background: #eff6ff;
}

.change-kind {
	display: inline-block;
	min-width: 70px;
	font-weight: bold;
	text-transform: uppercase;
	font-size: 11px;
}

.change-kind.added { color: #166534; }
.change-kind.removed { color: #991b1b; }
.change-kind.modified { color: #9a3412; }

.diff-toolbar {
	display: none;
	margin-bottom: 8px;
}

.copy-btn {
	background-color: #4b5563;
	text-transform: none;
}

.copy-btn:hover {
	background-color: #374151;
}

.view-btn.active {
	background-color: #1d4ed8;
}

.gh-diff {
	width: 100%;
	border-collapse: collapse;
	font-family: Consolas, Monaco, monospace;
	font-size: 12px;
	table-layout: fixed;
}

.gh-diff th {
	text-align: left;
	padding: 6px 8px;
	background: #f3f4f6;
	border-bottom: 1px solid #d1d5db;
	color: #111;
}

.gh-diff td {
	vertical-align: top;
	padding: 0 8px;
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.45;
}

.gh-num {
	width: 46px;
	color: #6b7280;
	text-align: right;
	background: #f9fafb;
	border-right: 1px solid #e5e7eb;
	user-select: none;
}

.gh-code.gh-del,
.gh-num.gh-del {
	background: #fecaca;
	color: #7f1d1d;
}

.gh-code.gh-ins,
.gh-num.gh-ins {
	background: #bbf7d0;
	color: #14532d;
}

.gh-code.gh-empty-del,
.gh-num.gh-empty-del {
	background: repeating-linear-gradient(
		-45deg,
		#fecaca,
		#fecaca 6px,
		#fee2e2 6px,
		#fee2e2 12px
	);
	min-height: 1.45em;
}

.gh-code.gh-empty-ins,
.gh-num.gh-empty-ins {
	background: repeating-linear-gradient(
		-45deg,
		#bbf7d0,
		#bbf7d0 6px,
		#dcfce7 6px,
		#dcfce7 12px
	);
	min-height: 1.45em;
}

.gh-word {
	background: #9f1239;
	color: #fff;
	font-weight: 700;
	padding: 0 4px;
	margin: 0 1px;
	border-radius: 2px;
	box-decoration-break: clone;
	-webkit-box-decoration-break: clone;
}

.gh-ins .gh-word {
	background: #14532d;
	color: #fff;
}

.gh-skip td {
	text-align: center;
	background: #f3f4f6;
	color: #1d4ed8;
	cursor: pointer;
	padding: 8px;
}

.gh-skip:hover td {
	background: #e5e7eb;
}

.diff-html {
	max-height: 520px;
	overflow: auto;
	border: 1px solid #ddd;
	padding: 12px;
	background: #fafafa;
}

.diff-flash {
	outline: 3px solid #2563eb;
}

/* Stronger contrast than jsondiffpatch defaults */
.jsondiffpatch-added .jsondiffpatch-property-name,
.jsondiffpatch-added .jsondiffpatch-value pre,
.jsondiffpatch-modified .jsondiffpatch-right-value pre,
.jsondiffpatch-textdiff-added {
	background: #166534;
	color: #fff;
}

.jsondiffpatch-deleted .jsondiffpatch-property-name,
.jsondiffpatch-deleted pre,
.jsondiffpatch-modified .jsondiffpatch-left-value pre,
.jsondiffpatch-textdiff-deleted {
	background: #991b1b;
	color: #fff;
	text-decoration: line-through;
}