/*
 * SingleBuck Membership profile UI.
 * Turns WooCommerce /my-account/ into a profile-first member hub.
 */

body.woocommerce-account .woocommerce-MyAccount-navigation {
    display: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
}

body.woocommerce-account .entry-title,
body.woocommerce-account h1,
body.woocommerce-account .woocommerce > h2:first-child {
    display: none;
}

.sb-profile-shell {
    --sb-primary: #6d35d5;
    --sb-primary-dark: #4b18af;
    --sb-blue: #1877f2;
    --sb-gold: #f9bd25;
    --sb-ink: #151827;
    --sb-muted: #667085;
    --sb-soft: #f5f7fb;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--sb-ink);
    margin: -20px auto 40px;
    max-width: 1600px;
}

.sb-profile-hero {
    min-height: 320px;
    border-radius: 0 0 24px 24px;
    background-size: cover;
    background-position: center;
    color: #fff;
    display: flex;
    align-items: flex-end;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
    overflow: hidden;
}

.sb-profile-hero-inner {
    width: 100%;
    padding: 44px 46px 34px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 28px;
    align-items: end;
}

.sb-profile-avatar-wrap {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 999px;
    background: #fff;
    padding: 6px;
    box-shadow: 0 16px 38px rgba(0,0,0,.28);
}

.sb-profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.sb-profile-camera {
    position: absolute;
    right: 0;
    bottom: 8px;
    width: 42px;
    height: 42px;
    border: 4px solid #fff;
    border-radius: 999px;
    background: var(--sb-primary);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    box-shadow: 0 10px 24px rgba(0,0,0,.22);
}

.sb-profile-identity {
    padding-bottom: 12px;
    text-shadow: 0 2px 16px rgba(0,0,0,.38);
}

.sb-profile-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sb-profile-name {
    margin: 0;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.05;
    font-weight: 900;
    color: #fff;
}

.sb-membership-badge {
    width: 36px;
    height: 36px;
}

.sb-profile-member-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 8px;
    padding: 8px 13px;
    border-radius: 12px;
    background: rgba(0,0,0,.48);
    backdrop-filter: blur(10px);
    font-size: 15px;
}

.sb-profile-member-chip span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--sb-gold);
}

.sb-profile-joined {
    margin: 0;
    color: rgba(255,255,255,.95);
    font-weight: 650;
}

.sb-profile-stats {
    display: flex;
    gap: 18px;
    padding-bottom: 22px;
}

.sb-profile-stats div {
    min-width: 150px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(0,0,0,.28);
    backdrop-filter: blur(10px);
}

.sb-profile-stats strong {
    display: block;
    font-size: 25px;
    line-height: 1;
    color: #fff;
}

.sb-profile-stats span {
    display: block;
    margin-top: 5px;
    color: rgba(255,255,255,.9);
    font-size: 14px;
}

.sb-profile-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 24px;
    max-width: 1320px;
    margin: 24px auto 0;
    padding: 0 22px;
}

.sb-profile-main-column,
.sb-profile-side-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sb-profile-card-panel {
    background: #fff;
    border: 1px solid #e8ebf2;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 16px 44px rgba(15, 23, 42, .08);
}

.sb-profile-card-panel h3 {
    margin: 0 0 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 21px;
    font-weight: 850;
    color: var(--sb-ink);
}

.sb-profile-card-panel p {
    margin: 0 0 10px;
}

.sb-profile-muted {
    color: var(--sb-muted);
}

.sb-inline-action {
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--sb-primary);
    cursor: pointer;
    font-weight: 750;
}

.sb-profile-membership-panel {
    display: grid;
    grid-template-columns: 1fr minmax(260px, 380px);
    gap: 22px;
    align-items: center;
}

.sb-membership-status-card {
    min-height: 110px;
    border-radius: 14px;
    padding: 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--sb-primary-dark), var(--sb-primary));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sb-membership-status-card strong {
    font-size: 20px;
}

.sb-membership-status-card span {
    padding: 6px 10px;
    border-radius: 999px;
    background: #35b86b;
    font-size: 13px;
    font-weight: 800;
}

.sb-card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.sb-card-title-row p {
    color: var(--sb-muted);
    font-size: 14px;
}

