/* App – the views' own styles: what utilities and components cannot express (grid areas, states,
   pseudo-elements, descendant rules, D3 visuals), scoped by the view's root ID or a feature prefix.
   Loaded last, so it overrides components.css on equal specificity. */
.main-content {
	min-height: calc(100vh - var(--navbar-height));
}
.view {
	display: none;
}
.view.active {
	display: block;
}
.selection-list {
	height: 400px;
	overflow-y: auto;
	border: 1px solid var(--border-color-strong);
	padding: var(--space-2);
	-webkit-user-select: none;
	user-select: none;
}
.categorical-values-container .selection-list {
	max-height: 35svh;
}
.selection-item {
	padding: var(--space-0-5) var(--space-2-5);
	cursor: pointer;
	border-radius: var(--border-radius-sm);
	overflow-anchor: none;
}
@media (hover: hover) {
	.selection-item:hover {
		background-color: var(--secondary-bg);
	}
}
.selection-item.selected {
	background-color: color-mix(in srgb, var(--primary-color) 20%, var(--body-bg));
}
.scroll-to-top {
	top: calc(var(--navbar-height) + 8px);
	right: 20px;
	z-index: 1040;
	width: 36px;
	height: 36px;
	font-size: var(--font-size-base);
	line-height: 1;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s, visibility 0.25s;
	box-shadow: 0 2px 6px color-mix(in srgb, var(--black-color) 25%, transparent);
}
.scroll-to-top.visible {
	opacity: 0.7;
	visibility: visible;
}
.scroll-to-top:hover {
	opacity: 1;
}
.output-container {
	margin-top: var(--space-4);
	border-top: 1px solid var(--border-color);
	padding-top: var(--space-3-5);
}
.output-item {
	margin-bottom: var(--space-4);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	padding: var(--space-3);
	background-color: var(--tertiary-bg);
}
/* A setup card: a result card's shape, tinted and accented so it is not scrolled past, dashed since it is derived */
.setup-card {
	margin-bottom: var(--space-4);
	border: 1px dashed color-mix(in srgb, var(--primary-color) 50%, var(--body-bg));
	border-left: 4px solid var(--primary-color);
	border-radius: var(--border-radius);
	padding: var(--space-2) var(--space-3);
	background-color: color-mix(in srgb, var(--primary-color) 6%, var(--body-bg));
	font-family: var(--output-font-family);
	font-size: var(--output-font-size);
}
/* Positioned for the result-settings popover, which hangs below the header's right edge */
.output-header {
	position: relative;
	display: flex;
	justify-content: space-between;
	margin-bottom: var(--space-2-5);
}
.result-settings-popover {
	top: 100%;
	right: 0;
	width: max-content;
	max-width: min(420px, 90vw);
}
/* A setting the card's computation read */
.result-settings-row.is-declared {
	margin-inline: calc(-1 * var(--space-1));
	padding-inline: var(--space-1);
	border-radius: var(--border-radius-sm);
	background-color: color-mix(in srgb, var(--warning-color) 25%, var(--body-bg));
}

.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: color-mix(in srgb, var(--body-bg) 80%, transparent);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 2000;
	flex-direction: column;
}
/* Loading subtext container - shows R session output lines */
.loading-subtext-container {
	height: 4.5em; /* ~3 lines */
	-webkit-mask-image: linear-gradient(to bottom, transparent, black 1.5em);
	mask-image: linear-gradient(to bottom, transparent, black 1.5em);
}
.loading-subtext-line {
	line-height: 1.5em;
	animation: subtextSlideIn 0.2s ease-out forwards;
}
@keyframes subtextSlideIn {
	from {
		opacity: 0;
		transform: translateY(0.5em);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.loading-progress-bar {
	width: 0%;
}

.btn-link-muted {
	background: none;
	color: var(--secondary-color);
	cursor: pointer;
	text-decoration: underline;
}
.btn-link-muted:hover {
	color: color-mix(in srgb, var(--secondary-color) 70%, var(--emphasis-color));
}
.file-name-display {
	margin-left: var(--space-2-5);
	font-size: var(--font-size-sm);
}

/* Table of Contents */
.results-toc {
	left: 0;
	bottom: 0%;
	width: 250px;
	border-radius: 0 var(--border-radius) 0 0;
	box-shadow: 2px 2px 5px color-mix(in srgb, var(--black-color) 10%, transparent);
	z-index: 100;
}

.toc-header {
	padding: var(--space-0-5) var(--space-2-5);
	border-radius: 0 var(--border-radius) 0 0;
}

.toc-title {
	margin-right: var(--space-2-5);
}

/* The side panels' header toggle and list – the results ToC's and the exam panel's */
.side-panel-toggle {
	background: transparent;
	border: none;
	color: var(--white-color);
	cursor: pointer;
	padding: 0;
	width: 100%;
	height: 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.results-toc.collapsed .toggle-icon {
	transform: rotate(180deg);
}

.toc-body {
	max-height: 70vh;
	overflow-y: auto;
	padding: var(--space-2-5);
}

.side-panel-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.toc-item {
	margin-bottom: 1px;
}

.toc-link {
	display: block;
	padding: var(--space-0-5) var(--space-1);
	color: var(--dark-color);
	text-decoration: none;
	border-radius: var(--border-radius-sm);
	transition: background-color 0.2s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: var(--font-size-xs);
}

.toc-link:hover {
	background-color: var(--secondary-bg);
}

.toc-link.active {
	background-color: color-mix(in srgb, var(--primary-color) 20%, var(--body-bg));
	color: var(--primary-color);
}

.toc-citations {
	margin-bottom: var(--space-1);
	border-bottom: 1px solid var(--border-color);
	padding-bottom: var(--space-1);
}

.toc-type {
	font-size: var(--font-size-xs-plus);
}

/* Custom badge for result count */
.toc-count {
	background-color: var(--primary-color);
	color: var(--white-color);
	border-radius: 50%;
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: var(--font-size-xs);
	margin-left: var(--space-1);
}

/* On mobile, make ToC a bit narrower */
@media (max-width: 768px) {
	.results-toc {
		width: 200px;
	}
}

/* Exam panel — stays under the loading overlay (z-index 2000), which is what makes a Check and the
   student's own analyses mutually exclusive, and under modals so the Cases dialog is reachable. */
.exam-panel {
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 320px;
	border-radius: var(--border-radius) 0 0 var(--border-radius);
	box-shadow: -2px 2px 5px color-mix(in srgb, var(--black-color) 15%, transparent);
	z-index: 1000;
}

.exam-panel.collapsed {
	width: auto;
}

.exam-panel-header {
	border-radius: var(--border-radius) 0 0 0;
	padding: var(--space-0-5) var(--space-2-5);
}

.exam-panel.collapsed .exam-panel-header {
	border-radius: var(--border-radius) 0 0 var(--border-radius);
	padding: var(--space-2) var(--space-0-5);
}

/* Collapsed, the panel is an edge tab: vertical-rl turns the flex row's main axis vertical, so
   title, score and chevron stack down the tab, and upright keeps each glyph the right way up. */
.exam-panel.collapsed .side-panel-toggle {
	writing-mode: vertical-rl;
	text-orientation: upright;
	align-items: stretch;
	width: 24px;
	height: auto;
	gap: var(--space-2);
}

.exam-panel-label {
	gap: var(--space-2-5);
}

.exam-panel-score {
	font-size: var(--font-size-xs);
	background-color: color-mix(in srgb, var(--white-color) 25%, transparent);
	border-radius: var(--border-radius-pill);
	padding: 0 var(--space-1-5);
}

#examScoreTotal::before {
	content: "/";
	margin: 0 var(--space-0-5);
}

/* Stacked as a fraction, because the tab reads downwards: the slash becomes the rule between the
   two numbers, and each number keeps horizontal-tb so "16" reads as a number and not as 1 over 6.
   The score is its own flex container, whose cross axis is horizontal here, to centre them. */
.exam-panel.collapsed .exam-panel-score {
	display: flex;
	align-items: center;
	align-self: stretch;
	background-color: transparent;
	border-radius: 0;
	padding: 0;
}

.exam-panel.collapsed #examScorePassed,
.exam-panel.collapsed #examScoreTotal {
	writing-mode: horizontal-tb;
}

.exam-panel.collapsed #examScoreTotal {
	align-self: stretch;
	border-top: 1px solid color-mix(in srgb, var(--white-color) 40%, transparent);
	margin-top: var(--space-0-5);
	padding-top: var(--space-0-5);
	text-align: center;
}

