.explorer-root {
    position: relative;
    width: 100%;
    height: calc(100vh - 80px);
    overflow: hidden;
    background: var(--brutal-color-bg);
    color: inherit;
    font-family: var(--brutal-font-display);
}

.explorer-root *,
.explorer-root *::before,
.explorer-root *::after {
    box-sizing: border-box;
}

.explorer-canvaswrap {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
}

#explorer-canvas-stash canvas#cv,
.explorer-canvaswrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.explorer-breadcrumb {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    padding: 6px 10px;
    background: color-mix(in srgb, var(--brutal-color-bg) 85%, transparent);
    border: 1px solid var(--brutal-color-fg);
    backdrop-filter: blur(2px);
}

.explorer-toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.explorer-popover {
    position: absolute;
    top: 64px;
    right: 12px;
    z-index: 6;
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    padding: 16px;
    background: var(--brutal-color-bg);
    color: inherit;
    border: 2px solid var(--brutal-color-fg);
    box-shadow: 6px 6px 0 var(--brutal-color-fg);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.explorer-popover__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.explorer-popover__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--brutal-color-fg);
    padding-top: 14px;
}

@media (max-width: 720px) {
    .explorer-popover {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        max-height: 70vh;
    }
}

.explorer-settings-group {
    border-top: 1px solid var(--brutal-color-fg);
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explorer-settings-group:first-child {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
}

.explorer-loading {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: var(--brutal-color-bg);
    color: inherit;
    font-family: var(--brutal-font-mono);
    font-size: var(--brutal-size-body);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: opacity 0.25s ease;
}

.explorer-loading.--hidden {
    opacity: 0;
    pointer-events: none;
}

.explorer-loading__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--brutal-color-bg);
    border-top-color: var(--brutal-color-secondary);
    border-radius: 50%;
    animation: vipsim-spin 0.85s linear infinite;
}

@keyframes vipsim-spin {
    to { transform: rotate(360deg); }
}

.explorer-scene-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.explorer-blind-color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
}

.explorer-blind-color-row > .brutal-slider {
    flex: 1;
}

.explorer-desc {
    font-size: var(--brutal-size-body);
    color: inherit;
    opacity: 0.85;
    margin: 0 0 12px;
    line-height: 1.5;
}

.explorer-desc--welcome {
    font-size: var(--brutal-size-subtitle);
    opacity: 1;
    line-height: 1.6;
    margin-top: 4px;
}

.explorer-desc--welcome p {
    margin: 0 0 1em;
}

.explorer-desc--welcome p:last-child {
    margin-bottom: 0;
}

.explorer-param-row {
    margin-bottom: 6px;
    padding-bottom: 0;
    border-bottom: 0;
    opacity: 1;
}

.explorer-param-row:last-child {
    margin-bottom: 0;
}

.explorer-param-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.explorer-param-label {
    font-size: var(--brutal-size-label);
    color: inherit;
    font-weight: 600;
    font-family: var(--brutal-font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.explorer-param-hint {
    font-size: var(--brutal-size-body);
    color: inherit;
    opacity: 0.75;
    margin: 0 0 6px;
    line-height: 1.4;
}

.explorer-param-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.explorer-val {
    font-family: var(--brutal-font-mono);
    font-size: var(--brutal-size-mono);
    font-weight: 600;
    min-width: 56px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: inherit;
}

.explorer-combine-row {
    margin-bottom: 6px;
    padding-bottom: 0;
    border-bottom: 0;
}

.explorer-combine-row:last-child {
    margin-bottom: 0;
}

.explorer-combine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.explorer-export-row {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid currentColor;
    display: flex;
    justify-content: flex-start;
}

.explorer-root.--hide-hints .explorer-param-hint,
.explorer-root.--hide-hints .explorer-desc:not(.explorer-desc--welcome) {
    display: none;
}

.explorer-root.--hide-hints .explorer-param-row:has(.brutal-slider),
.explorer-root.--hide-hints .explorer-param-row:has(.brutal-segmented) {
    display: grid;
    grid-template-columns: 5fr 4fr;
    column-gap: 12px;
    align-items: center;
    padding-bottom: 0;
    margin-bottom: 4px;
}

.explorer-root.--hide-hints .explorer-param-row:has(.brutal-slider) .explorer-param-header,
.explorer-root.--hide-hints .explorer-param-row:has(.brutal-segmented) .explorer-param-header {
    margin-bottom: 0;
    min-width: 0;
}

.explorer-root.--hide-hints .explorer-param-row:has(.brutal-slider) .explorer-param-label,
.explorer-root.--hide-hints .explorer-param-row:has(.brutal-segmented) .explorer-param-label {
    font-size: var(--brutal-size-control-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.explorer-root.--hide-hints .explorer-param-row:has(.brutal-slider) .explorer-val,
.explorer-root.--hide-hints .explorer-param-row:has(.brutal-segmented) .explorer-val {
    font-size: var(--brutal-size-control-sm);
    min-width: 40px;
}

.explorer-root.--large-text .explorer-param-label { font-size: calc(var(--brutal-size-label) * 1.5); }
.explorer-root.--large-text .explorer-param-hint { font-size: calc(var(--brutal-size-body) * 1.5); }
.explorer-root.--large-text .explorer-desc { font-size: calc(var(--brutal-size-body) * 1.5); }
.explorer-root.--large-text .explorer-desc--welcome { font-size: calc(var(--brutal-size-subtitle) * 1.5); line-height: 1.55; }
.explorer-root.--large-text .explorer-val { font-size: calc(var(--brutal-size-mono) * 1.5); }

.explorer-root.--large-text.--hide-hints .explorer-param-row:has(.brutal-slider),
.explorer-root.--large-text.--hide-hints .explorer-param-row:has(.brutal-segmented) {
    grid-template-columns: 1fr 1fr;
}

.explorer-root.--large-text.--hide-hints .explorer-param-row:has(.brutal-slider) .explorer-param-label,
.explorer-root.--large-text.--hide-hints .explorer-param-row:has(.brutal-segmented) .explorer-param-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}
