/* SLS LRS Dashboards */

.sls-lrs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1rem;
	margin: 1rem 0;
}

.sls-lrs-card {
	background: var(--sls-lrs-card-bg, #ffffff);
	border: 1px solid var(--sls-lrs-card-border, rgba(0, 0, 0, 0.08));
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	padding: 1rem 1.25rem;
	margin: 0 0 1rem;
	/* Pin text color: dark-theme sites (Nexus) set global light text,
	   which would be invisible on the white card background. */
	color: var(--sls-lrs-text, #1e293b);
}

.sls-lrs-grid .sls-lrs-card { margin: 0; }

.sls-lrs-title {
	margin: 0 0 0.15rem;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: inherit;
	opacity: 0.85;
}

.sls-lrs-subtitle {
	margin: 0 0 0.85rem;
	font-size: 0.75rem;
	color: inherit;
	opacity: 0.55;
}

.sls-lrs-body {
	position: relative;
	height: var(--sls-lrs-h, 320px);
	overflow: auto;
	color: inherit;
}

/* DOM-rendered widgets size to their content. */
.sls-lrs-type-kpi .sls-lrs-body,
.sls-lrs-type-ranklist .sls-lrs-body,
.sls-lrs-type-scorelist .sls-lrs-body,
.sls-lrs-type-feed .sls-lrs-body {
	height: auto;
	min-height: 0;
	overflow: visible;
}

.sls-lrs-body canvas { max-height: 100%; }

.sls-lrs-loading,
.sls-lrs-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 80px;
	height: 100%;
	opacity: 0.5;
	font-size: 0.9rem;
}

.sls-lrs-error {
	color: #b32d2e;
	font-size: 0.85rem;
	padding: 0.5rem 0;
}

/* KPI row */
.sls-lrs-kpis {
	display: flex;
	gap: 1rem;
	align-items: center;
	justify-content: space-around;
	flex-wrap: wrap;
	padding: 0.75rem 0;
}

.sls-lrs-kpi { text-align: center; }

.sls-lrs-kpi-value {
	font-size: 2.2rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--sls-lrs-accent, #2563eb);
}

.sls-lrs-kpi-label {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: inherit;
	opacity: 0.6;
	margin-top: 0.25rem;
}

/* Ranked list (ranklist / scorelist) */
.sls-lrs-rank {
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	padding: 0.25rem 0;
}

.sls-lrs-rank-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 0.75rem;
	margin-bottom: 0.2rem;
	font-size: 0.85rem;
}

.sls-lrs-rank-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: inherit;
}

.sls-lrs-rank-value {
	font-weight: 600;
	flex-shrink: 0;
	font-variant-numeric: tabular-nums;
}

.sls-lrs-bar-track {
	height: 6px;
	border-radius: 3px;
	background: var(--sls-lrs-track, rgba(0, 0, 0, 0.07));
	overflow: hidden;
}

.sls-lrs-bar-fill {
	height: 100%;
	border-radius: 3px;
}

.sls-lrs-legend {
	display: flex;
	gap: 1rem;
	margin-top: 0.85rem;
	font-size: 0.72rem;
	opacity: 0.7;
}

.sls-lrs-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
}

.sls-lrs-legend-dot {
	width: 9px;
	height: 9px;
	border-radius: 2px;
	display: inline-block;
}

/* Activity feed */
.sls-lrs-feed {
	display: flex;
	flex-direction: column;
}

.sls-lrs-feed-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--sls-lrs-card-border, rgba(0, 0, 0, 0.08));
	font-size: 0.85rem;
	background: transparent;
}

.sls-lrs-feed-row:last-child { border-bottom: none; }

.sls-lrs-avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.68rem;
	font-weight: 600;
	flex-shrink: 0;
}

.sls-lrs-feed-actor {
	font-weight: 600;
	flex-shrink: 0;
	max-width: 7.5rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.sls-lrs-chip {
	font-size: 0.7rem;
	font-weight: 600;
	padding: 2px 9px;
	border-radius: 9px;
	flex-shrink: 0;
	line-height: 1.5;
}

.sls-lrs-feed-object {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	opacity: 0.75;
}

.sls-lrs-feed-time {
	flex-shrink: 0;
	font-size: 0.75rem;
	opacity: 0.5;
	font-variant-numeric: tabular-nums;
}

/* Legacy table (kept for custom charts) — hardened against theme striping */
.sls-lrs-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.85rem;
	background: transparent;
}

.sls-lrs-card .sls-lrs-table tr,
.sls-lrs-card .sls-lrs-table tr:nth-child(odd),
.sls-lrs-card .sls-lrs-table tr:nth-child(even) {
	background: transparent;
	color: inherit;
}

.sls-lrs-table th,
.sls-lrs-table td {
	text-align: left;
	padding: 0.45rem 0.6rem;
	border: none;
	border-bottom: 1px solid var(--sls-lrs-card-border, rgba(0, 0, 0, 0.08));
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 220px;
	color: inherit;
}