.exam-panel.collapsed #examScoreTotal::before {
	content: none;
}

.exam-panel.collapsed .toggle-icon {
	transform: rotate(90deg);
}

.exam-panel-body {
	max-height: 70vh;
	padding: var(--space-2) var(--space-2-5);
}

.exam-question {
	border-left: 3px solid var(--border-color);
	padding: var(--space-1) 0 var(--space-2) var(--space-2);
}

.exam-question[data-mark="pass"] {
	border-left-color: var(--success-color);
}

.exam-question[data-mark="fail"] {
	border-left-color: var(--danger-color);
}

.exam-question[data-state="blocked"] {
	border-left-color: var(--warning-color);
}

.exam-question-id {
	font-size: var(--font-size-xs);
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.exam-question[data-mark="pass"] .exam-question-mark {
	color: var(--success-color);
}

.exam-question[data-mark="fail"] .exam-question-mark {
	color: var(--danger-color);
}

.exam-question-text {
	font-size: var(--font-size-xs-plus);
	margin: var(--space-0-5) 0 var(--space-1-5);
}

.exam-question-widget {
	font-size: var(--font-size-xs-plus);
}

.exam-question-note {
	font-size: var(--font-size-xs);
	color: var(--secondary-color);
	margin: var(--space-1) 0 0;
}

.exam-question[data-mark="fail"] .exam-question-note,
.exam-question[data-state="blocked"] .exam-question-note {
	color: var(--danger-color);
}

.exam-member-list {
	max-height: 11rem;
}

.exam-prose-note {
	font-style: italic;
}

.exam-table {
	font-size: var(--font-size-xs);
}

.exam-table [data-cell-mark="fail"] {
	background-color: color-mix(in srgb, var(--danger-color) 15%, transparent);
}

/* Sticky: the footer lives inside the scrolling body, and the one Check button has to stay
   reachable from anywhere in the question list. */
.exam-panel-footer {
	bottom: 0;
	gap: var(--space-1);
	padding-top: var(--space-1-5);
}

.exam-panel-gate {
	font-size: var(--font-size-xs);
	margin: 0 0 var(--space-1-5);
}

@media (max-width: 768px) {
	.exam-panel {
		width: 240px;
	}
}

.copyright-badge {
	right: 0;
	bottom: 0;
	padding: var(--space-0-5) var(--space-2-5);
	font-size: var(--font-size-xs);
	border-radius: var(--border-radius-lg) 0 0 0;
	z-index: 100;
	border-top-style: outset;
	border-left-style: outset;
}
.citation-box {
	margin-bottom: var(--space-3);
	font-size: var(--font-size-sm);
}

.citation-methods-list li,
.citation-software-list li,
.citation-background-list li {
	margin-bottom: var(--space-2);
}

/* The gap belongs between sections, and only where the one above is on screen. Background sits
   last, so any preceding section can be the one it takes the gap from – hence ~ rather than +. */
.citation-methods:not(.d-none) + .citation-software,
.citation-methods:not(.d-none) ~ .citation-background,
.citation-software:not(.d-none) + .citation-background {
	margin-top: var(--space-3);
}

/* Styling for the transformation view */
.rule-list {
	max-height: 300px;
}

/* The view's panels, placed by area: stacked when narrow; from md, the rule list and add buttons sit in
   a sidebar beside the 2×2 editor. Panels sharing a row stretch to the taller one. */
.transform-workspace {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "side" "inputs" "settings" "outputs" "preview";
}

.transform-sidebar {
	grid-area: side;
}

.transform-inputs {
	grid-area: inputs;
}

/* A stretched inputs panel gives its height to the variable list */
.transform-inputs .card-body {
	display: flex;
	flex-direction: column;
}

.transform-inputs .selection-list {
	flex-grow: 1;
}

.transform-outputs {
	grid-area: outputs;
}

.transform-settings {
	grid-area: settings;
}

.transform-preview {
	grid-area: preview;
}

.transform-add-buttons {
	margin-bottom: var(--space-3);
}

/* The settings | preview drag handle, centred in the grid's 1rem gap; only where they sit side by side.
   A line the panel's height, and a grip sticking mid-viewport so a tall panel keeps it in view. */
.panel-splitter {
	display: none;
	top: 0;
	bottom: 0;
	right: calc(-0.5rem - 5px);
	width: 10px;
	cursor: col-resize;
	touch-action: none;
}

.panel-splitter::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 4px;
	width: 2px;
	border-radius: var(--border-radius-pill);
	background: var(--border-color);
}

