/* Components – the Bootstrap-named building blocks (navbar, button, button group, dropdown, tabs, card,
   accordion, form, table, alert, badge, progress, toast, modal, dialog, pagination), each with its full
   set of variants. Loaded before app.css, which overrides them where a view needs to. */

/* Navbar */
.navbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-2);
	z-index: 1000;
}
.navbar-expand {
	flex-wrap: nowrap;
	justify-content: flex-start;
}
.navbar-dark {
	color: var(--white-color);
}
.navbar-brand {
	display: flex;
	flex: none;
	/* Stretched as a flex item the text pins to the top of the row, drifting further up the
	   smaller the clamp makes it – centre the box itself instead. */
	align-self: center;
	align-items: center;
	justify-content: center;
	/* Off the spacing scale on purpose: at the clamp's 1.25rem ceiling this makes the brand 40px, the
	   height of the bar's buttons, which keeps the navbar at --navbar-height. */
	padding-block: 0.3125rem;
	margin-right: clamp(var(--space-1), 1.5vw, var(--space-3));
	/* Fluid, so off the type scale: the name shrinks with the viewport instead of wrapping the bar */
	font-size: clamp(0.85rem, 3vw, 1.25rem);
	white-space: nowrap;
	text-decoration: none;
	color: var(--white-color);
}
.navbar-nav {
	display: flex;
	flex: none;
	flex-direction: row;
	padding-left: 0;
	margin-bottom: 0;
	list-style: none;
}
.navbar-nav:not(.mobile) .nav-item {
	margin-left: var(--space-2);
}
/* Brand, menu and tools keep their width – the selection buttons are the only navbar item that gives ground. */
#navbarTools {
	flex: none;
}
/* Still opens its panel, which says why */
#webMcpBtn[data-webmcp-status="unavailable"] {
	opacity: 0.55;
}
#selectionButtons {
	min-width: 0;
}
#variableSelectionBtn,
#caseSelectionBtn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-1-5);
	min-width: 0;
	white-space: nowrap;
}
#variableSelectionBtn > span:first-child,
#caseSelectionBtn > span:first-child {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}
#variableSelectionBtn > span:last-child,
#caseSelectionBtn > span:last-child {
	flex: none;
}
[data-tool-label] {
	display: none;
	margin-left: var(--space-1-5);
}
@media (min-width: 1280px) {
	[data-tool-label] {
		display: inline;
	}
}
@media (min-width: 768px) {
	.desktop {
		display: initial;
	}
	.mobile {
		display: none;
	}
}
@media (max-width: 768px) {
	.desktop {
		display: none;
	}
	.mobile {
		display: initial;
	}
}

/* Buttons */
.btn {
	display: inline-block;
	font-weight: 400;
	text-align: center;
	vertical-align: middle;
	-webkit-user-select: none;
	user-select: none;
	border: 1px solid transparent;
	padding: var(--space-1-5) var(--space-2-5);
	font-size: var(--font-size-base);
	line-height: 1.5;
	border-radius: var(--border-radius);
	transition: all 0.15s ease-in-out;
	cursor: pointer;
	text-decoration: none;
}
.btn:disabled {
	opacity: 0.65;
	pointer-events: none;
}
.btn-primary {
	color: var(--white-color);
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.btn-primary:hover {
	background-color: var(--primary-hover);
}
.btn-secondary {
	color: var(--white-color);
	background-color: var(--secondary-color);
	border-color: var(--secondary-color);
}
.btn-light {
	color: var(--dark-color);
	background-color: var(--light-color);
	border-color: var(--light-color);
}
.btn-success {
	color: var(--white-color);
	background-color: var(--success-color);
	border-color: var(--success-color);
}
.btn-success:hover {
	background-color: var(--success-hover);
}
.btn-warning {
	color: var(--black-color);
	background-color: var(--warning-color);
	border-color: var(--warning-color);
}
.btn-warning:hover {
	background-color: var(--warning-hover);
	border-color: var(--warning-hover);
}
.btn-danger {
	color: var(--white-color);
	background-color: var(--danger-color);
	border-color: var(--danger-color);
}
.btn-outline-danger {
	color: var(--danger-color);
	background-color: transparent;
	border-color: var(--danger-color);
}
.btn-outline-primary {
	color: var(--primary-color);
	background-color: transparent;
	border-color: var(--primary-color);
}
.btn-outline-secondary {
	color: var(--secondary-color);
	background-color: transparent;
	border-color: var(--secondary-color);
}
.btn-link {
	color: var(--primary-color);
	text-decoration: underline;
	background-color: transparent;
	border-color: transparent;
}
.btn-link:hover {
	color: var(--primary-hover);
}
.btn-sm {
	padding: var(--space-1) var(--space-2);
	font-size: var(--font-size-sm);
}

/* Button group */
.btn-group {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
}
.btn-group > .btn {
	position: relative;
	flex: 1 1 auto;
}
.btn-group > .btn:not(:first-child) {
	margin-left: -1px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.btn-group > .btn:not(:last-child) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}
/* Fix for btn-check pattern: first/last visible buttons */
.btn-group > .btn-check:first-child + .btn {
	border-top-left-radius: var(--border-radius);
	border-bottom-left-radius: var(--border-radius);
}
.btn-group > .btn-check:last-of-type + .btn {
	border-top-right-radius: var(--border-radius);
	border-bottom-right-radius: var(--border-radius);
}
.btn-group-sm > .btn {
	padding: var(--space-1) var(--space-2);
	font-size: var(--font-size-sm);
}

/* Button check (toggle buttons) */
.btn-check {
	position: absolute;
	clip: rect(0, 0, 0, 0);
	pointer-events: none;
}
.btn-check:checked + .btn {
	color: var(--white-color);
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.btn-check:focus + .btn {
	box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color) 25%, transparent);
}

