/* ARC RRAT Public Styles — Overview, Profile Widget, Institution Profile, Report Builder */

/* ── Base ─────────────────────────────────────────────────── */
.arc-rrat-public {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	max-width: 1100px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── Overview page ───────────────────────────────────────── */
.rrat-overview-header {
	text-align: center;
	margin-bottom: 32px;
}
.rrat-overview-header h2 {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 8px;
}
.rrat-subtitle {
	font-size: 15px;
	color: #64748b;
	margin: 0;
}

.rrat-overview-stats {
	display: flex;
	justify-content: center;
	gap: 48px;
	margin-bottom: 40px;
}
.rrat-overview-stat {
	text-align: center;
}
.rrat-overview-stat-value {
	font-size: 42px;
	font-weight: 800;
	color: #0D404A;
	line-height: 1.1;
}
.rrat-overview-stat-label {
	font-size: 14px;
	color: #64748b;
	margin-top: 4px;
}

.rrat-section {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	margin-bottom: 24px;
}
.rrat-section h3 {
	font-size: 18px;
	font-weight: 600;
	margin: 0 0 16px;
}

.rrat-pub-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}
.rrat-pub-table th {
	text-align: left;
	padding: 10px 12px;
	border-bottom: 2px solid #e2e8f0;
	color: #64748b;
	font-weight: 500;
	font-size: 13px;
}
.rrat-pub-table td {
	padding: 10px 12px;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: top;
}
.rrat-pub-table tr:hover td {
	background: #f8fafc;
}

/* ── Profile widget (embedded in institution profiles) ──── */
.rrat-profile-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	margin-top: 16px;
}
.rrat-profile-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 16px 20px;
	border-bottom: 1px solid #e2e8f0;
	background: #f8fafc;
}
.rrat-profile-card-header h3 {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}
.rrat-profile-badge {
	background: #0D404A;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 10px;
	border-radius: 12px;
	letter-spacing: .05em;
}

/* Score bars */
.rrat-profile-scores {
	padding: 20px;
}
.rrat-score-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}
.rrat-score-label {
	flex: 0 0 180px;
	font-size: 13px;
	color: #475569;
	text-align: right;
}
.rrat-score-bar-wrap {
	flex: 1;
	height: 12px;
	background: #f1f5f9;
	border-radius: 6px;
	overflow: hidden;
}
.rrat-score-bar {
	height: 100%;
	border-radius: 6px;
	transition: width .6s ease;
}
.rrat-score-pct {
	flex: 0 0 45px;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
}

/* Highlights */
.rrat-profile-highlights {
	padding: 0 20px 20px;
}
.rrat-profile-highlights h4 {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 12px;
	color: #334155;
}
.rrat-highlights-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 10px;
}
.rrat-highlight-item {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 10px 14px;
}
.rrat-highlight-label {
	font-size: 11px;
	color: #94a3b8;
	margin-bottom: 2px;
	line-height: 1.3;
}
.rrat-highlight-value {
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
}

/* Footer */
.rrat-profile-footer {
	display: flex;
	justify-content: space-between;
	padding: 12px 20px;
	border-top: 1px solid #e2e8f0;
	font-size: 11px;
	color: #94a3b8;
}

/* ── Institution full profile page ────────────────────────── */
.rrat-inst-header {
	margin-bottom: 32px;
}
.rrat-inst-header h1 {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 12px;
	color: #1e293b;
}
.rrat-inst-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	font-size: 14px;
	color: #64748b;
}
.rrat-inst-meta i {
	margin-right: 4px;
	color: #0D404A;
}
.rrat-inst-arc-link {
	margin-top: 16px;
}
.rrat-inst-arc-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #0D404A;
	color: #fff;
	border-radius: 8px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: background .15s, filter .15s;
}
.rrat-inst-arc-btn:hover {
	filter: brightness(0.9);
	color: #fff;
	text-decoration: none;
}

/* Overview grid: radar chart left, score bars right */
.rrat-inst-overview-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	align-items: start;
}

.rrat-inst-footer {
	margin-top: 32px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
	font-size: 12px;
	color: #94a3b8;
}
.rrat-inst-footer p {
	margin: 0 0 4px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
	.rrat-inst-overview-grid {
		grid-template-columns: 1fr;
	}
}
@media (max-width: 768px) {
	.arc-rrat-public {
		padding: 0 12px;
	}
	.rrat-score-label {
		flex: 0 0 100px;
		font-size: 11px;
	}
	.rrat-highlights-grid {
		grid-template-columns: 1fr;
	}
	.rrat-overview-stats {
		flex-direction: column;
		gap: 16px;
	}
	.rrat-inst-meta {
		flex-direction: column;
		gap: 8px;
	}
}

/* ── Report builder (scoped) ─────────────────────────────── */
#rrat-report-builder {
	font-size: 14px;
	color: #1e293b;
	line-height: 1.5;
}
#rrat-report-builder .rrat-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	border: none;
	transition: all .15s;
}
#rrat-report-builder .rrat-btn:disabled { opacity: .5; cursor: not-allowed; }
#rrat-report-builder .rrat-btn-primary { background: #0D404A; color: #fff; }
#rrat-report-builder .rrat-btn-primary:hover:not(:disabled) { filter: brightness(0.9); }
#rrat-report-builder .rrat-btn-outline { background: #fff; color: #475569; border: 1px solid #cbd5e1; }
#rrat-report-builder .rrat-btn-outline:hover:not(:disabled) { background: #f8fafc; }
#rrat-report-builder .rrat-btn-sm { padding: 4px 12px; font-size: 12px; }

