:root {
    --brand: #26547c;
    --accent: #ef476f;
    --ink: #172033;
    --soft: #f6f8fb;
    --gender-primary: #26547c;
    --gender-secondary: #69a7d6;
    --gender-soft: #e9f3ff;
    --gender-border: #bfdcff;
}

body.gender-female {
    --gender-primary: #ef476f;
    --gender-secondary: #ff8fab;
    --gender-soft: #fff0f5;
    --gender-border: #ffc2d1;
}

body.gender-male {
    --gender-primary: #26547c;
    --gender-secondary: #69a7d6;
    --gender-soft: #e9f3ff;
    --gender-border: #bfdcff;
}

body {
    background: var(--soft);
    color: var(--ink);
    text-align: start;
}

html[dir="rtl"] body {
    font-family: Tahoma, Arial, sans-serif;
}

html[dir="ltr"] body {
    font-family: Arial, Helvetica, sans-serif;
}

input,
textarea,
select,
button {
    direction: inherit;
    text-align: start;
}

input[type="email"],
input[type="url"],
input[type="tel"],
input[inputmode="numeric"],
.member-number,
.coordinates {
    direction: ltr;
    text-align: start;
}

[dir="rtl"] .dropdown-menu {
    text-align: right;
}

.language-switcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.language-switcher .btn-group {
    direction: ltr;
}

.payment-provider-actions {
    display: grid;
    gap: .65rem;
}

.favorite-card {
    display: grid;
    gap: 1rem;
}

.favorite-card-profile {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: .85rem;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.favorite-card-profile small {
    display: block;
    color: #6c7788;
}

.member-card-summary,
.message-member-summary {
    display: block;
    min-width: 0;
}

.member-card-summary strong,
.message-member-summary strong {
    display: block;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.member-card-summary small,
.message-member-summary small {
    display: block;
    color: #6c7788;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.favorite-note-form textarea {
    resize: vertical;
}

.page-title-header {
    position: relative;
    isolation: isolate;
    color: #fff;
    background: linear-gradient(135deg, #1f486b 0%, #3479a8 100%);
    border-bottom: 4px solid rgba(255, 255, 255, .42);
    box-shadow: 0 7px 22px rgba(23, 32, 51, .2);
}

body.gender-male .page-title-header {
    background: linear-gradient(135deg, #173f63 0%, #347fb5 100%);
    border-bottom-color: #a9d8fa;
}

body.gender-female .page-title-header {
    background: linear-gradient(135deg, #d92f61 0%, #f56f96 100%);
    border-bottom-color: #ffd0dc;
}

.page-title-header::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent 52%);
    pointer-events: none;
}

.page-title-header-inner {
    position: relative;
    min-height: 92px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding-block: 1rem;
}

.page-title-header h1 {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding-inline: 112px;
    overflow-wrap: anywhere;
    text-align: center;
    color: #fff;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0;
    text-shadow: 0 2px 5px rgba(23, 32, 51, .28);
}

.page-title-action {
    position: absolute;
    z-index: 1;
    color: #fff;
}

.page-title-save {
    inset-inline-start: 12px;
    top: 50%;
    min-width: 78px;
    min-height: 44px;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    font-weight: 700;
}

.page-title-save:hover,
.page-title-save:focus-visible {
    background: rgba(255, 255, 255, .28);
}

.page-title-edit {
    inset-inline-start: 16px;
    top: 50%;
    min-width: 78px;
    min-height: 44px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(23, 32, 51, .18);
}

.page-title-edit:hover,
.page-title-edit:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .28);
}

.page-title-close {
    inset-inline-end: 12px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    color: #fff;
    text-decoration: none;
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
}

.page-title-close:hover,
.page-title-close:focus-visible {
    color: #fff;
    opacity: .82;
}

.page-title-search {
    inset-inline-end: 14px;
    top: 50%;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}

.page-title-search span {
    position: relative;
    display: block;
    width: 19px;
    height: 19px;
    border: 3px solid #fff;
    border-radius: 50%;
}

.page-title-search span::after {
    content: "";
    position: absolute;
    right: -8px;
    bottom: -5px;
    width: 10px;
    height: 3px;
    border-radius: 999px;
    background: #fff;
    transform: rotate(45deg);
    transform-origin: left center;
}

.page-title-search:hover,
.page-title-search:focus-visible {
    background: rgba(255, 255, 255, .28);
}

.search-filters-modal .modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 20px 55px rgba(23, 32, 51, .24);
}

.search-filters-modal .modal-header {
    color: #fff;
    background: linear-gradient(135deg, var(--gender-primary), var(--gender-secondary));
}

.search-filters-modal .modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

body.gender-male .btn-primary,
body.gender-female .btn-primary {
    background-color: var(--gender-primary);
    border-color: var(--gender-primary);
}

body.gender-male .btn-outline-primary,
body.gender-female .btn-outline-primary {
    color: var(--gender-primary);
    border-color: var(--gender-primary);
}

body.gender-male .btn-outline-primary:hover,
body.gender-female .btn-outline-primary:hover {
    background-color: var(--gender-primary);
    border-color: var(--gender-primary);
    color: #fff;
}

.hero {
    min-height: 58vh;
    display: grid;
    align-items: center;
    background:
        linear-gradient(90deg, rgba(23,32,51,.86), rgba(23,32,51,.35)),
        url('https://images.unsplash.com/photo-1529156069898-49953e39b3ac?auto=format&fit=crop&w=1600&q=80') center/cover;
    color: #fff;
    border-radius: 0 0 8px 8px;
    margin: -1.5rem -12px 2rem;
    padding: 4rem 1rem;
}

.hero .inner {
    max-width: 760px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 4.6rem);
    letter-spacing: 0;
}

.panel {
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    padding: 1.25rem;
}

.registration-wizard {
    padding: clamp(1.25rem, 4vw, 2.5rem);
}

.registration-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
    margin-bottom: 2rem;
}

.registration-progress-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: .4rem;
    color: #8a94a6;
    text-align: center;
}

.registration-progress-step::before {
    content: "";
    position: absolute;
    top: 17px;
    right: 50%;
    width: 100%;
    height: 2px;
    background: #e1e6ed;
    z-index: 0;
}

[dir="rtl"] .registration-progress-step::before {
    right: auto;
    left: 50%;
}

.registration-progress-step:first-child::before {
    display: none;
}

.registration-progress-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid #d7dde6;
    border-radius: 50%;
    background: #fff;
    font-weight: 700;
}

.registration-progress-step.active {
    color: var(--brand);
}

.registration-progress-step.active::before {
    background: var(--brand);
}

.registration-progress-step.active span {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.registration-progress-step.optional small::after {
    content: " optional";
    font-size: .7rem;
}

.registration-heading {
    margin-bottom: 1.5rem;
}

.registration-heading h1 {
    font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.registration-heading p {
    max-width: 650px;
    color: #687386;
}

.registration-next {
    min-width: 190px;
}

.registration-location-state {
    min-height: 72px;
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px dashed #cbd3df;
    border-radius: 8px;
    background: #f8fafc;
    color: #687386;
}

.registration-location-state.success {
    border-color: #20a779;
    background: #ecfbf5;
    color: #087f5b;
}

.registration-photo-form {
    display: grid;
    justify-items: center;
    gap: 1.5rem;
}

.registration-photo-picker {
    display: grid;
    justify-items: center;
    gap: .8rem;
    cursor: pointer;
}

.registration-photo-picker img,
.registration-photo-placeholder {
    grid-area: 1 / 1;
    width: 180px;
    height: 180px;
    border-radius: 50%;
}

.registration-photo-picker img {
    display: none;
    object-fit: cover;
    border: 5px solid var(--gender-soft);
    box-shadow: 0 12px 28px rgba(23, 32, 51, .14);
}

.registration-photo-picker img.visible {
    display: block;
}

.registration-photo-placeholder {
    display: grid;
    place-items: center;
    border: 2px dashed #9eabbc;
    background: #f3f7fb;
    color: var(--brand);
    font-size: 4rem;
    font-weight: 300;
}

.registration-photo-picker img.visible + .registration-photo-placeholder {
    display: none;
}

.registration-member-number {
    width: min(100%, 420px);
    margin-inline: auto;
    padding: 1.25rem;
    border: 1px solid #dce3ec;
    border-radius: 8px;
    background: #f7f9fc;
    text-align: center;
}

.registration-member-number small {
    display: block;
    margin-bottom: .35rem;
    color: #687386;
}

.registration-member-number strong {
    display: block;
    color: var(--brand);
    font-size: clamp(1.75rem, 6vw, 2.6rem);
    letter-spacing: 0;
}

.avatar {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 50%;
    background: #dce3ec;
}

.avatar-lg {
    width: 96px;
    height: 96px;
}

.profile-photo-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    flex: 0 0 auto;
}

.gender-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(23, 32, 51, .18);
}