.sls-lrs-table th {
	text-transform: capitalize;
	font-weight: 600;
	opacity: 0.7;
	position: sticky;
	top: 0;
	background: var(--sls-lrs-card-bg, #ffffff);
}

.sls-lrs-embed { display: block; margin: 1rem 0; }

/* Learner progress widgets */
.sls-lrs-login-note {
	font-size: 0.9rem;
	opacity: 0.75;
}

.sls-lrs-progress-head {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.25rem;
}

.sls-lrs-progress-pct {
	font-size: 1.6rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--sls-lrs-accent, #2563eb);
	font-variant-numeric: tabular-nums;
}

.sls-lrs-rank-label a {
	color: inherit;
	text-decoration: none;
}

.sls-lrs-rank-label a:hover { text-decoration: underline; }

.sls-lrs-more {
	font-size: 0.78rem;
	opacity: 0.6;
}

.sls-lrs-lesson-card .sls-lrs-title .sls-lrs-chip {
	margin-left: 0.5rem;
	vertical-align: middle;
}

/* Learner journal portfolio */
.sls-journal-portfolio {
	--sls-journal-ink: #172033;
	--sls-journal-muted: #64748b;
	--sls-journal-line: #dbe3ea;
	--sls-journal-accent: #0f766e;
	max-width: 920px;
	margin: 1.5rem auto;
	background: #ffffff;
	border: 1px solid var(--sls-journal-line);
	border-radius: 8px;
	overflow: hidden;
	color: var(--sls-journal-ink);
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
	font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sls-journal-portfolio,
.sls-journal-portfolio * { box-sizing: border-box; }

.sls-journal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 2rem 2.25rem 1.5rem;
	border-bottom: 1px solid var(--sls-journal-line);
}

.sls-journal-heading { min-width: 0; }

.sls-journal-eyebrow,
.sls-journal-entry-number,
.sls-journal-role,
.sls-journal-prompt > span {
	margin: 0 0 0.35rem;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--sls-journal-accent);
}

.sls-journal-header h1 {
	margin: 0;
	font-size: 2rem;
	line-height: 1.15;
	font-weight: 750;
	letter-spacing: 0;
	color: var(--sls-journal-ink);
}

.sls-journal-byline {
	margin: 0.55rem 0 0;
	font-size: 0.95rem;
	color: var(--sls-journal-muted);
}

.sls-journal-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.65rem;
	flex-wrap: wrap;
	flex-shrink: 0;
}

.sls-journal-status {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 0.75rem;
	border: 1px solid #99d5cf;
	border-radius: 6px;
	background: #e9f7f5;
	color: #115e59;
	font-size: 0.78rem;
	font-weight: 700;
}

.sls-journal-print {
	min-height: 36px;
	padding: 0.45rem 0.8rem;
	border: 1px solid var(--sls-journal-accent);
	border-radius: 6px;
	background: var(--sls-journal-accent);
	color: #ffffff;
	font: inherit;
	font-size: 0.8rem;
	font-weight: 700;
	cursor: pointer;
}

.sls-journal-print:hover,
.sls-journal-print:focus-visible {
	background: #115e59;
	border-color: #115e59;
}

.sls-journal-print:focus-visible {
	outline: 3px solid rgba(15, 118, 110, 0.25);
	outline-offset: 2px;
}

.sls-journal-summary {
	display: flex;
	gap: 1.25rem;
	padding: 0.8rem 2.25rem;
	background: #f7fafc;
	border-bottom: 1px solid var(--sls-journal-line);
	font-size: 0.78rem;
	font-weight: 650;
	color: var(--sls-journal-muted);
}

.sls-journal-entries { padding: 0 2.25rem; }

.sls-journal-entry {
	padding: 2rem 0 2.25rem;
	border-bottom: 1px solid var(--sls-journal-line);
}

.sls-journal-entry:last-child { border-bottom: none; }

.sls-journal-entry-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.sls-journal-entry-header h2 {
	margin: 0;
	font-size: 1.2rem;
	line-height: 1.3;
	font-weight: 720;
	letter-spacing: 0;
	color: var(--sls-journal-ink);
}

.sls-journal-entry-header time {
	font-size: 0.78rem;
	color: var(--sls-journal-muted);
	white-space: nowrap;
}

.sls-journal-prompt {
	margin-bottom: 1.25rem;
	padding: 1rem 1.1rem;
	border-left: 4px solid var(--sls-journal-accent);
	background: #f4f8f8;
}

.sls-journal-prompt p {
	margin: 0;
	font-size: 1rem;
	line-height: 1.55;
	font-weight: 620;
	color: var(--sls-journal-ink);
}

.sls-journal-conversation {
	display: flex;
	flex-direction: column;
	gap: 0.8rem;
}