.panel-splitter::after {
	content: "";
	position: sticky;
	top: calc(50vh - 1.25rem);
	display: block;
	width: 6px;
	height: 2.5rem;
	margin: var(--space-4) auto 0;
	border-radius: var(--border-radius-pill);
	background: var(--secondary-color);
}

.panel-splitter:hover::before,
.panel-splitter:hover::after,
.panel-splitter.dragging::before,
.panel-splitter.dragging::after {
	background: var(--primary-color);
}

/* The sidebar takes a quarter and spans both rows; a 1fr second row takes any height it adds, so the
   inputs row keeps its own. A dragged --transform-config-width is capped so the preview keeps 14rem;
   undragged, the editor splits 2:1. */
@media (min-width: 768px) {
	.panel-splitter {
		display: block;
	}

	.transform-workspace {
		grid-template-columns: minmax(0, calc((100% - 2rem) / 4)) minmax(0, min(var(--transform-config-width, calc((100% - 2rem) / 2)), calc((100% - 2rem) * 3 / 4 - 14rem))) minmax(0, 1fr);
		grid-template-rows: auto 1fr;
		grid-template-areas: "side inputs outputs" "side settings preview";
	}

	/* The rule list, in run order, above the add buttons as a vertical list */
	.transform-sidebar .card-body {
		display: flex;
		flex-direction: column;
	}

	.transform-add-buttons {
		order: 1;
		flex-direction: column;
		margin: var(--space-3) 0 0;
	}

	.transform-add-buttons > .btn {
		text-align: left;
	}

	.transform-sidebar .rule-list {
		max-height: 60vh;
	}
}

.rule-item {
	padding: var(--space-2-5);
	border-bottom: 1px solid var(--border-color);
	cursor: pointer;
}

.rule-item:last-child {
	border-bottom: none;
}

.rule-item:hover {
	background-color: var(--tertiary-bg);
}

.rule-item.active {
	background-color: var(--secondary-bg);
}

/* A rule that does not run: all but its status line, which says why */
.rule-item.unresolved > :not(:last-child) {
	opacity: 0.5;
}

.rule-description {
	text-overflow: ellipsis;
}

/* One line: the input and output lists take equal shares capped at their own width, so a short list
   stays whole and the longer one is cut first, each behind its own ellipsis; the arrow and the
   in-place mark keep their width */
.rule-mapping {
	display: flex;
	gap: 0.25em;
	white-space: nowrap;
}

.rule-mapping-names {
	flex: 1 1 0;
	min-width: 0;
	max-width: max-content;
	text-overflow: ellipsis;
}

/* Drag-to-reorder (UI.dragReorder), which marks its container with data-reorderable. Inset
   shadows rather than borders, so a table row takes the edge marker without shifting height. */
.drag-handle {
	cursor: grab;
	color: var(--secondary-color);
	text-align: center;
	-webkit-user-select: none;
	user-select: none;
	touch-action: none;
}

[data-reorderable] > .dragging {
	cursor: grabbing;
	opacity: 0.7;
	background-color: var(--secondary-bg);
}

[data-reorderable] > .drop-above {
	box-shadow: inset 0 2px 0 var(--primary-color);
}

[data-reorderable] > .drop-below {
	box-shadow: inset 0 -2px 0 var(--primary-color);
}

/* Style for variable selection list */
.selection-item.affected:not(.selected) {
	border-left: 3px solid var(--warning-color);
	padding-left: var(--space-1-5);
}

.affected-marker {
	color: var(--warning-color);
	font-style: italic;
}

/* A rule's reference to a variable the dataset lacks, held in its place until replaced or removed */
.selection-item.unresolved {
	border-left: 3px dashed var(--warning-color);
	padding-left: var(--space-1-5);
	font-style: italic;
}

/* Regex preview highlighting */
.regex-match {
	background-color: color-mix(in srgb, var(--warning-color) 20%, var(--body-bg));
	border: 1px solid var(--warning-color);
}

.regex-group-1 { background-color: color-mix(in srgb, var(--primary-color) 10%, var(--body-bg)); border: 1px solid var(--border-color-strong); margin: 0 1px; }
.regex-group-2 { background-color: color-mix(in srgb, var(--success-color) 10%, var(--body-bg)); border: 1px solid var(--border-color-strong); margin: 0 1px; }
.regex-group-3 { background-color: color-mix(in srgb, var(--danger-color) 10%, var(--body-bg)); border: 1px solid var(--border-color-strong); margin: 0 1px; }
.regex-group-4 { background-color: color-mix(in srgb, var(--warning-color) 10%, var(--body-bg)); border: 1px solid var(--border-color-strong); margin: 0 1px; }
.regex-group-5 { background-color: color-mix(in srgb, var(--purple-color) 10%, var(--body-bg)); border: 1px solid var(--border-color-strong); margin: 0 1px; }
.regex-group-6 { background-color: color-mix(in srgb, var(--info-color) 10%, var(--body-bg)); border: 1px solid var(--border-color-strong); margin: 0 1px; }

/* Formula editor styling */
#formulaExpression {
	font-family: monospace;
}

.reference-badge {
	background-color: var(--tertiary-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius-sm);
	padding: var(--space-0-5) var(--space-1);
	font-size: var(--font-size-xs);
	font-family: monospace;
	margin-left: var(--space-2);
}

/* Drag list selectors */
.touch-selecting {
	overflow-y: hidden;
}
.touch-selecting .selection-item {
	-webkit-user-select: none;
	user-select: none;
}
.touch-selecting .selection-item.selected {
	background-color: color-mix(in srgb, var(--primary-color) 30%, transparent);
}

/* Correlation visualization styles */
.resize-handle {
	right: 0;
	bottom: 0;
	width: 10px;
	height: 10px;
	cursor: nwse-resize;
	border-right: 2px solid var(--gray-500);
	border-bottom: 2px solid var(--gray-500);
	z-index: 10;
	/* Without this the browser claims the touch gesture as a scroll/pan after a few px, firing
	   pointercancel mid-drag; none keeps pointermove flowing for the whole resize. */
	touch-action: none;
}

.zoom-controls {
	top: 10px;
	right: 10px;
	z-index: 10;
}

.viz-panel + .viz-panel {
	margin-top: var(--space-3-5);
}

/* Opt-in variant for panels that are one figure repeated per group rather than stacked companion
   plots: they flow side by side and reflow to the next row as the shared handle scales them. */
