.emtp-widget .emtp-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    border: 0;
    background: #222;
    color: #fff;
    padding: 12px 18px;
    transition: all 0.2s ease;
}

.emtp-widget .emtp-trigger:hover {
    opacity: 0.92;
}

.emtp-widget .emtp-trigger .emtp-trigger-icon,
.emtp-widget .emtp-trigger .emtp-trigger-icon i,
.emtp-widget .emtp-trigger .emtp-trigger-icon svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.emtp-widget .emtp-template-source {
    display: none !important;
}

.emtp-widget .emtp-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.emtp-widget .emtp-modal__dialog {
    position: relative;
    width: min(900px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.emtp-widget .emtp-modal__content {
    padding: 24px;
}

.emtp-widget .emtp-modal__close {
    position: sticky;
    top: 8px;
    margin-left: auto;
    display: block;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    color: #111;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

body.emtp-modal-open {
    overflow: hidden;
}

.emtp-widget .emtp-editor-note {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed #c3c7cf;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #555;
    background: #f8f9fb;
}

/* Keep source/template output hidden in Elementor editor and preview */
.elementor-editor-active .emtp-widget .emtp-template-source,
.elementor-editor-preview .emtp-widget .emtp-template-source,
.elementor-preview .emtp-widget .emtp-template-source,
body.elementor-page.elementor-editor-active .emtp-widget .emtp-template-source,
body.elementor-page.elementor-editor-preview .emtp-widget .emtp-template-source {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

.elementor-editor-active .emtp-widget .emtp-modal,
.elementor-editor-preview .emtp-widget .emtp-modal,
.elementor-preview .emtp-widget .emtp-modal {
    display: none !important;
}

.emtp-widget .emtp-trigger.emtp-trigger--icon {
    padding: 12px;
}

.emtp-widget .emtp-trigger.emtp-trigger--icon .emtp-trigger-icon {
    background: transparent;
    border-radius: inherit;
}

/* Extra hard-hide inside Elementor editor panel and preview iframe */
html.elementor-html .emtp-widget .emtp-template-source,
body.elementor-editor-active .emtp-widget .emtp-template-source,
body.elementor-editor-preview .emtp-widget .emtp-template-source,
body.elementor-preview .emtp-widget .emtp-template-source,
body.wp-admin .emtp-widget .emtp-template-source {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    max-height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}
