.emalm-album-picker {
  background: var(--emalm-ui-surface-1);
  border: 1px solid var(--emalm-ui-border);
  border-radius: 8px;
  color: var(--emalm-ui-surface-text);
  margin-top: 14px;
  padding: 14px;
}

.emalm-album-picker-row {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.emalm-album-picker-copy {
  min-width: 0;
}

.emalm-album-picker-summary {
  font-weight: 700;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.emalm-album-picker-visibility {
  color: var(--emalm-ui-readable-muted);
  font-size: 13px;
  margin-top: 4px;
}

.emalm-album-picker .emalm-upload-help {
  color: var(--emalm-ui-readable-muted);
}

.emalm-album-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emalm-album-picker-reset,
.emalm-album-modal-close {
  /* These secondary buttons override the global generic button paint. */
  background: var(--emalm-ui-surface-2) !important;
  border-color: var(--emalm-ui-border-strong) !important;
  color: var(--emalm-ui-surface-text) !important;
}

.emalm-album-picker-reset:hover,
.emalm-album-picker-reset:focus,
.emalm-album-modal-close:hover,
.emalm-album-modal-close:focus {
  background: var(--emalm-ui-control-hover-bg) !important;
  border-color: var(--emalm-ui-accent) !important;
}

.emalm-album-modal[hidden] {
  display: none;
}

.emalm-album-modal {
  inset: 0;
  position: fixed;
  z-index: 1200;
}

.emalm-album-modal-backdrop {
  background: var(--emalm-ui-overlay);
  inset: 0;
  position: absolute;
}

.emalm-album-modal-dialog {
  background: var(--emalm-ui-surface-1);
  border-radius: 10px;
  box-shadow: var(--emalm-ui-shadow-strong);
  color: var(--emalm-ui-surface-text);
  left: 50%;
  max-height: min(86vh, 820px);
  overflow-y: auto;
  padding: 18px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 780px);
}

.emalm-album-modal-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.emalm-album-modal-head p {
  color: var(--emalm-ui-readable-muted);
  margin: 4px 0 0;
}

.emalm-album-modal-close {
  min-width: 42px;
}

.emalm-album-modal-section + .emalm-album-modal-section {
  border-top: 1px solid var(--emalm-ui-border);
  margin-top: 16px;
  padding-top: 16px;
}

.emalm-album-modal-section-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}

.emalm-album-modal-list {
  display: grid;
  gap: 8px;
}

.emalm-album-choice {
  background: var(--emalm-ui-surface-2) !important;
  border: 1px solid var(--emalm-ui-border) !important;
  border-radius: 8px;
  color: var(--emalm-ui-surface-text) !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}

.emalm-album-choice:hover,
.emalm-album-choice:focus {
  background: var(--emalm-ui-control-hover-bg) !important;
  border-color: var(--emalm-ui-accent) !important;
}

.emalm-album-choice-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.emalm-album-choice-meta {
  color: var(--emalm-ui-readable-muted);
  font-size: 12px;
}

.emalm-album-field {
  display: block;
  margin-bottom: 12px;
}

.emalm-album-field > span {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}

.emalm-album-field input[type="text"],
.emalm-album-field select {
  background: var(--emalm-ui-surface-1);
  border: 1px solid var(--emalm-ui-border-strong);
  border-radius: 6px;
  color: var(--emalm-ui-surface-text);
  max-width: 100%;
  padding: 8px 10px;
  width: 100%;
}

.emalm-album-field input::placeholder {
  color: var(--emalm-ui-readable-muted);
}

.emalm-album-field small {
  color: var(--emalm-ui-readable-muted);
  display: block;
  margin-top: 6px;
}

.emalm-album-radio {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  margin-right: 14px;
}

.emalm-album-radio input {
  accent-color: var(--emalm-ui-accent);
}

.emalm-album-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}

@media only screen and (max-width: 768px) {
  .emalm-album-picker-row {
    flex-direction: column;
  }

  .emalm-album-modal-dialog {
    padding: 14px;
    width: min(96vw, 780px);
  }
}