/* Floating controls (appear on hover or keyboard focus). Hidden by opacity, not visibility, so Tab can
   reach them; pointer-events keeps an unseen button from taking a tap */
.floating-controls {
	z-index: 100;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}
.output-item:hover .floating-controls,
.floating-controls:focus-within,
.floating-controls:has(> .result-settings-popover) {
	opacity: 1;
	pointer-events: auto;
}
.output-item {
	font-family: var(--output-font-family);
	font-size: var(--output-font-size);
}
/* Row action (TableBuilders rowAction): the row's identifying cell is itself the control, so it spans
   that cell rather than overlaying anything, and needs no hover to be found. The value stays
   drag-selectable — the click handler ignores a click that ends a selection */
.row-action-btn {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	text-align: inherit;
	color: var(--primary-color);
	text-decoration: underline;
	cursor: pointer;
	user-select: text;
}
.row-action-btn:hover {
	color: var(--primary-hover);
}
@media print {
	.row-action-btn {
		color: inherit;
		text-decoration: none;
	}
}

.btn-close {
	box-sizing: content-box;
	width: 1em;
	height: 1em;
	padding: 0.25em;
	background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
	border: 0;
	border-radius: var(--border-radius-sm);
	opacity: 0.5;
	cursor: pointer;
}

/* Dropdown */
.dropdown {
	position: relative;
}
.navbar-nav:not(.mobile) .dropdown-toggle::after {
	display: inline-block;
	margin-left: 0.255em;
	vertical-align: 0.255em;
	content: "";
	border-top: 0.3em solid;
	border-right: 0.3em solid transparent;
	border-bottom: 0;
	border-left: 0.3em solid transparent;
}
.dropdown-menu {
	position: absolute;
	display: none;
	min-width: 10rem;
	padding: var(--space-2) 0;
	margin: 0;
	font-size: var(--font-size-base);
	color: var(--dark-color);
	text-align: left;
	list-style: none;
	background-color: var(--body-bg);
	background-clip: padding-box;
	border: 1px solid var(--border-color-translucent);
	border-radius: var(--border-radius);
	z-index: 1000;
	/* Hangs from the sticky navbar, which page scrolling never moves, so a menu taller than the
	   screen below the bar scrolls inside itself. dvh, where supported, leaves out a mobile
	   browser's toolbars. */
	max-height: calc(100vh - var(--navbar-height) - var(--space-2));
	max-height: calc(100dvh - var(--navbar-height) - var(--space-2));
	overflow-y: auto;
	overscroll-behavior: contain;
}
.dropdown-menu.show {
	display: block;
}
.mobile .dropdown-menu.show {
	right: 0px;
}
.dropdown-item {
	display: block;
	width: 100%;
	padding: var(--space-1) var(--space-3);
	clear: both;
	font-weight: 400;
	color: var(--dark-color);
	text-align: inherit;
	text-decoration: none;
	white-space: nowrap;
	background-color: transparent;
	border: 0;
	cursor: pointer;
}
.dropdown-item:hover {
	background-color: var(--tertiary-bg);
}
.dropdown-item.active {
	background-color: var(--primary-color);
	color: var(--white-color);
}
.dropdown-divider {
	height: 0;
	margin: var(--space-2) 0;
	overflow: hidden;
	border-top: 1px solid var(--border-color-translucent);
}

