/*
 * Gradient Loader Generator ([gradient_loader]). Loaded after tools.css; the
 * code boxes reuse its .gg-output styles. The loaders themselves are drawn by
 * the live <style> tool-ld.js writes.
 */

.ld-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }

.ld-stage { position: sticky; top: 96px; padding: 22px; border-radius: 28px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); transition: background .2s; }
.ld-stage[data-bg="light"] { background: #F4F4F7; }
.ld-stage[data-bg="dark"] { background: #0C0C11; }
.ld-demo { display: flex; align-items: center; justify-content: center; min-height: 340px; }
.ld-stage-bar { display: flex; justify-content: center; padding-top: 14px; border-top: 1px solid rgba(127, 127, 127, .18); }
.ld-stage-bar .ld-seg { width: 200px; }

.ld-side { display: grid; gap: 14px; }
.ld-card { background: #fff; border: 1px solid #F0F0F0; border-radius: 24px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.ld-card-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6E6E78; margin-bottom: 12px; }

.ld-types { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ld-types button {
	display: flex !important; flex-direction: column; align-items: stretch; gap: 6px; padding: 6px !important; margin: 0 !important;
	border: 1px solid #E6E6EC !important; border-radius: 16px !important; background: #fff !important; color: #333 !important;
	font-size: 12.5px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important;
}
.ld-th i { display: block; }
.ld-th { display: flex; align-items: center; justify-content: center; height: 54px; border-radius: 11px; background: #F4F4F7; overflow: hidden; }
.ld-types button:hover { border-color: #111 !important; }
.ld-types button[aria-pressed="true"] { border-color: #111 !important; box-shadow: 0 0 0 1px #111 !important; color: #111 !important; }

.ld-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(127, 127, 127, .14); }
.ld-seg button { padding: 7px 4px !important; border: 0 !important; border-radius: 999px !important; background: transparent !important; font-size: 13px !important; font-weight: 600 !important; color: #45454F !important; cursor: pointer; box-shadow: none !important; }
.ld-seg button[aria-pressed="true"] { background: #fff !important; color: #111 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; }
.ld-stage[data-bg="dark"] .ld-seg button { color: #B9B9C6 !important; }
.ld-stage[data-bg="dark"] .ld-seg button[aria-pressed="true"] { background: #2A2A36 !important; color: #fff !important; }

.ld-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.ld-row input[type="color"] { width: 40px !important; height: 40px !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important; background: none !important; cursor: pointer; flex-shrink: 0; }
.ld-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.ld-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.ld-row input[type="text"] { flex: 1; min-width: 90px; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; text-transform: uppercase; }
#ld-add[hidden], .ld-slider[hidden] { display: none !important; }

.ld-slider { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.ld-slider label { min-width: 72px; font-size: 13px; font-weight: 600; color: #333; }
.ld-slider input { flex: 1; }
.ld-slider span { min-width: 46px; text-align: right; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: 13px; color: #55555F; }

.ld-btn {
	display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px !important; margin: 0 !important;
	border: 1px solid #E2E2E8 !important; border-radius: 999px !important; background: #fff !important; color: #222 !important;
	font-size: 13px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important;
}
.ld-btn:hover { border-color: #111 !important; }
.ld-btn .tg-i { width: 15px; height: 15px; }
.ld-remove { width: 30px; height: 30px; padding: 0 !important; justify-content: center; }

.ld-outputs { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-bottom: 24px; }
.ld-outputs pre { white-space: pre-wrap !important; }

@media (max-width: 860px) {
	.ld-layout, .ld-outputs { grid-template-columns: 1fr; }
	.ld-stage { position: static; }
	.ld-demo { min-height: 240px; }
	.ld-types { grid-template-columns: repeat(3, 1fr); }
}

/* Dark mode (the stage keeps its own light/dark choice) */
html[data-theme="dark"] .tg-tool .ld-card { background: #15151D !important; border-color: rgba(255, 255, 255, .09) !important; }
html[data-theme="dark"] .tg-tool .ld-th { background: #1D1D27; }
html[data-theme="dark"] .tg-tool .ld-slider label { color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .ld-slider span { color: #9393A3 !important; }
html[data-theme="dark"] .tg-tool .ld-btn, html[data-theme="dark"] .tg-tool .ld-types button { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .ld-types button[aria-pressed="true"] { border-color: #EDEDF2 !important; box-shadow: 0 0 0 1px #EDEDF2 !important; }