.sls-journal-followup-label {
	margin: 0.7rem 0 0;
	padding-top: 1rem;
	border-top: 1px dashed var(--sls-journal-line);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sls-journal-muted);
}

.sls-journal-message {
	width: min(88%, 700px);
	padding: 0.9rem 1rem;
	border: 1px solid var(--sls-journal-line);
	border-radius: 6px;
	break-inside: avoid;
}

.sls-journal-message--student {
	align-self: flex-end;
	background: #e9f7f5;
	border-color: #b8e0dc;
}

.sls-journal-message--siera {
	align-self: flex-start;
	background: #f5f7fa;
}

.sls-journal-message--missing {
	align-self: flex-start;
	background: #ffffff;
	border-style: dashed;
	color: var(--sls-journal-muted);
}

.sls-journal-message--student .sls-journal-role { text-align: right; }
.sls-journal-message--missing .sls-journal-role { color: var(--sls-journal-muted); }

.sls-journal-message-text {
	font-size: 0.94rem;
	line-height: 1.62;
	color: inherit;
	overflow-wrap: anywhere;
}

.sls-journal-empty {
	padding: 3rem 2.25rem;
	text-align: center;
}

.sls-journal-empty h2 {
	margin: 0 0 0.5rem;
	font-size: 1.2rem;
	color: var(--sls-journal-ink);
}

.sls-journal-empty p {
	margin: 0;
	color: var(--sls-journal-muted);
}

.sls-journal-footer {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem 2.25rem;
	border-top: 1px solid var(--sls-journal-line);
	background: #f7fafc;
	font-size: 0.7rem;
	color: var(--sls-journal-muted);
}

.sls-journal-course-picker {
	max-width: 920px;
	margin: 1.5rem auto;
	padding: 1.5rem;
	border: 1px solid #dbe3ea;
	border-radius: 8px;
	background: #ffffff;
	color: #172033;
}

.sls-journal-course-picker h2 {
	margin: 0 0 1rem;
	font-size: 1.35rem;
	letter-spacing: 0;
	color: inherit;
}

.sls-journal-course-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.75rem;
}

.sls-journal-course-list a {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 0.8rem;
	min-height: 110px;
	padding: 1rem;
	border: 1px solid #dbe3ea;
	border-radius: 6px;
	background: #f7fafc;
	color: #172033;
	text-decoration: none;
}

.sls-journal-course-list a:hover,
.sls-journal-course-list a:focus-visible {
	border-color: #0f766e;
	background: #f1f9f8;
}

.sls-journal-course-list strong {
	font-size: 0.75rem;
	color: #0f766e;
}

@media (max-width: 680px) {
	.sls-journal-portfolio { margin: 1rem 0; }
	.sls-journal-header { flex-direction: column; padding: 1.5rem 1.25rem 1.2rem; }
	.sls-journal-header h1 { font-size: 1.55rem; }
	.sls-journal-actions { justify-content: flex-start; }
	.sls-journal-summary { padding: 0.75rem 1.25rem; flex-wrap: wrap; }
	.sls-journal-entries { padding: 0 1.25rem; }
	.sls-journal-entry { padding: 1.5rem 0 1.75rem; }
	.sls-journal-entry-header { flex-direction: column; }
	.sls-journal-message { width: 100%; }
	.sls-journal-footer { padding: 1rem 1.25rem; flex-direction: column; }
}

@media print {
	@page { margin: 15mm; }
	body.sls-journal-printing * { visibility: hidden !important; }
	body.sls-journal-printing .sls-journal-portfolio,
	body.sls-journal-printing .sls-journal-portfolio * { visibility: visible !important; }
	body.sls-journal-printing .sls-journal-portfolio {
		position: absolute;
		inset: 0 auto auto 0;
		width: 100%;
		max-width: none;
		margin: 0;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
	body.sls-journal-printing .sls-journal-actions,
	body.sls-journal-printing .sls-journal-footer { display: none; }
	body.sls-journal-printing .sls-journal-header { padding: 0 0 1rem; }
	body.sls-journal-printing .sls-journal-summary { padding: 0.7rem 0; }
	body.sls-journal-printing .sls-journal-entries { padding: 0; }
	body.sls-journal-printing .sls-journal-entry { padding: 1.25rem 0 1.5rem; }
	body.sls-journal-printing .sls-journal-footer { padding: 0.8rem 0; }
	body.sls-journal-printing .sls-journal-entry-header,
	body.sls-journal-printing .sls-journal-prompt,
	body.sls-journal-printing .sls-journal-message { break-inside: avoid; }
	body.sls-journal-printing .sls-journal-entry-header {
		break-after: avoid-page;
		page-break-after: avoid;
	}
	body.sls-journal-printing .sls-journal-prompt {
		break-before: avoid-page;
		page-break-before: avoid;
	}
}