#rrat-report-builder .rrat-select {
	padding: 8px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
	min-width: 160px;
}

#rrat-report-builder .rrat-tab {
	padding: 12px 20px;
	font-size: 13px;
	font-weight: 500;
	color: #64748b;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
#rrat-report-builder .rrat-tab:hover { color: #1e293b; background: #f8fafc; }
#rrat-report-builder .rrat-tab.active { color: #0D404A; border-bottom-color: #0D404A; }

#rrat-report-builder .rrat-domain-group { border-bottom: 1px solid #f1f5f9; }
#rrat-report-builder .rrat-domain-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 12px;
	cursor: pointer;
	font-size: 13px;
}
#rrat-report-builder .rrat-domain-header:hover { background: #f8fafc; }

#rrat-report-builder .rrat-table { width: 100%; border-collapse: collapse; font-size: 12px; }
#rrat-report-builder .rrat-table th { background: #f8fafc; padding: 10px 12px; text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
#rrat-report-builder .rrat-table td { padding: 8px 12px; border-bottom: 1px solid #f1f5f9; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
#rrat-report-builder .rrat-table tr:hover { background: #f8fafc; }

@media (max-width: 1024px) {
	#rrat-report-builder > div:last-child { grid-template-columns: 1fr !important; }
}

/* ─── Synthesis Report ─────────────────────────────────────────── */
#rrat-synthesis {
	max-width: 1180px;
	margin: 0 auto;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	color: #1e293b;
}
#rrat-synthesis * { box-sizing: border-box; }

/* ── v1.7 toolbar — progressive disclosure picker ──────────────────── */
#rrat-synthesis .rrat-syn-toolbar {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
	padding: 18px 20px; margin: 0 0 28px;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	position: relative;
}
#rrat-synthesis .rrat-syn-toolbar-head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 12px; padding-bottom: 12px; margin-bottom: 14px;
	border-bottom: 1px solid #f1f5f9;
}
#rrat-synthesis .rrat-syn-toolbar-title {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 15px; font-weight: 700; color: #0D404A;
}
#rrat-synthesis .rrat-syn-toolbar-title i { color: #0D404A; }
#rrat-synthesis .rrat-syn-toolbar-hint {
	font-size: 12.5px; color: #64748b;
}

/* Scope chips */
#rrat-synthesis .rrat-syn-scope-chips {
	display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px;
}
#rrat-synthesis .rrat-syn-chip-btn {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 7px 13px; font-size: 12.5px; font-weight: 500;
	background: #f8fafc; color: #475569;
	border: 1px solid #e2e8f0; border-radius: 999px;
	cursor: pointer; transition: all 0.15s ease;
}
#rrat-synthesis .rrat-syn-chip-btn i { font-size: 11px; opacity: 0.85; }
#rrat-synthesis .rrat-syn-chip-btn:hover {
	background: #f1f5f9; border-color: #cbd5e1; color: #1e293b;
}
#rrat-synthesis .rrat-syn-chip-btn.is-active {
	background: #0D404A; color: #fff; border-color: #0D404A;
	box-shadow: 0 1px 4px rgba(13, 64, 74, 0.25);
}
#rrat-synthesis .rrat-syn-chip-btn.is-active i { opacity: 1; }

/* Picker rows under the chips */
#rrat-synthesis .rrat-syn-pickers {
	background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
	padding: 14px 16px; margin-bottom: 14px;
}
#rrat-synthesis .rrat-syn-picker {
	display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap;
}
#rrat-synthesis .rrat-syn-picker-note {
	font-size: 12.5px; color: #64748b; line-height: 1.5;
	padding: 4px 0;
}
#rrat-synthesis .rrat-syn-picker-note i { color: #0D404A; margin-right: 4px; }

/* Field labels + inputs */
#rrat-synthesis .rrat-syn-field {
	display: flex; flex-direction: column; gap: 5px;
	font-size: 12px; color: #475569; font-weight: 500;
}
#rrat-synthesis .rrat-syn-field-wide { flex: 1 1 320px; min-width: 280px; }
#rrat-synthesis .rrat-syn-field-label {
	display: inline-flex; align-items: baseline; gap: 6px;
	text-transform: uppercase; letter-spacing: 0.04em; font-size: 11px;
	color: #64748b;
}
#rrat-synthesis .rrat-syn-field-hint {
	text-transform: none; letter-spacing: normal;
	font-size: 11px; color: #94a3b8; font-style: italic; font-weight: 400;
}
#rrat-synthesis .rrat-syn-input {
	padding: 8px 11px; font-size: 13px; color: #1e293b;
	border: 1px solid #cbd5e1; border-radius: 7px; background: #fff;
	min-width: 200px; max-width: 360px;
}
#rrat-synthesis .rrat-syn-input:focus {
	outline: none; border-color: #0D404A;
	box-shadow: 0 0 0 3px rgba(13, 64, 74, 0.12);
}