.viz-panel-group-wrap {
	gap: var(--space-3-5);
}
.viz-panel-group-wrap .viz-panel {
	/* Panels are intrinsically sized; shrinking one squeezes the plot instead of wrapping it, so
	   an oversized panel overflows to the container's own horizontal scroll. */
	flex: 0 0 auto;
}
.viz-panel-group-wrap .viz-panel + .viz-panel {
	margin-top: 0;
}

/* Frame wrapping a chart: hugs the plot width, stays centered, and reserves a right-hand gutter
   for the export overlay (which can't live inside the chart container – overflow:hidden clips it). */
.chart-frame {
	width: fit-content;
}

/* Floating SVG/PNG/JPG export overlay, stacked vertically in the gutter to the right of the plot.
   Hover-revealed on pointer devices (works outside output cards too, e.g. the power planner panel);
   persistently visible on touch, where there is no hover to summon it. */
.chart-export-controls {
	top: 0;
	left: 100%;
	margin-left: var(--space-1-5);
	gap: var(--space-1);
	z-index: 10;
	/* Backdrop so the group reads as a floating toolbar against any background (plot edge or page). */
	padding: var(--space-1);
	background-color: color-mix(in srgb, var(--body-bg) 90%, transparent);
	box-shadow: 0 1px 3px color-mix(in srgb, var(--black-color) 12%, transparent);
}
@media (hover: hover) {
	.chart-export-controls {
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease;
	}
	.chart-frame:hover .chart-export-controls {
		opacity: 1;
		visibility: visible;
	}
}

.diagram-legend {
	gap: var(--space-1) var(--space-2-5);
	padding: var(--space-1-5) var(--space-2-5);
	font-size: var(--font-size-2xs);
}

.diagram-legend-entry {
	gap: var(--space-1);
}

.sem-error-banners:not(:empty) {
	margin-bottom: var(--space-3);
}

.sem-error-banners .alert {
	margin-bottom: var(--space-2);
}

.sem-error-banners .alert:last-child {
	margin-bottom: 0;
}

/* Widget-disabled fallback mode: boot self-test failure or runtime parser
   round-trip mismatch hides widgets/diagram, leaving the textarea+options+Run
   visible (the textarea drives the runner directly, unaffected by the
   parser bugs that triggered this state). The options column expands to
   full width to fill the now-empty grid row. */
#sem-view.sem-widgets-disabled .sem-widget-region {
	display: none;
}

#sem-view.sem-widgets-disabled .sem-options-col {
	flex: 0 0 100%;
	max-width: 100%;
}

/* Fit-lock: while SEMTests.runSEM / CFATests.runCFA / runInvariance is in
   flight, dim and freeze the widget region so edits don't queue oracle
   calls behind the WebR worker pinned by the running fit. The lavaan
   editor swallows doc-changing transactions via a transactionFilter
   while fitInProgress is set (see StructuralEquationModeling.js). */
#sem-view.sem-fit-locked .sem-widget-region {
	pointer-events: none;
	opacity: 0.6;
}
#sem-view.sem-fit-locked #semSyntaxEditor {
	opacity: 0.6;
}

/* Syntax-error freeze: widgets still show the last model that parsed, so an edit made
   now would be reverted by the next successful parse. Cards only – #semSyntaxFrozenNotice
   sits in the same region and has to stay legible. */
#sem-view.sem-syntax-frozen .sem-widget-region .card {
	pointer-events: none;
	opacity: 0.6;
}

/* Lavaan's parse errors end in an ASCII caret line pointing at a column, so the feedback keeps
   its newlines and its character grid (with .font-monospace). A long line scrolls rather than
   wrapping – a wrap moves the caret off the column it points at. */
#semSyntaxFeedback:not(:empty) {
	display: block;
	margin-top: var(--space-2);
	overflow-x: auto;
	white-space: pre;
}

.sem-diagram-empty {
	padding: var(--space-4) var(--space-3);
	color: var(--secondary-color);
	font-style: italic;
	font-size: var(--font-size-xs);
	background: var(--tertiary-bg);
	border: 1px dashed var(--border-color-strong);
	border-radius: var(--border-radius-sm);
}

/* Transformation View Classes */
.rule-form-section {
	margin-bottom: var(--space-3);
	padding: var(--space-3);
	background-color: var(--tertiary-bg);
	border-radius: var(--border-radius);
}
.original-value {
	font-weight: 500;
	color: var(--dark-color);
}
.new-value {
	font-weight: 500;
	color: var(--primary-color);
}
.min-value,
.max-value,
.output-value {
	display: inline-block;
	margin: 0 var(--space-1);
}
.output-section {
	margin-top: var(--space-3);
	padding-top: var(--space-3);
	border-top: 1px solid var(--border-color);
}
.condition-name-input {
	max-width: 300px;
}

/* Variable Types Table */
.variable-types-container {
	max-height: 400px;
	overflow-y: auto;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
}
#variableTypesTable {
	-webkit-user-select: none;
	user-select: none;
}
#variableTypesTable th:not(:first-child),
#variableTypesTable td:not(:first-child) {
	width: 60px;
	text-align: center;
}
#variableTypesTable th:first-child,
#variableTypesTable td:first-child {
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Organize table – the name column takes whatever the three control columns leave */
#variableOrganizeTable .organize-narrow-cell {
	width: 1%;
}
#variableOrganizeTable td {
	vertical-align: middle;
}
/* Drag-check cells – unified interactive cell control */
.check-cell {
	cursor: pointer;
	padding: var(--space-1);
	transition: background-color 0.1s;
	user-select: none;
	text-align: center;
	touch-action: none;
}
/* min-width too: a td.cell-truncate beside it takes the table's spare width and would squeeze it */
.col-checkbox {
	width: 40px;
	min-width: 40px;
}
/* Vertical borders for headers and check-cell separator in check-cell tables */
table:has(.check-cell) th,
td.check-cell:first-child {
	border-right: 1px solid var(--border-color);
}
table:has(.check-cell) th:last-child {
	border-right: none;
}
.check-cell > * {
	visibility: hidden;
}
.check-cell.selected > * {
	visibility: visible;
}
.check-cell:hover {
	background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}
.check-cell.disabled {
	cursor: not-allowed;
	opacity: 0.4;
}
.check-cell.disabled:hover {
	background-color: transparent;
}
.rule-table-container table {
	-webkit-user-select: none;
	user-select: none;
	margin-bottom: 0;
}
.rule-table-container td {
	vertical-align: middle;
}
/* Square: a one-line row is 2rem tall */
.rule-table-container .col-checkbox {
	width: 2rem;
	min-width: 2rem;
}

