/*!
 * CSS Portal — Cubic bezier generator extras
 * Loaded after code-tool.css and generator-tool.css. Everything is scoped to .gt.
 */
.gt [hidden] { display: none !important; }

/* ---------- workbench: graph + preview ---------- */

.gt .cb-workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
@media (min-width: 760px) { .gt .cb-workbench { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); } }

.gt .cb-editor { display: flex; justify-content: center; padding: 12px; background: var(--ct-surface); border-right: 1px solid var(--ct-border); }
.gt .cb-graph { display: block; width: 100%; max-width: 320px; height: auto; aspect-ratio: 300 / 400; overflow: visible; touch-action: none; user-select: none; cursor: crosshair; }
.gt .cb-plot { fill: var(--ct-bg); stroke: var(--ct-border-strong); stroke-width: 1; }
.gt .cb-grid { fill: none; stroke: var(--ct-border); stroke-width: 1; }
.gt .cb-tick { font: 500 10px var(--ct-mono); fill: var(--ct-muted); }
.gt .cb-axis { font: 700 9.5px var(--ct-mono); letter-spacing: .08em; fill: var(--ct-gutter); }
.gt .cb-linear { fill: none; stroke: var(--ct-border-strong); stroke-width: 1.5; stroke-dasharray: 3 4; }
.gt .cb-compare { fill: none; stroke-width: 2; opacity: .55; }
.gt .cb-arm { stroke-width: 1.5; stroke-dasharray: 4 3; }
.gt .cb-arm--1 { stroke: #e11d48; }
.gt .cb-arm--2 { stroke: #2563eb; }
.gt .cb-curve { fill: none; stroke: var(--ct-text); stroke-width: 3; stroke-linecap: round; }
.gt .cb-end { fill: var(--ct-text); }
.gt .cb-playhead { fill: #f59e0b; stroke: var(--ct-bg); stroke-width: 2; }
.gt .cb-handle { cursor: grab; outline: none; }
.gt .cb-handle circle:not(.cb-hit) { stroke: var(--ct-bg); stroke-width: 3; }
.gt .cb-handle--1 circle:not(.cb-hit) { fill: #e11d48; }
.gt .cb-handle--2 circle:not(.cb-hit) { fill: #2563eb; }
.gt .cb-hit { fill: transparent; }
.gt .cb-handle:focus-visible circle:not(.cb-hit) { stroke: var(--ct-accent); stroke-width: 4; }

.gt .cb-side { display: flex; flex-direction: column; min-width: 0; }
.gt .cb-value {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--ct-border);
}
.gt .cb-value code {
	padding: 4px 8px;
	font-family: var(--ct-mono);
	font-size: 14px;
	font-weight: 600;
	color: var(--ct-text);
	background: var(--ct-surface-2);
	border-radius: 6px;
	white-space: nowrap;
}
.gt .cb-value .cb-kw { font-size: 12.5px; font-weight: 600; color: var(--ct-ok); }
.gt .cb-value .gt-card__tools { margin-left: auto; }
.gt .cb-msg { margin: 0; padding: 0 14px; font-size: 12.5px; color: var(--ct-ok); }
.gt .cb-msg:empty { display: none; }

.gt .cb-play-row { display: flex; align-items: center; gap: 6px; padding: 10px 14px 0; }
.gt .cb-lanes { display: grid; gap: 12px; padding: 12px 14px 16px; }
.gt .cb-lane { --c: var(--ct-accent); }
.gt .cb-lane__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--ct-muted); }
.gt .cb-lane__label span { padding: 0; color: var(--c); }
.gt .cb-lane__label code { padding: 0; font-family: var(--ct-mono); font-size: 11.5px; font-weight: 500; color: var(--ct-muted); background: none; }
.gt .cb-lane__track {
	position: relative;
	display: flex;
	align-items: center;
	height: 40px;
	padding: 0 8px;
	background: var(--ct-surface);
	border: 1px solid var(--ct-border);
	border-radius: 8px;
	overflow: hidden;
}
.gt .cb-lane__track.cb-mode-move::after,
.gt .cb-lane__track.cb-mode-width::after {
	content: "";
	position: absolute;
	top: 6px;
	bottom: 6px;
	left: calc(8px + (100% - 40px) * 0.75 + 23px);
	border-left: 2px dashed var(--ct-gutter);
	pointer-events: none;
}
.gt .cb-lane__obj { position: relative; z-index: 1; width: 24px; height: 24px; flex: none; background: var(--c); border-radius: 50%; }
.gt .cb-mode-width .cb-lane__obj { height: 14px; border-radius: 7px; }
.gt .cb-mode-fade .cb-lane__obj,
.gt .cb-mode-scale .cb-lane__obj { width: 100%; height: 22px; border-radius: 6px; flex: 1; }
.gt .cb-mode-scale .cb-lane__obj { width: 24px; height: 24px; flex: none; margin: 0 auto; border-radius: 6px; }

/* ---------- compare + presets ---------- */

.gt .cb-compare-list { display: grid; gap: 4px; }
.gt .cb-cmp {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 4px 8px;
	font-size: 13px;
	font-weight: 500;
	color: var(--ct-text);
	border: 1px solid var(--ct-border);
	border-radius: 8px;
	cursor: pointer;
}
.gt .cb-cmp input { width: 16px; height: 16px; margin: 0; accent-color: var(--c); }
.gt .cb-cmp svg { width: 40px; height: 28px; flex: none; }
.gt .cb-cmp .cb-mini__curve { stroke: var(--c); }
.gt .cb-cmp span { padding: 0; font-family: var(--ct-mono); font-size: 12.5px; }
.gt .cb-cmp:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); }

