.rpofds-demo {
    --rpofds-blue: #114ddd;
    --rpofds-ink: #172033;
    --rpofds-muted: #5f6675;
    --rpofds-line: #dfe5f0;
    --rpofds-soft: #f6f8fb;
    --rpofds-white: #ffffff;
    --rpofds-teal: #0f766e;
    --rpofds-amber: #b7791f;
    color: var(--rpofds-ink);
    background: var(--rpofds-white);
    font-family: inherit;
    letter-spacing: 0;
}

.rpofds-demo,
.rpofds-demo * {
    box-sizing: border-box;
}

.rpofds-demo-header {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 22px;
    padding: 14px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--rpofds-line);
}

.rpofds-demo-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    color: var(--rpofds-ink);
    text-decoration: none;
    font-weight: 800;
}

.rpofds-demo-logo:hover,
.rpofds-demo-logo:focus {
    color: var(--rpofds-blue);
}

.rpofds-demo-logo-mark {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--rpofds-blue);
    color: var(--rpofds-white);
    font-size: 1rem;
    line-height: 1;
}

.rpofds-demo-logo-text {
    font-size: 1.02rem;
    line-height: 1.2;
}

.rpofds-demo-nav {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.rpofds-mobile-menu {
    display: none;
    min-height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--rpofds-soft);
    color: var(--rpofds-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}

.rpofds-demo-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rpofds-demo-dropdown {
    position: relative;
}

.rpofds-demo-nav-button,
.rpofds-demo-nav-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rpofds-ink);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.rpofds-demo-nav-button:hover,
.rpofds-demo-nav-button:focus,
.rpofds-demo-nav-link:hover,
.rpofds-demo-nav-link:focus {
    background: var(--rpofds-soft);
    color: var(--rpofds-blue);
}

.rpofds-demo-submenu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 30;
    min-width: 238px;
    padding: 8px;
    display: none;
    background: var(--rpofds-white);
    border: 1px solid var(--rpofds-line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(23, 32, 51, 0.14);
}

.rpofds-demo-dropdown.is-open .rpofds-demo-submenu,
.rpofds-demo-dropdown:focus-within .rpofds-demo-submenu {
    display: grid;
    gap: 2px;
}

.rpofds-demo-submenu a {
    display: block;
    padding: 10px 11px;
    border-radius: 6px;
    color: var(--rpofds-ink);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.25;
}

.rpofds-demo-submenu a:hover,
.rpofds-demo-submenu a:focus,
.rpofds-demo-submenu a[aria-current="page"] {
    background: #eef4ff;
    color: var(--rpofds-blue);
}

.rpofds-menu-backdrop {
    display: none;
}

.rpofds-demo-workspace,
.rpofds-preview {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.rpofds-demo-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
    gap: 18px;
    align-items: start;
}

.rpofds-builder-panel,
.rpofds-shortcode-panel {
    padding: 20px;
    border: 0 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none !important;
}

.rpofds-preview {
    border: 1px solid var(--rpofds-line);
    border-radius: 8px;
    background: var(--rpofds-white);
}

.rpofds-section-heading {
    margin-bottom: 16px;
}

.rpofds-section-heading p,
.rpofds-preview-bar p {
    margin: 0 0 4px;
    color: var(--rpofds-teal);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.rpofds-section-heading h1,
.rpofds-section-heading h2,
.rpofds-preview-bar h2 {
    margin: 0;
    color: var(--rpofds-ink);
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 800;
}

.rpofds-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.rpofds-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.rpofds-field span {
    color: var(--rpofds-ink);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.25;
}

.rpofds-field input,
.rpofds-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cfd8e8;
    border-radius: 8px;
    background: var(--rpofds-white);
    color: var(--rpofds-ink);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.35;
}

.rpofds-field input:focus,
.rpofds-field select:focus {
    outline: 2px solid rgba(17, 77, 221, 0.24);
    outline-offset: 1px;
    border-color: var(--rpofds-blue);
}

.rpofds-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
}

