.workshop-controls {
  overflow-y: auto;
  min-width: 0;
}
.workshop-controls > .control-section,
.workshop-controls > .image-generate {
  flex-shrink: 0;
}
.workshop-controls > .prompt-section {
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
  min-height: 240px;
}
.workshop-controls .prompt-input-wrap {
  display: flex;
  flex: 1 0 180px;
  min-height: 180px;
}
.workshop-controls .prompt-section textarea {
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 180px;
  max-height: none;
  resize: none;
  font-size: 14px;
}
.workshop-controls .image-generate {
  margin-top: auto;
  min-height: 52px;
  gap: 12px;
}
.workshop-controls .image-generate small {
  text-align: right;
}
.workshop-controls .control-subtitle > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.workshop-controls .reference-transfer-summary {
  display: block;
  max-height: 36px;
  overflow-y: auto;
  overflow-wrap: anywhere;
}
.workshop-controls .reference-transfer-summary[hidden] { display: none; }
.workshop-controls .reference-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (min-width: 761px) {
  .workshop-body { height: 100dvh; }
  .workshop-shell { height: calc(100dvh - 70px); }
  .workshop-controls {
    height: 100%;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .workshop-controls .reference-grid { grid-template-columns: repeat(5, minmax(0, 54px)); }
}
@media (max-width: 760px) {
  .workshop-body .global-page-controls {
    top: 12px;
    right: 76px;
    bottom: auto;
    left: auto;
    padding: 0;
    border: 0;
  }
  .workshop-body .global-page-controls button { width: 32px; height: 32px; }
  .workshop-controls {
    height: auto;
    min-height: calc(100dvh - 70px);
    padding: 16px;
    gap: 12px;
  }
  .workshop-controls .control-title { flex-wrap: wrap; gap: 6px; }
  .workshop-controls .prompt-section { min-height: 320px; }
  .workshop-controls .prompt-input-wrap,
  .workshop-controls .prompt-section textarea { min-height: 240px; }
}
@media (min-width: 761px) and (max-height: 820px) {
  .workshop-controls .control-title { margin-bottom: 5px; }
  .workshop-controls .image-key-select { min-height: 34px; height: 34px; padding-block: 5px; }
  .workshop-controls .quality-row select { padding-block: 5px; }
}

/* Keep optional quality controls hidden under the existing label layout. */
.workshop-controls .quality-row [hidden] { display: none; }
.workshop-controls .quality-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workshop-controls .quality-row label { min-width: 0; }
.workshop-controls .reference-uploader-title { flex-wrap: wrap; gap: 8px; }