/* A table cell cut to one line with an ellipsis. max-width: 0 keeps an auto-layout table from
   widening the column to the text; width: 100% gives it the width the other columns leave. */
td.cell-truncate {
	max-width: 0;
	width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Model matrices – the CFA and structural-matrix editors share one widget: cells, header buttons, the
   first column's resizer, the cell popover. disabled and cycle cells are the structural matrix's alone. */
.matrix-cell {
	cursor: pointer;
	text-align: center;
	width: 70px;
	min-width: 70px;
	max-width: 70px;
	transition: background-color 0.15s;
	user-select: none;
}
.matrix-cell:hover {
	background-color: color-mix(in srgb, var(--primary-color) 10%, transparent);
}
.matrix-cell:focus-visible {
	outline: 2px solid var(--primary-color);
	outline-offset: -2px;
}
.matrix-cell.selected {
	background-color: color-mix(in srgb, var(--primary-color) 15%, transparent);
	color: var(--primary-color);
	font-weight: 500;
}
.matrix-cell.fixed {
	background-color: color-mix(in srgb, var(--secondary-color) 15%, transparent);
	color: var(--secondary-color);
	font-weight: 500;
}
.matrix-cell.constrained {
	background-color: color-mix(in srgb, var(--success-color) 15%, transparent);
	color: var(--success-color);
	font-weight: 500;
}
.matrix-cell.disabled {
	cursor: not-allowed;
	background: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 4px,
		color-mix(in srgb, var(--emphasis-color) 4%, transparent) 4px,
		color-mix(in srgb, var(--emphasis-color) 4%, transparent) 8px
	);
}
.matrix-cell.cycle {
	outline: 2px solid var(--danger-color);
	outline-offset: -2px;
}
/* A term whose value differs across groups – the badge shows the first one */
.matrix-cell[data-group-wise] {
	box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--warning-color) 75%, transparent);
}
.matrix-header-btn {
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0;
	width: 16px;
	height: 16px;
	font-size: var(--font-size-xs);
	line-height: 1;
	color: var(--secondary-color);
	opacity: 0.5;
	transition: opacity 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
}
.matrix-header-btn:hover {
	color: var(--primary-color);
}
.matrix-header-btn.remove:hover {
	color: var(--danger-color);
}
.matrix-col-resizer {
	position: absolute;
	right: 0;
	top: 0;
	bottom: 0;
	width: 5px;
	cursor: col-resize;
	background: transparent;
}
.matrix-col-resizer:hover,
.matrix-col-resizer.dragging {
	background: var(--primary-color);
	opacity: 0.3;
}
.matrix-cell-popover {
	position: absolute;
	background: var(--body-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	box-shadow: 0 2px 8px color-mix(in srgb, var(--black-color) 15%, transparent);
	padding: var(--space-2);
	z-index: 1050;
	display: flex;
	gap: var(--space-1);
	align-items: center;
}
.matrix-cell-popover input[type="text"] {
	width: 50px;
	text-align: center;
	padding: var(--space-1);
	font-size: var(--font-size-sm);
}
.matrix-cell-popover .btn {
	padding: var(--space-1) var(--space-2);
	font-size: var(--font-size-xs);
}
/* Editing a term group by group: the fields stack, one row each */
.matrix-cell-popover.grouped {
	flex-direction: column;
	align-items: stretch;
	gap: var(--space-1-5);
}
.matrix-cell-popover.grouped input[type="text"] {
	width: 5.5rem;
}

/* CFA Matrix */
.cfa-model-matrix {
	width: auto;
	table-layout: fixed;
}
.cfa-model-matrix th:first-child,
.cfa-model-matrix td:first-child {
	width: var(--cfa-var-col-width, 150px);
	min-width: 80px;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.cfa-factor-header {
	width: 70px;
	min-width: 70px;
	max-width: 70px;
	padding: var(--space-1) !important;
	vertical-align: middle;
}
.cfa-factor-header-content {
	display: flex;
	align-items: center;
	gap: var(--space-0-5);
}
.cfa-factor-name {
	flex: 1;
	text-align: center;
	font-weight: 500;
	border: none;
	background: transparent;
	padding: var(--space-0-5) var(--space-1);
	min-width: 0;
	width: 100%;
}
.cfa-factor-name:focus {
	outline: 1px solid var(--primary-color);
	border-radius: var(--border-radius-xs);
}
.cfa-factor-header:hover .matrix-header-btn {
	opacity: 1;
}
.cfa-var-col-header {
	position: relative;
}

/* StructuralMatrix widget */
#smMatrix {
	width: auto;
	table-layout: fixed;
}
#smMatrix th:first-child,
#smMatrix td:first-child {
	width: var(--sm-target-col-width, 150px);
	min-width: 80px;
	max-width: 300px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Structural matrix: a latent predictor's column header */
th[data-predictor][data-kind="latent"] {
	font-style: italic;
}
/* Model matrices: a name the model still references that left the variable pool */
tr[data-orphan],
th[data-orphan] {
	color: var(--secondary-color);
	font-style: italic;
}
tr[data-orphan] td:first-child,
th[data-orphan] {
	background-color: color-mix(in srgb, var(--warning-color) 12%, transparent);
}
.sm-target-cell-content {
	gap: var(--space-1);
}
.sm-target-name {
	flex: 1;
}
.sm-target-cell:hover .matrix-header-btn {
	opacity: 1;
}
.cell-popover-groups {
	display: flex;
	flex-direction: column;
	gap: var(--space-1-5);
}
.cell-popover-equal,
.cell-popover-group {
	display: flex;
	gap: var(--space-1-5);
	align-items: center;
	font-size: var(--font-size-xs-plus);
	white-space: nowrap;
}
.cell-popover-group label {
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 7rem;
}
.cell-popover-equal label {
	margin: 0;
}
.cell-popover-actions {
	display: flex;
	gap: var(--space-1);
	align-items: center;
	justify-content: flex-end;
}

/* R Console */
#console-output {
	white-space: pre-wrap;
	word-wrap: break-word;
}
#consoleModal .modal-footer {
	position: relative;
}
#console-input {
	flex: 1;
	min-width: 0;
}
#console-input .cm-editor {
	border: 1px solid var(--border-color);
	border-radius: 0;
	font-size: inherit;
	max-height: calc((90vh - 200px) * 0.4);
	min-height: calc(1.5em + 0.75rem + 2px);
}
#console-input .cm-editor.cm-focused {
	outline: none;
	box-shadow: none;
	border-color: var(--primary-color);
}
#console-input .cm-content {
	padding: var(--space-1-5) var(--space-2-5);
}
.console-input-group .input-group-text {
	align-self: flex-start;
}
.console-input-group .btn {
	align-self: flex-start;
}
.console-plot-gallery {
	gap: var(--space-2-5);
	flex: 1;
	min-height: 0;
}
.console-plot-entry {
	position: relative;
}
.console-plot-entry img {
	display: block;
	max-width: 100%;
	margin: 0 auto;
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
}
.console-plot-number {
	top: 0.25rem;
	left: 0.25rem;
	background-color: color-mix(in srgb, var(--black-color) 55%, transparent);
	font-size: var(--font-size-xs);
	padding: var(--space-0-5) var(--space-1-5);
	border-radius: var(--border-radius);
	line-height: 1;
}
.console-output-plot {
	display: block;
	max-width: 504px;
	height: auto;
}
#plotsTabLink.has-new-plot::after {
	content: '';
	display: inline-block;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 50%;
	background-color: var(--primary-color);
	margin-left: var(--space-1-5);
	vertical-align: middle;
}

