/* Color Palette Generator ([color_palette]). Loaded after tools.css; the code box reuses its .gg-output styles. */
.cp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.cp-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: #F4F4F7; }
.cp-seg button { padding: 8px 14px !important; margin: 0 !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; }
.cp-seg button[aria-pressed="true"] { background: #fff !important; color: #111 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; }
.cp-count { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: #333; white-space: nowrap; }
.cp-count input { width: 110px; }
.cp-count span { min-width: 14px; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; color: #55555F; }
.cp-bar-end { display: flex; gap: 8px; margin-left: auto; }
.cp-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; line-height: 1.3 !important; text-decoration: none !important; cursor: pointer; box-shadow: none !important;
}
.cp-btn:hover { border-color: #111 !important; }
.cp-btn:disabled { opacity: .45; cursor: default; border-color: #E2E2E8 !important; }
.cp-btn .tg-i { width: 15px; height: 15px; }
.cp-btn.is-primary { background: #111 !important; border-color: #111 !important; color: #fff !important; padding: 10px 22px !important; font-size: 14px !important; }
.cp-btn.is-primary:hover { background: #333 !important; }

.cp-swatches { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 440px; border-radius: 28px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.cp-sw { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; padding: 16px 6px 26px; transition: background .12s; }
.cp-sw button, .cp-sw .cp-edit {
	display: inline-flex; align-items: center; justify-content: center; margin: 0 !important; border: 0 !important; background: transparent !important;
	color: inherit !important; box-shadow: none !important; cursor: pointer;
}
.cp-lock, .cp-edit { position: relative; width: 40px; height: 40px; padding: 0 !important; border-radius: 999px !important; opacity: .55; transition: opacity .15s, background .15s; }
.cp-lock .tg-i, .cp-edit .tg-i { width: 19px; height: 19px; }
.cp-sw:hover .cp-lock, .cp-sw:hover .cp-edit, .cp-lock:focus-visible, .cp-edit:focus-within, .cp-sw.is-locked .cp-lock { opacity: 1; }
.cp-lock:hover, .cp-edit:hover { background: rgba(127, 127, 127, .22) !important; }
.cp-sw.is-locked .cp-lock { background: rgba(127, 127, 127, .28) !important; }
.cp-edit input { position: absolute; inset: 0; width: 100% !important; height: 100% !important; padding: 0 !important; border: 0 !important; opacity: 0; cursor: pointer; }
.cp-hex { margin-top: 8px !important; padding: 6px 10px !important; border-radius: 12px !important; font: 700 clamp(13px, 1.5vw, 19px)/1.1 'SF Mono', 'Fira Code', ui-monospace, monospace !important; letter-spacing: .01em; }
.cp-hex:hover { background: rgba(127, 127, 127, .22) !important; }
.cp-name { max-width: 100%; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: inherit !important; opacity: .82; text-decoration: none !important; }
.cp-name:hover { opacity: 1; text-decoration: underline !important; }

.cp-hint { margin: 10px 2px 16px !important; font-size: 13px; color: #6E6E78; }
.cp-hint kbd { padding: 1px 7px; border: 1px solid #DDDDE4; border-bottom-width: 2px; border-radius: 6px; background: #fff; font: 600 12px/1.5 'SF Mono', 'Fira Code', ui-monospace, monospace; color: #333; }
.cp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.cp-strip { flex: 1; min-width: 120px; height: 38px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.cp-output { margin-bottom: 28px; }
.cp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding-right: 80px; }
.cp-tabs button { padding: 6px 13px !important; margin: 0 !important; border: 1px solid #E6E6EC !important; border-radius: 999px !important; background: #fff !important; color: #333 !important; font-size: 12.5px !important; font-weight: 600 !important; cursor: pointer; box-shadow: none !important; }
.cp-tabs button[aria-pressed="true"] { background: #111 !important; border-color: #111 !important; color: #fff !important; }
.cp-toast { position: fixed; left: 50%; bottom: 24px; z-index: 9999; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 999px; background: #111; color: #fff; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.cp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
	.cp-bar-end { margin-left: 0; width: 100%; }
	.cp-count { flex: 1; }
	.cp-count input { flex: 1; width: auto; }
	.cp-bar-end .is-primary { flex: 1; justify-content: center; }
	.cp-swatches { grid-auto-flow: row; grid-auto-rows: 1fr; height: auto; }
	.cp-sw { flex-direction: row; justify-content: flex-start; gap: 4px; min-height: 68px; padding: 10px 12px; }
	.cp-lock, .cp-edit { opacity: 1; }
	.cp-hex { order: -2; margin: 0 !important; font-size: 16px !important; }
	.cp-name { order: -1; flex: 1; min-width: 0; }
	.cp-hint-key { display: none; }
}

/* Dark mode */
html[data-theme="dark"] .tg-tool .cp-seg { background: #1D1D27 !important; }
html[data-theme="dark"] .tg-tool .cp-seg button { color: #B9B9C6 !important; }
html[data-theme="dark"] .tg-tool .cp-seg button[aria-pressed="true"] { background: #262633 !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .cp-count { color: #EDEDF2; }
html[data-theme="dark"] .tg-tool .cp-count span, html[data-theme="dark"] .tg-tool .cp-hint { color: #9393A3; }
html[data-theme="dark"] .tg-tool .cp-hint kbd { background: #1D1D27; border-color: rgba(255, 255, 255, .16); color: #EDEDF2; }
html[data-theme="dark"] .tg-tool .cp-btn, html[data-theme="dark"] .tg-tool .cp-tabs button { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .cp-btn.is-primary, html[data-theme="dark"] .tg-tool .cp-tabs button[aria-pressed="true"] { background: #fff !important; border-color: #fff !important; color: #111 !important; }
html[data-theme="dark"] .tg-tool .cp-toast { background: #EDEDF2; color: #111; }