/* Multi-picker (countries) */
#rrat-synthesis .rrat-syn-multipick {
	width: 100%; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
	padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
#rrat-synthesis .rrat-syn-multipick-head {
	display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
#rrat-synthesis .rrat-syn-multipick-search {
	flex: 1 1 220px; padding: 8px 12px; font-size: 13px;
	border: 1px solid #cbd5e1; border-radius: 7px; background: #fff;
	min-width: 200px;
}
#rrat-synthesis .rrat-syn-multipick-search:focus {
	outline: none; border-color: #0D404A;
	box-shadow: 0 0 0 3px rgba(13, 64, 74, 0.12);
}
#rrat-synthesis .rrat-syn-multipick-actions {
	display: flex; gap: 6px; flex-wrap: wrap;
}
#rrat-synthesis .rrat-syn-mp-btn {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 6px 11px; font-size: 12px; font-weight: 500;
	background: #fff; color: #0D404A;
	border: 1px solid #cbd5e1; border-radius: 7px;
	cursor: pointer; transition: all 0.15s ease;
}
#rrat-synthesis .rrat-syn-mp-btn:hover {
	background: #f8fafc; border-color: #94a3b8;
}
#rrat-synthesis .rrat-syn-mp-region { position: relative; }
#rrat-synthesis .rrat-syn-mp-region-menu {
	position: absolute; top: calc(100% + 4px); right: 0;
	background: #fff; border: 1px solid #cbd5e1; border-radius: 8px;
	padding: 6px; min-width: 220px; z-index: 20;
	box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
	display: flex; flex-direction: column; gap: 2px;
}
#rrat-synthesis .rrat-syn-mp-region-menu[hidden] { display: none; }
#rrat-synthesis .rrat-syn-mp-region-item {
	display: flex; justify-content: space-between; align-items: baseline;
	padding: 7px 11px; font-size: 13px; color: #334155;
	background: transparent; border: none; cursor: pointer;
	border-radius: 6px; text-align: left;
}
#rrat-synthesis .rrat-syn-mp-region-item:hover { background: #f1f5f9; }
#rrat-synthesis .rrat-syn-mp-region-item small { color: #94a3b8; font-size: 11px; }

#rrat-synthesis .rrat-syn-multipick-list {
	max-height: 220px; overflow-y: auto;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 2px 8px;
	padding: 4px; border: 1px solid #f1f5f9; border-radius: 7px;
	background: #fff;
}
#rrat-synthesis .rrat-syn-mp-item {
	display: flex; align-items: center; gap: 8px;
	padding: 5px 8px; font-size: 13px; color: #1e293b;
	cursor: pointer; border-radius: 5px;
}
#rrat-synthesis .rrat-syn-mp-item:hover { background: #f8fafc; }
#rrat-synthesis .rrat-syn-mp-item input { margin: 0; cursor: pointer; }
#rrat-synthesis .rrat-syn-mp-item-name { flex: 1; }
#rrat-synthesis .rrat-syn-mp-item-n {
	font-size: 11px; color: #94a3b8;
	padding: 1px 6px; background: #f1f5f9; border-radius: 8px;
}
#rrat-synthesis .rrat-syn-mp-empty {
	padding: 14px; text-align: center; color: #94a3b8; font-size: 13px;
	grid-column: 1 / -1;
}

#rrat-synthesis .rrat-syn-multipick-footer {
	display: flex; flex-direction: column; gap: 8px;
	padding-top: 10px; border-top: 1px dashed #e2e8f0;
}
#rrat-synthesis .rrat-syn-mp-count { font-size: 12.5px; color: #475569; }
#rrat-synthesis .rrat-syn-mp-count strong { color: #0D404A; font-weight: 700; }
#rrat-synthesis .rrat-syn-mp-cap { color: #94a3b8; font-size: 11px; }
#rrat-synthesis .rrat-syn-mp-chips {
	display: flex; flex-wrap: wrap; gap: 6px;
}
#rrat-synthesis .rrat-syn-chip-tag {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 10px; font-size: 12px;
	background: #e0f2fe; color: #075985; border-radius: 14px;
}
#rrat-synthesis .rrat-syn-chip-x {
	background: none; border: none; color: #075985; cursor: pointer;
	font-size: 15px; line-height: 1; padding: 0 2px;
}
#rrat-synthesis .rrat-syn-chip-x:hover { color: #b91c1c; }

/* Multi-institution chip header */
#rrat-synthesis .rrat-syn-inst-selected-head {
	display: flex; align-items: center; justify-content: space-between;
	gap: 8px; margin-top: 10px;
}

/* Secondary filter row */
#rrat-synthesis .rrat-syn-secondary {
	display: flex; align-items: flex-end; justify-content: space-between;
	gap: 16px; flex-wrap: wrap;
}
#rrat-synthesis .rrat-syn-actions {
	display: flex; gap: 8px; align-items: center;
}