/* Color picker swatch */
.color-picker {
	width: 36px;
	height: 36px;
	border: 1px solid var(--border-color-strong);
	border-radius: var(--border-radius-sm);
	cursor: pointer;
}

/* Settings modal layout */
#settingsModal .modal-body {
	flex-direction: row;
	overflow-y: hidden;
	padding: 0;
}

.settings-sidebar {
	width: 160px;
	gap: var(--space-0-5);
	padding: var(--space-3) var(--space-2-5) var(--space-3) var(--space-3);
}

.settings-nav-link {
	display: block;
	padding: var(--space-1-5) var(--space-2);
	border-radius: var(--border-radius-sm);
	text-decoration: none;
	color: var(--dark-color);
	font-size: var(--font-size-sm);
}

.settings-nav-link:hover {
	background-color: var(--secondary-bg);
}

.settings-nav-link.active {
	background-color: var(--primary-color);
	color: var(--white-color);
}

.settings-nav-link.has-changes::after,
.settings-nav-link.has-errors::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--warning-color);
	margin-left: var(--space-1-5);
	vertical-align: middle;
}

.settings-nav-link.active.has-changes::after {
	background-color: var(--white-color);
}

/* After the .active rule so an out-of-range field stays findable in the highlighted category */
.settings-nav-link.has-errors::after,
.settings-nav-link.active.has-errors::after {
	background-color: var(--danger-color);
}

.setting-dirty {
	background-color: color-mix(in srgb, var(--warning-color) 10%, transparent);
	border-radius: var(--border-radius-sm);
	margin-left: calc(-1 * var(--space-1-5));
	margin-right: calc(-1 * var(--space-1-5));
	padding-left: var(--space-1-5);
	padding-right: var(--space-1-5);
}

.setting-invalid {
	background-color: color-mix(in srgb, var(--danger-color) 10%, transparent);
	border-radius: var(--border-radius-sm);
	margin-left: calc(-1 * var(--space-1-5));
	margin-right: calc(-1 * var(--space-1-5));
	padding-left: var(--space-1-5);
	padding-right: var(--space-1-5);
}

.settings-content {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
	padding: var(--space-3);
}

.settings-section {
	padding-bottom: var(--space-3);
	margin-bottom: var(--space-3);
	border-bottom: 1px solid var(--border-color);
}

.settings-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.thresholds-label {
	width: 80px;
}

.thresholds-input {
	max-width: 100px;
}

/* Narrow input; a narrow select is as wide as its longest option */
.input-narrow {
	width: 80px;
}
.select-narrow {
	width: auto;
	max-width: 100%;
}

/* Scrollable list */
.scrollable-list {
	max-height: 200px;
	overflow-y: auto;
}

/* Rule Library table */
.rule-table-scroll {
	height: 50vh;
	overflow-y: auto;
}
.col-type {
	width: 80px;
	min-width: 80px;
}
.col-action {
	width: 50px;
	min-width: 50px;
}

/* XLSX Import Modal */
#xlsxImportModal .modal-content {
	height: 90vh;
}
#xlsxImportModal .modal-body {
	overflow: hidden;
}
.xlsx-import-row {
	flex-wrap: nowrap;
	min-height: 0;
}
.xlsx-import-col-side {
	max-width: 50%;
}
.xlsx-import-col-preview {
	min-height: 0;
	min-width: 0;
}
.xlsx-import-col-preview > .card {
	min-height: 0;
	min-width: 0;
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
}
.xlsx-import-col-preview > .card > .card-body {
	min-height: 0;
	min-width: 0;
	flex: 1 1 0;
	overflow: auto;
}
@media (max-width: 767.98px) {
	.xlsx-import-row {
		flex-wrap: wrap;
	}
	.xlsx-import-col-side {
		max-width: 100%;
	}
	.xlsx-import-col-preview {
		max-height: 50vh;
	}
}
.xlsx-import-sheet-list table {
	-webkit-user-select: none;
	user-select: none;
	margin-bottom: 0;
}
.xlsx-import-merge-options {
	padding-top: var(--space-2-5);
}
.xlsx-import-preview th {
	background-color: var(--secondary-bg);
}
.xlsx-import-warning {
	color: color-mix(in srgb, var(--warning-color) 70%, var(--emphasis-color));
	font-size: 0.875em;
}
.xlsx-import-mapping-item {
	padding: var(--space-1-5) 0;
	border-bottom: 1px solid var(--border-color);
}
.xlsx-import-mapping-item:last-child {
	border-bottom: none;
}
.xlsx-import-mapping-source {
	font-size: 0.85em;
}
.xlsx-import-key-row .btn-close {
	font-size: var(--font-size-2xs);
}