.sb-gear-button {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: var(--sb-soft);
    color: var(--sb-ink);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
}

.sb-gear-button:hover,
.sb-account-row:hover,
.sbm-menu-item:hover {
    background: #f0ebff;
}

.sb-account-row,
.sbm-menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
    color: var(--sb-ink);
    text-decoration: none !important;
}

.sb-account-row span,
.sbm-menu-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f0ebff;
}

.sb-account-row strong,
.sbm-menu-item strong {
    display: block;
    font-size: 15px;
    color: var(--sb-ink);
}

.sb-account-row small,
.sbm-menu-item small {
    display: block;
    color: var(--sb-muted);
    font-size: 12px;
    margin-top: 2px;
}

.sb-account-row em,
.sbm-menu-arrow {
    font-style: normal;
    color: var(--sb-muted);
    font-size: 22px;
}

.sb-account-row-danger strong,
.sbm-menu-item-danger strong {
    color: #d92d20;
}

/* Modal */
.sbm-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
}

.sbm-modal.is-open {
    display: block;
}

.sbm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(4px);
}

.sbm-modal-dialog {
    position: absolute;
    top: 50%;
    right: 32px;
    transform: translateY(-50%);
    width: min(440px, calc(100vw - 36px));
    max-height: calc(100vh - 64px);
    overflow: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
    padding: 24px;
}

.sbm-modal-close {
    position: absolute;
    right: 18px;
    top: 16px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f6f7fb;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    color: var(--sb-muted);
}

.sbm-panel-heading {
    padding-right: 36px;
    margin-bottom: 18px;
}

.sbm-panel-heading h3 {
    margin: 0 0 6px;
    font-size: 23px;
    color: var(--sb-ink);
}

.sbm-panel-heading p {
    margin: 0;
    color: var(--sb-muted);
    font-size: 14px;
}

.sbm-back {
    margin-bottom: 12px;
    border: 0;
    background: transparent;
    color: var(--sb-primary);
    font-weight: 800;
    cursor: pointer;
}

.sbm-menu-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.sbm-record-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sbm-record {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 12px;
    padding: 14px;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    background: #fbfcff;
    color: var(--sb-ink);
    text-decoration: none !important;
}

.sbm-record strong {
    color: var(--sb-ink);
}

.sbm-record span {
    color: var(--sb-muted);
    font-size: 13px;
}

.sbm-record em {
    grid-row: 1 / span 2;
    grid-column: 2;
    align-self: center;
    font-style: normal;
    font-weight: 800;
    color: var(--sb-primary);
}

.sbm-empty {
    padding: 18px;
    border-radius: 14px;
    background: #fbfcff;
    color: var(--sb-muted);
    border: 1px dashed #d9deea;
}

.sbm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 13px;
}

.sbm-form-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 750;
    color: var(--sb-ink);
}

.sbm-form-grid input,
.sbm-form-grid textarea {
    width: 100%;
    border: 1px solid #d9deea;
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: var(--sb-ink);
    font-size: 14px;
}

.sbm-form-wide {
    grid-column: 1 / -1;
}

.sbm-save-button {
    margin-top: 16px;
    width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 13px 18px;
    background: var(--sb-blue);
    color: #fff;
    cursor: pointer;
    font-weight: 900;
}

.sbm-form-message {
    margin-top: 12px;
    color: var(--sb-muted);
    font-weight: 700;
}

.sbm-form-message.is-success {
    color: #16884b;
}

.sbm-form-message.is-error {
    color: #d92d20;
}

.sbm-loading {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--sb-muted);
    font-weight: 800;
}

.sb-no-access-message {
    background: #fff7f7;
    border: 1px solid #ffdede;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    color: #d8000c;
}

@media (max-width: 980px) {
    .sb-profile-hero-inner,
    .sb-profile-body,
    .sb-profile-membership-panel {
        grid-template-columns: 1fr;
    }

    .sb-profile-stats {
        padding-bottom: 0;
    }

    .sb-profile-hero-inner {
        align-items: center;
    }

    .sbm-modal-dialog {
        right: 18px;
    }
}