/* Floating cap warning */
#rrat-synthesis .rrat-syn-flash {
	position: absolute; bottom: -42px; left: 50%; transform: translateX(-50%);
	background: #1e293b; color: #fff;
	padding: 8px 14px; font-size: 12.5px; border-radius: 8px;
	z-index: 30; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
}
#rrat-synthesis .rrat-btn {
	padding: 8px 16px; font-size: 13px; font-weight: 600; border-radius: 6px;
	border: 1px solid transparent; cursor: pointer; display: inline-flex;
	align-items: center; gap: 8px;
}
#rrat-synthesis .rrat-btn-primary { background: #0D404A; color: #fff; }
#rrat-synthesis .rrat-btn-primary:hover { filter: brightness(1.1); }
#rrat-synthesis .rrat-btn-outline { background: #fff; color: #475569; border-color: #cbd5e1; }
#rrat-synthesis .rrat-btn-outline:hover { background: #f8fafc; }

/* Cover */
#rrat-synthesis .rrat-syn-cover {
	background: linear-gradient(135deg, #0D404A 0%, #1a5862 100%);
	color: #fff; padding: 48px 40px; border-radius: 12px;
	margin-bottom: 32px;
}
#rrat-synthesis .rrat-syn-cover-tag {
	font-size: 11px; font-weight: 600; letter-spacing: 0.15em;
	text-transform: uppercase; opacity: 0.85; margin-bottom: 16px;
}
#rrat-synthesis .rrat-syn-cover-title {
	font-size: 36px; font-weight: 700; line-height: 1.2; margin: 0 0 16px;
	color: #fff;
}
#rrat-synthesis .rrat-syn-cover-sub { font-size: 18px; opacity: 0.92; margin-bottom: 12px; }
#rrat-synthesis .rrat-syn-cover-meta { font-size: 13px; opacity: 0.75; }
#rrat-synthesis .rrat-syn-cover-strip {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px; margin-top: 28px; padding-top: 24px;
	border-top: 1px solid rgba(255,255,255,0.18);
}
#rrat-synthesis .rrat-syn-cover-stat {
	background: rgba(255,255,255,0.08); padding: 14px 16px;
	border-radius: 8px; backdrop-filter: blur(4px);
}
#rrat-synthesis .rrat-syn-cover-stat .v {
	font-size: 26px; font-weight: 700; color: #fff; line-height: 1;
}
#rrat-synthesis .rrat-syn-cover-stat .l {
	font-size: 11px; color: rgba(255,255,255,0.78);
	text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px;
}

#rrat-synthesis .rrat-syn-loading {
	text-align: center; padding: 80px 20px; color: #64748b;
	font-size: 15px;
}
#rrat-synthesis .rrat-syn-loading i { color: #0D404A; margin-right: 10px; }
#rrat-synthesis .rrat-syn-error {
	padding: 24px; background: #fef2f2; border: 1px solid #fecaca;
	color: #991b1b; border-radius: 8px;
}

/* Sections */
#rrat-synthesis .rrat-syn-section {
	margin: 0 0 40px;
	padding: 0;
}
#rrat-synthesis .rrat-syn-h2 {
	font-size: 24px; font-weight: 700; margin: 0 0 12px;
	color: #0D404A; padding-bottom: 10px; border-bottom: 2px solid #0D404A;
}
#rrat-synthesis .rrat-syn-lead {
	font-size: 14px; color: #475569; line-height: 1.6; margin: 0 0 18px;
	max-width: 880px;
}
#rrat-synthesis .rrat-syn-chip {
	display: inline-block; padding: 1px 8px; border-radius: 10px;
	font-size: 11px; font-weight: 600; margin-right: 4px;
}
#rrat-synthesis .rrat-syn-chip.ok  { background: #d1fae5; color: #065f46; }
#rrat-synthesis .rrat-syn-chip.mid { background: #fef3c7; color: #92400e; }
#rrat-synthesis .rrat-syn-chip.low { background: #fee2e2; color: #991b1b; }

/* Stats band */
#rrat-synthesis .rrat-syn-stats {
	display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
	margin-bottom: 20px;
}
#rrat-synthesis .rrat-syn-stat {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
	padding: 18px 16px; text-align: center;
}
#rrat-synthesis .rrat-syn-stat-v { font-size: 28px; font-weight: 700; color: #0D404A; line-height: 1; }
#rrat-synthesis .rrat-syn-stat-l { font-size: 12px; color: #64748b; margin-top: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
#rrat-synthesis .rrat-syn-insight {
	background: #f0f9ff; border-left: 4px solid #0284c7;
	padding: 14px 18px; border-radius: 0 6px 6px 0;
	font-size: 14px; line-height: 1.6; color: #0c4a6e;
}