/* Regression Path Builder */
#pathBuilderSVG {
	min-height: 120px;
	max-height: 400px;
}
#pathBuilderSVG svg {
	width: 100%;
	height: auto;
	display: block;
}
.cm-editor {
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	font-family: var(--font-monospace);
	font-size: 0.85em;
}
.cm-editor.cm-focused {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--primary-color) 25%, transparent);
}
.cm-scroller {
	overflow: auto;
}
#pathBuilderEditor .cm-editor {
	max-height: 200px;
}
#pathBuilderEditor .cm-content {
	padding: var(--space-1-5) var(--space-2-5);
}
#formulaEditorContainer .cm-editor {
	min-height: 8lh;
	max-height: 50vh;
}
#formulaEditorContainer .cm-at-variable {
	color: var(--primary-color);
	font-weight: 600;
}
#semSyntaxEditor .cm-editor {
	max-height: 200px;
}
#semSyntaxEditor .cm-content {
	padding: var(--space-1-5) var(--space-2-5);
}
#examgenEditor .cm-editor {
	min-height: 14lh;
	max-height: 60vh;
}

/* Regex editor (app/regex/) */
#regexSource .cm-editor {
	min-height: 10lh;
	max-height: 40vh;
}
#regexPreview .cm-editor {
	min-height: 14lh;
	max-height: 60vh;
}
.regex-match {
	background-color: color-mix(in srgb, var(--warning-color) 45%, var(--body-bg));
	border-radius: var(--border-radius-xs);
}
.regex-match-alt {
	background-color: color-mix(in srgb, var(--info-color) 35%, var(--body-bg));
	border-radius: var(--border-radius-xs);
}
.regex-step.selected {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 1px var(--primary-color);
}
/* A switched-off step keeps its header bright – the switch is there */
.regex-step.off .card-body > :not(:first-child) {
	opacity: 0.55;
}
.regex-flags .btn {
	font-family: var(--font-monospace);
}

/* Path edges – chevrons */
#pathBuilderSVG .path-edges .segment-ref {
	stroke: none;
}
#pathBuilderSVG .path-edges polyline {
	stroke: var(--primary-color);
	stroke-width: 1;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: stroke-width 0.15s;
}
#pathBuilderSVG .path-edges > g.closest polyline {
	stroke-width: 2;
}

/* Interaction edges – chevrons in warning color */
#pathBuilderSVG .ix-edges .segment-ref {
	stroke: none;
}
#pathBuilderSVG .ix-edges polyline {
	stroke: var(--warning-color);
	stroke-width: 1;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Interaction (product) nodes – diamond */
#pathBuilderSVG .ix-nodes polygon {
	fill: color-mix(in srgb, var(--warning-color) 10%, var(--body-bg));
	stroke: var(--warning-color);
	stroke-width: 1.5;
}
#pathBuilderSVG .ix-nodes text {
	font-size: 14px;
	fill: var(--dark-color);
	pointer-events: none;
}
#pathBuilderSVG .ix-nodes .node-delete {
	display: none;
}
#pathBuilderSVG .ix-nodes g:hover .node-delete {
	display: block;
	opacity: 1;
}

/* Nodes */
#pathBuilderSVG .nodes rect {
	fill: var(--body-bg);
	stroke: var(--primary-color);
	stroke-width: 1.5;
}
#pathBuilderSVG .nodes rect[data-role="mediator"] {
	fill: color-mix(in srgb, var(--primary-color) 10%, var(--body-bg));
}
#pathBuilderSVG .nodes rect[data-role="outcome"] {
	stroke-width: 2.5;
}
#pathBuilderSVG .nodes rect[data-role="unknown"] {
	fill: color-mix(in srgb, var(--danger-color) 10%, var(--body-bg));
	stroke: var(--danger-color);
	stroke-dasharray: 4 2;
}
#pathBuilderSVG .nodes rect[data-role="cycle"] {
	fill: color-mix(in srgb, var(--danger-color) 10%, var(--body-bg));
	stroke: var(--danger-color);
}
#pathBuilderSVG rect[data-role="empty"],
#pathBuilderSVG .nodes rect[data-role="isolated"] {
	fill: color-mix(in srgb, var(--warning-color) 10%, var(--body-bg));
	stroke: var(--warning-color);
	stroke-dasharray: 4 3;
}
#pathBuilderSVG .nodes text {
	font-size: 12px;
	fill: var(--dark-color);
	pointer-events: none;
}

/* Node delete button */
#pathBuilderSVG .node-delete {
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.15s;
}
#pathBuilderSVG .nodes g:hover .node-delete {
	opacity: 1;
}
#pathBuilderSVG .node-delete circle {
	fill: var(--danger-color);
	r: 8;
}
#pathBuilderSVG .node-delete text {
	fill: var(--white-color);
	font-size: 14px;
	font-weight: bold;
}

/* Node connection buttons */
#pathBuilderSVG .node-add-connection {
	opacity: 0;
	cursor: pointer;
	transition: opacity 0.15s;
}
#pathBuilderSVG .nodes g:hover .node-add-connection {
	opacity: 1;
}
#pathBuilderSVG .node-add-connection circle {
	fill: var(--success-color);
	r: 8;
}
#pathBuilderSVG .node-add-connection text {
	fill: var(--white-color);
	font-size: 14px;
	font-weight: bold;
}

/* Bulge popover */
#pathBuilderPopover {
	z-index: 10;
	box-shadow: 0 2px 8px color-mix(in srgb, var(--black-color) 15%, transparent);
	gap: var(--space-0-5);
}
#pathBuilderPopover button {
	background: none;
	border: none;
	padding: var(--space-1-5) var(--space-2-5);
	text-align: left;
	cursor: pointer;
	border-radius: var(--border-radius-sm);
	font-size: 0.85em;
	white-space: nowrap;
}
#pathBuilderPopover button:hover {
	background: var(--light-color);
}

/* Variable dropdown */
#pathBuilderDropdown {
	z-index: 20;
	box-shadow: 0 4px 12px color-mix(in srgb, var(--black-color) 15%, transparent);
	width: 220px;
	max-height: 280px;
}
#pathBuilderDropdown input {
	border: none;
	border-bottom: 1px solid var(--border-color);
	border-radius: var(--border-radius) var(--border-radius) 0 0;
}
#pathBuilderDropdown .dropdown-list {
	overflow-y: auto;
	flex: 1;
}
#pathBuilderDropdown .dropdown-item {
	padding: var(--space-1-5) var(--space-2-5);
	cursor: pointer;
	font-size: 0.85em;
}
#pathBuilderDropdown .dropdown-item:hover,
#pathBuilderDropdown .dropdown-item.highlighted {
	background: var(--light-color);
}

/* Notation style toggle */
#notationStyleToggle .btn.active {
	background: var(--primary-color);
	color: var(--white-color);
	border-color: var(--primary-color);
}