.gt .cb-mini__base { fill: none; stroke: var(--ct-border-strong); stroke-width: 1; stroke-dasharray: 2 2; }
.gt .cb-mini__curve { fill: none; stroke: var(--ct-accent); stroke-width: 2; stroke-linecap: round; }

.gt .cb-presets { padding: 6px 14px 16px; }
.gt .cb-group h3 { margin: 12px 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ct-muted); }
.gt .cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.gt .cb-preset {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	min-width: 0;
	margin: 0;
	padding: 8px 6px 6px;
	font: inherit;
	color: var(--ct-text);
	background: var(--ct-bg);
	border: 1px solid var(--ct-border);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color .15s, background-color .15s;
}
.gt .cb-preset svg { display: block; width: 64px; height: 44px; overflow: visible; }
.gt .cb-preset span { display: block; max-width: 100%; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--ct-mono); font-size: 11px; }
.gt .cb-preset:hover { border-color: var(--ct-border-strong); background: var(--ct-surface); }
.gt .cb-preset:focus-visible { outline: none; border-color: var(--ct-accent); box-shadow: 0 0 0 3px var(--ct-accent-soft); }
.gt .cb-preset.is-active { border-color: var(--ct-accent); background: var(--ct-accent-soft); }
.gt .cb-preset--mine .cb-mini__curve { stroke: #e11d48; }

.gt .cb-save { display: flex; gap: 6px; }
.gt .cb-save input {
	flex: 1;
	min-width: 0;
	width: auto;
	height: 34px;
	margin: 0;
	padding: 0 10px;
	font: inherit;
	font-size: 13px;
	color: var(--ct-text);
	background: var(--ct-bg);
	border: 1px solid var(--ct-border);
	border-radius: 8px;
	outline: none;
}
.gt .cb-save input:focus { border-color: var(--ct-accent); box-shadow: 0 0 0 3px var(--ct-accent-soft); }
.gt .cb-save .ct-btn { height: 34px; }
.gt .cb-mine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gt .cb-mine .gt-hint { grid-column: 1 / -1; }
.gt .cb-mine__item { position: relative; min-width: 0; }
.gt .cb-mine__item .cb-preset { width: 100%; }
.gt .cb-mine__del {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	font-size: 14px;
	line-height: 1;
	color: #fff;
	background: var(--ct-err);
	border: 2px solid var(--ct-bg);
	border-radius: 50%;
	cursor: pointer;
}

.gt [data-gt="code"].ce { height: clamp(200px, 26vh, 300px); }

@media (max-width: 759.98px) { .gt .cb-editor { border-right: 0; border-bottom: 1px solid var(--ct-border); } }
@media (prefers-reduced-motion: reduce) { .gt .cb-preset { transition: none; } }