.gender-icon.male {
    background: #26547c;
}

.gender-icon.female {
    background: #ef476f;
}

.gender-icon.large {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
    border-width: 3px;
}

.profile-photo-wrap .gender-icon {
    position: absolute;
    right: -4px;
    bottom: -4px;
}

.photo-upload-trigger {
    display: inline-grid;
    justify-items: center;
    cursor: pointer;
    color: var(--ink);
}

.photo-upload-trigger.disabled {
    opacity: .45;
    pointer-events: none;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.photo-item {
    position: relative;
    text-align: center;
    padding: .75rem;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #fff;
}

.profile-photo-circle {
    width: 132px;
    height: 132px;
    max-width: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--gender-soft);
}

.public-profile-media {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.public-profile-main-photo,
.public-profile-thumbnail {
    flex: 0 0 auto;
    padding: 0;
    overflow: hidden;
    border: 3px solid var(--gender-border);
    border-radius: 50%;
    background: var(--gender-soft);
    cursor: pointer;
}

.public-profile-main-photo {
    width: 112px;
    height: 112px;
    box-shadow: 0 8px 22px rgba(23, 32, 51, .14);
}

.public-profile-main-photo img,
.public-profile-thumbnail img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.public-profile-gallery {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: .65rem;
    overflow-x: auto;
    padding: .35rem .25rem .55rem;
    scrollbar-width: thin;
}

.public-profile-thumbnail {
    width: 70px;
    height: 70px;
    transition: transform .16s ease, border-color .16s ease;
}

.public-profile-thumbnail:hover,
.public-profile-thumbnail:focus-visible {
    transform: translateY(-2px);
    border-color: var(--gender-primary);
}

.profile-photo-viewer .modal-content {
    border: 0;
    border-radius: 0;
    background: rgba(8, 12, 20, .98);
}

.profile-photo-viewer-toolbar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent);
}

.profile-photo-viewer-close {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
}

.profile-photo-viewer .modal-body {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 5.5rem 1rem 1rem;
}

.profile-photo-viewer .modal-body img {
    max-width: 100%;
    max-height: calc(100dvh - 7rem);
    object-fit: contain;
}

.photo-status,
.photo-main {
    display: inline-block;
    margin-top: .5rem;
    font-size: .75rem;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: #eef2f7;
}

.photo-status.approved {
    background: #d8f7ec;
    color: #087f5b;
}

.photo-status.pending {
    background: #fff3cd;
    color: #8a6400;
}

.photo-status.rejected {
    background: #f8d7da;
    color: #842029;
}

.photo-main {
    background: #dbeafe;
    color: #1d4ed8;
}

.photo-actions {
    display: flex;
    justify-content: center;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}

.profile-editor {
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(23, 32, 51, .08);
}

.profile-editor-body {
    background: #fff;
    border-radius: 8px;
    padding: 3rem 2.5rem 0;
}

.profile-photo-matrix {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: clamp(1.5rem, 5vw, 4rem);
    justify-items: center;
    margin-bottom: 2.5rem;
}

.profile-photo-slot {
    position: relative;
    width: min(100%, 170px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}

.profile-photo-slot.filled img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    box-shadow: 0 8px 18px rgba(23, 32, 51, .12);
}

.profile-photo-slot.empty label {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.profile-photo-slot.empty label .profile-upload-icon,
.profile-photo-slot.empty label .profile-upload-plus {
    transition: transform .18s ease, box-shadow .18s ease;
}

.profile-photo-slot.empty label:hover .profile-upload-icon,
.profile-photo-slot.empty label:focus-visible .profile-upload-icon {
    transform: translateY(-2px);
    box-shadow:
        inset 10px 10px 20px rgba(255, 255, 255, .96),
        inset -13px -15px 25px rgba(38, 84, 124, .14),
        0 20px 36px rgba(23, 32, 51, .14);
}

body.gender-female .profile-photo-slot.empty label:hover .profile-upload-icon,
body.gender-female .profile-photo-slot.empty label:focus-visible .profile-upload-icon {
    box-shadow:
        inset 10px 10px 20px rgba(255, 255, 255, .96),
        inset -13px -15px 25px rgba(239, 71, 111, .15),
        0 20px 36px rgba(239, 71, 111, .16);
}

.profile-photo-slot.empty label:hover .profile-upload-plus,
.profile-photo-slot.empty label:focus-visible .profile-upload-plus {
    transform: translateY(-3px) scale(1.04);
}

.profile-photo-slot.empty label.disabled {
    opacity: .45;
    pointer-events: none;
}

.profile-upload-icon {
    --photo-icon-border: rgba(105, 167, 214, .42);
    --photo-icon-card-end: #d9ecfb;
    --photo-icon-glow: rgba(105, 167, 214, .24);
    --photo-icon-head-mid: #eaf6ff;
    --photo-icon-head-end: #83bce0;
    --photo-icon-body-start: #f8fcff;
    --photo-icon-body-end: #8ec2e3;
    --photo-icon-shadow: rgba(38, 84, 124, .18);
    width: 74%;
    height: 74%;
    border: 2px solid var(--photo-icon-border);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 34% 22%, rgba(255, 255, 255, .98), rgba(255, 255, 255, 0) 33%),
        radial-gradient(circle at 50% 78%, var(--photo-icon-glow), transparent 45%),
        linear-gradient(145deg, #ffffff 0%, #f7fbff 47%, var(--photo-icon-card-end) 100%);
    box-shadow:
        inset 9px 9px 18px rgba(255, 255, 255, .92),
        inset -12px -14px 24px var(--photo-icon-glow),
        0 16px 32px rgba(23, 32, 51, .11);
}

.profile-upload-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 19%;
    width: 37%;
    height: 37%;
    transform: translateX(-50%);
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 25%, rgba(255, 255, 255, 1), rgba(255, 255, 255, .58) 34%, transparent 35%),
        linear-gradient(145deg, #ffffff 0%, var(--photo-icon-head-mid) 45%, var(--photo-icon-head-end) 100%);
    border: 2px solid rgba(255, 255, 255, .8);
    box-shadow:
        inset -8px -10px 16px var(--photo-icon-shadow),
        0 9px 15px var(--photo-icon-shadow);
    z-index: 2;
}

.profile-upload-icon::after {
    content: "";
    position: absolute;
    left: 19%;
    bottom: 12%;
    width: 62%;
    height: 39%;
    border-radius: 999px 999px 10px 10px;
    background:
        radial-gradient(circle at 31% 20%, rgba(255, 255, 255, .86), transparent 34%),
        linear-gradient(145deg, var(--photo-icon-body-start) 0%, var(--photo-icon-body-end) 100%);
    box-shadow:
        inset -9px -10px 18px var(--photo-icon-shadow),
        0 11px 18px var(--photo-icon-shadow);
    z-index: 1;
}

.profile-upload-icon.female {
    --photo-icon-border: rgba(255, 143, 171, .66);
    --photo-icon-card-end: #ffdbe6;
    --photo-icon-glow: rgba(255, 143, 171, .25);
    --photo-icon-head-mid: #fff0f5;
    --photo-icon-head-end: #ff9fba;
    --photo-icon-body-start: #fff7fa;
    --photo-icon-body-end: #ff8fab;
    --photo-icon-shadow: rgba(239, 71, 111, .18);
}

