.op3-element[data-op3-element-type="tcp_modal"] {
    position: fixed;
    display: block;
    visibility: hidden;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    z-index: 1001;
    overflow-y: auto;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;

    &.op3-typography-control-panel--show {
    	visibility: visible;
	    opacity: 1;
	    pointer-events: all;
    }

    &.op3-typography-control-panel--loading {
        .op3-typography-control-panel--close,
        .op3-typography-control-panel--field,
        .op3-typography-control-panel--footer {
            opacity: 0;
            visibility: hidden;
        }

        .op3-typography-control-panel--loading-target::before {
            content: "";
            position: absolute;
            display: block;
            top: 8em;
            left: 50%;
            width: 2.5em;
            height: 2.5em;
            background: url("data:image/svg+xml,%3Csvg version=%221.1%22 xmlns=%22http://www.w3.org/2000/svg%22 xmlns:xlink=%22http://www.w3.org/1999/xlink%22 width=%2240%22 height=%2240%22 viewBox=%220 0 50 50%22%3E%3Cpath fill=%22%23999%22 d=%22M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z%22 transform=%22rotate(50 25 25)%22%3E%3CanimateTransform attributeType=%22xml%22 attributeName=%22transform%22 type=%22rotate%22 from=%220 25 25%22 to=%22360 25 25%22 dur=%220.6s%22 repeatCount=%22indefinite%22%3E%3C/animateTransform%3E%3C/path%3E%3C/svg%3E");
            transform: translateX(-50%);
        }
    }

    &.op3-typography-control-panel--message {
        .op3-typography-control-panel--field {
            opacity: 0;
            visibility: hidden;
        }

        .op3-typography-control-panel--message-target::before {
            content: attr(data-op3-typography-control-panel-message);
            position: absolute;
            display: block;
            top: 3.75em;
            width: calc(100% - 4em);
            color: gray;
        }

        .op3-typography-control-panel--button {
            display: none !important;
        }

        .op3-typography-control-panel--button-back {
            display: block !important;
        }
    }

    &.op3-typography-control-panel--message-error {
        .op3-typography-control-panel--message-target::before {
            color: red;
        }
    }

    .op3-typography-control-panel--wrapper {
        left: 50%;
        position: absolute;
        top: 50px;
        width: 750px;
        max-width: 96%;
        min-width: 2em;
        min-height: 1em;
        margin: 3em 0;
        padding: 2em;
        background: #fff;
        border-radius: 5px;
        z-index: 2;
        transform: translateX(-50%);
    }

    .op3-typography-control-panel--content {
        position: relative;
        max-height: calc(100vh - 54px - 50px - 11em);
        padding: 1px;
        overflow-y: auto;
        transition: 0.4s ease all;
    }

    .op3-typography-control-panel--content-presets {
        font-family: "IBM Plex Sans", sans-serif;
    }

    .op3-typography-control-panel--close {
        padding: 10px;
        position: absolute;
        top: -25px;
        right: -25px;
        cursor: pointer;
    }

    .op3-typography-control-panel--close__text {
        display: none;
    }

	.op3-typography-control-panel--close__icon {
        display: block;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        // background-image: url("../img/icn-close-popoverlay.svg");
        background-image: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iNTEycHgiIGlkPSJMYXllcl8xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1MTIgNTEyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgNTEyIDUxMiIgd2lkdGg9IjUxMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48Zz48cGF0aCBkPSJNMjU2LDMzQzEzMi4zLDMzLDMyLDEzMy4zLDMyLDI1N2MwLDEyMy43LDEwMC4zLDIyNCwyMjQsMjI0YzEyMy43LDAsMjI0LTEwMC4zLDIyNC0yMjRDNDgwLDEzMy4zLDM3OS43LDMzLDI1NiwzM3ogICAgTTM2NC4zLDMzMi41YzEuNSwxLjUsMi4zLDMuNSwyLjMsNS42YzAsMi4xLTAuOCw0LjItMi4zLDUuNmwtMjEuNiwyMS43Yy0xLjYsMS42LTMuNiwyLjMtNS42LDIuM2MtMiwwLTQuMS0wLjgtNS42LTIuM0wyNTYsMjg5LjggICBsLTc1LjQsNzUuN2MtMS41LDEuNi0zLjYsMi4zLTUuNiwyLjNjLTIsMC00LjEtMC44LTUuNi0yLjNsLTIxLjYtMjEuN2MtMS41LTEuNS0yLjMtMy41LTIuMy01LjZjMC0yLjEsMC44LTQuMiwyLjMtNS42bDc1LjctNzYgICBsLTc1LjktNzVjLTMuMS0zLjEtMy4xLTguMiwwLTExLjNsMjEuNi0yMS43YzEuNS0xLjUsMy41LTIuMyw1LjYtMi4zYzIuMSwwLDQuMSwwLjgsNS42LDIuM2w3NS43LDc0LjdsNzUuNy03NC43ICAgYzEuNS0xLjUsMy41LTIuMyw1LjYtMi4zYzIuMSwwLDQuMSwwLjgsNS42LDIuM2wyMS42LDIxLjdjMy4xLDMuMSwzLjEsOC4yLDAsMTEuM2wtNzUuOSw3NUwzNjQuMywzMzIuNXoiLz48L2c+PC9zdmc+");
        background-size: 30px 30px;
        background-color: #fff;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    }

    .op3-typography-control-panel--footer {
        display: flex;
        flex-direction: row;
        justify-content: flex-end;
        padding: 2em 0 0 0;
        font-family: "IBM Plex Sans", sans-serif;

        .op3-typography-control-panel--button {
            display: none;
            margin-left: 1em;
        }
    }

    .op3-typography-control-panel--button {
        position: relative;
        display: block;
        top: auto;
        right: auto;
        width: 124px;
        height: 36px;
        margin: 0;
        padding: 0 2.5em;
        font-size: 13px;
        font-weight: bold;
        font-family: inherit;
        background: #fff;
        color: #5d5d5d;
        border: 1px solid #d6d6d6;
        border-radius: 4px;
        outline: none;
        opacity: 0.8;
        cursor: pointer;
        transform: none;
        transition: all 0.4s ease;

        &:hover {
            opacity: 1;
        }
    }

    .op3-typography-control-panel--button-highlight {
        background: $op-blue;
        color: #fff;
        border-color: currentColor;
    }

    .op3-typography-control-panel--title {
        // Use important to override tcp settings (easier than
        // making stronger selector here).
        margin-bottom: 1em !important;
        line-height: 1.5 !important;
        font-size: 1.5em !important;
        font-weight: normal !important;
        font-family: "IBM Plex Sans", sans-serif !important;
        font-style: normal !important;
        text-transform: none !important;
        text-decoration: none !important;
        letter-spacing: 0 !important;
        color: #666 !important;
    }

    .op3-typography-control-panel--field {
        display: block;
        margin: 1em 0 0 0;
    }

    .op3-typography-control-panel--label {
        display: block;
        margin: 0 0 0.25em 0;
        font-size: 0.8em;
        color: gray;
    }

    .op3-typography-control-panel--input {
        display: block;
        width: 100%;
        height: 2.5em;
        max-width: none;
        margin: 0;
        padding: 0 1em;
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 4px;
        outline: none;
        box-shadow: none;
        background-color: #fff;
        color: #666;

        &:focus {
            border-color: #aaa;
        }

        &:focus-visible {
            outline: none;
        }

        &::placeholder {
            color: #97A3B4;
            opacity: 0.5;
        }
    }

    .op3-typography-control-panel--input-error {
        border-color: red !important;
    }

    .op3-typography-control-panel--input-select {
        min-height: 30px;
        padding-right: 28px;
        line-height: 2;
        background: #fff url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23999%22%2F%3E%3C%2Fsvg%3E) no-repeat right 12px top 55%;
        background-size: 16px 16px;
        vertical-align: middle;
        -webkit-appearance: none;
    }

    .select2-container:focus-visible, .select2-container *:focus-visible {
        outline: none;
    }

    .select2-container .select2-selection--single {
        height: 40px;
        border-color: #ddd;
    }

    .select2-container--focus .select2-selection, .select2-container--open .select2-selection {
        border-color: #aaa;
        //outline: 0 none;
    }

    .select2-container .select2-selection--single .select2-selection__rendered {
        padding: 5px 32px 5px 16px;
        color: #666;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        top: 0;
        right: 0;
        width: 24px;
        height: 100%;
    }

    .select2-search--dropdown {
        padding: 0.25em;
    }

    .select2-dropdown .select2-search {
        display: none;
    }

    .op3-typography-control-panel--widget-select2-search .select2-search {
        display: block;
    }

    .select2-container--default .select2-search--dropdown .select2-search__field {
        height: 2.5em;
        padding: 0 0.75em;
        font-size: 16px;
        border: 1px solid #ddd;
        border-radius: 4px;
        outline: none;
        box-shadow: none;
        background-color: #fff;
        color: #666;

        &:focus {
            border-color: #aaa;
        }
    }

    .select2-results__option {
        padding: 0.375em 0.75em;
        font-size: 16px;
        font-family: "IBM Plex Sans", sans-serif;
        color: #666;
    }

    .select2-results__option--highlighted {
        color: #fff;
    }

    .op3-typography-control-panel--input-error + .select2-container .select2-selection--single {
        border-color: red !important;
    }

    &[data-op3-typography-control-panel-content="elements"] .op3-typography-control-panel--content:not(.op3-typography-control-panel--content-elements),
    &[data-op3-typography-control-panel-content="presets"] .op3-typography-control-panel--content:not(.op3-typography-control-panel--content-presets) {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
    }

    .op3-typography-control-panel--desc {
        display: none;
        margin-top: 0.25em;
        font-style: italic;
        color: gray;
    }
    &[data-op3-typography-control-panel-action="create"] .op3-typography-control-panel--desc-create,
    &[data-op3-typography-control-panel-action="update"] .op3-typography-control-panel--desc-update,
    &[data-op3-typography-control-panel-action="detail"] .op3-typography-control-panel--desc-detail,
    &[data-op3-typography-control-panel-action="delete"] .op3-typography-control-panel--desc-delete {
        display: block;
    }

    .op3-typography-control-panel--field-name {
        display: none;
    }
    &[data-op3-typography-control-panel-action="create"] {
        .op3-typography-control-panel--field-name {
            display: block;
        }
        .op3-typography-control-panel--field-list {
            display: none;
        }
    }

    &[data-op3-typography-control-panel-content="elements"] .op3-typography-control-panel--footer .op3-typography-control-panel--button {
        &.op3-typography-control-panel--click-content-presets,
        &.op3-typography-control-panel--click-close {
            display: block;
        }
    }

    &[data-op3-typography-control-panel-content="presets"] .op3-typography-control-panel--footer .op3-typography-control-panel--button {
        &.op3-typography-control-panel--click-apply,
        &.op3-typography-control-panel--button-cancel {
            display: block;
        }
    }
}

@media (max-width: $breakpoint-tablet) {
    .op3-element[data-op3-element-type="tcp_modal"] {
        .op3-typography-control-panel--wrapper {
            top: 0;
            width: 640px;
        }

        .op3-typography-control-panel--content {
            max-height: 640px;
        }
    }
}

@media (max-width: $breakpoint-mobile) {
    html.op3-typography-control-panel--active {
        overflow: hidden;
    }

    .op3-element[data-op3-element-type="tcp_modal"] {
        .op3-typography-control-panel--wrapper {
            top: 0;
            right: 0;
            left: 0;
            width: auto;
            max-width: none;
            min-height: 100vh;
            margin: 0;
            transform: none;
            border-radius: 0;
        }

        .op3-typography-control-panel--content {
            max-height: none;
        }

        .op3-typography-control-panel--click-close {
            top: 0;
            right: 0;
        }
    }
}

// To satisfy Typography Control Panel we must use stronger
// CSS selector for tcp_modal select2.
#op3-designer-element .op3-element[data-op3-element-type="tcp_modal"] {
    .select2-results__option {
        padding: 0.375em 0.75em;
        font-size: 16px;
        font-family: "IBM Plex Sans", sans-serif;
        color: #666;
    }

    .select2-results__option--highlighted {
        color: #fff;
    }
}