@media (max-width: 640px) {
    .sb-profile-shell {
        margin-top: 0;
    }

    .sb-profile-hero {
        min-height: 430px;
        border-radius: 0 0 18px 18px;
    }

    .sb-profile-hero-inner {
        padding: 32px 20px 26px;
        text-align: center;
        justify-items: center;
    }

    .sb-profile-name-row {
        justify-content: center;
    }

    .sb-profile-stats {
        width: 100%;
        flex-direction: column;
    }

    .sb-profile-stats div {
        min-width: 0;
        width: 100%;
    }

    .sb-profile-body {
        padding: 0 12px;
    }

    .sb-profile-card-panel {
        padding: 18px;
    }

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

    .sbm-modal-dialog {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-height: 88vh;
        border-radius: 22px 22px 0 0;
    }
}


/* v1.0.3: profile card is now only a gear launcher; menu options live in the modal */
.sb-account-panel-card .sb-account-row {
    display: none !important;
}

.sb-account-panel-card {
    min-height: 120px;
}

.sb-card-title-row {
    margin-bottom: 0;
}

/* v1.0.3: center the account modal */
.sbm-modal-dialog {
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -50%) !important;
    width: min(460px, calc(100vw - 36px));
}

@media (max-width: 640px) {
    .sbm-modal-dialog {
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        width: min(440px, calc(100vw - 24px));
        max-height: 88vh;
        border-radius: 20px;
    }
}


/* v1.0.4: Break Woo My Account out of most theme containers */
body.sbm-profile-fullscreen {
    overflow-x: hidden;
}

body.sbm-profile-fullscreen .site,
body.sbm-profile-fullscreen #page,
body.sbm-profile-fullscreen .site-content,
body.sbm-profile-fullscreen #content,
body.sbm-profile-fullscreen .content-area,
body.sbm-profile-fullscreen #primary,
body.sbm-profile-fullscreen main,
body.sbm-profile-fullscreen .site-main,
body.sbm-profile-fullscreen .entry-content,
body.sbm-profile-fullscreen .woocommerce,
body.sbm-profile-fullscreen .woocommerce-account,
body.sbm-profile-fullscreen .woocommerce-MyAccount-content {
    max-width: none !important;
}

body.sbm-profile-fullscreen .entry-content,
body.sbm-profile-fullscreen .woocommerce,
body.sbm-profile-fullscreen .woocommerce-MyAccount-content {
    width: 100% !important;
}

body.sbm-profile-fullscreen .wp-site-blocks,
body.sbm-profile-fullscreen .is-layout-constrained,
body.sbm-profile-fullscreen .is-layout-flow,
body.sbm-profile-fullscreen .wp-block-group,
body.sbm-profile-fullscreen .wp-block-post-content,
body.sbm-profile-fullscreen .container,
body.sbm-profile-fullscreen .site-container,
body.sbm-profile-fullscreen .content-container,
body.sbm-profile-fullscreen .ast-container,
body.sbm-profile-fullscreen .col-full,
body.sbm-profile-fullscreen .wrap,
body.sbm-profile-fullscreen .page-content,
body.sbm-profile-fullscreen article.page,
body.sbm-profile-fullscreen .hentry {
    max-width: none !important;
}

body.sbm-profile-fullscreen .entry-content > *,
body.sbm-profile-fullscreen .wp-block-post-content > *,
body.sbm-profile-fullscreen .is-layout-constrained > * {
    max-width: none !important;
}

body.sbm-profile-fullscreen .sb-profile-shell {
    width: 100vw !important;
    max-width: none !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    margin-top: -1px !important;
}

body.sbm-profile-fullscreen .sb-profile-hero {
    border-radius: 0 !important;
}

body.sbm-profile-fullscreen .sb-profile-body {
    width: min(1320px, calc(100vw - 44px));
}

