.panel-img-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.panel-img-wrap img {
  display: block;
  width: 280px;
  min-height: 200px;
  object-fit: cover;
}

.regen-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(255,255,255,0.85);
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.regen-btn:hover { opacity: 1; transform: scale(1.12); }

#regen-modal {
  border: none;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.22);
  max-width: 540px;
  width: calc(100vw - 40px);
}
#regen-modal::backdrop {
  background: rgba(0,0,0,0.45);
}
.regen-modal-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.regen-modal-inner h3 {
  font-size: 1.1rem;
  margin: 0;
}
#regen-prompt {
  width: 100%;
  font-family: monospace;
  font-size: 0.85rem;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  min-height: 100px;
}
.regen-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
#regen-submit {
  background: #222;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 0.9rem;
  cursor: pointer;
}
#regen-submit:disabled { opacity: 0.5; cursor: not-allowed; }
#regen-cancel {
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
}
#regen-cancel:disabled { opacity: 0.5; cursor: not-allowed; }

.regen-spinner {
  display: none;
  width: 22px;
  height: 22px;
  border: 3px solid #ddd;
  border-top-color: #222;
  border-radius: 50%;
  animation: regen-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.regen-spinner.visible { display: block; }

@keyframes regen-spin {
  to { transform: rotate(360deg); }
}

.regen-error {
  display: none;
  color: #c0392b;
  font-size: 0.85rem;
  background: #fdecea;
  border-radius: 6px;
  padding: 8px 12px;
}
.regen-error.visible { display: block; }

@media (max-width: 640px) {
  .panel-img-wrap img { width: 100%; }
}
