.wprm-admin-modal-field-instruction-show-name-container {
    display: flex;
    align-items: center;
    margin-bottom: 15px;

    input {
        margin-right: 10px;
    }
}

.wprm-admin-modal-field-instruction,
.wprm-admin-modal-field-instruction-group {
    margin-bottom: 5px;
    background-color: white;

    .wprm-admin-modal-field-instruction-main-container {
        display: flex;
        flex: auto;
        align-items: center;

        .wprm-admin-modal-field-instruction-handle {
            flex-shrink: 0;
    
            .wprm-admin-icon {
                margin: 0 5px;
                cursor: move;
            }
        }
    }
}

.wprm-admin-modal-field-instruction-group {
    display: flex;
    align-items: center;

    .wprm-admin-modal-field-instruction-group-name-container {
        flex: auto;

        .wprm-admin-modal-field-richtext-singleline {
            font-weight: bold;
        }
    }
}

.wprm-admin-modal-field-instruction {    
    .wprm-admin-modal-field-instruction-text-container {
        flex: auto;

        .wprm-admin-modal-field-richtext,
        .wprm-admin-modal-field-richtext-legacy {
            flex: auto;
        }
        .wprm-admin-modal-field-instruction-text-name-container {
            display: flex;

            .wprm-admin-modal-field-instruction-text-editor-container {
                flex: auto;
                position: relative;
            }

            .wprm-admin-modal-field-instruction-name {
                min-width: 126px;
                flex-basis: 126px;
                max-width: 126px;
                margin-right: 2px;

                p {
                    margin: 1em 0;
                    line-height: 1.5;
                }
            }
        }
        .wprm-admin-modal-field-instruction-video-container {
            display: flex;
            margin-top: 2px;
            align-items: center;

            input:nth-of-type(1),
            input:nth-of-type(2) {
                min-width: 62px;
                max-width: 62px;
                flex-basis: 62px;
                flex-shrink: 0;
                margin-right: 2px;
            }
            input:nth-of-type(3) {
                flex: auto;
            }
            .wprm-admin-icon {
                margin-left: 3px;
            }
        }
    }
    .wprm-admin-modal-field-instruction-after-container {
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
    }

    &.wprm-admin-modal-field-instruction-tip {
        .wprm-admin-modal-field-instruction-tip-input-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--wprm-admin-tip-accent, #2b6cb0);
            position: absolute;
            left: 14px;
            top: 18px;
            z-index: 2;
            pointer-events: none;

            svg,
            img {
                width: 16px;
                height: 16px;
                display: block;
            }
        }

        .wprm-admin-modal-field-richtext.wprm-admin-modal-field-instruction-text {
            border-left: 4px solid var(--wprm-admin-tip-accent, #2b6cb0);
            background: #ffffff;
            color: var(--wprm-admin-tip-text-color, #000000);
        }

        .wprm-admin-modal-field-instruction-text-editor-container-tip-icon {
            .wprm-admin-modal-field-richtext.wprm-admin-modal-field-instruction-text {
                padding-left: 38px;
            }

            .wprm-admin-modal-field-richtext-legacy {
                input,
                textarea {
                    padding-left: 38px;
                }
            }
        }

        .wprm-admin-modal-field-richtext-legacy {
            input,
            textarea {
                border-left: 4px solid var(--wprm-admin-tip-accent, #2b6cb0);
                background: #ffffff;
                color: var(--wprm-admin-tip-text-color, #000000);
            }
        }
    }
}

.wprm-admin-modal-field-instruction-after-container {
    margin-left: 17px;

    .wprm-admin-modal-field-instruction-after-container-icons {
        margin: 5px;
        flex-shrink: 0;

        .wprm-admin-icon {
            margin-right: 5px;
        }
    }
    .wprm-admin-modal-field-instruction-after-container-ingredient,
    .wprm-admin-modal-field-instruction-after-container-summary {
        flex: 1;
        flex-shrink: 0;

        margin-left: 5px;
        margin-right: 5px;
    }
    .wprm-admin-modal-field-instruction-after-container-media {
        margin: 5px;
        flex-shrink: 0;

        .wprm-admin-modal-field-instruction-after-container-media-icons {
            margin-left: -5px;

            .wprm-admin-icon {
                margin-left: 5px;
            }
            .wprm-icon-spacer {
                display: inline-block;
                width: 16px;
            }
        }

        .wprm-admin-modal-field-image-preview,
        .wprm-admin-modal-field-video-preview {
            display: flex;
            flex-direction: column;
            align-items: flex-start;

            img {
                cursor: pointer;
                max-width: 75px;
                height: auto;
                margin-top: 5px;
            }
        }

        textarea {
            margin-top: 5px;
            width: auto;
            font-size: 14px;
        }

        &.wprm-admin-modal-field-instruction-after-container-tip {
            .wprm-admin-modal-field-instruction-after-container-media-icons {
                margin-left: 0;
            }
        }
    }
}

.wprm-admin-modal-field-instruction-inline-ingredients-container {
    margin-left: 26px;

    .wprm-admin-modal-field-instruction-inline-ingredients-info {
        font-style: italic;
    }
    .wprm-admin-modal-field-instruction-inline-ingredients-offset {
        display: none;
    }
    .wprm-admin-modal-field-instruction-inline-ingredient {
        display: block;
        margin: 4px 0;
        text-decoration: none;

        &:hover {
            text-decoration: underline;
        }

        &.wprm-admin-modal-field-instruction-inline-ingredient-split {
            padding-left: 20px;
            color: #646970;
            font-size: 0.95em;
        }
        &.wprm-admin-modal-field-instruction-inline-ingredient-in-other {
            opacity: 0.5;
        }
        &.wprm-admin-modal-field-instruction-inline-ingredient-in-current {
            opacity: 0.5;
            color: darkgreen;
        }
    }
}

.wprm-admin-modal-field-instruction-unused-ingredients {
    margin-left: 26px;
    margin-top: 10px;

    .wprm-admin-modal-field-instruction-unused-ingredients-info {
        font-style: italic;
    }
}

.wprm-admin-modal-field-instruction-actions {
    margin-left: 26px;
    margin-top: 10px;

    .button {
        margin-top: 5px;
        margin-right: 5px;
    }

    p {
        font-style: italic;
    }
}
@media screen and (max-width: 640px) {
    .wprm-admin-modal-field-instruction {    
        .wprm-admin-modal-field-instruction-text-container {
            .wprm-admin-modal-field-instruction-text-name-container {
                display: block;
    
                .wprm-admin-modal-field-instruction-name {
                    max-width: none;
                    margin-right: 0;
                    margin-bottom: 2px;
                }
            }
        }
    }
}

@media screen and (min-width: 782px) {
    .wprm-admin-modal-field-instruction,
    .wprm-admin-modal-field-instruction-group {
        .wprm-admin-modal-field-instruction-main-container {
            flex: 0 0 60%;
        }
        .wprm-admin-modal-field-instruction-after-container {
            flex: auto;
        }
    }

    .wprm-admin-modal-field-instruction {
        display: flex;
        align-items: center;

        .wprm-admin-modal-field-instruction-after-container {
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;

            .wprm-admin-modal-field-instruction-after-container-media {
                text-align: right;

                .wprm-admin-modal-field-image-preview,
                .wprm-admin-modal-field-video-preview {
                    align-items: flex-end;
                    margin-right: 5px;
                }

                textarea {
                    width: 165px;
                }
            }
        }
    }

    .wprm-admin-modal-field-instruction-after-container {
        .wprm-admin-modal-field-instruction-after-container-ingredient,
        .wprm-admin-modal-field-instruction-after-container-summary {
            margin-left: 10px;
            margin-right: 0;
        }
    }

    .wprm-admin-modal-field-instruction-unused-ingredients {
        padding-left: 100px;
        margin-left: 0;
        width: 40%;
        float: right;
    }

    .wprm-admin-modal-field-instruction-container-inline {
        position: relative;

        .wprm-admin-modal-field-instruction-inline-ingredients-offset {
            display: block;
        }

        .wprm-admin-modal-field-instruction-inline-ingredients-container {
            position: absolute;
            top: 0;
            bottom: 0;
            right: 0;
            left: 60%;
            margin-left: 96px;

            overflow: visible;
        }
    }
}