/* Optional: tighter top spacing when the theme leaves a giant page gap */
body.sbm-profile-fullscreen .woocommerce {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.sbm-profile-fullscreen .woocommerce-MyAccount-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* v1.0.5: polished modal, hidden scrollbars, better profile editor */
.sbm-modal-dialog {
    width: min(560px, calc(100vw - 36px)) !important;
    max-height: min(92vh, 860px) !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 26px !important;
    background: rgba(255,255,255,.96) !important;
    backdrop-filter: blur(22px);
}

.sbm-modal-content {
    max-height: min(92vh, 860px);
    overflow-y: auto;
    scrollbar-width: none;
    padding: 28px;
}

.sbm-modal-content::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.sbm-modal-close {
    z-index: 4;
    right: 18px !important;
    top: 18px !important;
    background: #f2f4f7 !important;
    color: #111827 !important;
    box-shadow: 0 8px 20px rgba(15,23,42,.08);
}

.sbm-panel-heading-polished {
    padding-right: 46px;
}

.sbm-panel-heading-polished h3 {
    font-size: 27px;
    letter-spacing: -.03em;
}

.sbm-polished-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sbm-upload-preview-card {
    position: relative;
    border: 1px solid #eceff6;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15,23,42,.07);
    overflow: hidden;
    margin-top: 4px;
}

.sbm-cover-preview {
    height: 145px;
    background-size: cover;
    background-position: center;
    position: relative;
    background-color: #eef2ff;
}

.sbm-cover-preview::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15,23,42,.08), rgba(15,23,42,.42));
}

.sbm-cover-upload input,
.sbm-avatar-upload input {
    display: none !important;
}

.sbm-cover-upload {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    cursor: pointer;
}

.sbm-cover-upload span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: #111827;
    font-size: 13px;
    font-weight: 850;
    box-shadow: 0 10px 24px rgba(15,23,42,.16);
}

.sbm-avatar-preview-wrap {
    width: 104px;
    height: 104px;
    border-radius: 999px;
    padding: 5px;
    background: #fff;
    position: relative;
    margin: -52px 0 18px 22px;
    z-index: 3;
    box-shadow: 0 16px 32px rgba(15,23,42,.20);
}

.sbm-avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.sbm-avatar-upload {
    position: absolute;
    right: -2px;
    bottom: 4px;
    cursor: pointer;
}

.sbm-avatar-upload span {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--sb-primary);
    color: #fff;
    border: 3px solid #fff;
    box-shadow: 0 10px 22px rgba(15,23,42,.18);
}

.sbm-form-section {
    border: 1px solid #eceff6;
    border-radius: 20px;
    padding: 18px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15,23,42,.055);
}

.sbm-form-section h4 {
    margin: 0 0 14px;
    color: #111827;
    font-size: 16px;
    letter-spacing: -.01em;
}

.sbm-polished-form .sbm-form-grid {
    gap: 14px;
}

.sbm-polished-form label span {
    font-size: 12px;
    color: #4b5563;
}

.sbm-polished-form input,
.sbm-polished-form textarea {
    border-radius: 14px;
    border-color: #dfe3ee;
    background: #fbfcff;
}

.sbm-polished-form input:focus,
.sbm-polished-form textarea:focus {
    outline: none;
    border-color: var(--sb-primary);
    box-shadow: 0 0 0 4px rgba(109,53,213,.12);
    background: #fff;
}

.sbm-sticky-actions {
    position: sticky;
    bottom: -28px;
    margin: 2px -28px -28px;
    padding: 16px 28px 22px;
    background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.98) 32%);
    backdrop-filter: blur(18px);
    border-top: 1px solid #eef0f5;
    display: grid;
    gap: 12px;
}

.sbm-sticky-actions .sbm-form-message {
    min-height: 20px;
    margin: 0;
    text-align: center;
}

.sbm-save-button {
    position: relative;
    min-height: 48px;
    border-radius: 16px !important;
    background: linear-gradient(135deg, var(--sb-primary-dark), var(--sb-primary)) !important;
    box-shadow: 0 14px 30px rgba(109,53,213,.24);
}

.sbm-saving-text {
    display: none;
}

.sbm-ajax-form.is-saving .sbm-save-text {
    display: none;
}

.sbm-ajax-form.is-saving .sbm-saving-text {
    display: inline;
}

.sbm-ajax-form.is-saving .sbm-save-button {
    opacity: .82;
    cursor: wait;
}

.sbm-ajax-form.is-saving .sbm-save-button::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 999px;
    display: inline-block;
    margin-right: 9px;
    vertical-align: -3px;
    animation: sbmSpin .8s linear infinite;
}