/* Tables (matrix, sectors, annex) */
#rrat-synthesis .rrat-syn-table-wrap { overflow-x: auto; }
#rrat-synthesis .rrat-syn-table {
	width: 100%; border-collapse: collapse; font-size: 12.5px;
	background: #fff; border: 1px solid #e2e8f0;
}
#rrat-synthesis .rrat-syn-table th {
	background: #f8fafc; padding: 10px 12px; text-align: center;
	font-weight: 600; color: #334155; border-bottom: 2px solid #e2e8f0;
	font-size: 11.5px; white-space: nowrap;
}
#rrat-synthesis .rrat-syn-table th:first-child { text-align: left; }
#rrat-synthesis .rrat-syn-table td {
	padding: 9px 12px; text-align: center; border-bottom: 1px solid #f1f5f9;
}
#rrat-synthesis .rrat-syn-table th.country-cell,
#rrat-synthesis .rrat-syn-table td.country-cell,
#rrat-synthesis .rrat-syn-table tbody th { text-align: left; font-weight: 600; }
#rrat-synthesis .rrat-syn-table .mean-row { background: #f8fafc; }
#rrat-synthesis .rrat-syn-table .mean-row th,
#rrat-synthesis .rrat-syn-table .mean-row td { border-top: 2px solid #cbd5e1; font-weight: 700; }
#rrat-synthesis .rrat-syn-table td.ok  { background: #d1fae5; color: #065f46; font-weight: 600; }
#rrat-synthesis .rrat-syn-table td.mid { background: #fef3c7; color: #92400e; font-weight: 600; }
#rrat-synthesis .rrat-syn-table td.low { background: #fee2e2; color: #991b1b; font-weight: 600; }
#rrat-synthesis .rrat-syn-table td.na  { color: #cbd5e1; }
#rrat-synthesis .rrat-syn-table td.composite { background: #f1f5f9; }

/* Country profiles */
#rrat-synthesis .rrat-syn-profiles {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: 16px;
}
#rrat-synthesis .rrat-syn-profile {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
	padding: 20px; page-break-inside: avoid;
}
#rrat-synthesis .rrat-syn-profile-head {
	display: flex; justify-content: space-between; align-items: flex-start;
	gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #f1f5f9;
	margin-bottom: 14px;
}
#rrat-synthesis .rrat-syn-profile h3 { margin: 0; font-size: 18px; color: #0D404A; }
#rrat-synthesis .rrat-syn-profile-meta { font-size: 12px; color: #64748b; margin-top: 4px; }
#rrat-synthesis .rrat-syn-rcmm-badge {
	font-size: 22px; font-weight: 700; padding: 8px 14px; border-radius: 8px; min-width: 56px; text-align: center;
}
#rrat-synthesis .rrat-syn-rcmm-badge.ok  { background: #d1fae5; color: #065f46; }
#rrat-synthesis .rrat-syn-rcmm-badge.mid { background: #fef3c7; color: #92400e; }
#rrat-synthesis .rrat-syn-rcmm-badge.low { background: #fee2e2; color: #991b1b; }
#rrat-synthesis .rrat-syn-profile-cols {
	display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
}
#rrat-synthesis .rrat-syn-profile-cols h4 {
	margin: 0 0 8px; font-size: 12px; color: #64748b;
	text-transform: uppercase; letter-spacing: 0.05em;
}
#rrat-synthesis .rrat-syn-profile-cols ul { list-style: none; padding: 0; margin: 0; }
#rrat-synthesis .rrat-syn-profile-cols li {
	font-size: 13px; padding: 5px 0; line-height: 1.4;
	border-bottom: 1px dotted #f1f5f9;
}
#rrat-synthesis .rrat-syn-profile-cols li:last-child { border-bottom: none; }
#rrat-synthesis .rrat-syn-profile-cols li strong { color: #0D404A; }

/* Tier matrix */
#rrat-synthesis .rrat-syn-tiers { display: grid; gap: 16px; }
#rrat-synthesis .rrat-syn-tier {
	background: #fff; border: 1px solid #e2e8f0; border-left: 6px solid #94a3b8;
	border-radius: 8px; padding: 18px 20px; page-break-inside: avoid;
}
#rrat-synthesis .rrat-syn-tier.tier-1 { border-left-color: #059669; }
#rrat-synthesis .rrat-syn-tier.tier-2 { border-left-color: #0284c7; }
#rrat-synthesis .rrat-syn-tier.tier-3 { border-left-color: #d97706; }
#rrat-synthesis .rrat-syn-tier.tier-4 { border-left-color: #dc2626; }
#rrat-synthesis .rrat-syn-tier-head {
	display: flex; justify-content: space-between; align-items: baseline;
	gap: 12px; margin-bottom: 6px;
}
#rrat-synthesis .rrat-syn-tier-head h3 { margin: 0; font-size: 17px; color: #0D404A; }
#rrat-synthesis .rrat-syn-tier-count { font-size: 14px; color: #475569; font-weight: 600; }
#rrat-synthesis .rrat-syn-tier-criteria { font-size: 12.5px; color: #64748b; margin-bottom: 12px; font-style: italic; }
#rrat-synthesis .rrat-syn-tier-table {
	width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px;
}
#rrat-synthesis .rrat-syn-tier-table th,
#rrat-synthesis .rrat-syn-tier-table td {
	padding: 7px 10px; border-bottom: 1px solid #f1f5f9; text-align: left;
}
#rrat-synthesis .rrat-syn-tier-table th { background: #f8fafc; font-size: 11px; color: #475569; font-weight: 600; }
#rrat-synthesis .rrat-syn-tier-more { font-size: 12px; color: #64748b; margin-top: 8px; font-style: italic; }
#rrat-synthesis .rrat-syn-tier-empty { font-size: 13px; color: #94a3b8; font-style: italic; padding: 12px 0; }

