.next-studio-selector { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 16px 0; font-size: .8rem; }
.next-studio-selector select, #next-studio input[type="text"], #next-studio input[type="url"], #next-studio select { color: var(--text); background: var(--panel); border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 12px; font: inherit; max-width: 100%; }
#next-studio-stage-select { color: var(--text); background: var(--panel); border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 12px; font: inherit; max-width: 100%; }
#next-studio-roster-select { color: var(--text); background: var(--panel); border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 12px; font: inherit; max-width: 100%; }
html[data-quest-engine="new"]:not([data-quest-workflow="outputs"]) #legacy-quest-studio { display: none !important; }
html[data-quest-engine="new"][data-quest-workflow="outputs"] #next-studio,
html[data-quest-engine="new"][data-quest-workflow="outputs"] #legacy-quest-studio > :not(#institution-next-actions-panel):not(#institution-embedded-engine-shell),
html[data-quest-engine="new"][data-quest-workflow="outputs"] :is(#institution-write-db-button, #institution-repair-db-button, #institution-progress-dock) { display: none !important; }
html[data-quest-engine="new"] :is(#institution-creator-analytics-section, #institution-feedback-section, .studio-tools-menu) { display: none !important; }
html[data-quest-engine="legacy"] #next-studio { display: none !important; }
#next-studio[hidden] { display: none; }
#next-studio { border-top: 2px solid #34d399; padding: 20px 0; font-size: .8rem; }
.next-studio-header, .next-studio-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.next-studio-url-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.next-studio-url-row input { flex: 1 1 320px; min-width: 0; }
.next-studio-header { justify-content: space-between; }
.next-studio-header h2 { font-size: 1.2rem; margin: 0 0 16px; }
.next-studio-source { display: grid; gap: 8px; margin: 16px 0; }
#next-studio textarea { width: 100%; min-height: 220px; max-height: 600px; resize: vertical; background: var(--panel); color: var(--text); border: 1px solid var(--border-soft); border-radius: 6px; padding: 12px; font: inherit; line-height: 1.6; }
#next-studio-stage-json { min-height: 280px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace !important; }
.next-studio-file { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.next-studio-file input { max-width: 230px; width: 100%; font: inherit; }
#next-studio-status, #next-studio-results { overflow-wrap: anywhere; white-space: pre-wrap; }
#next-studio-status[data-error="true"] { color: #fda4af; }
.next-studio-progress { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 12px 24px; border-block: 1px solid var(--border-soft); }
.next-studio-progress li { padding: 4px 0; color: var(--muted); }
.next-studio-progress li[data-complete="true"] { color: #6ee7b7; }
.next-studio-progress li[data-active="true"] { color: #fde68a; font-weight: 700; }
#next-studio-results details { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
#next-studio-results summary { cursor: pointer; font-weight: bold; }
#next-studio-results h3 { font-size: .95rem; margin: 16px 0 4px; }
#next-studio-results p { margin: 4px 0 12px; }
#next-studio-results .next-studio-gameplay { color: var(--muted); font-size: .7rem; }
#next-studio-results .next-studio-origin { color: #a7f3d0; font-size: .7rem; }
#next-studio-results blockquote { border-left: 2px solid #6ee7b7; padding-left: 12px; margin: 8px 0; }
.next-studio-stage-controls { margin: 16px 0; padding: 14px; border: 1px solid #34d399; border-radius: 6px; }
.next-studio-stage-controls p { margin: 0 0 12px; }
#next-studio button:disabled, #quest-studio-engine:disabled { opacity: .55; cursor: not-allowed; }
#next-studio button { max-width: 100%; white-space: normal; }
@media (max-width: 600px) { .next-studio-toolbar, .next-studio-url-row { align-items: stretch; } .next-studio-toolbar button, .next-studio-url-row button { flex: 1 1 130px; } .next-studio-file { flex-basis: 100%; } }