@keyframes sbmSpin {
    to { transform: rotate(360deg); }
}

.sbm-image-selected {
    display: inline-flex;
    margin-top: 8px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #087443;
    font-size: 12px;
    font-weight: 800;
}

@media (max-width: 640px) {
    .sbm-modal-dialog {
        width: calc(100vw - 18px) !important;
        max-height: calc(100vh - 24px) !important;
    }

    .sbm-modal-content {
        max-height: calc(100vh - 24px);
        padding: 22px;
    }

    .sbm-sticky-actions {
        margin: 2px -22px -22px;
        padding: 14px 22px 20px;
    }

    .sbm-cover-preview {
        height: 128px;
    }
}


/* v1.0.6 button text visibility fix */
.sbm-save-button {
    color: #ffffff !important;
    font-weight: 800;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sbm-save-button .sbm-save-text,
.sbm-save-button .sbm-saving-text {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block;
}

.sbm-save-button:disabled {
    color: #ffffff !important;
}


/* v1.0.7: make modal save controls impossible to miss */
.sbm-modal-dialog {
    overflow: visible !important;
}

.sbm-modal-content {
    overflow-y: visible !important;
    max-height: none !important;
}

.sbm-polished-form {
    padding-bottom: 0 !important;
}

.sbm-sticky-actions {
    position: relative !important;
    bottom: auto !important;
    margin: 18px 0 0 !important;
    padding: 18px !important;
    border: 1px solid #e8ebf2 !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    box-shadow: 0 16px 40px rgba(15,23,42,.09) !important;
    z-index: 5 !important;
}

.sbm-sticky-actions .sbm-save-button,
.sbm-polished-form .sbm-save-button,
.sbm-billing-form .sbm-save-button,
.sbm-ajax-form button[type="submit"].sbm-save-button {
    display: flex !important;
    width: 100% !important;
    min-height: 54px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, #4b18af, #6d35d5) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-indent: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    cursor: pointer !important;
    box-shadow: 0 14px 30px rgba(109,53,213,.24) !important;
}

.sbm-sticky-actions .sbm-save-button *,
.sbm-polished-form .sbm-save-button *,
.sbm-billing-form .sbm-save-button *,
.sbm-ajax-form button[type="submit"].sbm-save-button * {
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sbm-save-button .sbm-save-text {
    display: inline-block !important;
}

.sbm-save-button .sbm-saving-text {
    display: none !important;
}

.sbm-ajax-form.is-saving .sbm-save-button .sbm-save-text {
    display: none !important;
}

.sbm-ajax-form.is-saving .sbm-save-button .sbm-saving-text {
    display: inline-block !important;
}

.sbm-ajax-form.is-saving .sbm-save-button {
    cursor: wait !important;
    opacity: .9 !important;
}

.sbm-form-message {
    min-height: 22px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

/* Keep the modal centered but allow taller profile forms to fit cleanly */
@media (min-width: 641px) {
    .sbm-modal-dialog {
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-height: calc(100vh - 50px) !important;
    }

    .sbm-modal-content {
        max-height: calc(100vh - 50px) !important;
        overflow-y: auto !important;
        scrollbar-width: none !important;
    }

    .sbm-modal-content::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
    }
}

@media (max-width: 640px) {
    .sbm-modal-content {
        max-height: calc(100vh - 30px) !important;
        overflow-y: auto !important;
        scrollbar-width: none !important;
    }

    .sbm-modal-content::-webkit-scrollbar {
        width: 0 !important;
        height: 0 !important;
    }
}


/* v1.0.8: remove theme page/title whitespace while keeping the site menu/header */
body.sbm-profile-fullscreen .wp-site-blocks,
body.sbm-profile-fullscreen .site,
body.sbm-profile-fullscreen #page {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.sbm-profile-fullscreen .site-content,
body.sbm-profile-fullscreen #content,
body.sbm-profile-fullscreen .content-area,
body.sbm-profile-fullscreen #primary,
body.sbm-profile-fullscreen main,
body.sbm-profile-fullscreen .site-main,
body.sbm-profile-fullscreen article.page,
body.sbm-profile-fullscreen .hentry,
body.sbm-profile-fullscreen .entry-content,
body.sbm-profile-fullscreen .page-content,
body.sbm-profile-fullscreen .woocommerce {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.sbm-profile-fullscreen .entry-header,
body.sbm-profile-fullscreen .page-header,
body.sbm-profile-fullscreen .wp-block-post-title,
body.sbm-profile-fullscreen .entry-title,
body.sbm-profile-fullscreen .woocommerce-products-header,
body.sbm-profile-fullscreen .woocommerce-breadcrumb {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.sbm-profile-fullscreen .wp-block-spacer,
body.sbm-profile-fullscreen .wp-block-group:empty,
body.sbm-profile-fullscreen .entry-content > .wp-block-spacer:first-child,
body.sbm-profile-fullscreen .wp-block-post-content > .wp-block-spacer:first-child {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.sbm-profile-fullscreen .woocommerce-MyAccount-content,
body.sbm-profile-fullscreen .sb-profile-shell {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body.sbm-profile-fullscreen .sb-profile-shell {
    transform: translateY(0) !important;
}

/* If the active theme uses a hero/header block above page content, collapse it only on account pages */
body.sbm-profile-fullscreen .wp-block-template-part + main,
body.sbm-profile-fullscreen header.site-header + #content,
body.sbm-profile-fullscreen header.wp-block-template-part + main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Stronger override for themes that add giant min-height to page intro areas */
body.sbm-profile-fullscreen .page-hero,
body.sbm-profile-fullscreen .hero,
body.sbm-profile-fullscreen .site-hero,
body.sbm-profile-fullscreen .title-area,
body.sbm-profile-fullscreen .page-title-area,
body.sbm-profile-fullscreen .page-banner,
body.sbm-profile-fullscreen .inside-article > header,
body.sbm-profile-fullscreen .ast-archive-description {
    display: none !important;
    min-height: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* v1.0.9: tighten profile closer to the site menu/header */
body.sbm-profile-fullscreen .sb-profile-shell {
    margin-top: -76px !important;
}

body.sbm-profile-fullscreen .sb-profile-hero {
    padding-top: 0 !important;
}

/* Reduce common theme spacing immediately above Woo account content */
body.sbm-profile-fullscreen .woocommerce,
body.sbm-profile-fullscreen .woocommerce-MyAccount-content,
body.sbm-profile-fullscreen .entry-content,
body.sbm-profile-fullscreen .wp-block-post-content,
body.sbm-profile-fullscreen main,
body.sbm-profile-fullscreen #primary,
body.sbm-profile-fullscreen #content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* If the theme menu/header becomes too close on smaller screens, soften the pull-up */
@media (max-width: 900px) {
    body.sbm-profile-fullscreen .sb-profile-shell {
        margin-top: -48px !important;
    }
}

@media (max-width: 640px) {
    body.sbm-profile-fullscreen .sb-profile-shell {
        margin-top: -28px !important;
    }
}


/* v1.0.10: image focus and zoom controls */
.sb-profile-avatar-wrap,
.sbm-avatar-preview-wrap {
    overflow: hidden;
}

.sb-profile-avatar-img,
.sbm-avatar-preview {
    transform-origin: center center;
}

.sbm-image-focus-section {
    display: grid;
    gap: 16px;
}

.sbm-help-text {
    margin: -6px 0 0;
    color: #667085;
    font-size: 13px;
    line-height: 1.4;
}

.sbm-focus-group {
    border: 1px solid #eef0f5;
    border-radius: 16px;
    padding: 14px;
    background: #fbfcff;
    display: grid;
    gap: 10px;
}

.sbm-focus-group strong {
    font-size: 14px;
    color: #111827;
}

.sbm-focus-group label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: #4b5563;
}

.sbm-focus-group input[type="range"] {
    width: 100%;
    accent-color: var(--sb-primary);
    padding: 0;
    background: transparent;
}

.sbm-cover-preview {
    background-repeat: no-repeat;
}

.sb-profile-hero {
    background-repeat: no-repeat;
}

.sbm-image-selected {
    position: relative;
    z-index: 4;
}


/* v1.0.11: separate image editor modal */
.sb-cover-edit-button {
    position: absolute;
    right: 36px;
    top: 24px;
    z-index: 5;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.9);
    color: #111827;
    padding: 10px 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(15,23,42,.18);
}

.sb-profile-hero {
    position: relative;
}

.sbm-image-shortcuts {
    background: linear-gradient(135deg, #fbfcff, #f6f2ff);
}

.sbm-image-shortcut-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
}

.sbm-secondary-button {
    border: 1px solid #e2e7f0;
    background: #fff;
    color: #111827;
    border-radius: 15px;
    padding: 12px 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15,23,42,.06);
}

.sbm-secondary-button:hover {
    background: #f0ebff;
    border-color: #d7c8ff;
}

.sbm-image-focus-section {
    display: none !important;
}

.sbm-upload-preview-card {
    display: none !important;
}

.sbm-image-modal {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: none;
}

.sbm-image-modal.is-open {
    display: block;
}

.sbm-image-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(6px);
}

.sbm-image-modal-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, calc(100vw - 34px));
    max-height: calc(100vh - 42px);
    overflow: auto;
    scrollbar-width: none;
    background: rgba(255,255,255,.98);
    border-radius: 28px;
    box-shadow: 0 32px 90px rgba(15,23,42,.34);
    padding: 28px;
}

.sbm-image-modal-dialog::-webkit-scrollbar {
    display: none;
}

.sbm-image-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #f2f4f7;
    color: #111827;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    z-index: 3;
}