/* Tabs */
.nav-tabs {
	display: flex;
	flex-wrap: wrap;
	padding-left: 0;
	margin-bottom: 0;
	list-style: none;
	border-bottom: 1px solid var(--border-color);
}
.nav-tabs .nav-link {
	display: block;
	padding: var(--space-2) var(--space-3);
	color: var(--secondary-color);
	text-decoration: none;
	background: none;
	border: 1px solid transparent;
	border-top-left-radius: var(--border-radius);
	border-top-right-radius: var(--border-radius);
	cursor: pointer;
	margin-bottom: -1px;
}
.nav-tabs .nav-link:hover {
	border-color: var(--secondary-bg) var(--secondary-bg) var(--border-color);
	color: var(--dark-color);
}
.nav-tabs .nav-link.active {
	color: var(--dark-color);
	background-color: var(--body-bg);
	border-color: var(--border-color) var(--border-color) var(--body-bg);
}
.tab-content {
	padding-top: var(--space-3);
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}
.tab-content > .tab-pane {
	display: none;
}
.tab-content > .tab-pane.active {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

/* Card */
.card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	word-wrap: break-word;
	background-color: var(--body-bg);
	background-clip: border-box;
	border: 1px solid var(--border-color-translucent);
	border-radius: var(--border-radius);
}
.card-body {
	flex: 1 1 auto;
	padding: var(--space-3);
}
.card-title {
	margin-bottom: var(--space-2);
	font-weight: 500;
}
.card-subtitle {
	margin-top: var(--space-3);
	margin-bottom: var(--space-2);
	font-weight: 500;
	color: var(--secondary-color);
}
.card-text:last-child {
	margin-bottom: 0;
}
.card-header {
	padding: var(--space-2) var(--space-3);
	margin-bottom: 0;
	background-color: color-mix(in srgb, var(--body-color) 3%, transparent);
	border-bottom: 1px solid var(--border-color-translucent);
}
.card-footer {
	padding: var(--space-2) var(--space-3);
	background-color: color-mix(in srgb, var(--body-color) 3%, transparent);
	border-top: 1px solid var(--border-color-translucent);
}

/* Accordion */
.accordion {
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	overflow: hidden;
}
.accordion-item {
	border-bottom: 1px solid var(--border-color);
}
.accordion-item:last-child {
	border-bottom: none;
}
.accordion-header {
	margin: 0;
}
.accordion-button {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	padding: var(--space-3) var(--space-3-5);
	font-size: var(--font-size-base);
	font-weight: 500;
	color: var(--dark-color);
	text-align: left;
	background-color: var(--light-color);
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease-in-out;
}
.accordion-button:hover {
	background-color: var(--secondary-bg);
}
.accordion-button::after {
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	margin-left: auto;
	content: "";
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-size: 1.25rem;
	transition: transform 0.2s ease-in-out;
}
.accordion-button:not(.collapsed)::after {
	transform: rotate(-180deg);
}
.accordion-button:not(.collapsed) {
	background-color: color-mix(in srgb, var(--primary-color) 10%, var(--body-bg));
	color: var(--primary-color);
}
.accordion-collapse {
	overflow: hidden;
	transition: height 0.3s ease;
}
.accordion-collapse.collapsing {
	height: 0;
}
.accordion-collapse.collapsed {
	display: none;
}
.accordion-body {
	padding: var(--space-3) var(--space-3-5);
	background-color: var(--body-bg);
}

