/* HTML Table Generator — scoped under .aah-tool via the shared wrapper. */

.aah-tablegen__controls,
.aah-tablegen__settings {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: flex-end;
	margin-bottom: 0.75rem;
}

.aah-tablegen__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-weight: 700;
	font-size: 0.95em;
}

.aah-tablegen__field input[type="number"] {
	width: 80px;
}

.aah-tablegen__field input[type="text"] {
	width: 180px;
}

.aah-tablegen__field input[type="color"] {
	width: 64px;
	height: 44px;
	padding: 2px;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	background: var(--aah-bg);
	cursor: pointer;
}

.aah-tablegen__check {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 400;
	padding-bottom: 0.5rem;
}

.aah-tablegen__check input {
	width: auto;
	margin: 0;
	accent-color: var(--aah-crimson);
}

.aah-tablegen__editor {
	overflow-x: auto;
	margin-bottom: 0.75rem;
}

.aah-tablegen__grid {
	border-collapse: collapse;
	width: 100%;
}

.aah-tablegen__grid th,
.aah-tablegen__grid td {
	border: 1px solid var(--aah-border);
	padding: 8px;
	min-width: 90px;
	text-align: left;
}

.aah-tablegen__grid th {
	background: #f2f2f2;
}

.aah-tablegen__grid [contenteditable]:focus {
	outline: 2px solid var(--aah-crimson);
	outline-offset: -2px;
}

/* The selected row and column (the cell last clicked) get a
 * light crimson tint, so it is clear which row and column the
 * insert/delete buttons will act on. */
.aah-tablegen__grid tr.aah-tablegen__row-selected th,
.aah-tablegen__grid tr.aah-tablegen__row-selected td,
.aah-tablegen__grid th.aah-tablegen__col-selected,
.aah-tablegen__grid td.aah-tablegen__col-selected {
	background: #fdeef0;
}

.aah-tablegen__rowcol {
	margin-bottom: 0.75rem;
	padding: 0.75rem;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	background: var(--aah-bg-soft);
}

.aah-tablegen__rowcol-label {
	margin: 0 0 0.25rem;
	font-weight: 700;
}

.aah-tablegen__rowcol-hint {
	margin: 0 0 0.5rem;
	color: var(--aah-muted);
	font-size: 0.9em;
}

.aah-tablegen__rowcol-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.aah-tablegen__rowcol-title {
	font-weight: 700;
	min-width: 3.5rem;
}

.aah-tablegen__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.aah-tablegen__preview-wrap {
	margin-bottom: 0.75rem;
}

.aah-tablegen__preview-wrap label,
.aah-tablegen__output label {
	display: block;
	font-weight: 700;
	margin-bottom: 0.4rem;
}

.aah-tablegen__output {
	margin-bottom: 0.75rem;
}

.aah-tablegen__output textarea {
	width: 100%;
	min-height: 280px;
	resize: vertical;
	font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
	font-size: 0.9em;
	line-height: 1.5;
}

.aah-tablegen__preview {
	overflow-x: auto;
	border: 1px solid var(--aah-border);
	border-radius: 6px;
	padding: 1rem;
	background: var(--aah-bg);
	min-height: 280px;
}

.aah-tablegen__status {
	color: var(--aah-muted);
	font-weight: 600;
}

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