.sbm-image-editor-form {
    display: grid;
    gap: 18px;
}

.sbm-image-editor-head {
    padding-right: 44px;
}

.sbm-image-editor-head h3 {
    margin: 0 0 6px;
    font-size: 28px;
    letter-spacing: -.03em;
    color: #111827;
}

.sbm-image-editor-head p {
    margin: 0;
    color: #667085;
}

.sbm-image-editor-stage {
    border: 1px solid #e8ebf2;
    border-radius: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(109,53,213,.14), transparent 30%),
        linear-gradient(135deg, #fbfcff, #eef2ff);
    min-height: 330px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 28px;
}

.sbm-image-editor-preview {
    background-color: #dfe4ee;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: 50% 50%;
    box-shadow: 0 20px 48px rgba(15,23,42,.22);
    overflow: hidden;
}

.sbm-image-editor-avatar {
    width: 260px;
    height: 260px;
    border-radius: 999px;
    border: 7px solid #fff;
}

.sbm-image-editor-cover {
    width: min(620px, 100%);
    aspect-ratio: 3 / 1;
    border-radius: 20px;
    border: 7px solid #fff;
}

.sbm-image-editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    transform-origin: center center;
    display: block;
}

.sbm-image-editor-cover img {
    display: none;
}

.sbm-image-upload-drop {
    border: 1px dashed #cfd6e6;
    border-radius: 20px;
    padding: 16px;
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 4px 12px;
    align-items: center;
    cursor: pointer;
    background: #fff;
}