/* Power-analysis visualizations */
.power-curve-chart .grid line {
	stroke: var(--secondary-bg);
	stroke-dasharray: 3, 3;
}
.power-curve-chart .power-line {
	fill: none;
	stroke: var(--primary-color);
	stroke-width: 2.5;
}
.power-curve-chart .desired-power-line,
.power-curve-chart .required-n-line {
	stroke: var(--success-color);
	stroke-width: 1.5;
	stroke-dasharray: 5, 5;
}
.power-curve-chart .result-point {
	fill: var(--success-color);
	stroke: var(--body-bg);
	stroke-width: 2;
}
.power-curve-chart .result-label {
	fill: var(--success-color);
	font-size: 11px;
	font-weight: bold;
}
.power-curve-chart .axis-label {
	fill: var(--secondary-color);
}
.power-curve-chart .overlay {
	fill: transparent;
}
.power-curve-chart .hover-group {
	visibility: hidden;
}
.power-curve-chart .hover-group.is-visible {
	visibility: visible;
}
.power-curve-chart .hover-line-h,
.power-curve-chart .hover-line-v {
	stroke: var(--danger-color);
	stroke-width: 1.5;
	stroke-dasharray: 3, 3;
}
.power-curve-chart .hover-point {
	fill: var(--danger-color);
	stroke: var(--body-bg);
	stroke-width: 2;
}
.power-curve-chart .hover-label-n,
.power-curve-chart .hover-label-power {
	fill: var(--danger-color);
	font-size: 11px;
	font-weight: bold;
}

/* Sensitivity heatmap */
.sensitivity-heatmap .heatmap-cell {
	stroke: var(--body-bg);
	stroke-width: 1;
}
.sensitivity-heatmap .heatmap-label {
	font-size: 10px;
	fill: var(--dark-color);
	pointer-events: none;
}
.sensitivity-heatmap .heatmap-label[data-cell-bright="1"] {
	fill: var(--white-color);
}
.sensitivity-heatmap .axis-label {
	fill: var(--secondary-color);
}
.sensitivity-heatmap .legend-label,
.sensitivity-heatmap .legend-title {
	font-size: 10px;
	fill: var(--secondary-color);
}
.sensitivity-heatmap .legend-bar {
	stroke: var(--border-color);
	stroke-width: 0.5;
}

/* Reference line (e.g. μ₀ on one-sample distribution plots) */
.reference-line {
	stroke: var(--danger-color);
	stroke-width: 1.5;
	stroke-dasharray: 5, 5;
}
.reference-line-label {
	fill: var(--danger-color);
	font-size: 11px;
	font-weight: bold;
}

/* Standardized-residual marks on the category-proportion chart */
.cell-mark {
	fill: var(--dark-color);
	font-size: 11px;
	font-weight: bold;
	/* Halo: the glyph sits on a filled bar in the stacked layout and on the pair connector, which
	   crosses the bars between the groups. */
	paint-order: stroke;
	stroke: var(--body-bg);
	stroke-width: 3px;
	pointer-events: none;
}
.cell-mark-link {
	stroke: var(--dark-color);
	stroke-width: 1;
	stroke-dasharray: 3, 3;
	pointer-events: none;
}

/* P-value significance highlight */
/* Body intentionally empty — the real declarations (bold / text color / background) are minted at
   runtime by updateSignificanceCSS() (core.js) from the user's significance settings and injected as
   <style id="sig-styles">. Declared here so static tooling (css-health, grep for .sig) sees it. */
.sig {}

/* Meta-analysis: the per-row resolve grid. Taller than .scrollable-list's default, because this one
   is read by scanning it — a study table runs to dozens of rows and each may wrap to two lines. */
#metaRowStatusContainer {
	max-height: 22rem;
}

/* Docs-sourced help (DocHelp.js). A trigger is a label the docs have a block for. Mouse: the view's
   and a modal's chrome – a label, a button, a tab, a card or modal title – wears the ⓘ glyph after
   its text (.doc-help-glyph) and the glyph alone – hovered, clicked, under the help cursor – opens the
   block, so the text keeps its own job; a select or a radio group has no glyph, its label's opens it. A results header,
   cell or heading, and a table cell anywhere, is dotted instead and opens on hovering the text – a
   glyph on every row label would be noise. Touch (html.doc-help-touch, from the hover media query and
   the live pointer type): no underline, the glyph on every trigger; a dotted one opens on its own tap,
   a glyph-wearer on a tap of its glyph. SVG text renders no ::after, so a chart's stays dotted on
   touch too. The glyph is ::after – never a sibling element, which takes a grid row of its own in a
   .form-check and a line of its own under a .form-select – and U+24D8, not the look-alike U+2139,
   which a platform may draw as an emoji. Bold is synthesized for the symbol font and smears the
   circle, hence the weight. */
.doc-help-trigger,
.doc-help-touch text.doc-help-trigger {
	text-decoration: underline dotted;
	text-decoration-color: var(--secondary-color);
	text-underline-offset: 2px;
}
.doc-help-glyph,
select.doc-help-trigger,
[role="group"].doc-help-trigger,
.doc-help-touch .doc-help-trigger:not(text) {
	text-decoration: none;
}
.doc-help-glyph::after,
.doc-help-touch .doc-help-trigger:not([role="group"])::after {
	content: " \24D8";
	content: " \24D8" / "";
	color: var(--secondary-color);
	font-weight: normal;
	cursor: help;
}
.doc-help-popover,
.result-settings-popover {
	position: absolute;
	z-index: 1060;
	background: var(--body-bg);
	border: 1px solid var(--border-color);
	border-radius: var(--border-radius);
	box-shadow: 0 2px 8px color-mix(in srgb, var(--black-color) 15%, transparent);
	padding: var(--space-2) var(--space-2-5);
	font-size: var(--font-size-sm);
	font-weight: normal;
	text-align: left;
	white-space: normal;
}
.doc-help-bar {
	font-size: var(--font-size-xs);
}
.doc-help-title {
	flex: 1;
	font-weight: 600;
}
.doc-help-lang {
	font-style: italic;
}
.doc-help-btn {
	padding: 0 0.3em;
	border: 0;
	background: none;
	color: inherit;
	font-size: var(--font-size-base);
	line-height: 1;
	cursor: pointer;
}
.doc-help-body {
	max-height: 40vh;
	overflow-y: auto;
}
.doc-help-body p:last-child {
	margin-bottom: 0;
}
.doc-help-foot {
	display: flex;
	justify-content: flex-end;
	gap: var(--space-2-5);
	margin-top: var(--space-2);
	font-size: var(--font-size-xs);
}
