body.embed-modal-open {
    overflow: hidden;
}

.embed-modal[hidden] {
    display: none;
}

.embed-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.72);
}

.embed-modal-window {
    position: relative;

    width: min(960px, 96vw);
    max-height: 94vh;

    overflow: auto;

    padding: 20px;

    background: #202020;
    border: 1px solid #555;
}

.embed-modal-window h2 {
    margin: 0 0 18px;

    text-align: center;
    color: #ff8800;
}

.embed-modal-close {
    position: absolute;
    top: 8px;
    right: 10px;

    font-size: 24px;
}

.embed-builder-layout {
    display: grid;

    grid-template-columns: 320px minmax(0, 1fr);

    gap: 12px;
}

.embed-theme-column,
.embed-preview-column {
    border: 1px solid #555;
}

.embed-theme-column select {
    width: 100%;
    margin: 8px 0 12px;
}

.embed-theme-column > button {
    width: 100%;
    margin-bottom: 18px;
}

.embed-color-row {
    display: grid;

    grid-template-columns: minmax(95px, 1fr) 40px 82px;

    align-items: center;

    gap: 8px;

    margin-bottom: 8px;

    min-width: 0;
}

.embed-color-row input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 0;
}

.embed-color-row input.is-invalid {
    outline: 2px solid #ff5555;
}

.embed-preview-column {
    display: grid;

    grid-template-rows: auto 1fr auto;

    min-height: 470px;
}

.embed-size-selector {
    display: flex;
    justify-content: center;

    gap: 8px;

    padding: 10px;

    border-bottom: 1px solid #555;
}

.embed-size-selector button.is-selected {
    outline: 2px solid #ff8800;
}

.embed-preview-area {
    display: flex;

    align-items: center;
    justify-content: center;

    min-height: 380px;

    padding: 16px;

    overflow: auto;
}

.embed-preview-area iframe {
    flex: 0 0 auto;

    border: 0;
}

#embedPreview {
    pointer-events: none;
}

.embed-generate-area {
    padding: 10px;

    text-align: center;

    border-top: 1px solid #555;
}

#embedCodePanel {
    max-width: 760px;
    margin: 20px auto 0;
}

#embedGeneratedCode {
    display: block;

    width: 100%;
    height: 150px;

    resize: none;
}

.embed-code-actions {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 10px;
}

#embedCopyStatus {
    min-height: 24px;

    margin-top: 8px;

    text-align: right;
}

.embed-theme-column {
    min-width: 0;
    padding: 14px;
}

.embed-custom-colors {
    width: 100%;
    min-width: 0;
    max-width: 100%;

    box-sizing: border-box;

    margin: 0;
    padding: 10px;
}

.embed-color-row label {
    min-width: 0;
    white-space: nowrap;
}

.embed-color-row input[type="text"] {
    width: 76px;
    min-width: 0;
    box-sizing: border-box;
}

.embed-builder-layout,
.embed-preview-column {
    min-width: 0;
}

.embed-theme-column,
.embed-custom-colors,
.embed-custom-colors legend,
.embed-color-row label {
    color: #fff;
}

#embedPreview {
    pointer-events: none;
}

@media (max-width: 760px) {
    .embed-builder-layout {
        grid-template-columns: 1fr;
    }
}