.profile-upload-plus {
    position: absolute;
    right: 2%;
    top: -2%;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(174, 180, 186, .72);
    background:
        radial-gradient(circle at 31% 24%, #fff, rgba(255, 255, 255, .94) 34%, #eef2f6 100%);
    color: var(--gender-primary);
    font-size: 2rem;
    line-height: 1;
    box-shadow:
        inset -4px -5px 9px rgba(23, 32, 51, .12),
        0 9px 18px rgba(23, 32, 51, .16);
    z-index: 3;
}

.slot-actions {
    position: absolute;
    left: 50%;
    bottom: .5rem;
    transform: translateX(-50%);
    display: flex;
    gap: .35rem;
    opacity: 0;
    transition: opacity .16s ease;
}

.profile-photo-slot:hover .slot-actions,
.profile-photo-slot:focus-within .slot-actions {
    opacity: 1;
}

.profile-photo-slot .photo-status,
.profile-photo-slot .photo-main {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
}

.profile-photo-slot .photo-status {
    top: .5rem;
}

.profile-photo-slot .photo-main {
    top: 2.15rem;
}

.photo-settings-note {
    text-align: center;
    color: #6c757d;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.profile-info-list {
    margin-inline: -2.5rem;
    border-top: 1px solid #eceff3;
}

.profile-info-row {
    min-height: 82px;
    display: grid;
    grid-template-columns: minmax(120px, 180px) 1fr;
    gap: 1rem;
    align-items: center;
    border-bottom: 1px solid #eceff3;
    padding: .9rem 2.5rem;
}

.profile-info-row span {
    color: #222;
    font-weight: 600;
}

.profile-info-row .form-control-plaintext {
    width: 100%;
    color: #111;
    font-size: 1.05rem;
    text-align: inherit;
    border: 0;
    resize: none;
}

.profile-gps-location {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.profile-location-value {
    color: #111;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

.member-card {
    min-height: 180px;
}

.member-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.member-card-link:hover,
.member-card-link:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    border-color: var(--gender-border);
    box-shadow: 0 10px 24px rgba(23, 32, 51, .12);
}

.dashboard-logout {
    margin-top: 2rem;
    padding-bottom: .5rem;
}

.dashboard-logout .btn {
    min-height: 48px;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.account-language-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

.account-language-options .btn {
    display: grid;
    min-height: 42px;
    place-items: center;
}

.remembered-accounts-panel {
    display: grid;
    gap: 1rem;
}

.remembered-accounts-heading p {
    font-size: .92rem;
}

.remembered-accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: .75rem;
}

.remembered-account-card {
    display: grid;
    gap: .35rem;
    border: 1px solid #e1e7f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.remembered-account-link {
    min-height: 172px;
    display: grid;
    place-items: center;
    gap: .35rem;
    padding: .9rem;
    color: inherit;
    text-align: center;
    text-decoration: none;
}

.remembered-account-link:hover,
.remembered-account-link:focus-visible {
    color: var(--gender-primary);
    background: var(--gender-soft);
}

.remembered-account-avatar {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--gender-soft);
    box-shadow: 0 8px 18px rgba(23, 32, 51, .14);
}

.remembered-account-name {
    max-width: 100%;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.remembered-account-card small {
    color: #687386;
    line-height: 1.15;
}

.remembered-account-card strong {
    color: var(--gender-primary);
    font-size: .82rem;
}

.remembered-account-forget {
    display: grid;
    border-top: 1px solid #edf1f6;
}

.remembered-account-forget .btn {
    min-height: 34px;
    border-radius: 0;
    color: #6b7280;
    font-size: .78rem;
    text-decoration: none;
}
.status-dot {
    width: .65rem;
    height: .65rem;
    display: inline-block;
    border-radius: 50%;
    background: #adb5bd;
}

.status-dot.on {
    background: #06d6a0;
}

.admin-gps-status {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
}

.admin-gps-status span {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: #adb5bd;
}

.admin-gps-status.enabled {
    color: #087f5b;
}

.admin-gps-status.enabled span {
    background: #06d6a0;
}

.admin-gps-status.disabled {
    color: #842029;
}

.admin-map-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-map-status {
    color: #087f5b;
    font-size: .875rem;
    font-weight: 700;
}

.admin-map-status.error {
    color: #842029;
}

.admin-members-map {
    width: 100%;
    min-height: 480px;
    margin-top: 1rem;
    border: 1px solid #dce3ec;
    border-radius: 8px;
    background: #eef2f7;
    z-index: 1;
}

.leaflet-member-pin {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 8px;
    transform: rotate(-45deg);
    background: #26547c;
    color: #fff;
    box-shadow: 0 5px 12px rgba(23, 32, 51, .28);
    font-weight: 800;
}

.leaflet-member-pin.female {
    background: #ef476f;
}

.leaflet-member-pin span {
    transform: rotate(45deg);
}

.admin-map-info {
    min-width: 210px;
    display: grid;
    gap: .35rem;
    color: #172033;
}

.admin-map-info strong {
    font-size: 1.05rem;
}

.admin-map-info > span,
.admin-map-member-summary span {
    display: block;
}

.admin-map-member-summary {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
}

.admin-map-member-photo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(23, 32, 51, .2);
}

.admin-map-member-photo-placeholder {
    display: grid;
    place-items: center;
    background: #26547c;
    color: #fff;
    font-weight: 800;
}

.admin-map-info p {
    max-width: 250px;
    margin: .2rem 0;
    color: #566176;
    line-height: 1.5;
}

.admin-map-info .btn {
    margin-top: .35rem;
}

.admin-map-popup-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.messages-thread {
    max-height: 60vh;
    overflow-y: auto;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    padding: 1rem;
    background: #f9fbfd;
}

.messages-member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 1rem;
}

.message-member-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e1e6ed;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(23, 32, 51, .06);
}

.new-message-indicator {
    position: absolute;
    top: .65rem;
    inset-inline-end: .65rem;
    width: 1.7rem;
    height: 1.7rem;
    display: none;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ef476f;
    color: #fff;
    box-shadow: 0 8px 18px rgba(239, 71, 111, .28);
    pointer-events: none;
}

.new-message-indicator::before {
    content: "";
    width: .78rem;
    height: .58rem;
    border: 2px solid currentColor;
    border-radius: .18rem;
}

.new-message-indicator span {
    position: absolute;
    top: .36rem;
    width: .5rem;
    height: .5rem;
    border-inline-start: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
}

.message-member-card[data-message-state="new"] {
    position: relative;
    border-color: rgba(239, 71, 111, .5);
    box-shadow: 0 8px 22px rgba(239, 71, 111, .12);
}

.message-member-card[data-message-state="new"] .new-message-indicator {
    display: grid;
    animation: new-message-pulse 1.8s ease-in-out infinite;
}

@keyframes new-message-pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    .message-member-card[data-message-state="new"] .new-message-indicator {
        animation: none;
    }
}

.message-member-avatar {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border: 3px solid var(--gender-border);
    border-radius: 50%;
    background: var(--gender-soft);
}

.message-member-summary h2 {
    margin: 0 0 .25rem;
    overflow-wrap: anywhere;
    font-size: 1.1rem;
}

.message-member-summary p,
.message-member-summary small {
    display: block;
    margin: 0;
    color: #687386;
}

.message-member-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.member-list-card {
    min-height: 0;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 38px;
    gap: .65rem;
    padding: .75rem;
}

.member-list-profile {
    min-height: 72px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: .75rem;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.member-list-avatar {
    width: 72px;
    height: 72px;
    margin: 0 !important;
    object-fit: cover;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--gender-soft);
    box-shadow: 0 5px 14px rgba(23, 32, 51, .14);
}

.member-list-summary {
    min-width: 0;
}

.member-list-summary strong,
.member-list-summary small {
    display: block;
    margin: 0;
    overflow-wrap: anywhere;
}

.member-list-summary strong {
    color: var(--ink);
    font-size: .95rem;
    line-height: 1.15;
}

.member-list-summary small {
    color: #687386;
    font-size: .8rem;
    line-height: 1.15;
}

.member-list-actions {
    min-height: 38px;
    display: grid;
    gap: .45rem;
    margin: 0 !important;
    align-items: stretch;
}

.search-member-actions {
    grid-template-columns: 1fr;
}

.message-member-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.message-state-button {
    display: grid;
    place-items: center;
    gap: .08rem;
}

.message-state-button .message-button-state {
    font-size: .58rem;
    font-weight: 900;
    line-height: 1;
    opacity: .9;
}

.message-state-button.is-read {
    background: #1f8f68;
    border-color: #1f8f68;
}

.message-state-button.is-unread {
    background: var(--gender-primary);
    border-color: var(--gender-primary);
}

.message-state-button.is-new {
    background: #ef476f;
    border-color: #ef476f;
    box-shadow: 0 0 0 .14rem rgba(239, 71, 111, .14);
}

.message-state-button.is-not_delivered {
    background: #6b7280;
    border-color: #6b7280;
}

.favorite-note-form {
    grid-template-columns: minmax(80px, 1fr) minmax(76px, auto) minmax(76px, auto);
}

.member-list-actions .btn,
.favorite-note-form textarea.form-control {
    min-height: 38px;
    height: 38px;
    margin: 0;
    font-size: .76rem;
    line-height: 1.1;
}

.member-list-actions .btn {
    padding: .35rem .55rem;
    font-weight: 700;
}

.favorite-note-form textarea.form-control {
    padding: .45rem .55rem;
    resize: none;
}

.messages-conversation-modal .modal-content,
.member-preview-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    box-shadow: 0 20px 55px rgba(23, 32, 51, .24);
}

.messages-conversation-modal .modal-header,
.member-preview-modal .modal-header {
    color: #fff;
    background: linear-gradient(135deg, var(--gender-primary), var(--gender-secondary));
}

