.codex-help-open {
    overflow: hidden;
}

.codex-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
}

.codex-help-overlay[hidden] {
    display: none !important;
}

.codex-help-dialog {
    width: min(760px, 100%);
    max-height: min(82vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(127, 127, 127, 0.2);
    border-radius: 8px;
    background: #fff;
    color: #252525;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    outline: 0;
}

.codex-dark .codex-help-dialog {
    background: rgb(24, 26, 27);
    color: rgb(218, 215, 210);
}

.codex-dark .codex-help-body p {
    color: rgb(198, 194, 185);
}

.codex-help-header,
.codex-help-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.codex-help-header {
    justify-content: space-between;
    border-bottom: 1px solid rgba(127, 127, 127, 0.25);
}

.codex-help-header h3 {
    margin: 0;
}

.codex-help-close {
    flex: 0 0 auto;
}

.codex-help-header .codex-help-close {
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
}

.codex-help-body {
    overflow-y: auto;
    padding: 20px;
    line-height: 1.55;
}

.codex-help-body h4 {
    margin-top: 1.25rem;
}

.codex-help-body h4:first-child {
    margin-top: 0;
}

.codex-help-body ul {
    padding-left: 1.35rem;
}

.codex-help-footer {
    justify-content: flex-end;
    border-top: 1px solid rgba(127, 127, 127, 0.25);
}

@media (max-width: 767.98px) {
    .codex-help-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .codex-help-dialog {
        width: 100%;
        max-height: 88vh;
        border-radius: 12px 12px 0 0;
    }

    .codex-help-header,
    .codex-help-footer,
    .codex-help-body {
        padding-left: 16px;
        padding-right: 16px;
    }
}