/* Forms */
.form-control {
	display: block;
	width: 100%;
	padding: var(--space-1-5) var(--space-2-5);
	font-size: var(--font-size-base);
	line-height: 1.5;
	color: var(--dark-color);
	background-color: var(--body-bg);
	background-clip: padding-box;
	border: 1px solid var(--border-color-strong);
	border-radius: var(--border-radius);
	transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control-sm {
	padding: var(--space-1) var(--space-2);
	font-size: var(--font-size-sm);
}
/* The author colour and background above override the UA's disabled look, so the grey is ours */
.form-control:disabled {
	color: var(--secondary-color);
	background-color: var(--light-color);
}
.form-select {
	display: block;
	width: 100%;
	/* The 2.25rem right padding is the arrow's box – its 0.75rem inset, 16px width and a 0.5rem gap – not a spacing step */
	padding: var(--space-1-5) 2.25rem var(--space-1-5) var(--space-2-5);
	font-size: var(--font-size-base);
	line-height: 1.5;
	color: var(--dark-color);
	background-color: var(--body-bg);
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 16px 12px;
	border: 1px solid var(--border-color-strong);
	border-radius: var(--border-radius);
	appearance: none;
}
.form-select-sm {
	padding-top: var(--space-1);
	padding-bottom: var(--space-1);
	font-size: var(--font-size-sm);
}
/* Inline post-hoc estimate toggle (e.g. SEM diagram standardization). Constrains
   the select so it doesn't fill the row inside a d-flex toolbar. */
.estimate-toggle-select {
	width: auto;
	max-width: 18rem;
}
.form-label {
	margin-bottom: var(--space-2);
	display: inline-block;
}
.form-text {
	margin: 0;
	font-size: 0.875em;
	color: var(--secondary-color);
}
.form-control.is-invalid,
.form-select.is-invalid {
	border-color: var(--danger-color);
}
.invalid-feedback {
	margin-top: var(--space-1);
	font-size: 0.875em;
	color: var(--danger-color);
}
/* In an inline row the message takes a line of its own under the row's controls */
.d-flex:not(.flex-column):has(> .invalid-feedback) {
	flex-wrap: wrap;
}
.d-flex:not(.flex-column) > .invalid-feedback {
	flex-basis: 100%;
}
/* Grid, not inline flow: the gap between box and label used to come from a collapsed whitespace
   text node, so JS-built rows had none at all. Column 2 stacks the label and any .form-text. */
.form-check {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 0.5em;
	align-items: start;
	min-height: 1.5rem;
	margin-bottom: var(--space-0-5);
}
.form-check > .form-check-input {
	grid-column: 1;
	grid-row: 1;
}
.form-check > :not(.form-check-input) {
	grid-column: 2;
}
.form-check > .form-check-label {
	/* Keeps the click target on the text rather than the whole row, as inline flow did. */
	justify-self: start;
}
.form-check-input {
	/* The UA gives inputs their own 13.33px font, so an em-sized box would not match the label. */
	font-size: inherit;
	width: 1em;
	height: 1em;
	/* Centres the box on the first line of the label, so a wrapping label keeps it level with line
	   one. The zero sides drop the UA margin, which differs between checkbox (4px) and radio (5px). */
	margin: 0.25em 0 0;
	background-color: var(--body-bg);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	border: 1px solid color-mix(in srgb, var(--emphasis-color) 25%, transparent);
	appearance: none;
	-webkit-print-color-adjust: exact;
	print-color-adjust: exact;
}
.form-check-input[type="checkbox"] {
	border-radius: 0.25em;
}
.form-check-input[type="radio"] {
	border-radius: 50%;
}
.form-check-input:checked {
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.form-check-input[type="checkbox"]:checked {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
}
.form-check-input[type="radio"]:checked {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23fff'/%3e%3c/svg%3e");
}
.form-check-label {
	cursor: pointer;
}
.input-group {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	width: 100%;
}
.input-group > .form-control,
.input-group > .form-select {
	position: relative;
	flex: 1 1 auto;
	width: 1%;
	min-width: 0;
}
.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text {
	padding: var(--space-1) var(--space-2);
	font-size: var(--font-size-sm);
	border-radius: var(--border-radius);
}
.input-group-text {
	display: flex;
	align-items: center;
	padding: var(--space-1-5) var(--space-2-5);
	font-size: var(--font-size-base);
	font-weight: 400;
	line-height: 1.5;
	color: var(--dark-color);
	text-align: center;
	white-space: nowrap;
	background-color: var(--secondary-bg);
	border: 1px solid var(--border-color-strong);
	border-radius: var(--border-radius);
}
.input-group > :not(:first-child):not(.dropdown-menu) {
	margin-left: -1px;
	border-top-left-radius: 0;
	border-bottom-left-radius: 0;
}
.input-group > :not(:last-child):not(.dropdown-menu) {
	border-top-right-radius: 0;
	border-bottom-right-radius: 0;
}

/* Tables */
.table {
	width: 100%;
	margin-bottom: var(--space-3);
	color: var(--dark-color);
	vertical-align: top;
	border-color: var(--border-color);
	border-collapse: collapse;
}
.table > thead {
	vertical-align: bottom;
}
.table > :not(caption) > * > * {
	padding: var(--space-2);
	border-bottom-width: 1px;
}
.table-sm > :not(caption) > * > * {
	padding: var(--space-1);
}
@layer table-stripes {
	.table-striped > tbody > tr:nth-of-type(odd) > * {
		background-color: color-mix(in srgb, var(--emphasis-color) 5%, transparent);
	}
}
.table-hover > tbody > tr:hover > * {
	background-color: color-mix(in srgb, var(--emphasis-color) 7.5%, transparent);
}
.table-bordered {
	border: 1px solid var(--border-color);
}
.table-bordered > :not(caption) > * > * {
	border-width: 1px;
	border-style: solid;
	border-color: var(--border-color);
}
.table-dark {
	color: var(--white-color);
	background-color: var(--dark-color);
}
.table-primary td,
.table-primary th,
td.table-primary,
th.table-primary {
	background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}
.table-secondary td,
.table-secondary th {
	background-color: color-mix(in srgb, var(--secondary-color) 10%, transparent);
}
.table-success td,
.table-success th,
td.table-success,
th.table-success {
	background-color: color-mix(in srgb, var(--success-color) 10%, transparent);
}
.table-danger td,
.table-danger th,
td.table-danger,
th.table-danger {
	background-color: color-mix(in srgb, var(--danger-color) 10%, transparent);
}
.table-warning td,
.table-warning th,
td.table-warning,
th.table-warning {
	background-color: color-mix(in srgb, var(--warning-color) 15%, transparent);
}
.table-info td,
.table-info th,
td.table-info,
th.table-info {
	background-color: color-mix(in srgb, var(--info-color) 10%, transparent);
}
.table-active td,
.table-active th,
td.table-active,
th.table-active {
	background-color: color-mix(in srgb, var(--emphasis-color) 7.5%, transparent);
}
.table-for-export {
	width: auto;
}

/* Full borders (default) */
.table-style-full th,
.table-style-full td {
	border: 1px solid var(--emphasis-color);
	padding: var(--space-1);
}
.table-style-full th {
	background-color: transparent;
}

/* APA style */
.table-style-apa {
	border-top: 2px solid var(--emphasis-color);
	border-bottom: 2px solid var(--emphasis-color);
}
.table-style-apa thead {
	border-bottom: 1px solid var(--emphasis-color);
}
.table-style-apa th,
.table-style-apa td {
	border: none;
	padding: var(--space-1);
}
/* The spanner rule under a grouped header's label (buildRowTable's column groups) */
.table-style-apa th.column-group {
	border-bottom: 1px solid var(--emphasis-color);
}
.table-style-minimal th.column-group {
	border-bottom: 1px solid var(--body-color);
}
.table-style-borderless th.column-group {
	border-bottom: 1px solid var(--border-color);
}

/* Borderless */
.table-style-borderless th,
.table-style-borderless td {
	border: none;
	padding: var(--space-1);
}
.table-style-borderless thead {
	border-bottom: 1px solid var(--border-color);
}

/* Horizontal lines only */
.table-style-horizontal th,
.table-style-horizontal td {
	border: none;
	border-bottom: 1px solid var(--body-color);
	padding: var(--space-1);
}
.table-style-horizontal thead tr {
	border-bottom: 2px solid var(--body-color);
}

/* Minimal */
.table-style-minimal {
	border-top: 1px solid var(--body-color);
	border-bottom: 1px solid var(--body-color);
}
.table-style-minimal th,
.table-style-minimal td {
	border: none;
	padding: var(--space-1);
}
.table-style-minimal thead {
	border-bottom: 1px solid var(--body-color);
}

/* Alerts */
.alert {
	position: relative;
	padding: var(--space-3);
	margin-bottom: var(--space-3);
	border: 1px solid transparent;
	border-radius: var(--border-radius);
}
.alert-info {
	color: color-mix(in srgb, var(--info-color) 40%, var(--emphasis-color));
	background-color: color-mix(in srgb, var(--info-color) 20%, var(--body-bg));
	border-color: color-mix(in srgb, var(--info-color) 30%, var(--body-bg));
}
.alert-success {
	color: color-mix(in srgb, var(--success-color) 70%, var(--emphasis-color));
	background-color: color-mix(in srgb, var(--success-color) 15%, var(--body-bg));
	border-color: color-mix(in srgb, var(--success-color) 25%, var(--body-bg));
}
.alert-warning {
	color: color-mix(in srgb, var(--warning-color) 70%, var(--emphasis-color));
	background-color: color-mix(in srgb, var(--warning-color) 15%, var(--body-bg));
	border-color: color-mix(in srgb, var(--warning-color) 25%, var(--body-bg));
}
.alert-danger {
	color: color-mix(in srgb, var(--danger-color) 70%, var(--emphasis-color));
	background-color: color-mix(in srgb, var(--danger-color) 15%, var(--body-bg));
	border-color: color-mix(in srgb, var(--danger-color) 25%, var(--body-bg));
}
.alert-secondary {
	color: color-mix(in srgb, var(--secondary-color) 60%, var(--emphasis-color));
	background-color: color-mix(in srgb, var(--secondary-color) 20%, var(--body-bg));
	border-color: color-mix(in srgb, var(--secondary-color) 30%, var(--body-bg));
}
.alert-dismissible {
	padding-right: var(--space-5);
}
.alert-dismissible .btn-close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	padding: var(--space-3-5) var(--space-3);
}

/* Badge */
.badge {
	display: inline-block;
	padding: 0.35em 0.65em;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1;
	color: var(--white-color);
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: var(--border-radius-sm);
}

/* Progress and Loading */
.spinner-border {
	display: inline-block;
	width: 2rem;
	height: 2rem;
	vertical-align: -0.125em;
	border: 0.25em solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spinner-border 0.75s linear infinite;
}
@keyframes spinner-border {
	to {
		transform: rotate(360deg);
	}
}
.progress {
	display: flex;
	height: 1rem;
	overflow: hidden;
	font-size: var(--font-size-xs);
	background-color: var(--secondary-bg);
	border-radius: var(--border-radius-sm);
}
.progress-bar {
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	color: var(--white-color);
	text-align: center;
	white-space: nowrap;
	background-color: var(--primary-color);
	transition: width 0.6s ease;
}
.progress-bar-striped {
	background-image: linear-gradient(45deg, color-mix(in srgb, var(--white-color) 15%, transparent) 25%, transparent 25%, transparent 50%, color-mix(in srgb, var(--white-color) 15%, transparent) 50%, color-mix(in srgb, var(--white-color) 15%, transparent) 75%, transparent 75%, transparent);
	background-size: 1rem 1rem;
}
.progress-bar-animated {
	animation: progress-bar-stripes 1s linear infinite;
}
@keyframes progress-bar-stripes {
	0% {
		background-position-x: 1rem;
	}
}
.visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Toast */
.toast-container {
	position: fixed;
	z-index: 1050;
	max-width: 350px;
	padding: var(--space-2-5);
}
/* Position variants nothing uses yet – kept for a setting choosing where toasts appear */
.toast-container.top-right {
	top: 15px;
	right: 15px;
}
.toast-container.top-left {
	top: 15px;
	left: 15px;
}
.toast-container.bottom-right {
	bottom: 15px;
	right: 15px;
}
.toast-container.bottom-left {
	bottom: 15px;
	left: 15px;
}
.toast-container.top-center {
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
}
.toast-container.bottom-center {
	bottom: 15px;
	left: 50%;
	transform: translateX(-50%);
}
.toast {
	position: relative;
	margin-bottom: var(--space-2-5);
	padding: var(--space-3);
	background-color: var(--body-bg);
	border-radius: var(--border-radius);
	box-shadow: 0 0.25rem 0.75rem color-mix(in srgb, var(--black-color) 10%, transparent);
	max-width: 350px;
	overflow: hidden;
	opacity: 0;
	transform: translateY(-15px);
	transition: all 0.3s ease;
}
.toast.showing {
	opacity: 1;
	transform: translateY(0);
}
.toast.hiding {
	opacity: 0;
	transform: translateY(-15px);
}
.toast-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: var(--space-1-5);
	font-weight: 500;
}
.toast-body {
	padding-right: var(--space-2-5);
}
.toast .btn-close {
	position: absolute;
	top: 10px;
	right: 10px;
}
.toast-info {
	border-left: 4px solid var(--primary-color);
	background-color: color-mix(in srgb, var(--primary-color) 10%, var(--body-bg));
	color: color-mix(in srgb, var(--primary-color) 80%, var(--emphasis-color));
}
.toast-success {
	border-left: 4px solid var(--success-color);
	background-color: color-mix(in srgb, var(--success-color) 10%, var(--body-bg));
	color: color-mix(in srgb, var(--success-color) 70%, var(--emphasis-color));
}
.toast-warning {
	border-left: 4px solid var(--warning-color);
	background-color: color-mix(in srgb, var(--warning-color) 10%, var(--body-bg));
	color: color-mix(in srgb, var(--warning-color) 70%, var(--emphasis-color));
}
.toast-error {
	border-left: 4px solid var(--danger-color);
	background-color: color-mix(in srgb, var(--danger-color) 10%, var(--body-bg));
	color: color-mix(in srgb, var(--danger-color) 70%, var(--emphasis-color));
}