.messages-conversation-modal .modal-header {
    min-height: 50px;
    padding: .55rem .85rem;
    border: 0;
}

.messages-conversation-modal .modal-title {
    width: 100%;
    margin: 0;
    text-align: center;
    font-size: .95rem;
    font-weight: 800;
}

.messages-conversation-modal .modal-header .btn-close {
    position: absolute;
    inset-inline-start: 1rem;
    margin: 0;
    opacity: .95;
}

.messages-conversation-modal .modal-header .btn-close,
.member-preview-modal .modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(2);
}

.messages-conversation-modal .messages-thread {
    height: min(55vh, 520px);
    max-height: none;
}

.messages-conversation-modal .modal-body {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .9rem;
    padding: 1rem;
    background: #f5f8fc;
}

.messages-conversation-modal .messages-thread {
    border-color: #dce5f0;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .76)),
        radial-gradient(circle at top left, var(--gender-soft), transparent 42%);
    padding: 1rem;
}

.member-preview-photo {
    width: 132px;
    height: 132px;
    object-fit: cover;
    border: 4px solid var(--gender-border);
    border-radius: 50%;
    background: var(--gender-soft);
}

.member-preview-details {
    margin: 0;
    border-top: 1px solid #e7ebf1;
}

.member-preview-details > div {
    display: grid;
    grid-template-columns: minmax(90px, .75fr) minmax(0, 1.25fr);
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid #edf0f4;
}

.member-preview-details > div[hidden] {
    display: none;
}

.member-preview-details dt,
.member-preview-details dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: .82rem;
    line-height: 1.35;
}

.member-preview-details dt {
    color: var(--ink);
    font-weight: 700;
}

.member-preview-details dd {
    color: #586579;
    white-space: pre-line;
}

.message-row {
    display: flex;
    margin-bottom: .65rem;
}

.message-row.mine {
    justify-content: flex-end;
}

.message-bubble {
    max-width: min(72%, 620px);
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 8px 8px 8px 2px;
    padding: .5rem .6rem;
    box-shadow: 0 8px 18px rgba(23, 32, 51, .06);
}

.message-row.mine .message-bubble {
    background: var(--gender-soft);
    border-color: var(--gender-border);
    border-radius: 8px 8px 2px 8px;
}

.message-bubble p {
    margin: .15rem 0 .4rem;
    overflow-wrap: anywhere;
    font-size: .82rem;
    line-height: 1.35;
}

.message-bubble > strong {
    display: block;
    margin-bottom: .15rem;
    font-size: .78rem;
    color: var(--ink);
}

.message-bubble .small {
    display: block;
    margin-top: .25rem;
    font-size: .66rem;
}

.message-read-status {
    display: block;
    margin-top: .08rem;
    font-size: .64rem;
    font-weight: 700;
    line-height: 1.1;
}

.message-read-status.is-read {
    color: var(--gender-primary);
}

.message-read-status.is-unread {
    color: #8a95a8;
}

.message-compose {
    display: grid;
    gap: .55rem;
    margin: 0;
}

.message-compose-editor {
    position: relative;
}

.message-compose-editor textarea {
    min-height: 88px;
    padding: .65rem .75rem 3.15rem;
    font-size: .82rem;
    resize: none;
    border-color: #d9e2ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
}

.message-compose-editor textarea:focus {
    border-color: var(--gender-primary);
    box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--gender-primary) 18%, transparent);
}

.message-compose-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.message-compose-tools {
    position: absolute;
    inset-inline-start: .65rem;
    inset-inline-end: .65rem;
    bottom: .55rem;
    display: flex;
    align-items: center;
    gap: .3rem;
    min-height: 34px;
    padding-top: .3rem;
    border-top: 1px solid #e5eaf1;
}

.message-attachment-picker {
    display: flex;
    min-width: 0;
    flex: 1;
    min-height: 28px;
    align-items: center;
    justify-content: flex-start;
    gap: .45rem;
    margin: 0;
    padding: 0 .25rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #536176;
    cursor: pointer;
    user-select: none;
}

.message-attachment-picker span {
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--gender-primary);
    font-size: 1.2rem;
    line-height: 1;
}

.message-attachment-picker strong {
    min-width: 0;
    overflow: hidden;
    font-size: .72rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.message-emoji-trigger {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--gender-primary);
    background: var(--gender-soft);
    font-size: 1rem;
    line-height: 1;
}

.message-emoji-picker {
    position: absolute;
    inset-inline-start: 0;
    bottom: calc(100% + .5rem);
    z-index: 5;
    width: min(260px, calc(100vw - 64px));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .25rem;
    padding: .5rem;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(23, 32, 51, .18);
}

.message-emoji-picker[hidden] {
    display: none;
}

.message-emoji-option {
    display: grid;
    min-width: 0;
    height: 36px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 1.2rem;
}

.message-emoji-option:hover,
.message-emoji-option:focus-visible {
    background: var(--gender-soft);
}

.message-compose .btn {
    min-height: 42px;
    min-width: 88px;
    padding-inline: 1.05rem;
    border-radius: 8px;
}

.message-compose .message-compose-send {
    width: auto;
    min-width: 58px;
    min-height: 28px;
    height: 28px;
    padding: .25rem .55rem;
    border-radius: 7px;
    font-size: .7rem;
    line-height: 1;
}

.subscription-message-lock {
    min-width: min(100%, 280px);
    margin: .6rem 0;
    padding: .85rem;
    border: 1px solid #f1c36a;
    border-radius: 8px;
    background: #fff8e8;
    color: #664d03;
}

.subscription-message-lock p {
    margin: .3rem 0 .75rem;
}

.subscription-pending-message {
    margin-top: .65rem;
    padding: .75rem;
    border: 1px solid #f1c36a;
    border-radius: 8px;
    background: #fff8e8;
    color: #664d03;
}

.subscription-pending-message p {
    margin: .3rem 0 .75rem;
}

.subscription-send-notice {
    min-height: 24px;
    color: #842029;
}

.subscription-send-notice a {
    font-weight: 700;
}

.message-attachment {
    display: block;
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    margin: .5rem 0;
    object-fit: cover;
}

@media (max-width: 767px) {
    .profile-editor {
        border-radius: 8px;
    }

    .page-title-header h1 {
        padding-inline: 84px;
        font-size: 1.35rem;
    }

    .page-title-save {
        inset-inline-start: 8px;
        min-width: 64px;
        min-height: 40px;
    }

    .page-title-edit {
        inset-inline-start: 10px;
        min-width: 25px;
        min-height: 40px;
        font-size: .9rem;
    }

    .page-title-close {
        inset-inline-end: 8px;
        width: 42px;
        height: 42px;
        font-size: 2.6rem;
    }

    .profile-editor-body {
        padding: 2rem 1rem 0;
    }

    .messages-conversation-modal .modal-dialog,
    .member-preview-modal .modal-dialog {
        margin: .5rem;
    }

    .messages-conversation-modal .modal-dialog {
        min-height: calc(100dvh - 1rem);
        display: flex;
        align-items: stretch;
    }

    .messages-conversation-modal .modal-content {
        min-height: calc(100dvh - 1rem);
        border-radius: 8px;
    }

    .messages-conversation-modal .modal-body {
        min-height: 0;
        padding: .85rem;
    }

    .messages-conversation-modal .messages-thread {
        height: auto;
        min-height: 0;
        padding: .85rem;
    }

    .messages-conversation-modal .modal-title {
        font-size: .9rem;
    }

    .message-bubble {
        max-width: 84%;
        padding: .48rem .58rem;
    }

    .message-compose-editor textarea {
        min-height: 82px;
    }

    .message-compose-actions {
        display: flex;
        justify-content: flex-end;
    }

    .message-compose .btn {
        width: auto;
        min-width: 58px;
        padding-inline: .6rem;
    }

    .message-compose .message-compose-send {
        min-width: 56px;
        min-height: 28px;
        height: 28px;
        padding: .2rem .45rem;
        font-size: .68rem;
    }

    .profile-photo-matrix {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .profile-photo-slot {
        width: 100%;
    }

    .profile-upload-plus {
        width: 34px;
        height: 34px;
        font-size: 1.5rem;
    }

    .profile-info-list {
        margin-inline: -1rem;
    }

    .profile-info-row {
        grid-template-columns: 96px 1fr;
        min-height: 70px;
        padding: .75rem 1rem;
    }

    .profile-info-row .form-control-plaintext {
        font-size: .98rem;
    }

    .profile-gps-location {
        grid-template-columns: 1fr;
    }

    .profile-location-value {
        font-size: .98rem;
    }

    .hero {
        min-height: 48vh;
        margin-inline: -12px;
    }
}

/* Polished mobile-first application layer */
html {
    min-height: 100%;
    background: #eef3f8;
}

body {
    min-height: 100%;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(246, 248, 251, 0) 240px),
        #f4f7fb;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

main > .container {
    max-width: 1180px;
}

.panel {
    border-color: rgba(188, 201, 218, .72);
    box-shadow: 0 12px 30px rgba(23, 32, 51, .07);
}

.panel h1,
.panel h2,
.panel h3 {
    letter-spacing: 0;
}

.btn {
    min-height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    font-weight: 700;
}

.btn-sm {
    min-height: 36px;
}

.form-control,
.form-select {
    min-height: 46px;
    border-radius: 8px;
    border-color: #d8e0eb;
    background-color: #fbfcfe;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--gender-primary);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--gender-primary) 18%, transparent);
}

.list-group.user-nav {
    position: sticky;
    top: 1rem;
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(23, 32, 51, .06);
}

.user-nav .list-group-item {
    min-height: 48px;
    display: flex;
    align-items: center;
    border-color: #edf1f6;
    font-weight: 700;
}

.user-nav-messages {
    position: relative;
    gap: .35rem;
}

.user-nav-badge {
    min-width: 1.25rem;
    height: 1.25rem;
    display: inline-grid;
    place-items: center;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--gender-primary);
    color: #fff;
    font-size: .68rem;
    font-weight: 900;
    line-height: 1;
}