.rpofds-button,
.rpofds-preview-link {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 15px;
    border: 0 !important;
    border-radius: 8px;
    font: inherit;
    font-size: 0.94rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none !important;
}

.rpofds-button-primary {
    background: var(--rpofds-blue);
    color: var(--rpofds-white);
}

.rpofds-button-primary:hover,
.rpofds-button-primary:focus {
    background: #0f3fb7;
    color: var(--rpofds-white);
}

.rpofds-button-secondary,
.rpofds-preview-link {
    background: var(--rpofds-soft);
    color: var(--rpofds-ink);
}

.rpofds-button-secondary:hover,
.rpofds-button-secondary:focus,
.rpofds-preview-link:hover,
.rpofds-preview-link:focus {
    background: #eef4ff;
    color: var(--rpofds-blue);
}

.rpofds-shortcode-help {
    margin: 0 0 10px;
    color: var(--rpofds-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.rpofds-shortcode-box {
    width: 100%;
    min-height: 104px;
    margin: 0;
    padding: 13px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--rpofds-line);
    border-radius: 8px;
    background: #111827;
    color: #f8fafc;
    font-size: 0.9rem;
    line-height: 1.5;
}

.rpofds-preview {
    margin-top: 18px;
    overflow: hidden;
}

.rpofds-preview-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--rpofds-line);
    background: var(--rpofds-soft);
}

.rpofds-preview-frame {
    padding: 18px;
    background: var(--rpofds-white);
}

.rpofds-preview-frame .ao-wrap,
.rpofds-preview-frame .aofb-wrap,
.rpofds-preview-frame .aosb-wrap,
.rpofds-preview-frame .aogb-wrap,
.rpofds-preview-frame .aotb-wrap,
.rpofds-preview-frame .aoab-wrap {
    max-width: 100%;
}

.rpofds-empty-preview {
    padding: 18px;
    border: 1px solid var(--rpofds-line);
    border-radius: 8px;
    background: #fff8e8;
    color: var(--rpofds-amber);
    font-weight: 700;
}

@media (max-width: 1024px) {
    .rpofds-demo-header {
        align-items: center;
        padding: 12px 0;
    }

    .rpofds-mobile-menu {
        display: inline-flex;
        align-items: center;
    }

    .rpofds-demo-menu {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1001;
        width: min(380px, 88vw);
        height: 100vh;
        max-height: 100vh;
        padding: 24px 18px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 10px;
        background: var(--rpofds-white);
        border: 0;
        border-left: 1px solid var(--rpofds-line);
        border-radius: 0;
        box-shadow: none;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 180ms ease;
    }

    .rpofds-demo-menu.is-open {
        transform: translateX(0);
    }

    .rpofds-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(17, 24, 39, 0.36);
        opacity: 0;
        pointer-events: none;
        transition: opacity 180ms ease;
    }

    .rpofds-menu-backdrop.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .rpofds-demo-nav-button,
    .rpofds-demo-nav-link {
        width: 100%;
        justify-content: flex-start;
    }

    .rpofds-demo-submenu {
        position: static;
        min-width: 0;
        margin: 4px 0 6px;
        padding: 6px;
        display: none;
        border: 0;
        border-radius: 8px;
        background: var(--rpofds-soft);
        box-shadow: none;
    }

    .rpofds-demo-dropdown.is-open .rpofds-demo-submenu {
        display: grid;
        gap: 2px;
    }

    .rpofds-demo-workspace {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 760px) {
    .rpofds-demo-header,
    .rpofds-demo-workspace,
    .rpofds-preview {
        width: calc(100% - 24px);
    }

    .rpofds-form-grid {
        grid-template-columns: 1fr;
    }

    .rpofds-builder-panel,
    .rpofds-shortcode-panel {
        padding: 16px;
    }

    .rpofds-preview-bar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .rpofds-preview-frame {
        padding: 12px;
    }

    .rpofds-actions,
    .rpofds-button,
    .rpofds-preview-link {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .rpofds-demo-menu {
        width: 92vw;
        padding: 20px 14px;
    }

    .rpofds-demo-logo-text {
        font-size: 0.95rem;
    }
}
