.image-tool {
  margin-top: 18px;
}
.image-tool > .card-title > small {
  color: #7d8790;
  font-size: 10px;
}
.image-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 470px;
}
.image-form {
  padding: 4px 20px 20px;
  border-right: 1px solid var(--line);
}
.image-field {
  padding-inline: 0;
}
.image-field textarea {
  width: 100%;
  height: 128px;
  resize: vertical;
  border: 1px solid #d9dfe3;
  border-radius: 7px;
  padding: 12px;
  font: 13px/1.6 inherit;
  outline: none;
}
.image-field textarea:focus {
  border-color: #5ca98d;
}
.model-field select {
  width: 100%;
  height: 40px;
  border: 1px solid #d9dfe3;
  border-radius: 7px;
  background: #fff;
  padding: 0 10px;
  color: #37424d;
}
.reference-upload {
  min-height: 72px;
  border: 1px dashed #bdc9cd;
  border-radius: 7px;
  background: #fafcfc;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--green);
  cursor: pointer;
}
.reference-upload span {
  max-width: 90%;
  overflow: hidden;
  color: #89939a;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reference-upload input {
  display: none;
}
.reference-upload.disabled {
  cursor: not-allowed;
  opacity: .58;
}
.reference-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;width:100%}.reference-actions .reference-upload,.reference-actions #mainGalleryButton{box-sizing:border-box;width:100%;height:72px;min-height:72px}.reference-actions #mainGalleryButton{white-space:normal}.batch-import{margin-top:18px}.batch-actions{display:flex!important;gap:8px!important}.batch-actions a{text-decoration:none}.batch-upload input,.gallery-upload input,.draft-reference input{display:none}.batch-toolbar{display:flex;align-items:center;gap:16px;padding:13px 18px;border-bottom:1px solid var(--line);background:#fafbfb}.batch-toolbar span{flex:1;color:#7d8790;font-size:10px}.draft-table-wrap{overflow:auto;max-height:520px}.draft-table{width:100%;border-collapse:collapse;font-size:11px;white-space:nowrap}.draft-table th{position:sticky;top:0;z-index:1;background:#244b40;color:#fff;padding:10px;text-align:left}.draft-table td{padding:9px 10px;border-bottom:1px solid #edf0f2}.draft-table tr.submitted{opacity:.62}.draft-prompt{max-width:340px;overflow:hidden;text-overflow:ellipsis}.draft-reference{display:flex;align-items:center;gap:6px}.draft-reference>span{max-width:145px;overflow:hidden;text-overflow:ellipsis}.draft-reference .secondary,.draft-reference button,.submit-draft{height:28px;padding:0 9px}.submitted-label{color:var(--green)}.import-errors{display:flex;flex-direction:column;gap:4px;padding:0 18px;color:#a33e36;font-size:10px}.import-errors:not(:empty){padding-block:12px;background:#fff0ee}.gallery-modal{display:none;position:fixed;inset:0;z-index:50;background:#101a2499;padding:5vh 5vw}.gallery-modal.show{display:grid;place-items:center}.gallery-dialog{width:min(1050px,95vw);max-height:90vh;display:flex;flex-direction:column}.gallery-tools{display:flex;align-items:center;gap:9px;padding:13px 18px;border-bottom:1px solid var(--line)}.gallery-tools>b{flex:1;color:#65717a}.gallery-tools input{height:37px;border:1px solid #d9dfe3;border-radius:7px;padding:0 10px}.gallery-grid{display:grid;grid-template-columns:repeat(5,minmax(120px,1fr));gap:12px;padding:18px;overflow:auto}.gallery-folder,.gallery-image{border:1px solid var(--line);border-radius:8px;background:#fff;padding:8px;display:flex;flex-direction:column;gap:7px;align-items:center;cursor:pointer}.gallery-folder b{font-size:42px}.gallery-folder span,.gallery-image span{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}.gallery-image img{width:100%;height:120px;object-fit:cover;border-radius:5px}@media(max-width:900px){.gallery-grid{grid-template-columns:repeat(3,minmax(100px,1fr))}.gallery-tools{flex-wrap:wrap}}
.image-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.image-options label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #5f6973;
  font-size: 10px;
  font-weight: bold;
}
.image-options select {
  height: 38px;
  border: 1px solid #d9dfe3;
  border-radius: 6px;
  background: #fff;
  padding: 0 9px;
  color: #37424d;
}
.custom-size {
  display: none;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}