.user-nav .list-group-item-action.active .user-nav-badge {
    background: #fff;
    color: var(--gender-primary);
}

.user-nav .list-group-item-action:hover,
.user-nav .list-group-item-action:focus-visible {
    color: var(--gender-primary);
    background: var(--gender-soft);
}

.user-nav .list-group-item-action.active {
    color: #fff;
    background: linear-gradient(135deg, var(--gender-primary), var(--gender-secondary));
    border-color: transparent;
}

.member-card {
    height: 100%;
}

.member-card-link {
    color: inherit;
    text-decoration: none;
}

.member-card-link:hover,
.member-card-link:focus-visible {
    color: var(--gender-primary);
}

.member-card .avatar,
.favorite-card .avatar {
    border: 3px solid #fff;
    box-shadow: 0 6px 16px rgba(23, 32, 51, .14);
}

.payment-provider-actions {
    grid-template-columns: 1fr;
}

.search-filters-modal .modal-body {
    background: #f8fafc;
}

.search-filters-modal .modal-footer {
    background: #fff;
}

.profile-info-row {
    transition: background .16s ease;
}

.profile-info-row:focus-within {
    background: var(--gender-soft);
}
.profile-options-row {
    align-items: start;
}

.profile-option-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    padding-block: .15rem;
}

.profile-option {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 38px;
    padding: .35rem .7rem;
    border: 1px solid #d8e0eb;
    border-radius: 8px;
    background: #fbfcfe;
    color: #253044;
    font-weight: 700;
    cursor: pointer;
}

.profile-option input {
    margin: 0;
    accent-color: var(--gender-primary);
}

.profile-info-row .form-select {
    max-width: 360px;
}

@media (min-width: 768px) {
    .payment-provider-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    html {
        font-size: 15px;
    }

    body {
        font-size: .95rem;
        line-height: 1.55;
    }

    body.is-authenticated {
        padding-bottom: 0;
    }

    main.py-4 {
        padding-top: 1rem !important;
        padding-bottom: 0 !important;
    }

    main > .container {
        padding-inline: 14px;
    }

    body.is-authenticated main > .container {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    body.is-authenticated .col-lg-9 {
        padding-bottom: calc(18px + env(safe-area-inset-bottom));
    }

    .row.g-4 {
        --bs-gutter-y: 1rem;
    }

    .page-title-header {
        position: sticky;
        top: 0;
        z-index: 1030;
        border-bottom-width: 0;
        box-shadow: 0 10px 24px rgba(23, 32, 51, .18);
    }

    .page-title-header-inner {
        min-height: 54px;
        padding-block: .5rem;
    }

    .page-title-header h1 {
        padding-inline: 66px;
        font-size: 1.12rem;
        line-height: 1.2;
    }

    .page-title-save,
    .page-title-edit {
        min-width: 50px;
        min-height: 25px;
        padding-inline: .55rem;
        font-size: .78rem;
    }

    .page-title-search,
    .page-title-close {
        width: 25px;
        height: 25px;
    }

    .page-title-search span {
        width: 17px;
        height: 17px;
        border-width: 2px;
    }

    .page-title-search span::after {
        right: -7px;
        bottom: -4px;
        width: 9px;
        height: 2px;
    }

    .btn {
        min-height: 34px;
        padding: .48rem .78rem;
        font-size: .78rem;
    }

    .btn-sm {
        min-height: 34px;
        padding: .35rem .62rem;
        font-size: .78rem;
    }

    button,
    input[type="button"],
    input[type="submit"],
    input[type="reset"] {
        font-size: .78rem;
    }

    .form-control,
    .form-select {
        min-height: 42px;
        font-size: .92rem;
    }

    .panel {
        padding: .75rem;
        border-radius: 8px;
        box-shadow: 0 6px 16px rgba(23, 32, 51, .06);
    }

    .row.g-3 {
        --bs-gutter-x: .65rem;
        --bs-gutter-y: .55rem;
    }

    .panel .btn:not(.page-title-action) {
        min-height: 32px;
        padding: .32rem .5rem;
        font-size: .72rem;
        line-height: 1.1;
    }

    .col-lg-3:has(.user-nav) {
        position: static;
    }

    .user-nav {
        position: fixed !important;
        inset-inline: 8px;
        bottom: max(7px, env(safe-area-inset-bottom));
        top: auto !important;
        z-index: 1040;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        margin: 0 !important;
        overflow: hidden;
        border: 1px solid rgba(216, 224, 235, .92);
        border-radius: 7px;
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 8px 22px rgba(23, 32, 51, .16);
        backdrop-filter: blur(14px) saturate(1.15);
        -webkit-backdrop-filter: blur(14px) saturate(1.15);
    }

    .user-nav .list-group-item {
        min-height: 46px;
        justify-content: center;
        padding: .25rem .12rem;
        border-width: 0;
        border-radius: 0;
        background: transparent;
        text-align: center;
        font-size: .7rem;
        font-weight: 800;
        line-height: 1.05;
    }

    .user-nav-messages {
        gap: .12rem;
    }

    .user-nav-badge {
        position: absolute;
        top: .22rem;
        inset-inline-end: .42rem;
        min-width: 1rem;
        height: 1rem;
        padding: 0 .22rem;
        font-size: .58rem;
    }

    .user-nav .list-group-item-action {
        color: #445169;
    }

    .user-nav .list-group-item-action:hover,
    .user-nav .list-group-item-action:focus-visible {
        color: var(--gender-primary);
        background: transparent;
    }

    .user-nav .list-group-item-action.active {
        color: var(--gender-primary);
        background: var(--gender-soft);
        box-shadow: inset 0 2px 0 var(--gender-primary);
    }

    .user-nav .list-group-item-action:nth-child(n+5),
    .user-nav .language-switcher {
        display: none;
    }

    .member-card {
        display: grid;
        gap: .42rem;
    }

    .search-results-row .member-card-link {
        min-height: 0;
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr);
        column-gap: .45rem;
        row-gap: 0;
        align-items: center;
        padding: 0;
        line-height: 1.15;
    }

    .search-member-card {
        min-height: 0;
        align-content: space-between;
        padding: .55rem .65rem;
    }

    .search-member-card form {
        margin-top: .4rem !important;
    }

    .search-member-card form .btn {
        width: 100%;
    }

    .search-results-row {
        --bs-gutter-x: .65rem;
        --bs-gutter-y: .55rem;
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
        width: auto;
        margin-inline: calc(-1 * var(--bs-gutter-x) / 2);
        padding-inline: 0;
        padding-bottom: .35rem;
        scroll-snap-type: none;
    }

    .search-results-row > [class*="col-"] {
        flex: 0 0 100%;
        width: 100%;
        max-width: none;
        scroll-snap-align: none;
    }

    .member-card .avatar {
        width: 62px;
        height: 62px;
    }

    .search-results-row .member-card .avatar {
        grid-row: 1;
        grid-column: 1;
        float: none !important;
        width: 60px;
        height: 60px;
        margin: 0 !important;
        justify-self: center;
    }

    .search-results-row .member-card-summary {
        grid-column: 2;
        min-width: 0;
        margin: 0;
    }

    .member-card-summary strong,
    .message-member-summary strong,
    .favorite-card-profile strong {
        font-size: .9rem;
        line-height: 1.08;
    }

    .member-card-summary small,
    .message-member-summary small,
    .favorite-card-profile small,
    .panel .text-muted,
    .small {
        font-size: .76rem;
    }

    .member-card-summary small,
    .message-member-summary small,
    .favorite-card-profile small {
        line-height: 1.05;
    }

    .favorite-card-profile {
        grid-template-columns: 60px minmax(0, 1fr);
        gap: .55rem;
    }

    .favorite-card .avatar {
        width: 60px;
        height: 60px;
    }

    .message-member-card {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .message-member-avatar {
        width: 60px;
        height: 60px;
    }

    .favorite-card {
        gap: .45rem;
        padding: .55rem .65rem;
    }

    .favorite-note-form .form-label {
        margin-bottom: .25rem;
        font-size: .78rem;
    }

    .favorite-note-form textarea.form-control {
        min-height: 48px;
        height: 48px;
        padding: .4rem .55rem;
        font-size: .78rem;
        line-height: 1.2;
        resize: none;
    }

    .favorite-note-form .d-flex {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .4rem !important;
        margin-top: .4rem !important;
    }

    .favorite-note-form .btn {
        min-height: 32px;
        padding: .3rem .25rem;
        font-size: .72rem;
        line-height: 1.1;
        white-space: normal;
    }

    .messages-member-grid {
        gap: .55rem;
    }

    .message-member-card {
        gap: .5rem;
        padding: .6rem;
    }

    .message-member-actions {
        gap: .4rem;
    }

    .message-member-actions .btn,
    .search-member-card form .btn,
    .favorite-note-form .btn {
        min-height: 32px;
        font-size: .72rem;
        font-weight: 700;
    }

    .member-list-card {
        min-height: 0;
        grid-template-columns: 1fr;
        grid-template-rows: 60px 34px;
        gap: .45rem;
        padding: .55rem .65rem;
    }

    .member-list-profile,
    .search-results-row .member-list-profile,
    .message-member-profile,
    .favorite-card-profile {
        min-height: 60px;
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr);
        gap: .5rem;
        align-items: center;
        padding: 0;
    }

    .member-list-avatar,
    .search-results-row .member-card .member-list-avatar,
    .favorite-card .member-list-avatar,
    .message-member-avatar.member-list-avatar {
        width: 60px;
        height: 60px;
        margin: 0 !important;
    }

    .member-list-summary strong,
    .member-card-summary strong,
    .message-member-summary strong,
    .favorite-card-profile strong {
        font-size: .88rem;
        line-height: 1.05;
    }

    .member-list-summary small,
    .member-card-summary small,
    .message-member-summary small,
    .favorite-card-profile small {
        font-size: .72rem;
        line-height: 1.03;
    }

    .member-list-actions,
    .message-member-actions,
    .favorite-note-form {
        min-height: 34px;
        height: 34px;
        gap: .35rem;
    }

    .favorite-note-form {
        grid-template-columns: minmax(0, .85fr) minmax(0, 1fr) minmax(0, 1fr);
    }

    .member-list-actions .btn,
    .favorite-note-form .btn,
    .favorite-note-form textarea.form-control {
        min-height: 34px;
        height: 34px;
        padding: .28rem .35rem;
        font-size: .7rem;
        line-height: 1.05;
    }

    .favorite-note-form textarea.form-control {
        resize: none;
    }

    .search-filters-modal .modal-dialog {
        align-items: end;
        min-height: calc(100% - 1rem);
        margin: .5rem;
    }

    .search-filters-modal .modal-content {
        max-height: calc(100dvh - 1rem);
        overflow: hidden;
    }

    .search-filters-modal .modal-body {
        overflow-y: auto;
    }

    .search-filters-modal .modal-footer {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .5rem;
    }

    .search-filters-modal .modal-title {
        font-size: 1rem;
    }

    .search-filters-modal .form-label {
        font-size: .82rem;
        font-weight: 700;
    }

    .panel h1 {
        font-size: 1.35rem;
    }

    .panel h2,
    .panel .h4 {
        font-size: 1.08rem;
    }

    .panel h3,
    .panel .h5,
    .panel .h6 {
        font-size: .98rem;
    }

    .public-profile-media {
        align-items: flex-start;
    }

    .public-profile-main-photo {
        width: 96px;
        height: 96px;
    }

    .public-profile-thumbnail {
        width: 58px;
        height: 58px;
    }

    .message-bubble {
        max-width: 86%;
    }

    .messages-thread {
        max-height: 58vh;
    }

    .dashboard-logout {
        margin-bottom: .5rem;
    }
}

