/*!
 * CSS Portal — Gradient generator extras
 * Loaded after code-tool.css and generator-tool.css. Everything is scoped to .gt.
 */

/* ---------- Colour-stop editor (settings panel) ---------- */

.gt .gr-bar {
	position: relative;
	height: 22px;
	margin: 2px 0 14px;
	border-radius: 6px;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .15);
}
.gt .gr-bar i {
	position: absolute;
	top: 100%;
	width: 10px;
	height: 10px;
	margin: 2px 0 0 -5px;
	border: 2px solid var(--ct-bg);
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--ct-border-strong);
}
.gt .gr-stops { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.gt .gr-stop {
	display: grid;
	gap: 6px;
	margin: 0;
	padding: 8px;
	background: var(--ct-bg);
	border: 1px solid var(--ct-border);
	border-radius: 8px;
}
.gt .gr-stop__row { display: flex; align-items: center; gap: 6px; }
.gt .gr-stop .gt-color { flex: 1; min-width: 0; }
.gt .gr-stop .gt-num { flex: none; width: 74px; }
.gt .gr-del {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	font-size: 15px;
	color: var(--ct-muted);
	background: transparent;
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}
.gt .gr-del:hover { color: var(--ct-err); background: var(--ct-surface-2); }
.gt .gr-del:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--ct-accent); }
.gt .gr-del:disabled { opacity: .3; pointer-events: none; }
.gt .gr-stops__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.gt .gr-alpha { display: grid; grid-template-columns: auto minmax(0, 1fr) 40px; align-items: center; gap: 8px; margin: 0; font-size: 12px; color: var(--ct-muted); }
.gt .gr-alpha output { font-variant-numeric: tabular-nums; text-align: right; color: var(--ct-text); }

/* ---------- Presets card ---------- */

.gt .gr-presets {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 10px;
	padding: 14px;
}
.gt .gr-preset {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
	margin: 0;
	padding: 0;
	font: inherit;
	color: var(--ct-text);
	background: var(--ct-bg);
	border: 1px solid var(--ct-border);
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	transition: border-color .15s, transform .15s;
}
.gt .gr-preset__swatch { display: block; height: 72px; }
.gt .gr-preset__name {
	display: block;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 7px 8px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	border-top: 1px solid var(--ct-border);
}
.gt .gr-preset:hover { border-color: var(--ct-border-strong); transform: translateY(-1px); }
.gt .gr-preset:focus-visible { outline: none; border-color: var(--ct-accent); box-shadow: 0 0 0 3px var(--ct-accent-soft); }
.gt .gr-preset.is-active { border-color: var(--ct-accent); box-shadow: 0 0 0 1px var(--ct-accent); }

@media (prefers-reduced-motion: reduce) {
	.gt .gr-preset { transition: none; }
}

/* gradient output is short; a smaller code panel keeps the presets in view */
.gt [data-gt="code"].ce { height: clamp(200px, 26vh, 300px); }