/* Modal */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 1050;
	display: none;
	width: 100%;
	height: 100%;
	overflow: hidden;
	outline: 0;
	background-color: color-mix(in srgb, var(--black-color) 50%, transparent);
}
.modal.show {
	display: flex;
	align-items: center;
	justify-content: center;
}
.modal-dialog {
	position: relative;
	width: auto;
	max-width: 500px;
	max-height: 90vh;
}
.modal-lg {
	max-width: 800px;
}
.modal-fullscreen {
	max-width: 90%;
	max-height: 90%;
	width: 90%;
}
.modal-content {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-height: 90vh;
	pointer-events: auto;
	background-color: var(--body-bg);
	border: 1px solid var(--border-color-translucent);
	border-radius: var(--border-radius-sm);
	outline: 0;
}
.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-3);
	border-bottom: 1px solid var(--border-color);
}
.modal-title {
	margin-bottom: 0;
	margin-top: 0;
	line-height: 1.5;
}
.modal-body {
	overflow-y: auto;
	display: flex;
	flex: 1;
	flex-direction: column;
	position: relative;
	padding: var(--space-3);
}
#caseSelectionModal .modal-body {
	overflow-y: hidden;
}
#activeFiltersContainer {
	overflow-y: auto;
}
.modal-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	padding: var(--space-2-5);
	border-top: 1px solid var(--border-color);
}