/* Mobile experience refinements */
@media (max-width: 991px) {
    img,
    video,
    canvas,
    iframe {
        max-width: 100%;
    }

    .navbar .container,
    .page-title-header-inner,
    main > .container {
        max-width: 100%;
    }

    .navbar-brand {
        max-width: min(68vw, 420px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .navbar-collapse {
        padding-block: .75rem;
    }

    .navbar .d-flex {
        align-items: stretch !important;
    }

    .navbar .dropdown,
    .navbar .btn,
    .navbar .dropdown-toggle {
        width: 100%;
    }

    .table-responsive {
        margin-inline: -.75rem;
        padding-inline: .75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .table-responsive > .table {
        min-width: 720px;
        margin-bottom: .25rem;
    }

    .table th,
    .table td {
        vertical-align: middle;
        white-space: nowrap;
    }

    .table td {
        overflow-wrap: anywhere;
    }

    .table td:nth-child(4),
    .table td:nth-child(5) {
        white-space: normal;
    }

    .admin-map-heading {
        display: grid;
        gap: .75rem;
        align-items: start;
    }

    .admin-map-status {
        justify-self: start;
        max-width: 100%;
    }

    .admin-members-map {
        min-height: 360px;
        height: min(64dvh, 560px);
    }
}

@media (max-width: 767px) {
    .hero {
        min-height: auto;
        margin: -1rem -14px 1rem;
        padding: 3rem 1rem 3.25rem;
        border-radius: 0;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.12;
    }

    .hero .lead {
        font-size: 1rem;
    }

    .registration-progress {
        gap: .25rem;
        margin-bottom: 1.25rem;
    }

    .registration-progress-step {
        font-size: .72rem;
    }

    .registration-progress-step span {
        width: 30px;
        height: 30px;
    }

    .registration-wizard {
        padding: 1rem;
    }

    .public-profile-media {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: .75rem;
    }

    .public-profile-gallery {
        align-self: center;
        padding-bottom: .35rem;
    }

    .profile-photo-matrix {
        gap: .75rem;
    }

    .profile-editor-body {
        padding: 1rem .75rem 0;
    }

    .profile-info-row {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: .65rem;
    }

    .profile-info-row span:first-child {
        font-size: .78rem;
    }

    .profile-info-row .form-select,
    .profile-info-row .form-control-plaintext {
        max-width: 100%;
        min-width: 0;
    }

    .profile-option-grid {
        gap: .4rem;
    }

    .profile-option {
        min-height: 34px;
        padding: .25rem .5rem;
        font-size: .76rem;
    }

    .user-nav {
        grid-template-columns: none;
        grid-auto-flow: column;
        grid-auto-columns: minmax(72px, 1fr);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .user-nav::-webkit-scrollbar {
        display: none;
    }

    .user-nav .list-group-item {
        scroll-snap-align: center;
        white-space: nowrap;
    }

    .user-nav .list-group-item-action:nth-child(n+5),
    .user-nav .language-switcher {
        display: flex;
    }

    .messages-member-grid {
        grid-template-columns: 1fr;
    }

    .message-member-actions,
    .member-list-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .message-member-actions .btn,
    .member-list-actions .btn {
        width: 100%;
        white-space: normal;
    }

    .favorite-note-form {
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-columns: 1fr;
    }

    .favorite-note-form textarea.form-control {
        height: 42px;
        min-height: 42px;
    }

    .messages-conversation-modal .modal-dialog {
        margin: 0;
        max-width: none;
        min-height: 100dvh;
    }

    .messages-conversation-modal .modal-content {
        min-height: 100dvh;
        border-radius: 0;
    }

    .messages-conversation-modal .modal-body {
        display: grid;
        grid-template-rows: minmax(0, 1fr) auto;
        gap: .65rem;
    }

    .messages-conversation-modal .messages-thread {
        max-height: none;
        height: auto;
    }

    .message-compose-editor {
        gap: .45rem;
    }

    .message-compose-tools {
        flex-wrap: wrap;
        gap: .4rem;
    }

    .message-attachment-picker {
        min-width: 0;
        flex: 1 1 150px;
    }

    .message-compose-send {
        flex: 0 0 auto;
    }

    .modal-dialog {
        margin: .5rem;
    }

    .modal-content {
        border-radius: 8px;
    }

    .modal-body {
        max-height: calc(100dvh - 7rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .search-filters-modal .modal-body,
    .messages-conversation-modal .modal-body {
        max-height: none;
    }

    .admin-members-map {
        min-height: 300px;
        height: 58dvh;
        margin-inline: -.25rem;
    }

    .admin-map-heading h2,
    .admin-map-heading p {
        margin-bottom: .15rem;
    }
}

@media (max-width: 420px) {
    .page-title-header h1 {
        padding-inline: 54px;
        font-size: 1rem;
    }

    .panel {
        padding: .65rem;
    }

    .profile-info-row {
        grid-template-columns: 1fr;
        gap: .3rem;
        min-height: 0;
    }

    .profile-info-row span:first-child {
        color: #667386;
    }

    .public-profile-media {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .public-profile-main-photo {
        width: 82px;
        height: 82px;
    }

    .public-profile-thumbnail {
        width: 52px;
        height: 52px;
    }

    .member-list-profile,
    .search-results-row .member-list-profile,
    .message-member-profile,
    .favorite-card-profile {
        grid-template-columns: 54px minmax(0, 1fr);
        min-height: 54px;
    }

    .member-list-avatar,
    .search-results-row .member-card .member-list-avatar,
    .favorite-card .member-list-avatar,
    .message-member-avatar.member-list-avatar {
        width: 54px;
        height: 54px;
    }
}

/* Fix mobile photo upload grid overflow */
@media (max-width: 767px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .profile-editor,
    .profile-editor-body,
    .profile-photo-matrix {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .profile-photo-matrix {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: clamp(.45rem, 2.4vw, .75rem);
        justify-items: center;
        align-items: start;
        margin-inline: 0;
        padding-inline: 0;
    }

    .profile-photo-slot {
        width: clamp(74px, 25vw, 108px);
        max-width: 100%;
        min-width: 0;
    }

    .profile-photo-slot.filled img {
        border-radius: 16px;
    }

    .profile-upload-icon {
        width: 78%;
        height: 78%;
        border-radius: 18px;
        box-shadow:
            inset 6px 6px 12px rgba(255, 255, 255, .92),
            inset -8px -9px 16px var(--photo-icon-glow),
            0 8px 18px rgba(23, 32, 51, .1);
    }

    .profile-upload-icon::before {
        border-width: 1px;
        box-shadow:
            inset -5px -6px 10px var(--photo-icon-shadow),
            0 5px 9px var(--photo-icon-shadow);
    }

    .profile-upload-icon::after {
        box-shadow:
            inset -5px -6px 10px var(--photo-icon-shadow),
            0 6px 10px var(--photo-icon-shadow);
    }

    .profile-upload-plus {
        width: clamp(26px, 8vw, 34px);
        height: clamp(26px, 8vw, 34px);
        border-width: 2px;
        font-size: clamp(1.15rem, 5vw, 1.5rem);
        right: -4px;
        top: -4px;
    }

    .profile-photo-slot .photo-status,
    .profile-photo-slot .photo-main {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .64rem;
    }
}

@media (max-width: 380px) {
    .profile-photo-matrix {
        gap: .4rem;
    }

    .profile-photo-slot {
        width: clamp(68px, 24vw, 92px);
    }
}

/* Photo cropper */
.photo-cropper-open {
    overflow: hidden;
}

.photo-cropper-modal[hidden] {
    display: none;
}

.photo-cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    background: rgba(10, 16, 28, .72);
}

.photo-cropper-dialog {
    width: min(100%, 520px);
    max-height: calc(100dvh - 2rem);
    display: grid;
    gap: .85rem;
    padding: 1rem;
    overflow-y: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

.photo-cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.photo-cropper-close {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #eef2f7;
    color: #172033;
    font-size: 2rem;
    line-height: 1;
}

.photo-cropper-stage {
    position: relative;
    width: min(100%, 440px);
    aspect-ratio: 1;
    margin-inline: auto;
    overflow: hidden;
    border-radius: 8px;
    background: #eef3f8;
    touch-action: none;
}

.photo-cropper-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
    touch-action: none;
}

.photo-cropper-canvas:active {
    cursor: grabbing;
}

.photo-cropper-frame {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 255, 255, .95);
    box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .08);
    pointer-events: none;
}

.photo-cropper-hint {
    margin: 0;
    color: #667386;
    font-size: .9rem;
    text-align: center;
}

.photo-cropper-zoom {
    display: grid;
    gap: .35rem;
    color: #344156;
    font-weight: 700;
}

.photo-cropper-zoom input {
    width: 100%;
    accent-color: var(--gender-primary);
}

.photo-cropper-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

@media (max-width: 767px) {
    .photo-cropper-modal {
        align-items: end;
        padding: .5rem;
    }

    .photo-cropper-dialog {
        width: 100%;
        max-height: calc(100dvh - 1rem);
        padding: .85rem;
    }

    .photo-cropper-stage {
        width: min(100%, 78dvw, 420px);
    }
}

.new-message-indicator.has-count::before {
    display: none;
}

.new-message-indicator.has-count .new-message-count {
    position: static;
    width: auto;
    height: auto;
    min-width: 1ch;
    border: 0;
    color: inherit;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1;
    transform: none;
}/* Mobile usability pass */
@media (max-width: 991px) {
    html {
        scroll-padding-top: 72px;
    }

    body {
        -webkit-text-size-adjust: 100%;
        overflow-x: hidden;
    }

    .navbar {
        box-shadow: 0 8px 22px rgba(23, 32, 51, .08);
    }

    .navbar .container {
        padding-inline: 14px;
    }

    .navbar-toggler {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        padding: 0;
        border-radius: 8px;
    }

    .navbar-collapse {
        max-height: calc(100dvh - 68px);
        overflow-y: auto;
    }

    .navbar-nav {
        gap: .25rem;
        padding-block: .65rem;
    }

    .navbar .nav-link,
    .navbar .dropdown-item {
        min-height: 42px;
        display: flex;
        align-items: center;
        border-radius: 8px;
    }

    .navbar .d-flex.align-items-center {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: .5rem !important;
        width: 100%;
        padding-bottom: .75rem;
    }

    .navbar .dropdown,
    .navbar .btn,
    .navbar .dropdown-toggle {
        width: 100%;
    }

    .page-title-header-inner {
        min-height: 72px;
        padding-block: .7rem;
    }

    .page-title-header h1 {
        padding-inline: 58px;
        font-size: clamp(1.05rem, 5vw, 1.35rem);
        line-height: 1.18;
    }

    .page-title-save,
    .page-title-edit {
        min-width: 54px;
        min-height: 38px;
        font-size: .76rem;
    }

    .page-title-close,
    .page-title-search {
        width: 42px;
        height: 42px;
    }

    main.py-4 {
        padding-top: 1rem !important;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important;
    }

    main > .container,
    footer > .container {
        padding-inline: 14px;
    }

    .alert {
        margin-bottom: .75rem;
        padding: .65rem .75rem;
        border-radius: 8px;
        font-size: .9rem;
    }

    .table-responsive {
        border: 1px solid #e5e9f0;
        border-radius: 8px;
        background: #fff;
    }
}

@media (max-width: 767px) {
    .hero {
        min-height: min(560px, calc(100dvh - 64px));
        display: flex;
        align-items: flex-end;
        margin: -1rem -14px 1rem;
        padding: 4.5rem 1rem 1.25rem;
        border-radius: 0;
        background-position: center;
    }

    .hero .inner {
        width: 100%;
        max-width: none;
    }

    .hero h1 {
        max-width: 12ch;
        margin-bottom: .75rem;
        font-size: clamp(2rem, 11vw, 3rem);
        line-height: 1.04;
    }

    .hero .lead {
        max-width: 34rem;
        margin-bottom: 1rem;
        font-size: .98rem;
        line-height: 1.45;
    }

    .hero .btn {
        flex: 1 1 150px;
        min-height: 46px;
        padding-inline: .8rem;
        font-size: .92rem;
    }

    .panel {
        padding: .85rem;
        border-radius: 8px;
    }

    .panel + .panel,
    .remembered-accounts-panel + .panel {
        margin-top: .75rem !important;
    }

    .panel h1 {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .panel h2,
    .panel .h4,
    .panel .h5 {
        font-size: 1.05rem;
        line-height: 1.25;
    }

    .form-control,
    .form-select,
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .row.g-4 {
        --bs-gutter-x: .75rem;
        --bs-gutter-y: .75rem;
    }

    .remembered-accounts-panel {
        gap: .75rem;
    }

    .remembered-accounts-heading p {
        font-size: .84rem;
        line-height: 1.35;
    }

    .remembered-accounts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .55rem;
    }

    .remembered-account-link {
        min-height: 138px;
        padding: .7rem .45rem;
    }

    .remembered-account-avatar {
        width: 58px;
        height: 58px;
    }

    .remembered-account-name {
        font-size: .86rem;
    }

    .remembered-account-card small,
    .remembered-account-card strong,
    .remembered-account-forget .btn {
        font-size: .7rem;
    }

    .member-card,
    .message-member-card,
    .favorite-card,
    .search-member-card {
        border-radius: 8px;
    }

    .member-list-card {
        grid-template-rows: auto auto;
        height: auto;
    }

    .message-member-actions,
    .member-list-actions {
        min-height: 38px;
        height: auto;
    }

    .message-state-button .message-button-state {
        font-size: .62rem;
    }

    .new-message-indicator {
        top: .45rem;
        inset-inline-end: .45rem;
        width: 1.45rem;
        height: 1.45rem;
    }

    .new-message-indicator.has-count .new-message-count {
        font-size: .68rem;
    }

    .messages-thread {
        padding: .65rem;
    }

    .message-bubble {
        max-width: 90%;
        padding: .65rem .75rem;
    }

    .message-compose-editor textarea {
        min-height: 74px;
    }

    .message-compose-tools {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        align-items: stretch;
    }

    .message-emoji-trigger,
    .message-attachment-picker,
    .message-compose-send {
        min-height: 42px;
    }

    .message-attachment-picker strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .modal-dialog {
        margin: .5rem;
    }

    .modal-content {
        border-radius: 8px;
    }

    footer .container {
        display: grid !important;
        justify-content: stretch !important;
        text-align: center;
    }
}

@media (max-width: 420px) {
    main > .container,
    footer > .container,
    .navbar .container {
        padding-inline: 10px;
    }

    .hero {
        margin-inline: -10px;
        padding-inline: .8rem;
    }

    .hero h1 {
        max-width: 11ch;
        font-size: clamp(1.85rem, 12vw, 2.55rem);
    }

    .hero .d-flex {
        display: grid !important;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .remembered-accounts-grid {
        grid-template-columns: 1fr;
    }

    .remembered-account-link {
        min-height: 96px;
        grid-template-columns: 54px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        place-items: center start;
        text-align: start;
    }

    .remembered-account-avatar {
        grid-row: 1 / 4;
        width: 54px;
        height: 54px;
    }

    .page-title-header h1 {
        padding-inline: 48px;
        font-size: .98rem;
    }

    .page-title-save,
    .page-title-edit {
        min-width: 46px;
        padding-inline: .35rem;
    }
}
.messages-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.messages-unread-total {
    min-width: 2rem;
    height: 2rem;
    display: inline-grid;
    place-items: center;
    padding: 0 .55rem;
    border-radius: 999px;
    background: #ef476f;
    color: #fff;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239, 71, 111, .22);
}
.message-member-sent-count {
    display: inline-flex !important;
    align-items: center;
    gap: .25rem;
    width: fit-content;
    margin-top: .18rem !important;
    padding: .16rem .45rem;
    border-radius: 999px;
    background: var(--gender-soft);
    color: var(--gender-primary) !important;
    font-weight: 800;
}

.message-member-sent-count strong {
    color: inherit;
    font-size: .82rem;
    line-height: 1;
}

@media (max-width: 575px) {
    .message-member-sent-count {
        padding: .12rem .38rem;
        font-size: .68rem !important;
    }
}
/* Small-screen layout and touch refinements */
@media (max-width: 991px) {
    .page-title-header { padding-top: env(safe-area-inset-top); }
    .user-nav {
        margin-inline: -14px;
        padding-inline: 0 14px;
        scroll-padding-inline: 14px;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
    .user-nav .list-group-item {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
    .user-nav .list-group-item.active { box-shadow: 0 5px 14px rgba(38, 84, 124, .2); }
}

@media (max-width: 767px) {
    body { min-width: 320px; }
    main > .container { max-width: 100%; }
    .row.g-3, .row.g-4 { --bs-gutter-x: .75rem; }
    .table-responsive {
        margin-inline: -.85rem;
        border-inline: 0;
        border-radius: 0;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .table-responsive > .table { min-width: 620px; margin-bottom: 0; }
    .table > :not(caption) > * > * { padding: .65rem .55rem; vertical-align: middle; }
    input, select, textarea { max-width: 100%; font-size: 16px !important; }
    input[type="file"] { min-height: 48px; padding: .45rem; }
    input[type="file"]::file-selector-button { min-height: 36px; }
    .btn:not(.page-title-action), button:not(.page-title-action) { touch-action: manipulation; }
    .public-profile-details dt { margin-bottom: .15rem; color: #667386; }
    .public-profile-details dd { margin-bottom: .85rem; overflow-wrap: anywhere; }
    footer { padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important; }
}

@media (max-width: 420px) {
    .user-nav { margin-inline: -10px; padding-inline: 0 10px; scroll-padding-inline: 10px; }
    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) .page-title-header-inner {
        min-height: 86px;
        align-items: end;
    }
    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) h1 {
        padding-inline: 8px;
        padding-top: 42px;
    }
    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) .page-title-action {
        top: 8px;
        transform: none;
    }
}
/* Keep collapsed navbar dropdowns inside the mobile viewport */
@media (max-width: 991px) {
    .navbar-collapse .dropdown-menu {
        position: static !important;
        inset: auto !important;
        width: 100%;
        min-width: 0;
        margin: .35rem 0 .6rem;
        padding: .35rem;
        transform: none !important;
        border-color: #e1e6ed;
        box-shadow: none;
    }

    .navbar-collapse .dropdown-item {
        width: 100%;
        min-height: 44px;
        padding-inline: .85rem;
        white-space: normal;
    }

    .navbar-collapse .dropdown-menu-end {
        right: auto;
        left: auto;
    }
}
/* Fixed mobile account navigation with protected content space */
@media (max-width: 767px) {
    body:has(.user-nav) {
        padding-bottom: 68px;
    }

    .user-nav {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1030;
        width: 100%;
        min-height: 62px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        grid-auto-flow: row;
        grid-auto-columns: auto;
        gap: 0;
        margin: 0;
        padding: 6px;
        overflow: visible;
        border: 0;
        border-top: 1px solid #dce3ec;
        border-radius: 0;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 -8px 24px rgba(23, 32, 51, .12);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .user-nav .list-group-item {
        min-width: 0;
        min-height: 50px;
        padding: .35rem .2rem;
        justify-content: center;
        gap: .25rem;
        overflow: hidden;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #667386;
        font-size: clamp(.62rem, 2.7vw, .78rem);
        font-weight: 700;
        line-height: 1.15;
        text-align: center;
        text-overflow: ellipsis;
        white-space: normal;
    }

    .user-nav .list-group-item.active {
        background: var(--gender-soft);
        color: var(--gender-primary);
        box-shadow: none;
    }

    .user-nav-badge {
        flex: 0 0 auto;
        min-width: 1.25rem;
        height: 1.25rem;
        padding-inline: .3rem;
        font-size: .65rem;
    }
}
/* Compact mobile headers */
@media (max-width: 767px) {
    .navbar { --bs-navbar-padding-y: .3rem; }
    .navbar-brand { padding-block: .2rem; font-size: 1.05rem; }
    .navbar-toggler { width: 38px; height: 38px; }

    .page-title-header-inner {
        min-height: 58px;
        padding-block: .4rem;
    }

    .page-title-header h1 {
        font-size: clamp(.95rem, 4.5vw, 1.2rem);
    }

    .page-title-save,
    .page-title-edit { min-height: 36px; }

    .page-title-close,
    .page-title-search {
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 420px) {
    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) .page-title-header-inner {
        min-height: 76px;
    }

    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) h1 {
        padding-top: 34px;
    }

    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) .page-title-action {
        top: 5px;
    }
}
/* Extra-compact mobile header spacing */
@media (max-width: 767px) {
    .navbar { --bs-navbar-padding-y: .12rem; }
    .navbar-brand {
        padding-block: .08rem;
        font-size: .95rem;
        line-height: 1.1;
    }
    .navbar-toggler { width: 36px; height: 36px; }

    .page-title-header-inner {
        min-height: 50px;
        padding-block: .2rem;
    }

    .page-title-header h1 {
        font-size: clamp(.9rem, 4.2vw, 1.1rem);
    }

    .page-title-save,
    .page-title-edit { min-height: 34px; }

    .page-title-close,
    .page-title-search {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 420px) {
    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) .page-title-header-inner {
        min-height: 68px;
    }

    .page-title-header:has(.page-title-save, .page-title-edit):has(.page-title-close, .page-title-search) h1 {
        padding-top: 30px;
    }
}