/* Annex */
#rrat-synthesis .rrat-syn-annex-block { margin-bottom: 28px; }
#rrat-synthesis .rrat-syn-annex-block h3 {
	font-size: 16px; font-weight: 700; color: #0D404A;
	margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid #cbd5e1;
}
#rrat-synthesis .rrat-syn-annex-table .rrat-syn-indicator-cell {
	text-align: left; font-weight: 500; max-width: 280px;
	white-space: normal; line-height: 1.35;
}
#rrat-synthesis .rrat-syn-annex-table .rrat-syn-assessment {
	text-align: left; font-size: 12px; color: #475569;
	max-width: 280px; white-space: normal; line-height: 1.4;
	font-style: italic;
}
#rrat-synthesis .rrat-syn-annex-table .rrat-syn-assessment-col { min-width: 240px; }
#rrat-synthesis .rrat-syn-annex-table td.overall { background: #f1f5f9; font-weight: 700; }

#rrat-synthesis .rrat-syn-footer {
	margin-top: 40px; padding-top: 18px; border-top: 1px solid #e2e8f0;
	font-size: 12px; color: #94a3b8; text-align: center;
}

/* Print stylesheet — produces a clean PDF via the browser's "Save as PDF" */
@media print {
	@page { size: A4; margin: 14mm 12mm; }

	body { background: #fff !important; }
	#rrat-synthesis { max-width: none; margin: 0; padding: 0; color: #000; }
	#rrat-synthesis .no-print,
	.rrat-rrat-preview-banner,
	header, .site-header, nav, footer.site-footer, .wp-block-navigation,
	.elementor-section.no-print { display: none !important; }

	#rrat-synthesis .rrat-syn-cover {
		background: #0D404A !important; color: #fff !important;
		-webkit-print-color-adjust: exact; print-color-adjust: exact;
		padding: 30mm 18mm !important; margin-bottom: 12mm !important;
		page-break-after: always;
	}
	#rrat-synthesis .rrat-syn-cover-title { font-size: 28pt !important; }
	#rrat-synthesis .rrat-syn-cover-sub { font-size: 14pt !important; }

	#rrat-synthesis .rrat-syn-h2 { color: #0D404A !important; font-size: 16pt; page-break-after: avoid; }
	#rrat-synthesis .rrat-syn-section { page-break-inside: avoid; margin-bottom: 8mm; }
	#rrat-synthesis .rrat-syn-stats { gap: 6px; }
	#rrat-synthesis .rrat-syn-stat-v { font-size: 18pt; }
	#rrat-synthesis .rrat-syn-stat-l { font-size: 8pt; }

	#rrat-synthesis .rrat-syn-table { font-size: 9pt; }
	#rrat-synthesis .rrat-syn-table th { font-size: 8.5pt; padding: 5px 6px; }
	#rrat-synthesis .rrat-syn-table td { padding: 4px 6px; }
	#rrat-synthesis .rrat-syn-table td.ok  { background: #d1fae5 !important; color: #065f46 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	#rrat-synthesis .rrat-syn-table td.mid { background: #fef3c7 !important; color: #92400e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	#rrat-synthesis .rrat-syn-table td.low { background: #fee2e2 !important; color: #991b1b !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	#rrat-synthesis .rrat-syn-table td.composite,
	#rrat-synthesis .rrat-syn-table .mean-row { background: #f1f5f9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

	#rrat-synthesis .rrat-syn-rcmm-badge {
		-webkit-print-color-adjust: exact; print-color-adjust: exact;
	}
	#rrat-synthesis .rrat-syn-tier {
		-webkit-print-color-adjust: exact; print-color-adjust: exact;
	}

	#rrat-synthesis .rrat-syn-profile,
	#rrat-synthesis .rrat-syn-tier,
	#rrat-synthesis .rrat-syn-annex-block { page-break-inside: avoid; }
	.page-break-before { page-break-before: always; }
}

/* ── v1.6: AI synthesis additions ─────────────────────────────────── */

/* Multi-select countries — wider than the standard selects. */
#rrat-synthesis #syn-countries { min-width: 240px; max-width: 320px; }

/* Institution typeahead picker. */
#rrat-synthesis #syn-institution-wrap { position: relative; min-width: 280px; }
#rrat-synthesis #syn-inst-search {
	display: block; margin-top: 4px; padding: 7px 10px; font-size: 13px;
	border: 1px solid #cbd5e1; border-radius: 6px; background: #fff;
	width: 100%; min-width: 260px;
}
#rrat-synthesis .rrat-syn-inst-results {
	position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
	background: #fff; border: 1px solid #cbd5e1; border-top: none;
	border-radius: 0 0 6px 6px; max-height: 260px; overflow-y: auto;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
#rrat-synthesis .rrat-syn-inst-result {
	padding: 8px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f1f5f9;
	display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
#rrat-synthesis .rrat-syn-inst-result:hover { background: #f8fafc; }
#rrat-synthesis .rrat-syn-inst-country { color: #64748b; font-size: 12px; }
#rrat-synthesis .rrat-syn-inst-comp { color: #0D404A; font-weight: 600; font-size: 12px; }
#rrat-synthesis .rrat-syn-inst-noresults { padding: 12px; color: #64748b; font-size: 13px; }
#rrat-synthesis .rrat-syn-inst-selected { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
#rrat-synthesis .rrat-syn-inst-tag {
	display: inline-flex; align-items: center; gap: 6px;
	background: #e0f2fe; color: #075985; padding: 4px 8px;
	border-radius: 14px; font-size: 12px;
}
#rrat-synthesis .rrat-syn-inst-tag small { color: #0369a1; opacity: 0.85; }
#rrat-synthesis .rrat-syn-inst-remove {
	background: none; border: none; color: #075985; cursor: pointer;
	font-size: 16px; line-height: 1; padding: 0 2px;
}
#rrat-synthesis .rrat-syn-inst-remove:hover { color: #b91c1c; }