/* Dialog (confirmation modal) */
.dialog-modal .modal-dialog {
	max-width: 420px;
}
.dialog-modal .dialog-header {
	border-bottom: none;
	padding-bottom: 0;
}
.dialog-modal .dialog-body {
	padding: var(--space-3-5) var(--space-4);
	font-size: var(--font-size-base);
	line-height: 1.5;
}
.dialog-modal .dialog-header:not(.d-none) + .dialog-body {
	padding-top: var(--space-2-5);
}
.dialog-modal .dialog-footer {
	border-top: 1px solid var(--border-color);
	gap: var(--space-2);
}
.dialog-modal .dialog-footer .btn {
	font-size: var(--font-size-sm);
	padding: var(--space-1) var(--space-2-5);
}

/* Pagination */
.pagination {
	display: flex;
	padding-left: 0;
	list-style: none;
}
.page-item:not(:first-child) .page-link {
	margin-left: -1px;
}
.page-item.active .page-link {
	z-index: 3;
	color: var(--white-color);
	background-color: var(--primary-color);
	border-color: var(--primary-color);
}
.page-item.disabled .page-link {
	color: var(--secondary-color);
	pointer-events: none;
	background-color: var(--body-bg);
	border-color: var(--border-color);
}
.page-link {
	position: relative;
	display: block;
	padding: var(--space-2) var(--space-2-5);
	color: var(--primary-color);
	text-decoration: none;
	background-color: var(--body-bg);
	border: 1px solid var(--border-color);
}
.pagination-sm .page-link {
	padding: var(--space-1) var(--space-2);
	font-size: var(--font-size-sm);
}
