div.modal-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 100;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

div.modal-container.show {
  display: flex;
  pointer-events: all;
}

article.modal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  background-color: var(--cr-bg-primary);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  border-radius: var(--br-radius-small);
  border: 1px solid var(--cr-border-primary);
  max-width: 90%;
  max-height: 90%;
  overflow-y: auto;
}

@media (width >= 1200px) {
  article.modal {
    max-width: 50%;
    max-height: 75%;
  }
}

@media (width < 600px) {
  article.modal {
    padding: 1rem;
  }
}

article.modal button {
  background-color: transparent;
  padding: 0.25rem 0.5rem;
  align-self: flex-end;
}

article.modal button:hover {
  background-color: var(--cr-warning);
  border-color: var(--cr-warning);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-content h3 {
  margin-bottom: 1rem;
}

.modal-content h4 {
  margin-bottom: 0.5rem;
}

.modal-content p + h3, .modal-content p + h4 {
  margin-top: 1rem;
}

.modal-content p {
  margin-bottom: 1rem;
}

.modal-content p:first-of-type {
  margin-top: 0;
}

.modal-content p:last-of-type {
  margin-bottom: 0;
}

#files-modal-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style-type: none;
  min-width: 400px;
}

#files-modal-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  color: var(--cr-text-primary);
  background-color: var(--cr-bg-primary);
  border: 1px solid var(--cr-border-primary);
  border-radius: var(--br-radius-small);
  transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

#files-modal-list a:hover {
  background-color: var(--cr-bg-secondary);
}

#files-modal-list p.error,
#files-modal-list li.error {
  color: var(--cr-warning);
}
