.imggen-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.imggen-guarded {
  position: relative;
  z-index: 1;
  transition: filter 0.2s ease;
}

.imggen-locked .imggen-guarded {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.imggen-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  backdrop-filter: blur(2px);
  background: rgba(8, 8, 8, 0.45);
  z-index: 2;
}

.imggen-lock-overlay[hidden] {
  display: none !important;
}

.imggen-lock-card {
  max-width: 460px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  background: rgba(8, 8, 8, 0.9);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.imggen-lock-card h2 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.imggen-lock-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.imggen-lock-btn {
  width: 100%;
}

.imggen-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.35);
}

.imggen-key {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.imggen-key-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.imggen-key-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.imggen-key-status {
  color: #38bdf8;
  font-weight: 600;
}

.imggen-key-warning {
  color: #fca5a5;
  font-size: 0.9rem;
}

.imggen-label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.imggen-input,
.imggen-textarea,
.imggen-select {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.imggen-input:focus,
.imggen-textarea:focus,
.imggen-select:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.imggen-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.imggen-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
}

.imggen-field--compact {
  flex: 1;
  min-width: 160px;
}

.imggen-btn {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.95), rgba(125, 211, 252, 0.95));
  color: #081018;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.imggen-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.25);
}

.imggen-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.imggen-btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.imggen-btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.imggen-status {
  min-height: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.imggen-status[data-type="error"] {
  color: #fca5a5;
}

.imggen-section-title {
  font-size: 1.2rem;
  margin: 1.5rem 0 0.75rem;
}

.imggen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.imggen-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.4);
}

.imggen-card img {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.imggen-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.imggen-card__prompt {
  font-size: 0.95rem;
  color: var(--text);
}

.imggen-card__info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.imggen-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.imggen-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.imggen-empty {
  padding: 1rem;
  color: var(--text-muted);
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  margin-top: 0.5rem;
}

.imggen-modal {
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.imggen-modal[hidden] {
  display: none !important;
}

.imggen-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 10, 18, 0.6);
  backdrop-filter: blur(8px);
}

.imggen-modal__panel {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(10, 16, 26, 0.95);
  padding: 1.5rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.imggen-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.imggen-inline__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.imggen-modal__content {
  position: relative;
}

@media (max-width: 768px) {
  .imggen-row {
    flex-direction: column;
    align-items: stretch;
  }
}
