/* HTML Try It Editor — single editor, side by side with the preview.
 * Scoped under .aah-tool via the shared wrapper. */

.aah-tryit__toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.aah-tryit__toolbar .aah-button,
.aah-tryit__toolbar .aah-button--secondary {
	margin: 0;
}

.aah-tryit__autorun {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0 0.25rem;
	font-weight: 600;
	cursor: pointer;
}

.aah-tryit__autorun input {
	width: auto;
	margin: 0;
}

.aah-tryit__editor textarea {
	min-height: 320px;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.95em;
	line-height: 1.5;
	tab-size: 2;
}

.aah-tryit__preview-label {
	display: block;
	font-weight: 600;
	margin: 0.75rem 0 0.25rem;
}

.aah-tryit__preview iframe {
	width: 100%;
	min-height: 340px;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	background: #ffffff;
}

.aah-tryit__error {
	color: var(--aah-crimson-dark);
	font-weight: 600;
}

.aah-tryit__error:empty {
	display: none;
}

.aah-tryit__help {
	margin-top: 1rem;
}

.aah-tryit__help summary {
	cursor: pointer;
	font-weight: 600;
}

/* Desktop: taller editor and preview panes. The side-by-side
 * columns come from the shared .aah-split layout. */
@media (min-width: 900px) {
	.aah-tryit__editor textarea {
		min-height: 480px;
	}

	.aah-tryit__preview iframe {
		min-height: 480px;
	}

	.aah-tryit__preview-label {
		margin-top: 0;
	}
}

/* Expanded: preview takes the full width, editor hides. The
 * split collapses to one column and the controls column (the
 * editor) is hidden. The grid selector beats the shared
 * two-column rule on specificity. */
.aah-tool .aah-tryit--expanded .aah-split {
	grid-template-columns: minmax(0, 1fr);
}

.aah-tryit--expanded .aah-split__controls {
	display: none;
}

.aah-tryit--expanded .aah-tryit__preview iframe {
	min-height: 70vh;
}
