/* Scoped to the prompt: keep Div-idy's existing blue/mint workspace chrome. */
body#devbody .prompt-input-surface {
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 20px;
  background: rgba(255,255,255,.64);
  box-shadow: 0 2px 12px rgba(45,79,106,.04);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
body#devbody .prompt-input-surface[hidden] { display: none !important; }
body#devbody .prompt-input-surface:focus-within {
  border-color: rgba(79,118,246,.5);
  box-shadow: 0 0 0 3px rgba(79,118,246,.09);
  background: rgba(255,255,255,.76);
}
body#devbody .prompt-input-surface #changeai,
body#devbody .prompt-input-surface #changeai.active,
body#devbody .prompt-input-surface #changeai:focus {
  display: block;
  width: 100%;
  min-height: 72px;
  height: 88px;
  max-height: 220px;
  margin: 0;
  padding: 15px 16px 10px;
  border: 0;
  border-radius: 20px 20px 0 0;
  background: transparent;
  color: #22364a;
  box-shadow: none;
  outline: 0;
  font-size: 16px;
  line-height: 1.45;
}
body#devbody .prompt-input-surface.has-attachments #changeai { min-height: 64px; }
body#devbody .prompt-input-surface .prompt-attachment-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 3px 10px 9px;
}
body#devbody .prompt-input-surface #add-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 44px;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: #395b70;
  font: 600 12px/1.2 "Josefin Sans",sans-serif;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
}
body#devbody .prompt-input-surface #add-image .material-symbols-outlined { color: inherit; font-size: 21px; }
body#devbody .prompt-input-surface #add-image:hover:not(:disabled) { transform: none; background: rgba(74,126,174,.08); border-color: rgba(74,126,174,.1); }
body#devbody .prompt-input-surface #add-image:disabled { opacity: .5; cursor: not-allowed; }
body#devbody .prompt-input-surface button:focus-visible,
body#devbody .prompt-input-surface summary:focus-visible,
body#devbody .prompt-input-surface .image-name-input:focus-visible { outline: 2px solid #4f76f6; outline-offset: 2px; }
body#devbody .prompt-input-surface .prompt-attachment-count {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: 6px;
  color: #267157;
  background: #e4f2e9;
  font-size: 10px;
}
body#devbody .prompt-input-surface .prompt-attachment-count[hidden] { display: none; }
body#devbody .prompt-input-surface .prompt-attachment-help { color: #6a7f8c; font-size: 10px; line-height: 1.4; padding-right: 5px; }
body#devbody .prompt-input-surface #image-input-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-height: 180px;
  padding: 12px 12px 3px;
  margin: 0;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #b3c6d4 transparent;
}
body#devbody .prompt-input-surface #image-input-wrapper:empty { display: none; }
body#devbody .prompt-input-surface .image-input-row {
  position: relative;
  display: grid;
  flex: 0 0 190px;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  width: 190px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid #dce6ec;
  border-radius: 13px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 2px 5px rgba(42,65,89,.04);
  animation: promptAttachmentIn .2s ease-out;
}
body#devbody .prompt-input-surface .image-preview-button,
body#devbody .prompt-input-surface .image-preview-button.has-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  color: #546f83;
  background: linear-gradient(130deg,#e9f0f8,#e9f4ee);
  font-size: 12px;
}
body#devbody .prompt-input-surface .image-preview-button img { display: block; width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
body#devbody .prompt-input-surface .image-input-row[data-upload-state="uploading"] .image-preview-button img { opacity: .5; }
body#devbody .prompt-input-surface .image-input-row[data-upload-state="uploading"] .image-preview-button::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(43,84,126,.2);
  border-top-color: #346f9e;
  border-radius: 50%;
  animation: promptAttachmentSpin .9s linear infinite;
}
body#devbody .prompt-input-surface .image-input-row[data-upload-state="error"] { border-color: #d7a1ab; }
body#devbody .prompt-input-surface .image-reference-copy { display: grid; gap: 2px; min-width: 0; padding: 1px 20px 0 0; }
body#devbody .prompt-input-surface .image-file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #2e4b61; font-size: 11px; font-weight: 600; line-height: 1.4; }
body#devbody .prompt-input-surface .image-reference-status { min-height: 14px; color: #6c7e8c; font-size: 10px; font-weight: 400; line-height: 1.4; }
body#devbody .prompt-input-surface .image-reference-status.is-ready { color: #2a7756; }
body#devbody .prompt-input-surface .image-reference-status.is-error { color: #a72e42; }
body#devbody .prompt-input-surface .image-reference-note { width: 100%; min-width: 0; }
body#devbody .prompt-input-surface .image-reference-note summary { display: flex; align-items: center; min-height: 36px; padding: 2px 0; color: #55788e; font-size: 10px; font-weight: 500; cursor: pointer; list-style: none; }
body#devbody .prompt-input-surface .image-reference-note summary::-webkit-details-marker { display: none; }
body#devbody .prompt-input-surface .image-name-input {
  display: block;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  margin: 0 0 7px;
  padding: 8px;
  border: 1px solid #c9dce9;
  border-radius: 8px;
  background: #f5f9fc;
  color: #263f55;
  font-size: 12px;
  opacity: 1;
  transform: none;
}
body#devbody .prompt-input-surface .remove-image-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 12px 0 12px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
body#devbody .prompt-input-surface .remove-image-btn .material-symbols-outlined {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  color: #344c60;
  background: rgba(255,255,255,.94);
  box-shadow: 0 1px 5px #2337471a;
  font-size: 16px;
}
body#devbody .prompt-input-surface .remove-image-btn:hover .material-symbols-outlined { color: #a72e42; background: #fff0f3; }
body#devbody .prompt-input-surface .prompt-attachment-message { margin: 0; padding: 0 16px 10px; color: #507369; font-size: 11px; line-height: 1.45; }
body#devbody .prompt-input-surface .prompt-attachment-message.is-error { color: #a72e42; }
body#devbody .prompt-input-surface .prompt-attachment-message[hidden] { display: none; }
body#devbody .prompt-input-surface .prompt-drop-overlay {
  position: absolute;
  inset: 5px;
  z-index: 5;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 2px dashed #5b98b3;
  border-radius: 15px;
  color: #25536a;
  background: rgba(237,248,251,.96);
  pointer-events: none;
  text-align: center;
}
body#devbody .prompt-input-surface.is-dragover .prompt-drop-overlay { display: flex; }
body#devbody .prompt-input-surface .prompt-drop-overlay strong { font-size: 16px; }
body#devbody .prompt-input-surface .prompt-drop-overlay span { color: #547788; font-size: 11px; }
@keyframes promptAttachmentIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes promptAttachmentSpin { to { transform: rotate(360deg); } }
@media (max-width: 520px) {
  body#devbody .prompt-input-surface { border-radius: 17px; }
  body#devbody .prompt-input-surface #changeai { padding: 13px 13px 7px; font-size: 16px; }
  body#devbody .prompt-input-surface .prompt-attachment-toolbar { padding: 2px 7px 7px; gap: 4px; }
  body#devbody .prompt-input-surface .prompt-attachment-help { font-size: 9px; max-width: 120px; text-align: right; }
  body#devbody .prompt-input-surface #image-input-wrapper { padding: 10px 10px 2px; gap: 8px; }
  body#devbody .prompt-input-surface .image-input-row { flex-basis: 180px; width: 180px; }
  body#devbody .prompt-input-surface .image-reference-note summary { min-height: 44px; }
  body#devbody .prompt-input-surface .image-name-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body#devbody .prompt-input-surface,
  body#devbody .prompt-input-surface .image-input-row { animation: none; transition: none; }
  body#devbody .prompt-input-surface .image-preview-button::after { animation: none !important; }
}