/* AI error banner (admin only). */
#rrat-synthesis .rrat-syn-ai-error {
	padding: 12px 16px; margin: 0 0 18px;
	background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
	border-radius: 8px; font-size: 13px;
}
#rrat-synthesis .rrat-syn-ai-error a {
	margin-left: 8px; color: #9a3412; text-decoration: underline; font-weight: 600;
}

/* AI narrative paragraphs sit between deterministic tables and the next section. */
#rrat-synthesis .rrat-syn-narrative {
	font-size: 14.5px; color: #334155; line-height: 1.65;
	margin: 14px 0 4px; max-width: 880px;
}
#rrat-synthesis .rrat-syn-narrative:empty { display: none; }

/* Per-profile AI commentary. */
#rrat-synthesis .rrat-syn-profile-commentary {
	font-size: 13.5px; color: #334155; line-height: 1.6;
	background: #f8fafc; border-left: 3px solid #0D404A;
	padding: 10px 14px; margin: 10px 0 14px; border-radius: 0 6px 6px 0;
}

/* AI tier description sits below the criteria line. */
#rrat-synthesis .rrat-syn-tier-desc {
	font-size: 13px; color: #475569; line-height: 1.55;
	margin: 6px 0 10px; font-style: italic;
}

/* Strategic recommendations — v1 fallback (legacy <ol> list of strings). */
#rrat-synthesis .rrat-syn-recs-legacy { font-size: 14.5px; color: #1e293b; line-height: 1.7; padding-left: 20px; }
#rrat-synthesis .rrat-syn-recs-legacy li { margin-bottom: 8px; }

/* ── v2 narrative sections ──────────────────────────────────────────── */

/* Background context paragraph — sits between stats band and exec summary. */
#rrat-synthesis .rrat-syn-narrative-lead {
	font-size: 15px; color: #1e293b; line-height: 1.7;
	border-left: 3px solid #0D404A;
	padding: 4px 0 4px 16px; margin: 18px 0 14px;
	max-width: 880px;
}
#rrat-synthesis .rrat-syn-narrative-prose {
	font-size: 14.5px; color: #334155; line-height: 1.7;
	max-width: 880px;
}

/* Indicator deep-reads — card grid of analytical reads. */
#rrat-synthesis .rrat-syn-deepreads {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 14px;
}
#rrat-synthesis .rrat-syn-deepread {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
	padding: 16px 18px; page-break-inside: avoid;
	border-top: 3px solid #0D404A;
}
#rrat-synthesis .rrat-syn-deepread-head {
	display: flex; justify-content: space-between; align-items: flex-start;
	gap: 8px; margin-bottom: 10px;
}
#rrat-synthesis .rrat-syn-deepread-head h3 {
	margin: 0; font-size: 15px; color: #0D404A; line-height: 1.35;
}
#rrat-synthesis .rrat-syn-deepread-var {
	font-size: 10.5px; color: #94a3b8; font-family: 'SF Mono', Menlo, monospace;
	background: #f1f5f9; padding: 1px 6px; border-radius: 4px; white-space: nowrap;
}
#rrat-synthesis .rrat-syn-deepread-body {
	margin: 0 0 10px; font-size: 13.5px; color: #334155; line-height: 1.6;
}
#rrat-synthesis .rrat-syn-deepread-implication {
	margin: 0; font-size: 13px; color: #075985; line-height: 1.55;
	background: #f0f9ff; padding: 8px 12px; border-radius: 6px;
}
#rrat-synthesis .rrat-syn-deepread-implication strong { color: #0c4a6e; }

