/*
 * Colours use the contextual `--ds-color-*` aliases so the launcher follows the
 * active colour scheme. Never add hex fallbacks.
 */

.ObReportLauncher-root {
	display: flex;
	flex-direction: column;
	gap: var(--ds-size-4);
	block-size: 100%;
	min-block-size: 0;
}

/*
 * The filter builder is the part that grows: its criteria editor scrolls, and
 * the report fields it hosts keep their natural height.
 */
.ObReportLauncher-root > .ObFilterBuilder-root {
	flex: 1 1 auto;
	min-block-size: 0;
}

/*
 * The tabs, the open panel and the report options share the column next to the
 * saved-filter list. Only the panel grows; the tab list and the options keep
 * their natural height.
 */
.ObReportLauncher-main {
	display: flex;
	flex-direction: column;
	gap: var(--ds-size-3);
	min-block-size: 0;
}

.ObReportLauncher-tabs {
	flex: 0 0 auto;
}

/*
 * The criteria editor scrolls its own conditions, so the panel holding it must
 * not scroll as well. The parameters have no such arrangement and get their
 * scrolling from the panel.
 */
.ObReportLauncher-panel {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-block-size: 0;
	overflow: hidden;
}

.ObReportLauncher-panel--scroll {
	gap: var(--ds-size-3);
	overflow: auto;
}

.ObReportLauncher-panel > .ObFilterEditor-root {
	flex: 1 1 auto;
	min-block-size: 0;
}

.ObReportLauncher-options {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	gap: var(--ds-size-2);
}

.ObReportLauncher-status {
	margin: 0;
	color: var(--ds-color-text-subtle);
}

.ObReportLauncher-error {
	margin: 0;
	color: var(--ds-color-danger-text-default);
}

/* The action row of the Windows dialog: save, preview, print, close. */
.ObReportLauncher-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: var(--ds-size-2);
}

.ObReportLauncher-progress {
	margin-inline-end: auto;
	color: var(--ds-color-text-subtle);
}

/* The save button and its format menu read as one control. */
.ObReportLauncher-saveGroup {
	display: flex;
	align-items: stretch;
	gap: var(--ds-border-width-default);
}

.ObReportLauncher-saveGroup > :first-child {
	border-start-end-radius: 0;
	border-end-end-radius: 0;
}

.ObReportLauncher-saveGroup > :last-child:not(:first-child) {
	border-start-start-radius: 0;
	border-end-start-radius: 0;
}

/*
 * As with the filter builder, `Dialog` caps itself at `--dsc-dialog-max-width`,
 * so the variables have to be raised rather than the width set.
 */
.ObReportLauncher-dialog {
	--dsc-dialog-max-width: 84rem;
	--dsc-dialog-max-height: 90dvh;
}

/*
 * Taller than the filter builder: the column next to the saved-filter list has
 * to fit the tabs, a panel worth scrolling and the report options below it.
 */
.ObReportLauncher-dialog[open] {
	display: flex;
	flex-direction: column;
	block-size: min(58rem, 90dvh);
	overflow: hidden;
}

.ObReportLauncher-dialogHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ds-size-2);
}

.ObReportLauncher-dialogBody {
	flex: 1 1 auto;
	min-block-size: 0;
	overflow: hidden;
}

@media (width < 48rem) {
	.ObReportLauncher-dialogBody {
		overflow: auto;
	}
}
