.oplp-wrap {
    max-width: 980px;
}

.oplp-lede {
    color: #50575e;
    font-size: 14px;
    margin-bottom: 24px;
}

.oplp-form .oplp-step {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.oplp-form h2,
.oplp-frontend-wrap .oplp-form h2 {
    font-size: 16px !important;
    margin: 0 0 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    font-weight: 600 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    letter-spacing: normal !important;
    word-spacing: normal !important;
    text-transform: none !important;
    line-height: 1.4 !important;
}

.oplp-step-num,
.oplp-frontend-wrap .oplp-step-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #2271b1 !important;
    background-color: #2271b1 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    flex: 0 0 24px !important;
}

.oplp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
    align-items: start;
}

.oplp-grid label,
.oplp-tool-block label,
.oplp-license-block textarea {
    width: 100%;
}

.oplp-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 500;
    font-size: 13px;
    color: #1d2327;
}

.oplp-grid label > .oplp-field-label {
    min-height: 1.3em;
}

.oplp-grid label > small {
    margin-top: 2px;
}

.oplp-field-label {
    display: inline-block;
    line-height: 1.3;
}

.oplp-req,
.oplp-frontend-wrap .oplp-req {
    display: inline !important;
    margin-left: 4px;
    color: #d63638;
    -webkit-text-fill-color: #d63638;
    font-weight: 600;
    font-size: 13px;
    vertical-align: baseline;
}

.oplp-grid input,
.oplp-grid select,
.oplp-tool-block input,
.oplp-license-block textarea {
    width: 100%;
    box-sizing: border-box;
}

/*
 * Force readable text on every form control inside the wizard. Frontend
 * themes (and the admin screen's body color) can otherwise inherit a light
 * color that makes the selected <select> value look washed out. !important
 * is required because some themes (e.g. theme.css with body-level rules)
 * bind colors with higher specificity.
 */
.oplp-form input,
.oplp-form select,
.oplp-form textarea,
.oplp-frontend-wrap input,
.oplp-frontend-wrap select,
.oplp-frontend-wrap textarea {
    color: #000 !important;
    background-color: #fff !important;
    -webkit-text-fill-color: #000 !important;
    caret-color: #000 !important;
}

.oplp-form select option,
.oplp-form select optgroup,
.oplp-frontend-wrap select option,
.oplp-frontend-wrap select optgroup {
    color: #000 !important;
    background-color: #fff !important;
}

.oplp-form input::placeholder,
.oplp-form textarea::placeholder,
.oplp-frontend-wrap input::placeholder,
.oplp-frontend-wrap textarea::placeholder {
    color: #646970 !important;
    -webkit-text-fill-color: #646970 !important;
    opacity: 1 !important;
}

/* Explicit checkbox color so accent shows on themes that strip it */
.oplp-form input[type="checkbox"],
.oplp-frontend-wrap input[type="checkbox"] {
    accent-color: #2271b1;
}

.oplp-grid small {
    color: #646970;
    font-weight: 400;
    margin-top: 2px;
}

.oplp-req {
    color: #b32d2e;
    margin-left: 2px;
}

.oplp-products {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.oplp-product {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    background: #f6f7f7;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.oplp-product:has(input:checked) {
    border-color: #2271b1;
    background: #f0f6fc;
}

.oplp-tool-block,
.oplp-license-block {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.oplp-tool-block legend,
.oplp-license-block legend {
    font-weight: 600;
    padding: 0 6px;
}

.oplp-tool-block label {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    font-size: 13px;
}

.oplp-tool-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    align-items: start;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
}

.oplp-tool-row-label {
    padding-top: 6px;
    color: #1d2327;
    font-weight: 500;
}

.oplp-tool-row-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.oplp-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    padding: 4px 6px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
    flex: 1 1 200px;
    min-width: 200px;
}

.oplp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px 2px 10px;
    border-radius: 999px;
    background: #f0f6fc;
    border: 1px solid #c6dcf2;
    font-size: 12px;
    color: #135e96;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.oplp-chip-remove,
.oplp-frontend-wrap .oplp-chip-remove {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #135e96 !important;
    -webkit-text-fill-color: #135e96 !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.oplp-chip-remove:hover,
.oplp-frontend-wrap .oplp-chip-remove:hover {
    background: #c6dcf2 !important;
    background-color: #c6dcf2 !important;
    color: #0a4b78 !important;
    -webkit-text-fill-color: #0a4b78 !important;
}

.oplp-chip-remove:focus,
.oplp-frontend-wrap .oplp-chip-remove:focus {
    outline: 2px solid #2271b1 !important;
    outline-offset: 1px !important;
}

.oplp-chip-empty {
    color: #646970;
    font-style: italic;
    font-size: 12px;
    padding: 4px 6px;
}

.oplp-pick-versions {
    flex: 0 0 auto;
}

.oplp-license-block textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

/* Versions modal */
.oplp-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oplp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.oplp-modal-panel {
    position: relative;
    background: #fff;
    color: #1d2327;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 64px);
    border-radius: 6px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
}

.oplp-modal-header,
.oplp-modal-footer {
    padding: 14px 20px;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    align-items: center;
    gap: 12px;
}

.oplp-modal-footer {
    border-bottom: 0;
    border-top: 1px solid #dcdcde;
    justify-content: flex-end;
}

.oplp-modal-header h3 {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.oplp-modal-close,
.oplp-frontend-wrap .oplp-modal-close {
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 22px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    color: #1d2327 !important;
    -webkit-text-fill-color: #1d2327 !important;
    padding: 4px 8px !important;
    margin: 0 !important;
    border-radius: 4px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
}

.oplp-modal-close:hover,
.oplp-frontend-wrap .oplp-modal-close:hover {
    background: #f0f0f1 !important;
    background-color: #f0f0f1 !important;
}

.oplp-modal-body {
    padding: 14px 20px;
    overflow: auto;
    flex: 1;
}

.oplp-versions-filter {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 13px;
}

.oplp-versions-list {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #fff;
}

.oplp-version-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    color: #1d2327;
}

.oplp-version-row:last-child {
    border-bottom: 0;
}

.oplp-version-row:hover {
    background: #f6f7f7;
}

.oplp-version-row input[type="checkbox"] {
    margin: 0;
}

.oplp-modal-meta {
    margin-right: auto;
    font-size: 12px;
    color: #646970;
}

.oplp-versions-loading,
.oplp-versions-empty {
    margin: 0;
    padding: 16px;
    color: #646970;
    text-align: center;
    font-size: 13px;
}

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

.oplp-status {
    margin-left: 12px;
    font-size: 13px;
}

.oplp-status.is-error {
    color: #b32d2e;
}

.oplp-status.is-busy {
    color: #2271b1;
}

.oplp-status.is-ok {
    color: #008a20;
}

.oplp-tool-block.is-disabled,
.oplp-license-block.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* Frontend shortcode ([posit_onprem]) — themes may lack wp-admin button styles */
.oplp-frontend-wrap {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.oplp-frontend-title {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.5rem;
}

.oplp-login-notice {
    padding: 12px 16px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    background: #f6f7f7;
}

.oplp-frontend-wrap .button.button-primary.button-hero {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
    color: #fff;
    background: #2271b1;
    border: 1px solid #2271b1;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.oplp-frontend-wrap .button.button-primary.button-hero:hover {
    background: #135e96;
    border-color: #135e96;
}

.oplp-frontend-wrap .button.button-primary.button-hero:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