/* Risk & Opportunity matrix */
#rrat-synthesis .rrat-syn-riskopp {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: 18px;
}
#rrat-synthesis .rrat-syn-ro-col h3 {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 16px; color: #0D404A; margin: 0 0 10px;
}
#rrat-synthesis .rrat-syn-ro-col-risks h3 i { color: #b91c1c; }
#rrat-synthesis .rrat-syn-ro-col-opps  h3 i { color: #d97706; }
#rrat-synthesis .rrat-syn-ro-col ul {
	list-style: none; padding: 0; margin: 0;
	display: flex; flex-direction: column; gap: 10px;
}
#rrat-synthesis .rrat-syn-ro-item {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
	padding: 12px 14px; page-break-inside: avoid;
	border-left: 4px solid #cbd5e1;
}
#rrat-synthesis .rrat-syn-ro-item h4 {
	margin: 0 0 6px; font-size: 14px; color: #0D404A; line-height: 1.4;
}
#rrat-synthesis .rrat-syn-ro-item p {
	margin: 0; font-size: 13px; color: #475569; line-height: 1.55;
}
#rrat-synthesis .rrat-syn-ro-tag {
	display: inline-block; font-size: 10.5px; font-weight: 600;
	text-transform: uppercase; letter-spacing: 0.05em;
	padding: 2px 8px; border-radius: 10px; margin-bottom: 8px;
	background: #f1f5f9; color: #475569;
}
#rrat-synthesis .rrat-syn-ro-sev-high   { border-left-color: #dc2626; }
#rrat-synthesis .rrat-syn-ro-sev-high   .rrat-syn-ro-tag { background: #fee2e2; color: #991b1b; }
#rrat-synthesis .rrat-syn-ro-sev-medium { border-left-color: #f59e0b; }
#rrat-synthesis .rrat-syn-ro-sev-medium .rrat-syn-ro-tag { background: #fef3c7; color: #92400e; }
#rrat-synthesis .rrat-syn-ro-sev-low    { border-left-color: #94a3b8; }
#rrat-synthesis .rrat-syn-ro-sev-low    .rrat-syn-ro-tag { background: #f1f5f9; color: #475569; }
#rrat-synthesis .rrat-syn-ro-lev-high   { border-left-color: #059669; }
#rrat-synthesis .rrat-syn-ro-lev-high   .rrat-syn-ro-tag { background: #d1fae5; color: #065f46; }
#rrat-synthesis .rrat-syn-ro-lev-medium { border-left-color: #0284c7; }
#rrat-synthesis .rrat-syn-ro-lev-medium .rrat-syn-ro-tag { background: #e0f2fe; color: #075985; }
#rrat-synthesis .rrat-syn-ro-lev-low    { border-left-color: #94a3b8; }
#rrat-synthesis .rrat-syn-ro-lev-low    .rrat-syn-ro-tag { background: #f1f5f9; color: #475569; }

/* Strategic recommendations — structured action cards (v2). */
#rrat-synthesis .rrat-syn-recs {
	display: flex; flex-direction: column; gap: 12px;
	font-size: 14.5px; color: #1e293b; line-height: 1.65;
	padding: 0;
}
#rrat-synthesis .rrat-syn-rec {
	display: flex; gap: 14px; align-items: flex-start;
	background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
	padding: 16px 18px; page-break-inside: avoid;
	border-left: 4px solid #0D404A;
}
#rrat-synthesis .rrat-syn-rec-num {
	flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
	background: #0D404A; color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 15px;
}
#rrat-synthesis .rrat-syn-rec-body { flex: 1; }
#rrat-synthesis .rrat-syn-rec-action {
	margin: 0 0 6px; font-size: 15px; line-height: 1.4; color: #0D404A;
}
#rrat-synthesis .rrat-syn-rec-rationale {
	margin: 0 0 10px; font-size: 13.5px; color: #475569; line-height: 1.55;
}
#rrat-synthesis .rrat-syn-rec-meta {
	display: flex; flex-wrap: wrap; gap: 6px;
}
#rrat-synthesis .rrat-syn-rec-pill {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 3px 9px; font-size: 11.5px; color: #475569;
	background: #f1f5f9; border-radius: 12px;
}
#rrat-synthesis .rrat-syn-rec-pill i { color: #0D404A; font-size: 10.5px; }

/* Audience briefs — side-by-side policy + funder cards */
#rrat-synthesis .rrat-syn-briefs {
	display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
	gap: 16px;
}
#rrat-synthesis .rrat-syn-brief {
	background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
	padding: 18px 20px; page-break-inside: avoid;
}
#rrat-synthesis .rrat-syn-brief-policy { border-top: 4px solid #0D404A; }
#rrat-synthesis .rrat-syn-brief-funder { border-top: 4px solid #d97706; }
#rrat-synthesis .rrat-syn-brief-tag {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 11.5px; font-weight: 600; color: #0D404A;
	text-transform: uppercase; letter-spacing: 0.06em;
	margin-bottom: 10px;
}
#rrat-synthesis .rrat-syn-brief-funder .rrat-syn-brief-tag { color: #b45309; }
#rrat-synthesis .rrat-syn-brief-body {
	font-size: 14px; color: #1e293b; line-height: 1.7;
}

/* Further research — open questions list */
#rrat-synthesis .rrat-syn-further {
	list-style: none; padding: 0; margin: 0;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 10px;
}
#rrat-synthesis .rrat-syn-further li {
	background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
	padding: 12px 14px 12px 38px; font-size: 13.5px; color: #334155;
	line-height: 1.55; position: relative;
}
#rrat-synthesis .rrat-syn-further li::before {
	content: "?"; position: absolute; left: 12px; top: 11px;
	width: 18px; height: 18px; border-radius: 50%;
	background: #0D404A; color: #fff;
	display: flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 700;
}

@media print {
	#rrat-synthesis .rrat-syn-ai-error,
	#rrat-synthesis .rrat-syn-inst-results,
	#rrat-synthesis .rrat-syn-toolbar { display: none !important; }
	#rrat-synthesis .rrat-syn-profile-commentary,
	#rrat-synthesis .rrat-syn-brief,
	#rrat-synthesis .rrat-syn-deepread,
	#rrat-synthesis .rrat-syn-rec,
	#rrat-synthesis .rrat-syn-ro-item { background: #fff !important; }
}

