/* Scoped to plugin components; inherit the surrounding site's typography. */
.ewig-playground-gate,
.ewig-playground-popup {
    box-sizing: border-box;
    --pg-accent: #6544ad;
    --pg-ink: #242033;
    --pg-muted: #625d70;
    --pg-border: #d9d3e4;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--pg-ink);
}
.ewig-playground-gate *,
.ewig-playground-popup * { box-sizing: border-box; }
.ewig-playground-gate {
    width: 100%;
    max-width: 34rem;
    padding: clamp(20px, 4vw, 32px);
    border: 1px solid var(--pg-border);
    border-radius: 16px;
    background: #fff;
}
.ewig-playground-gate [hidden] { display: none !important; }
.ewig-playground-title,
.ewig-playground-dialog-header h2 {
    margin: 0 0 12px;
    font: inherit;
    font-size: 1.45em;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}
.ewig-playground-gate p { margin: 0 0 20px; }
.ewig-playground-intro { color: var(--pg-muted); }
.ewig-playground-gate form { display: grid; gap: 12px; margin: 0; }
.ewig-playground-gate label { font-weight: 600; color: inherit; }
.ewig-playground-gate input[type="email"] {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 14px;
    border: 1px solid var(--pg-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pg-ink);
    font: inherit;
}
.ewig-playground-gate .ewig-playground-button,
.ewig-playground-popup .ewig-playground-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    max-width: 100%;
    padding: 12px 20px;
    border: 1px solid var(--pg-accent);
    border-radius: 8px;
    background: var(--pg-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}
.ewig-playground-gate .ewig-playground-button:hover,
.ewig-playground-popup .ewig-playground-button:hover { background: #50318f; color: #fff; }
.ewig-playground-gate .ewig-playground-link,
.ewig-playground-popup .ewig-playground-close {
    min-height: 48px;
    padding: 10px 4px;
    border: 0;
    background: transparent;
    color: #50318f;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}
.ewig-playground-gate .ewig-playground-link { display: block; margin: 8px 0 0; }
.ewig-playground-gate :focus-visible,
.ewig-playground-popup :focus-visible { outline: 3px solid #2c1762; outline-offset: 3px; }
.ewig-playground-gate [data-ewig-message]:focus { outline: none; }
.ewig-playground-status { margin-top: 12px; min-height: 0; color: var(--pg-muted); }
.ewig-playground-status:empty { margin: 0; }
.ewig-playground-gate.is-loading { opacity: .75; }
.ewig-playground-gate button:disabled { cursor: wait; }
.ewig-playground-gate .ewig-playground-hp {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.ewig-playground-dialog:not([open]) { display: none; }
.ewig-playground-dialog {
    width: min(36rem, calc(100% - 32px));
    max-width: calc(100% - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: clamp(20px, 4vw, 32px);
    border: 1px solid var(--pg-border);
    border-radius: 20px;
    background: #fff;
    color: var(--pg-ink);
    font: inherit;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.ewig-playground-dialog::backdrop { background: rgb(24 17 38 / 45%); }
.ewig-playground-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.ewig-playground-dialog-header h2 { margin: 8px 0 0; }
.ewig-playground-dialog .ewig-playground-gate { max-width: none; padding: 0; border: 0; border-radius: 0; }
.ewig-playground-popup .ewig-playground-close { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 48px; margin: 0; padding: 8px; font-size: 1.75em; line-height: 1; text-decoration: none; }
@media (max-width: 480px) {
    .ewig-playground-gate .ewig-playground-button { width: 100%; }
    .ewig-playground-dialog-header h2 { font-size: 1.25em; }
}

html.ewig-playground-modal-open { overflow: hidden; }

/* Keep the trigger legible in link states and through the modal backdrop. */
.ewig-playground-popup [data-ewig-popup-open]:link,
.ewig-playground-popup [data-ewig-popup-open]:visited {
    background: #6544ad;
    color: #fff;
}
.ewig-playground-popup [data-ewig-popup-open]:hover,
.ewig-playground-popup [data-ewig-popup-open]:focus {
    background: #50318f;
    color: #fff;
}
.ewig-playground-popup [data-ewig-popup-open]:focus,
.ewig-playground-popup [data-ewig-popup-open]:focus-visible {
    outline: 3px solid #2c1762;
    outline-offset: 3px;
}
.ewig-playground-popup [data-ewig-popup-open][aria-expanded="true"] {
    background: #fff;
    color: #242033;
    border-color: #242033;
}
