/* v23: keep the ImageGen action rail inside its fixed-height grid cell. */
.reference-image-workspace > .reference-studio-left,
.reference-image-workspace > .reference-studio-stage,
.reference-image-workspace > .reference-studio-right {
  min-height: 0 !important;
}

.reference-image-workspace > .reference-studio-left {
  overflow: hidden !important;
}

.reference-studio-left-scroll {
  min-height: 0 !important;
}

.reference-studio-generate-bar {
  display: flex !important;
  visibility: visible !important;
}

/* ChatGPT-style image picker beneath the composer. */
.reference-chat-attach {
  width: 30px !important;
  height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: 1px solid #333 !important;
  border-radius: 50% !important;
  background: #111 !important;
  color: #d4d4d4 !important;
  font-size: 20px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
}

.reference-chat-attach:hover {
  border-color: #666 !important;
  background: #1a1a1a !important;
  color: #fff !important;
}

.task-dialog-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 4px 14px !important;
}

.task-dialog-meta span:first-child {
  color: #c8c8c8 !important;
}

.task-dialog-meta span:last-child {
  color: #fff !important;
  font-weight: 600 !important;
}

/* Keep the workspace visually clean while preserving wheel/touch scrolling. */
.reference-studio-left-scroll,
.reference-studio-task-list,
.reference-studio-image-wrap {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.reference-studio-left-scroll::-webkit-scrollbar,
.reference-studio-task-list::-webkit-scrollbar,
.reference-studio-image-wrap::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.reference-studio-image-wrap {
  overflow: hidden !important;
}

.reference-studio-image-wrap img,
.reference-studio-upload-item img {
  image-rendering: auto !important;
}

.reference-studio-upload-item img {
  opacity: 1 !important;
}

/* Single-surface ChatGPT-style composer. */
.reference-chat-composer-wrap {
  padding: 32px 24px 20px !important;
}

.reference-chat-composer {
  max-width: 800px !important;
  gap: 8px !important;
}

.reference-chat-prompt-shell {
  display: flex !important;
  min-height: 52px !important;
  align-items: flex-end !important;
  gap: 8px !important;
  padding: 5px 6px 5px 10px !important;
  border: 1px solid #303030 !important;
  border-radius: 27px !important;
  background: #212121 !important;
  box-shadow: none !important;
}

.reference-chat-prompt-shell #chat-input {
  min-width: 0 !important;
  min-height: 40px !important;
  max-height: 160px !important;
  flex: 1 !important;
  margin: 0 !important;
  padding: 10px 2px 8px !important;
  overflow-y: auto !important;
  resize: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #f1f1f1 !important;
  font-size: 15px !important;
  line-height: 22px !important;
}

.reference-chat-prompt-shell #chat-input:focus {
  border: 0 !important;
  box-shadow: none !important;
}

.reference-chat-prompt-shell #chat-input::placeholder {
  color: #aaa !important;
}

.reference-chat-prompt-shell .reference-chat-attach {
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
  align-self: flex-end !important;
  margin: 0 !important;
  border-color: transparent !important;
  background: transparent !important;
  color: #e2e2e2 !important;
  font-size: 28px !important;
}

.reference-chat-prompt-shell .reference-chat-attach:hover {
  border-color: #424242 !important;
  background: #2f2f2f !important;
}

.reference-chat-prompt-shell #chat-model-select {
  width: 122px !important;
  min-width: 0 !important;
  height: 32px !important;
  align-self: flex-end !important;
  margin: 0 2px 3px 0 !important;
  padding: 0 24px 0 9px !important;
  overflow: hidden !important;
  outline: 0 !important;
  border: 1px solid #3b3b3b !important;
  border-radius: 16px !important;
  background: #2a2a2a !important;
  color: #d6d6d6 !important;
  cursor: pointer !important;
  font-size: 11px !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.reference-chat-send {
  width: 40px !important;
  height: 40px !important;
  flex: 0 0 40px !important;
  align-self: flex-end !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #ececec !important;
  color: #151515 !important;
  cursor: pointer !important;
  font-size: 23px !important;
  font-weight: 600 !important;
  line-height: 38px !important;
}

.reference-chat-send:hover:not(:disabled) {
  background: #fff !important;
}

.reference-chat-send:disabled {
  background: #3d3d3d !important;
  color: #929292 !important;
  cursor: not-allowed !important;
}

.reference-chat-price-note {
  padding: 0 12px !important;
  color: #666 !important;
  text-align: center !important;
}

/* ChatGPT-like thread: no visible role or per-message billing labels. */
.reference-chat-float {
  align-items: center !important;
  gap: 8px !important;
}

.reference-chat-model-top {
  width: 138px !important;
  height: 30px !important;
  padding: 0 24px 0 10px !important;
  outline: 0 !important;
  border: 1px solid #252525 !important;
  border-radius: 15px !important;
  background: rgba(14, 14, 14, .88) !important;
  color: #a9a9a9 !important;
  cursor: pointer !important;
  font: 12px/1 inherit !important;
  pointer-events: auto !important;
}

.reference-chat-model-top:hover,
.reference-chat-model-top:focus {
  border-color: #444 !important;
  color: #fff !important;
}

.reference-chat-message {
  align-items: flex-start !important;
  gap: 0 !important;
  margin-bottom: 28px !important;
}

.reference-chat-message.user {
  align-items: flex-end !important;
}

.reference-chat-message .reference-chat-bubble {
  box-sizing: border-box !important;
  max-width: min(86%, 700px) !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #ececec !important;
  font-size: 15px !important;
  line-height: 1.72 !important;
}

.reference-chat-message.user .reference-chat-bubble {
  width: fit-content !important;
  max-width: min(80%, 640px) !important;
  padding: 11px 16px !important;
  border-radius: 22px 22px 6px 22px !important;
  background: #1d4f8d !important;
  color: #fff !important;
}

.reference-chat-message.assistant .reference-chat-bubble {
  padding: 0 !important;
}

.reference-chat-message .reference-chat-bubble p {
  margin: 0 !important;
  white-space: pre-wrap !important;
}

.reference-chat-message .reference-chat-bubble.loading {
  color: #929292 !important;
}

.reference-chat-message.user .reference-chat-message-images {
  justify-content: flex-end !important;
}

@media (max-width: 620px) {
  .reference-chat-composer-wrap { padding: 26px 12px 12px !important; }
  .reference-chat-prompt-shell { gap: 5px !important; padding-left: 6px !important; }
  .reference-chat-prompt-shell #chat-model-select { width: 82px !important; font-size: 10px !important; }
  .reference-chat-float { padding: 12px !important; }
  .reference-chat-model-top { width: 112px !important; font-size: 11px !important; }
  .reference-chat-message .reference-chat-bubble { max-width: 92% !important; }
  .reference-chat-message.user .reference-chat-bubble { max-width: 88% !important; }
  .reference-chat-prompt-shell .reference-chat-attach { width: 34px !important; height: 34px !important; flex-basis: 34px !important; }
  .reference-chat-send { width: 36px !important; height: 36px !important; flex-basis: 36px !important; font-size: 20px !important; }
}

@media (min-width: 761px) {
  .reference-image-workspace {
    height: calc(100vh - 56px) !important;
  }
}
