/*
 * Social Banner Maker ([social_banner]). Loaded after tools.css; the code
 * boxes reuse its .gg-output styles. The canvas is drawn at the real export
 * size and scaled down here to fit the stage.
 */

.bn-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
.bn-main { position: sticky; top: 96px; }

.bn-stage {
	display: flex; align-items: center; justify-content: center; min-height: 360px; padding: 24px; border-radius: 28px;
	background: #F4F4F7 repeating-conic-gradient(#EDEDF2 0 25%, transparent 0 50%) 0 0 / 20px 20px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.bn-frame { position: relative; line-height: 0; overflow: hidden; border-radius: 10px; box-shadow: 0 12px 32px rgba(17, 17, 30, .16); }
.bn-frame canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 62vh; }
.bn-safe {
	position: absolute; pointer-events: none; border: 2px dashed rgba(255, 255, 255, .9); outline: 1px dashed rgba(0, 0, 0, .45);
	box-shadow: 0 0 0 9999px rgba(10, 10, 20, .32);
}
.bn-safe[hidden] { display: none !important; }

.bn-under { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: #55555F; }
.bn-dims { font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; }
.bn-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; color: #333; }
.bn-check[hidden], .bn-note[hidden], #bn-logo-opts[hidden], #bn-font-note[hidden], #bn-logo-rm[hidden], .bn-custom[hidden], #bn-angle-row[hidden], #bn-add[hidden], .bn-swatches[hidden] { display: none !important; }
.bn-note { margin: 6px 0 0 !important; font-size: 12.5px; color: #6E6E78; }

.bn-meter { margin-top: 12px; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5; background: #F4F4F7; color: #333; }
.bn-meter:empty { display: none; }
.bn-meter b { font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; }
.bn-meter.is-good { background: #E7F8EE; color: #14532D; }
.bn-meter.is-ok { background: #FFF6DB; color: #713F12; }
.bn-meter.is-bad { background: #FDE8E8; color: #7F1D1D; }
.bn-actions { margin-top: 14px; }

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

.bn-text { display: grid; gap: 5px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: #333; }
.bn-text small { font-weight: 500; color: #8A8A96; margin-left: 4px; }
.bn-text input, .bn-text textarea { width: 100%; font-size: 14px !important; font-weight: 500; border-radius: 12px !important; }
.bn-text textarea { resize: vertical; min-height: 58px; line-height: 1.4; }

.bn-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: #F4F4F7; margin-bottom: 10px; }
.bn-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; }
.bn-seg button[aria-pressed="true"] { background: #fff !important; color: #111 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; }

.bn-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.bn-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; }
.bn-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.bn-row input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.bn-row input[type="text"] { flex: 1; min-width: 90px; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; text-transform: uppercase; }
.bn-custom label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #333; }
.bn-custom input { width: 96px; }

.bn-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 12px; }
.bn-swatch { aspect-ratio: 1; padding: 0 !important; border: 0 !important; border-radius: 10px !important; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08) !important; transition: transform .12s; }
.bn-swatch:hover { transform: scale(1.08); }

.bn-slider { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.bn-slider label { min-width: 52px; font-size: 13px; font-weight: 600; color: #333; }
.bn-slider input { flex: 1; }
.bn-slider span { min-width: 46px; text-align: right; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: 13px; color: #55555F; }
.bn-field { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; font-weight: 600; color: #333; }
.bn-field select { flex: 1; min-width: 0; padding: 8px 30px 8px 12px !important; border-radius: 999px !important; font-size: 13px !important; }

.bn-btn {
	display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px !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; white-space: nowrap;
}
.bn-btn:hover { border-color: #111 !important; }
.bn-btn-dark { background: #111 !important; border-color: #111 !important; color: #fff !important; }
.bn-btn-dark:hover { background: #333 !important; }
.bn-btn.ok { border-color: #16A34A !important; color: #166534 !important; background: #E7F8EE !important; }
.bn-btn .tg-i { width: 15px; height: 15px; }
.bn-remove { width: 30px; height: 30px; padding: 0 !important; justify-content: center; }

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

@media (max-width: 860px) {
	.bn-layout, .bn-outputs { grid-template-columns: 1fr; }
	.bn-main { position: static; }
	.bn-stage { min-height: 0; padding: 14px; border-radius: 20px; }
	.bn-frame canvas { max-height: 56vh; }
}

.bn-tpls { display: flex; flex-wrap: wrap; gap: 6px; }
.bn-tpls button { padding: 7px 12px !important; margin: 0 !important; border: 1px solid #E2E2E8 !important; border-radius: 999px !important; background: #fff !important; color: #222 !important; font-size: 12.5px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important; }
.bn-tpls button:hover { border-color: #111 !important; }
.bn-hint { margin: -4px 0 10px !important; font-size: 12px; color: #6E6E78; }
.bn-hint code { padding: 1px 5px; border-radius: 6px; background: #F4F4F7; font-size: 11.5px; }
.bn-sub { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: #333; }
#bn-logo-opts .bn-check { margin-top: 4px; }

/* Dark mode */
html[data-theme="dark"] .tg-tool .bn-stage { background-color: #12121A; background-image: repeating-conic-gradient(#1A1A24 0 25%, transparent 0 50%); }
html[data-theme="dark"] .tg-tool .bn-card { background: #15151D !important; border-color: rgba(255, 255, 255, .09) !important; }
html[data-theme="dark"] .tg-tool .bn-seg { background: #1D1D27 !important; }
html[data-theme="dark"] .tg-tool .bn-seg button { color: #B9B9C6 !important; }
html[data-theme="dark"] .tg-tool .bn-seg button[aria-pressed="true"] { background: #262633 !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .bn-slider label, html[data-theme="dark"] .tg-tool .bn-field, html[data-theme="dark"] .tg-tool .bn-text,
html[data-theme="dark"] .tg-tool .bn-check, html[data-theme="dark"] .tg-tool .bn-custom label { color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .bn-slider span, html[data-theme="dark"] .tg-tool .bn-note, html[data-theme="dark"] .tg-tool .bn-under { color: #9393A3 !important; }
html[data-theme="dark"] .tg-tool .bn-btn { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .bn-btn-dark { background: #EDEDF2 !important; color: #111 !important; }
html[data-theme="dark"] .tg-tool .bn-meter:not(.is-good):not(.is-ok):not(.is-bad) { background: #1D1D27; color: #EDEDF2; }
html[data-theme="dark"] .tg-tool .bn-tpls button { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .bn-hint { color: #9393A3 !important; }
html[data-theme="dark"] .tg-tool .bn-hint code { background: #1D1D27; color: #EDEDF2; }
html[data-theme="dark"] .tg-tool .bn-sub { color: #EDEDF2 !important; }
