/* Color Palette from Image ([palette_from_image]). Loaded after tools.css; the code box reuses its .gg-output styles. */
.pi-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 16px; }
.pi-main { border-radius: 28px; }
.pi-main.is-over { outline: 3px dashed #7B5CFF; outline-offset: 4px; }
.pi-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 340px; padding: 24px; border: 2px dashed #D9D9E2; border-radius: 28px; background: #FAFAFC; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.pi-drop[hidden] { display: none; }
.pi-drop:hover { border-color: #111; background: #fff; }
.pi-drop .tg-i { width: 30px; height: 30px; transform: rotate(180deg); color: #6E6E78; }
.pi-drop strong { font-size: 17px; color: #111; }
.pi-drop span { font-size: 13px; color: #6E6E78; }
.pi-fig { margin: 0 !important; border-radius: 28px; overflow: hidden; background: #F4F4F7; text-align: center; line-height: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.pi-fig[hidden] { display: none; }
.pi-fig img { display: inline-block; max-width: 100%; max-height: 560px; width: auto; height: auto; cursor: crosshair; }
.pi-drop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.pi-privacy { font-size: 12.5px; color: #6E6E78; }
.pi-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;
}
.pi-btn[hidden] { display: none !important; }
.pi-btn:hover { border-color: #111 !important; }
.pi-btn:disabled, .pi-btn[aria-disabled="true"] { opacity: .45; cursor: default; border-color: #E2E2E8 !important; }
.pi-btn .tg-i { width: 15px; height: 15px; }

.pi-side { display: grid; gap: 12px; }
.pi-count { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: #333; white-space: nowrap; }
.pi-count input { flex: 1; }
.pi-count span { min-width: 14px; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; color: #55555F; }
.pi-swatches { display: grid; border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.pi-empty { padding: 34px 18px; font-size: 14px; color: #6E6E78; text-align: center; background: #FAFAFC; }
.pi-sw { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 8px 10px 8px 12px; }
.pi-sw button { margin: 0 !important; border: 0 !important; background: transparent !important; color: inherit !important; box-shadow: none !important; cursor: pointer; }
.pi-hex { padding: 6px 8px !important; border-radius: 10px !important; font: 700 16px/1.1 'SF Mono', 'Fira Code', ui-monospace, monospace !important; }
.pi-hex:hover, .pi-x:hover { background: rgba(127, 127, 127, .24) !important; }
.pi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; font-weight: 600; color: inherit !important; opacity: .85; text-decoration: none !important; }
a.pi-name:hover { opacity: 1; text-decoration: underline !important; }
.pi-sw small { font-size: 12px; font-weight: 600; opacity: .75; }
.pi-x { width: 32px; height: 32px; padding: 0 !important; border-radius: 999px !important; font-size: 20px !important; line-height: 1 !important; opacity: .7; }
.pi-x:hover { opacity: 1; }
.pi-x:disabled { opacity: .25; cursor: default; background: transparent !important; }
.pi-hint { margin: 0 2px !important; font-size: 13px; color: #6E6E78; }
.pi-hint[hidden] { display: none; }
.pi-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pi-output { margin-bottom: 28px; }
.pi-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; padding-right: 80px; }
.pi-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; }
.pi-tabs button[aria-pressed="true"] { background: #111 !important; border-color: #111 !important; color: #fff !important; }
.pi-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; }
.pi-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
	.pi-layout { grid-template-columns: 1fr; }
	.pi-drop { min-height: 220px; }
	.pi-fig img { max-height: 380px; }
}

/* Dark mode */
html[data-theme="dark"] .tg-tool .pi-drop, html[data-theme="dark"] .tg-tool .pi-empty, html[data-theme="dark"] .tg-tool .pi-fig { background: #15151D; border-color: rgba(255, 255, 255, .16); }
html[data-theme="dark"] .tg-tool .pi-drop strong, html[data-theme="dark"] .tg-tool .pi-count { color: #EDEDF2; }
html[data-theme="dark"] .tg-tool .pi-drop span, html[data-theme="dark"] .tg-tool .pi-privacy, html[data-theme="dark"] .tg-tool .pi-hint, html[data-theme="dark"] .tg-tool .pi-empty, html[data-theme="dark"] .tg-tool .pi-count span { color: #9393A3; }
html[data-theme="dark"] .tg-tool .pi-btn, html[data-theme="dark"] .tg-tool .pi-tabs button { background: #1D1D27 !important; border-color: rgba(255, 255, 255, .16) !important; color: #EDEDF2 !important; }
html[data-theme="dark"] .tg-tool .pi-tabs button[aria-pressed="true"] { background: #fff !important; border-color: #fff !important; color: #111 !important; }
html[data-theme="dark"] .tg-tool .pi-toast { background: #EDEDF2; color: #111; }
