/* One prompt editor across empty and populated boards. */
body.studio #studio[data-prompt-layout]:not([data-result=true]) {
  height: calc(100dvh - var(--hdr)); padding-bottom: 24px;
}
body.studio #studio[data-prompt-layout]:not([data-result=true]) .st-app { gap: 20px; }
body.studio #studio[data-prompt-layout] #studioEditor {
  position: relative; flex: none; align-items: center; width: min(1460px,100%); margin: 0 auto;
  min-height: 0; padding: 16px 18px; column-gap: 14px; row-gap: 12px;
  border: 1px solid var(--line2); border-radius: 20px; background: var(--bg2); box-shadow: var(--sh1);
}
body.studio #studio[data-prompt-layout]:not([data-result=true]) #studioEditor { display: grid; }
body.studio-empty #studio[data-prompt-layout] #studioEditor { grid-template: 'prompt prompt prompt prompt' auto 'refs quick api go' auto / auto minmax(0,1fr) auto auto; }
body.studio:not(.studio-empty) #studio[data-prompt-layout] #studioEditor { grid-template: 'prompt prompt prompt' auto 'head options go' auto / minmax(0,1fr) auto auto; }
body.studio #studio[data-prompt-layout] #studioEditor .prompt-panel {
  grid-area: prompt; display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  min-width: 0; height: auto; margin: 0; padding: 0 0 12px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none;
}
body.studio #studio[data-prompt-layout] #studioEditor .composer-spark { display: none; }
.studio-prompt-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; min-height: 28px; }
.studio-prompt-heading label { color: var(--tx2); font-size: 13px; font-weight: 600; }
.studio-prompt-meta { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.studio-prompt-count { color: var(--mu); font: 12px/20px var(--sans); white-space: nowrap; }
.studio-prompt-count b { font-weight: 400; font-variant-numeric: tabular-nums; }
#studioPromptExpand { min-height: 32px; padding: 4px 8px; border-radius: 7px; color: var(--tx2); background: var(--sf); font-size: 12px; }
#studioPromptExpand:hover { color: var(--ac); background: var(--acs); }
body.studio #studio[data-prompt-layout] #studioEditor #wbPrompt {
  display: block; width: 100%; height: 84px; min-height: 84px; max-height: none;
  padding: 4px 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: var(--tx); font: 16px/25px var(--sans); white-space: pre-wrap; overflow-wrap: anywhere;
  overflow-x: hidden; resize: none; scrollbar-width: thin; scrollbar-gutter: stable;
}
body.studio #studio[data-prompt-layout] #studioEditor .prompt-panel:focus-within { border-bottom-color: var(--ac); }
body.studio-empty #studio[data-prompt-layout] #studioEditor .composer-add { gap: 8px; padding: 0; border: 0; }
body.studio-empty #studio[data-prompt-layout] .composer-add button { min-height: 40px; padding: 6px 12px; font-size: 14px; line-height: 24px; }
body.studio-empty #studio[data-prompt-layout] #studioEditor > .quick { justify-content: flex-end; gap: 12px; }
body.studio-empty #studio[data-prompt-layout] :is(.studio-style > summary,.q2 .lab) { font-size: 14px; }
body.studio-empty #studio[data-prompt-layout] .studio-style > summary { min-height: 40px; padding: 6px 8px; }
body.studio-empty #studio[data-prompt-layout] #studioEditor .q2 > .row { gap: 12px; }
body.studio-empty #studio[data-prompt-layout] #studioEditor > #wbCfg { min-height: 40px; min-width: 74px; padding: 6px 12px; }
body.studio-empty #studio[data-prompt-layout] .studio-api-label { gap: 8px; font-size: 14px; }
body.studio #studio[data-prompt-layout] #studioEditor .gobar { position: static; grid-area: go; padding: 0; margin: 0; border: 0; min-height: 0; }
body.studio #studio[data-prompt-layout] #studioEditor #wbGo { width: auto; min-width: 110px; min-height: 42px; padding: 8px 20px; font-size: 15px; line-height: 24px; }
body.studio #studio[data-prompt-layout] #studioEditor .studio-editor-head { grid-area: head; justify-content: flex-start; }
body.studio:not(.studio-empty) #studio[data-prompt-layout] .composer-references > summary { display: inline-flex; align-items: center; gap: 8px; width: auto; height: auto; min-height: 40px; padding: 7px 12px; border: 1px solid var(--line2); border-radius: 9px; background: var(--sf); color: var(--tx); font-size: 13px; line-height: 22px; }
body.studio:not(.studio-empty) #studio[data-prompt-layout] .composer-references > summary svg { width: 17px; height: 17px; }
body.studio:not(.studio-empty) #studio[data-prompt-layout] #studioReferenceCount { position: static; width: auto; height: auto; padding: 0 6px; border-radius: 5px; background: var(--bg2); color: var(--mu); font: 12px/20px var(--sans); clip-path: none; overflow: visible; }
body.studio:not(.studio-empty) #studio[data-prompt-layout] #studioOptions { grid-area: options; }
#studioPromptDialog { z-index: 98; display: grid; place-items: center; padding: 24px; background: rgb(20 24 33 / .46); }
#studioPromptDialog[hidden] { display: none; }
.studio-prompt-dialog-card { display: flex; flex-direction: column; width: min(960px,100%); height: min(720px,calc(100dvh - 48px)); min-height: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--bg2); box-shadow: var(--sh3); overflow: hidden; }
.studio-prompt-dialog-card > header { position: relative; flex: none; padding: 20px 60px 16px 24px; border-bottom: 1px solid var(--line); }
.studio-prompt-dialog-card h2 { margin: 0; color: var(--tx); font-size: 20px; line-height: 28px; }
.studio-prompt-dialog-card p { margin: 5px 0 0; color: var(--mu); font-size: 13px; line-height: 20px; }
#studioPromptDialogBody { display: flex; flex: 1; min-height: 0; padding: 18px 24px; }
#studioPromptDialog #wbPrompt { flex: 1; width: 100%; height: 100%; min-height: 0; max-height: none; padding: 0; border: 0; border-radius: 0; resize: none; background: transparent; color: var(--tx); font: 16px/1.8 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; scrollbar-width: thin; }
#studioPromptDialog #wbPrompt:focus { outline: none; }
.studio-prompt-dialog-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; margin: 0; padding: 14px 24px; border-top: 1px solid var(--line); }
#studioPromptDone { min-height: 40px; padding: 8px 18px; font-size: 14px; }
@media(min-width:1024px) and (max-width:1279px) {
  body.studio-empty #studio[data-prompt-layout] #studioEditor { grid-template: 'prompt prompt prompt' auto 'refs refs refs' auto 'quick api go' auto / minmax(0,1fr) auto auto; }
  body.studio-empty #studio[data-prompt-layout] #studioEditor .composer-add { flex-wrap: wrap; }
  body.studio-empty #studio[data-prompt-layout] #studioEditor > .quick { justify-content: flex-start; }
}
@media(max-width:1023px) {
  body.studio #studio[data-prompt-layout]:not([data-result=true]) { height: auto; }
  body.studio #studio[data-prompt-layout] #studioEditor { padding: 14px; border-radius: 16px; }
  body.studio-empty #studio[data-prompt-layout] #studioEditor { grid-template: 'prompt prompt' auto 'refs refs' auto 'quick quick' auto 'api go' auto / minmax(0,1fr) auto; gap: 10px; }
  body.studio-empty #studio[data-prompt-layout] #studioEditor .composer-add { justify-content: flex-start; flex-wrap: wrap; }
  body.studio-empty #studio[data-prompt-layout] #studioEditor > .quick { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  body.studio #studio[data-prompt-layout] #studioEditor #wbPrompt { min-height: 82px; font-size: 16px; }
  body.studio #studio[data-prompt-layout] #studioEditor #wbGo { min-width: 110px; }
  body.studio #studio[data-prompt-layout][data-view=preview] #studioEditor { display: none; }
}
@media(max-width:459px) {
  body.studio #studio[data-prompt-layout] #studioEditor { padding: 12px; }
  body.studio-empty #studio[data-prompt-layout] .composer-add button { flex: 1; padding-inline: 8px; font-size: 13px; }
  body.studio #studio[data-prompt-layout] #studioEditor #wbGo { min-width: 98px; }
  #studioPromptDialog { padding: 10px; }
  .studio-prompt-dialog-card { height: calc(100dvh - 20px); border-radius: 14px; }
  .studio-prompt-dialog-card > header { padding: 18px 52px 14px 16px; }
  #studioPromptDialogBody { padding: 14px 16px; }
  .studio-prompt-dialog-card > footer { padding: 12px 16px; }
}
@media(min-width:1024px) and (max-height:740px) {
  body.studio #studio[data-prompt-layout] .studio-head { min-height: 66px; padding-block: 12px; }
  body.studio #studio[data-prompt-layout] .st-app { gap: 14px; }
  body.studio #studio[data-prompt-layout] #studioPreview { min-height: 180px; }
}
