.studio-head {align-items: flex-end; gap: 18px;}
.studio-project-select {display: grid; gap: 5px; max-width: 100%; font-size: 12px; color: var(--muted);}
.studio-project-select select {max-width: 100%; min-height: 40px; font-size: 14px;}
.studio-brief {padding: 12px 16px; background: #eaf1e6; border-radius: 10px;}
.studio-brief summary {display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--brand); font-weight: 650;}
.studio-brief summary::after {content: "＋"; margin-left: auto;}
.studio-brief[open] summary::after {content: "－";}
.studio-brief p {margin: 12px 0 0; line-height: 1.7; white-space: pre-wrap;}
.studio-ended,.studio-lead,.studio-panel small {color: var(--muted);}
.studio-switch {display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin: 20px 0 12px;}
.studio-switch button {display: flex; gap: 12px; align-items: center; padding: 15px; text-align: left; background: var(--paper); color: var(--muted); border: 1px solid var(--line); border-radius: 12px; transition: background .15s, border-color .15s;}
.studio-switch button:hover {background: var(--soft);}
.studio-switch button[aria-pressed=true] {border-color: var(--brand); background: #e9f1e7; color: var(--brand);}
.studio-stage-icon {display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; background: var(--soft);}
.studio-switch button[aria-pressed=true] .studio-stage-icon {background: var(--brand); color: white;}
.studio-switch b,.studio-switch small {display: block;}
.studio-switch small {margin-top: 2px; font-size: 12px;}
.studio-panel {max-width: 100%; padding: clamp(16px,3vw,30px);}
.studio-panel h2,.studio-panel h3 {margin: 0;}
.studio-panel h2 {font-size: clamp(20px,2.5vw,25px);}
.studio-panel h3 {font-size: 17px;}
.studio-lead {max-width: 70ch; margin: 7px 0 24px; line-height: 1.65;}
.studio-panel label:not(.studio-upload) {display: block; font-weight: 650; margin-bottom: 7px;}
.studio-panel textarea {display: block; width: 100%; resize: vertical; padding: 12px; line-height: 1.6; color: var(--ink); font: inherit; min-height: 90px; border: 1px solid #a5b8aa; border-radius: 9px; background: white; box-sizing: border-box;}
.studio-panel textarea:focus-visible,.studio-upload:focus-within {outline: 2px solid var(--brand); outline-offset: 2px;}
.studio-actions,.studio-prompts {display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 13px;}
.studio-prompts button {padding: 6px 10px; background: #f3f6f1; border: 1px solid var(--line); border-radius: 8px; color: var(--brand); text-align: left; font-size: 13px;}
.studio-panel :disabled {opacity: .65; cursor: default;}
.studio-chat {display: grid; gap: 12px; margin-bottom: 20px; max-height: min(58vh,520px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;}
.studio-bubble {padding: 14px 16px; background: #f3f6f1; border-radius: 12px; margin-right: min(6vw,76px);}
.studio-bubble.mine,.studio-sending {margin-left: min(6vw,76px); margin-right: 0; background: #e5eee5;}
.studio-sending {padding: 10px 14px; border-radius: 9px; overflow-wrap: anywhere;}
.studio-bubble>b {display: block; margin-bottom: 4px; font-size: 12px; color: var(--brand);}
.studio-prose {white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; font-size: 15px;}
.studio-subheading {font-weight: 750;}
.studio-result {border-top: 1px solid var(--line); padding-top: 20px; margin-top: 23px;}
.studio-result header {display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px;}
.studio-result>small {display: block; margin-top: 16px;}
.studio-upload {position: relative; display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 100px; padding: 14px; border: 1px dashed #8ea997; border-radius: 10px; background: #f4f7f1; cursor: pointer;}
.studio-upload.has-file {min-height: 60px; justify-content: flex-start; margin-top: 12px;}
.studio-upload small,.studio-file small {display: block; margin-top: 3px; font-size: 13px;}
.studio-upload input {position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;}
.studio-file {display: grid; gap: 8px; overflow-wrap: anywhere;}
.studio-file video {display: block; max-height: min(48vh,420px); width: 100%; background: #18211d; border-radius: 10px;}
.studio-alert,.studio-wait {padding: 10px 12px; border-radius: 8px; margin: 14px 0; line-height: 1.55;}
.studio-alert {background: #fff0df; color: #71461f;}
.studio-wait {display: flex; flex-wrap: wrap; gap: 9px; align-items: center; background: var(--soft);}
.studio-spinner {width: 15px; height: 15px; border: 2px solid #b4cbb8; border-top-color: var(--brand); border-radius: 50%; animation: studio-turn .85s linear infinite;}
@keyframes studio-turn {to {transform: rotate(360deg);}}
@media (prefers-reduced-motion: reduce) {.studio-spinner {animation: none;} .studio-switch button {transition: none;}}
@media (max-width: 650px) {
  .studio-head {align-items: stretch; flex-direction: column;}
  .studio-switch {gap: 6px;}
  .studio-switch button {padding: 10px 4px; flex-direction: column; justify-content: center; gap: 6px; text-align: center; font-size: 13px;}
  .studio-switch small {display: none;}
  .studio-stage-icon {width: 30px; height: 30px;}
}