.sbm-image-upload-drop input {
    display: none !important;
}

.sbm-image-upload-drop span {
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f0ebff;
}

.sbm-image-upload-drop strong {
    color: #111827;
}

.sbm-image-upload-drop small {
    color: #667085;
}

.sbm-image-editor-controls {
    display: grid;
    gap: 12px;
    border: 1px solid #e8ebf2;
    border-radius: 22px;
    background: #fff;
    padding: 18px;
}

.sbm-image-editor-controls label {
    display: grid;
    gap: 7px;
    font-size: 12px;
    color: #4b5563;
    font-weight: 900;
}

.sbm-image-editor-controls input[type="range"] {
    width: 100%;
    accent-color: var(--sb-primary);
}

.sbm-image-editor-actions {
    display: grid;
    gap: 12px;
}

.sbm-image-editor-message {
    min-height: 22px;
    text-align: center;
    font-weight: 900;
    color: #667085;
}

.sbm-image-editor-message.is-success {
    color: #16884b;
}

.sbm-image-editor-message.is-error {
    color: #d92d20;
}

.sbm-image-editor-form.is-saving .sbm-save-text {
    display: none !important;
}

.sbm-image-editor-form.is-saving .sbm-saving-text {
    display: inline-block !important;
}

@media (max-width: 640px) {
    .sb-cover-edit-button {
        right: 16px;
        top: 16px;
        font-size: 12px;
    }

    .sbm-image-shortcut-buttons {
        grid-template-columns: 1fr;
    }

    .sbm-image-modal-dialog {
        width: calc(100vw - 18px);
        max-height: calc(100vh - 24px);
        padding: 22px;
        border-radius: 22px;
    }

    .sbm-image-editor-stage {
        min-height: 260px;
        padding: 18px;
    }

    .sbm-image-editor-avatar {
        width: 210px;
        height: 210px;
    }
}


