/*
 * Gradient Border Generator ([gradient_border]). Loaded after tools.css; the
 * code boxes reuse its .gg-output styles. The border on the demo element comes
 * from the live <style> tool-bd.js writes, not from here.
 */

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

/* Stage */
.bd-stage {
	position: sticky; top: 96px;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
	min-height: 420px; padding: 40px 24px 22px; border-radius: 28px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); transition: background .2s;
}
.bd-stage[data-bg="light"] { background: #F4F4F7; }
.bd-stage[data-bg="dark"]  { background: #0C0C11; }
.bd-stage[data-bg="photo"] {
	background:
		radial-gradient(circle at 20% 25%, #FFB86B 0, transparent 40%),
		radial-gradient(circle at 80% 30%, #22D3EE 0, transparent 42%),
		radial-gradient(circle at 45% 85%, #FF6FB5 0, transparent 45%),
		repeating-linear-gradient(45deg, #2A2140 0 14px, #1E1830 14px 28px);
}
.bd-demo { display: flex; align-items: center; justify-content: center; min-height: 260px; }
.bd-stage-bg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .85); box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.bd-stage-bg button { padding: 6px 14px !important; border: 0 !important; border-radius: 999px !important; background: transparent !important; font-size: 12.5px !important; font-weight: 600 !important; color: #45454F !important; cursor: pointer; box-shadow: none !important; }
.bd-stage-bg button[aria-pressed="true"] { background: #111 !important; color: #fff !important; }

/* Demo elements: size and type only; the border is the tool's output */
.bd-el { font-family: inherit; margin: 0 !important; }
.bd-el-button { padding: 14px 30px !important; font-size: 16px !important; font-weight: 700 !important; line-height: 1 !important; cursor: pointer; box-shadow: none; }
.bd-el-card { display: flex; flex-direction: column; gap: 4px; width: 280px; padding: 22px 24px; }
.bd-el-card strong { font-size: 18px; }
.bd-el-card span { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.bd-el-card p { margin: 8px 0 0 !important; font-size: 14px; line-height: 1.5; opacity: .75; color: inherit !important; }
.bd-el-avatar { display: flex; align-items: center; justify-content: center; width: 112px; height: 112px; font-size: 32px; font-weight: 800; }
.bd-el-avatar span { color: inherit; }
#bd-demo .bd-el-input { width: 300px; padding: 14px 18px !important; font-size: 15px !important; outline: none; color: inherit !important; }
#bd-demo .bd-el-input::placeholder { color: currentColor !important; opacity: .55; }

/* Side */
.bd-side { display: grid; gap: 14px; }
.bd-card { background: #fff; border: 1px solid #F0F0F0; border-radius: 24px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.bd-card-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6E6E78; margin-bottom: 12px; }
.bd-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: #F4F4F7; margin-bottom: 12px; }
.bd-seg button { padding: 8px 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; }
.bd-seg button[aria-pressed="true"] { background: #fff !important; color: #111 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; }

.bd-stops { display: grid; gap: 8px; margin-bottom: 12px; }
.bd-stop, .bd-fill { display: flex; align-items: center; gap: 8px; }
.bd-stop input[type="color"], .bd-fill 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; }
.bd-stop input[type="color"]::-webkit-color-swatch-wrapper, .bd-fill input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.bd-stop input[type="color"]::-webkit-color-swatch, .bd-fill input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.bd-stop input[type="text"], .bd-fill input[type="text"] { flex: 1; min-width: 0; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; text-transform: uppercase; }
.bd-fill label { font-size: 13px; font-weight: 600; color: #333; min-width: 32px; }
.bd-fill[hidden], .bd-slider[hidden], #bd-add[hidden] { display: none !important; }
.bd-remove { width: 30px; height: 30px; padding: 0 !important; border-radius: 50% !important; border: 1px solid #ECECF1 !important; background: #FAFAFA !important; color: #55555F !important; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.bd-row { display: flex; flex-wrap: wrap; gap: 8px; }

.bd-slider { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.bd-slider label { min-width: 52px; font-size: 13px; font-weight: 600; color: #333; }
.bd-slider input { flex: 1; }
.bd-slider input:disabled { opacity: .4; }
.bd-slider span { min-width: 46px; text-align: right; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: 13px; color: #55555F; }
.bd-note { margin: 12px 0 0 !important; font-size: 12.5px; line-height: 1.55; color: #6E6E78; }

.bd-btn { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px !important; font-weight: 600; cursor: pointer; border: 1px solid #E2E2E8 !important; background: #fff !important; color: #222 !important; }
.bd-btn:hover { border-color: #111 !important; }
.bd-btn-sm { padding: 7px 14px; font-size: 13px; }
.bd-btn-sm .tg-i { width: 15px; height: 15px; }

.bd-outputs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }

@media (max-width: 860px) {
	.bd-layout, .bd-outputs { grid-template-columns: 1fr; }
	.bd-stage { position: static; min-height: 340px; }
	#bd-demo .bd-el-input, .bd-el-card { width: min(300px, 80vw); }
}

/* Dark mode */
html[data-theme="dark"] .tg-tool .bd-card { background: #15151D !important; border-color: rgba(255, 255, 255, .09) !important; }
html[data-theme="dark"] .tg-tool .bd-seg { background: #1D1D27 !important; }
html[data-theme="dark"] .tg-tool .bd-seg button { color: #B9B9C6 !important; }
html[data-theme="dark"] .tg-tool .bd-seg button[aria-pressed="true"] { background: #262633 !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .bd-slider label, html[data-theme="dark"] .tg-tool .bd-fill label { color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .bd-slider span, html[data-theme="dark"] .tg-tool .bd-note { color: #9393A3 !important; }
html[data-theme="dark"] .tg-tool .bd-btn, html[data-theme="dark"] .tg-tool .bd-remove { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .bd-stage { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
html[data-theme="dark"] .bd-stage[data-bg="light"] { background: #E9E9EE; }
