/* A wrapped WordPress toolbar must reserve its actual height. Keep dropdowns
   visible and clickable; only the authenticated frontend has this marker. */
html.ibreg-adminbar-measured {
    margin-top: var(--ibreg-adminbar-height, 32px) !important;
    scroll-padding-top: var(--ibreg-adminbar-offset, 32px);
}
html.ibreg-adminbar-measured body.admin-bar #wpadminbar {
    height: var(--ibreg-adminbar-height, 32px) !important;
}
html.ibreg-adminbar-measured body.admin-bar #ins-home-new-header {
    top: var(--ibreg-adminbar-offset, 32px) !important;
}

#ibreg-profile-reminder[hidden],
#ibreg-profile-reminder-dialog:not([open]),
[data-ibreg-account-badge][hidden],
[data-ibreg-account-link][hidden],
[data-ibreg-account-guest][hidden],
#ibreg-profile-reminder-dialog [hidden] {
    display: none !important;
}

[data-ibreg-account-guest] { display: contents; }
body #ins-home-new-header [data-ibreg-account-link] { grid-column: 1 / -1; }

[data-ibreg-account-link] {
    position: relative;
    gap: 7px;
}
[data-ibreg-account-link] .ibreg-account-icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
}

[data-ibreg-account-link] .ibreg-account-notification-badge {
    position: absolute;
    z-index: 1;
    top: -7px;
    right: -7px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 1px 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #d90016;
    color: #fff;
    font: 800 12px/1.2 system-ui, sans-serif;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

#ibreg-profile-reminder,
#ibreg-profile-reminder-dialog {
    box-sizing: border-box;
    color: #12233d;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    text-align: left;
    overflow-wrap: anywhere;
}

#ibreg-profile-reminder {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 99980;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 12px 16px;
    border: 1px solid #dfe4eb;
    border-left: 4px solid #e3000b;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgb(9 26 49 / 16%);
}

#ibreg-profile-reminder .ibreg-reminder-copy { flex: 1 1 170px; }
#ibreg-profile-reminder strong {
    display: block;
    color: #12233d;
    font-size: 16px;
    line-height: 1.3;
}

#ibreg-profile-reminder p,
#ibreg-profile-reminder-dialog p {
    margin: 8px 0 0;
    font: inherit;
    color: inherit;
}

#ibreg-profile-reminder .ibreg-reminder-link,
#ibreg-profile-reminder-dialog .ibreg-reminder-link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    max-width: 100%;
    padding: 10px 16px;
    border: 2px solid #e3000b;
    border-radius: 999px;
    background: #e3000b;
    color: #fff;
    font: inherit;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}

#ibreg-profile-reminder-dialog {
    inset: 0;
    width: 500px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 24px;
    border: 1px solid #dfe4eb;
    border-top: 4px solid #e3000b;
    border-radius: 18px;
    box-shadow: 0 20px 70px rgb(9 26 49 / 30%);
    overflow-y: auto;
    overscroll-behavior: contain;
}

#ibreg-profile-reminder-dialog::backdrop { background: rgb(9 26 49 / 58%); }
#ibreg-profile-reminder-dialog .ibreg-reminder-sender {
    margin: 0 38px 8px 0;
    color: #8c0b14;
    font-size: 13px;
    font-weight: 700;
}

#ibreg-profile-reminder-dialog h2 {
    margin: 0 32px 12px 0;
    color: #12233d;
    font-family: inherit;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: none;
}

#ibreg-profile-reminder-dialog [data-ibreg-reminder-field-count] { font-weight: 700; }
#ibreg-profile-reminder-dialog [data-ibreg-reminder-issues] {
    display: grid;
    gap: 0 32px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    margin: 8px 0 14px;
    padding-left: 20px;
}
#ibreg-profile-reminder-dialog [data-ibreg-reminder-issues] li { min-width: 0; }
#ibreg-profile-reminder-dialog [data-ibreg-reminder-issues] a {
    display: block;
    max-width: 100%;
    padding-block: 6px;
    color: #173c70;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#ibreg-profile-reminder-dialog .ibreg-reminder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

#ibreg-profile-reminder-dialog [data-ibreg-reminder-dismiss] {
    box-sizing: border-box;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid #aebccd;
    border-radius: 999px;
    background: #fff;
    color: #12233d;
    font: inherit;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
}

#ibreg-profile-reminder-dialog .ibreg-reminder-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-color: transparent;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
}
#ibreg-profile-reminder-dialog .ibreg-reminder-close:hover { background: #eef2f6; }

#ibreg-profile-reminder a:focus-visible,
#ibreg-profile-reminder-dialog :is(a, button, [tabindex]):focus-visible,
[data-ibreg-account-link]:focus-visible {
    outline: 3px solid #b77900;
    outline-offset: 3px;
}

@media (max-width: 600px) {
    #ibreg-profile-reminder {
        right: 12px;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 24px);
        padding: 12px 14px;
        font-size: 14px;
    }
    #ibreg-profile-reminder-dialog {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 20px;
    }
    #ibreg-profile-reminder-dialog h2 { font-size: 22px; }
    #ibreg-profile-reminder-dialog [data-ibreg-reminder-issues] { grid-template-columns: minmax(0, 1fr); }
    #ibreg-profile-reminder-dialog .ibreg-reminder-actions > .ibreg-reminder-link { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
    #ibreg-profile-reminder,
    #ibreg-profile-reminder-dialog { scroll-behavior: auto; }
}