.custom-size.show {
  display: grid;
}
.custom-size label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #5f6973;
  font-size: 10px;
  font-weight: bold;
}
.custom-size input {
  width: 100%;
  height: 38px;
  border: 1px solid #d9dfe3;
  border-radius: 6px;
  padding: 0 9px;
}
.custom-size > b {
  padding-bottom: 11px;
  color: #8b949c;
}
.image-generate {
  width: 100%;
  margin-top: 18px;
}
.image-note {
  margin: 12px 0 0;
  color: #8b949c;
  font-size: 9px;
  line-height: 1.6;
}
.image-result {
  position: relative;
  min-height: 470px;
  padding: 24px;
  background: #edf0f1;
  display: grid;
  place-items: center;
}
.image-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #89939b;
}
.image-empty b {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: #dce9e4;
  color: var(--green);
  display: grid;
  place-items: center;
}
.image-result img {
  display: none;
  max-width: 100%;
  max-height: 390px;
  border-radius: 6px;
  object-fit: contain;
  box-shadow: 0 8px 28px #18202a22;
}
.image-result > button {
  display: none;
  position: absolute;
  right: 20px;
  bottom: 18px;
}
.image-result.has-image .image-empty {
  display: none;
}
.image-result.has-image img,
.image-result.has-image > button {
  display: block;
}
.result-actions {
  display: none;
  position: absolute;
  right: 20px;
  bottom: 18px;
  left: 20px;
  align-items: center;
  justify-content: space-between;
}
.result-actions span {
  border-radius: 5px;
  background: #ffffffdd;
  padding: 7px 10px;
  color: #65717a;
  font-size: 10px;
}
.image-result.has-image .result-actions {
  display: flex;
}
.task-history {
  margin-top: 18px;
}
.task-summary {
  display: flex;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  color: #7d8790;
  font-size: 10px;
}
.task-summary b {
  color: var(--green);
}
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}
.task-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.task-image {
  height: 190px;
  background: #edf0f1;
  display: grid;
  place-items: center;
}
.task-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.task-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #829089;
  font-size: 11px;
}
.task-placeholder i {
  width: 27px;
  height: 27px;
  border: 3px solid #cad6d1;
  border-top-color: var(--green);
  border-radius: 50%;
}
.task-card.running .task-placeholder i {
  animation: task-spin .9s linear infinite;
}
.task-card.failed .task-placeholder i {
  border-color: #d78b84;
}
.task-body {
  padding: 12px;
}
.task-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}
.task-status b {
  color: var(--green);
}
.task-status span,.task-body small {
  color: #8b949c;
}
.task-body p {
  min-height: 38px;
  margin: 10px 0 7px;
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.task-error {
  max-height: 72px;
  overflow: auto;
  margin-top: 9px;
  border-radius: 5px;
  background: #fff0ee;
  padding: 7px;
  color: #a33e36;
  font-size: 9px;
}
.task-download {
  text-decoration: none;
}
.task-result-actions { display:flex; gap:7px; margin-top:11px; }
.task-result-actions > * { flex:1; }
.task-empty {
  grid-column: 1 / -1;
  padding: 42px;
  text-align: center;
  color: #8b949c;
}
@keyframes task-spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .image-layout {
    grid-template-columns: 1fr;
  }
  .image-form {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .task-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 650px) {
  .task-grid {
    grid-template-columns: 1fr;
  }
}
.prompt-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.prompt-heading>div{display:flex;gap:7px}.prompt-heading button{height:30px;padding:0 10px}.ai-optimize{color:#176b52!important;border-color:#7eb6a4!important}.reference-guide{display:grid;grid-template-columns:1fr 1fr;gap:10px}.reference-card{min-width:0;border:1px solid #dfe6e2;border-radius:8px;padding:10px;background:#fafcfb;display:flex;flex-direction:column;gap:8px}.reference-card-head{display:flex;flex-direction:column;gap:3px}.reference-card-head b{font-size:11px;color:#36443e}.reference-card-head small,.reference-card>span{font-size:9px;color:#7b8982}.reference-card>img{width:100%;height:130px;object-fit:cover;object-position:center;border-radius:6px;background:#e8ecea}.reference-card-actions{display:flex;gap:6px}.reference-card-actions>*{flex:1;text-align:center}.reference-card-actions input{display:none}.reference-card-actions .selected{background:#e5f3ed;border-color:#77ad99;color:#176b52}.product-reference .reference-upload{height:130px;min-height:130px}.product-reference #mainGalleryButton{width:100%;height:36px}.reference-card.disabled{opacity:.5;pointer-events:none}@media(max-width:650px){.reference-guide{grid-template-columns:1fr}.prompt-heading{align-items:flex-start;flex-direction:column}.prompt-heading>div{width:100%}.prompt-heading button{flex:1}}
