#visual-lab-app {
    --vl-bg: #05070a;
    --vl-panel: rgba(11, 14, 18, 0.82);
    --vl-border: rgba(232, 242, 255, 0.16);
    --vl-text: #f5f7fb;
    --vl-muted: #a8b3c5;
    --vl-accent: #b8e4ff;

    position: relative;
    display: grid;
    width: 100%;
    min-height: min(82vh, 780px);
    overflow: hidden;
    border: 1px solid var(--vl-border);
    border-radius: 8px;
    background: var(--vl-bg);
    color: var(--vl-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    isolation: isolate;
}

#visual-lab-app * {
    box-sizing: border-box;
}

.vl-panel {
    position: relative;
    z-index: 2;
    align-self: start;
    width: min(440px, calc(100% - 32px));
    margin: 16px;
    padding: 20px;
    border: 1px solid var(--vl-border);
    border-radius: 8px;
    background: var(--vl-panel);
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.vl-kicker,
.vl-subtitle {
    margin: 0;
    color: var(--vl-muted);
}

.vl-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.vl-panel h1 {
    margin: 6px 0 6px;
    color: var(--vl-text);
    font-size: clamp(32px, 5vw, 58px);
    line-height: 0.95;
    letter-spacing: 0;
}

.vl-subtitle {
    font-size: 15px;
    line-height: 1.45;
}

.vl-controls {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.vl-controls label {
    display: grid;
    gap: 7px;
    color: var(--vl-muted);
    font-size: 13px;
    font-weight: 700;
}

.vl-controls input,
.vl-controls textarea,
.vl-controls select,
.vl-controls button {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--vl-border);
    border-radius: 6px;
    color: var(--vl-text);
    font: inherit;
}

.vl-controls input,
.vl-controls textarea,
.vl-controls select {
    background: rgba(255, 255, 255, 0.07);
}

.vl-controls input[type="file"] {
    cursor: pointer;
}

.vl-controls input,
.vl-controls textarea {
    padding: 10px 12px;
}

.vl-controls select {
    padding: 0 10px;
}

.vl-controls textarea {
    resize: vertical;
}

.vl-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.vl-select-label {
    min-width: 0;
}

.vl-controls button {
    cursor: pointer;
    padding: 0 12px;
    background: rgba(184, 228, 255, 0.1);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.vl-controls button:disabled {
    cursor: not-allowed;
    border-color: rgba(232, 242, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 247, 251, 0.48);
}

.vl-controls button:hover,
.vl-controls button:focus-visible {
    border-color: rgba(184, 228, 255, 0.52);
    background: rgba(184, 228, 255, 0.18);
}

.vl-controls button:disabled:hover,
.vl-controls button:disabled:focus-visible {
    border-color: rgba(232, 242, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.vl-controls button:active {
    transform: translateY(1px);
}

#vl-play {
    align-self: end;
    background: var(--vl-accent);
    color: #061017;
    font-weight: 800;
}

#visual-lab-app.is-playing #vl-play {
    background: #ffffff;
}

.vl-status {
    min-height: 22px;
    margin: 0;
    color: var(--vl-muted);
    font-size: 13px;
    line-height: 1.45;
}

#vl-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
}

#vl-audio {
    display: none;
}

@media (max-width: 640px) {
    #visual-lab-app {
        min-height: 760px;
    }

    .vl-panel {
        width: calc(100% - 24px);
        margin: 12px;
        padding: 16px;
    }

    .vl-row {
        grid-template-columns: 1fr;
    }
}