/* v1.0.12: avatar editor + save visibility fixes */
.sb-profile-avatar-img,
.sbm-image-editor-preview img,
.sbm-avatar-preview {
    object-fit: cover !important;
    object-position: var(--sbm-avatar-x, 50%) var(--sbm-avatar-y, 50%) !important;
    transform: scale(var(--sbm-avatar-zoom, 1)) !important;
    transform-origin: var(--sbm-avatar-x, 50%) var(--sbm-avatar-y, 50%) !important;
}

.sbm-image-modal-dialog {
    overflow: visible !important;
    max-height: calc(100vh - 30px) !important;
}

.sbm-image-editor-form {
    max-height: calc(100vh - 54px);
    overflow-y: auto;
    scrollbar-width: none;
}

.sbm-image-editor-form::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}

.sbm-image-editor-actions {
    position: sticky !important;
    bottom: -28px !important;
    margin: 4px -28px -28px !important;
    padding: 16px 28px 24px !important;
    background: linear-gradient(180deg, rgba(255,255,255,.70), #fff 34%) !important;
    border-top: 1px solid #eef0f5 !important;
    z-index: 20 !important;
    display: grid !important;
    gap: 12px !important;
}

.sbm-image-editor-actions .sbm-save-button,
.sbm-image-editor-form .sbm-save-button {
    display: flex !important;
    width: 100% !important;
    min-height: 54px !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sbm-image-editor-actions .sbm-save-button *,
.sbm-image-editor-form .sbm-save-button * {
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.sbm-image-editor-preview img {
    --sbm-avatar-x: 50%;
    --sbm-avatar-y: 50%;
    --sbm-avatar-zoom: 1;
}

@media (max-width: 640px) {
    .sbm-image-editor-actions {
        bottom: -22px !important;
        margin: 4px -22px -22px !important;
        padding: 14px 22px 20px !important;
    }

    .sbm-image-editor-form {
        max-height: calc(100vh - 48px);
    }
}


/* v1.0.13: make the live/front avatar crop use background positioning like the editor */
.sb-profile-avatar-img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 999px !important;
    display: block !important;
    background-repeat: no-repeat !important;
    background-position: 50% 50%;
    background-size: 100%;
    transform: none !important;
}

.sbm-image-editor-preview img,
.sbm-avatar-preview {
    object-fit: cover !important;
    object-position: var(--sbm-avatar-x, 50%) var(--sbm-avatar-y, 50%) !important;
    transform: scale(var(--sbm-avatar-zoom, 1)) !important;
    transform-origin: var(--sbm-avatar-x, 50%) var(--sbm-avatar-y, 50%) !important;
}


/* v1.0.14: processed avatar images are real square crops, not CSS background chop jobs */
.sb-profile-avatar-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    transform: none !important;
    border-radius: 999px !important;
    display: block !important;
}

.sb-profile-hero {
    background-size: cover !important;
    background-position: center center !important;
}


/* v1.0.15: modal display hardening after JS cleanup */
.sbm-modal.is-open,
.sbm-image-modal.is-open {
    display: block !important;
}

.sbm-modal,
.sbm-image-modal {
    pointer-events: none;
}

.sbm-modal.is-open,
.sbm-image-modal.is-open {
    pointer-events: auto;
}

.sbm-image-editor-actions .sbm-save-button,
.sbm-sticky-actions .sbm-save-button {
    display: flex !important;
    color: #ffffff !important;
    opacity: 1 !important;
    visibility: visible !important;
}
