#pygfx-editor { margin: 2.5rem 0 3rem; }
.pygfx-upload {
    position: relative; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 1rem;
    min-height: 190px; padding: 2rem; box-sizing: border-box;
    border: 1px dashed var(--color-muted); border-radius: 8px;
    background: var(--color-surface); text-align: center;
    transition: border-color .15s, background .15s;
}
.pygfx-upload:hover { border-color: var(--color-text); }
.pygfx-upload:focus-within { outline: 2px solid var(--color-text); outline-offset: 4px; }
.pygfx-upload input {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: 0; cursor: pointer;
}
.pygfx-upload:has(input:disabled) { opacity: .6; }
.pygfx-upload input:disabled { cursor: wait; }
.pygfx-upload-button {
    padding: .75rem 1.25rem; border: 1px solid var(--color-border);
    border-radius: 5px; background: var(--color-bg); color: var(--color-text);
}
#pygfx-filename { color: var(--color-muted); font-size: .85em; overflow-wrap: anywhere; max-width: 100%; }
.pygfx-controls { display: flex; flex-wrap: wrap; gap: 1rem 1.25rem; align-items: end; margin-top: 2rem; }
.pygfx-controls label { display: grid; gap: .65rem; min-width: 0; }
.pygfx-controls select, .pygfx-controls button {
    font: inherit; color: var(--color-text); background: var(--color-bg);
    border: 1px solid var(--color-border); border-radius: 5px;
    padding: .75rem 1rem; min-height: 48px; box-sizing: border-box;
}
.pygfx-select { position: relative; display: block; }
.pygfx-select select { appearance: none; width: 100%; min-width: 12rem; padding-right: 3rem; }
.pygfx-select::after {
    content: ''; position: absolute; right: 1.2rem; top: 50%;
    width: .45rem; height: .45rem; margin-top: -.35rem;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg); pointer-events: none;
}
.pygfx-controls button { cursor: pointer; }
.pygfx-controls button:hover:not(:disabled) { background: var(--color-surface); border-color: var(--color-muted); }
.pygfx-controls :is(button, select):focus-visible { outline: 2px solid var(--color-text); outline-offset: 3px; }
.pygfx-controls button:disabled, .pygfx-controls select:disabled { opacity: .5; cursor: wait; }
#pygfx-editor #pygfx-status { margin: 1.5rem 0 0; color: var(--color-muted); overflow-wrap: anywhere; line-height: 1.7; }
#pygfx-result { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
#pygfx-image { display: block; max-width: 100%; height: auto; margin-top: 1.5rem; }
.pygfx-compare { display: inline-block; margin: 1rem 0 1rem 1.5rem; }
#pygfx-editor [hidden] { display: none; }
@media (max-width: 480px) {
    .pygfx-upload { min-height: 180px; padding: 1.5rem; }
    .pygfx-controls label { width: 100%; }
    .pygfx-compare { display: block; margin-left: 0; }
}
