/**
 * NikahFinder â€“ Modern design system
 * Hybrid of Ancestry (warmer tones, pill buttons), FamilySearch (clarity, search-first), MyHeritage (cards, hints).
 * Optimized for fast load: minimal selectors, contain, no heavy images in CSS.
 */

/* ---- Design tokens ---- */
:root {
    /* Primary â€“ heritage purple (softer than before) */
    --mat-primary: #ec4899;
    --mat-primary-light: #f472b6;
    --mat-primary-dark: #be185d;
    /* Neutrals â€“ warm grays for readability */
    --mat-text: #1f2937;
    --mat-text-muted: #6b7280;
    --mat-text-light: #9ca3af;
    --mat-bg: #fafafa;
    --mat-bg-card: #ffffff;
    --mat-border: #e5e7eb;
    /* Accents */
    --mat-success: #059669;
    --mat-verified: #0284c7;
    /* Surfaces */
    --mat-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --mat-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --mat-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    /* Layout */
    --mat-radius: 12px;
    --mat-radius-pill: 9999px;
    --mat-max-width: 1200px;
    --mat-gap: 1.5rem;
}

/* ---- Base: muslimancestry pages only ---- */
body.nikahfinder-site {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--mat-text);
    background: var(--mat-bg);
    line-height: 1.48;
    --mat-gap: 0.65rem;
}

/* ---- Site-wide compact rhythm (desktop + mobile) ---- */
body.nikahfinder-site .mat-hero {
    margin: 10px auto 0.5rem !important;
    padding: 0.75rem 1rem !important;
    max-width: min(1200px, calc(100% - 1rem));
    border-radius: 12px;
}

body.nikahfinder-site .mat-hero h1 {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    margin-bottom: 0.2rem;
}

body.nikahfinder-site .mat-hero p {
    font-size: clamp(0.78rem, 1.1vw, 0.88rem);
    margin-bottom: 0.45rem;
}

body.nikahfinder-site .mat-section {
    padding: 0.75rem 1rem !important;
}

body.nikahfinder-site .mat-section + .mat-section {
    padding-top: 0.35rem !important;
}

body.nikahfinder-site .mat-section-title {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    margin-bottom: 0.2rem;
}

body.nikahfinder-site .mat-section-desc {
    font-size: 0.82rem;
    margin-bottom: 0.55rem;
}

body.nikahfinder-site .mat-quick-card,
body.nikahfinder-site .mat-feature-card,
body.nikahfinder-site .mat-card {
    padding: 0.75rem !important;
}

body.nikahfinder-site .mat-quick-icon {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

body.nikahfinder-site .mat-quick-card h3,
body.nikahfinder-site .mat-feature-card h3,
body.nikahfinder-site .mat-card h3 {
    font-size: 0.88rem;
}

body.nikahfinder-site .mat-quick-card p,
body.nikahfinder-site .mat-feature-card p,
body.nikahfinder-site .mat-card p {
    font-size: 0.78rem;
}

body.nikahfinder-site .mat-feature-icon {
    width: 38px;
    height: 38px;
    font-size: 1rem;
    margin-bottom: 0.45rem;
}

body.nikahfinder-site .mat-step-num {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

body.nikahfinder-site .mat-step h3 {
    font-size: 0.88rem;
}

body.nikahfinder-site .mat-step p {
    font-size: 0.78rem;
}

body.nikahfinder-site .mat-cta {
    padding: 0.85rem 1rem !important;
    margin: 0.5rem auto 0.5rem !important;
}

body.nikahfinder-site .mat-cta h2 {
    font-size: 1.05rem;
}

body.nikahfinder-site .mat-cta p {
    font-size: 0.82rem;
    margin-bottom: 0.5rem;
}

body.nikahfinder-site .mat-btn {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

body.nikahfinder-site .mat-cta-box {
    padding: 0.65rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.35rem !important;
}

body.nikahfinder-site .main-layout-wrapper {
    padding: 0.5rem 0.75rem 0 !important;
    margin-bottom: 0 !important;
}

body.nikahfinder-site .content-area,
body.nikahfinder-site main,
body.nikahfinder-site .main-content {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

body.nikahfinder-site .nikahfinder-hero {
    padding: 0.75rem 1rem !important;
    margin-top: 10px !important;
    margin-bottom: 0.45rem !important;
}

body.nikahfinder-site .nikahfinder-hero h1 {
    font-size: 1.15rem !important;
}

body.nikahfinder-site .nikahfinder-hero p {
    font-size: 0.82rem !important;
}

body.nikahfinder-site .ancestor-section {
    padding: 0.6rem 1rem !important;
}

body.nikahfinder-site .ancestor-section + .ancestor-section {
    padding-top: 0.15rem !important;
}

body.nikahfinder-site .section-title {
    font-size: 1rem !important;
}

body.nikahfinder-site .ancestor-row-wrapper {
    margin-bottom: 0.45rem !important;
}

body.nikahfinder-site .nikahfinder-compact-sections {
    margin: 0.45rem auto !important;
    gap: 0.45rem !important;
    padding: 0 1rem !important;
}

body.nikahfinder-site .nikahfinder-cta {
    margin: 0.45rem 1rem !important;
    padding: 0.75rem !important;
}

body.nikahfinder-site .pagination {
    margin: 0.45rem 0 !important;
}

body.nikahfinder-site .inline-filter-panel.active {
    margin-bottom: 0.45rem !important;
}

body.nikahfinder-site #footer-wrapper {
    margin-top: 0.35rem !important;
}

body.nikahfinder-site div:has(> .gtrado-section) {
    margin: 0.35rem auto !important;
    padding: 0 0.75rem !important;
}

body.nikahfinder-site .gtrado-section {
    margin: 0.35rem 0 !important;
    padding: 0.65rem !important;
}

/* Footer drawers: readable contrast on white panel */
body.nikahfinder-site #filing-cabinet-footer .footer-drawer-panel {
    display: none;
    width: 100% !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border-top: 2px solid #f9a8d4 !important;
    box-shadow: 0 -4px 16px rgba(190, 24, 93, 0.12) !important;
    padding: 0.65rem 0.85rem !important;
    box-sizing: border-box !important;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e2e8f0;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-header h3 {
    margin: 0 !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #be185d !important;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-header h3 i {
    color: #db2777 !important;
    font-size: 0.85rem !important;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-close {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    color: #475569 !important;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem !important;
    padding: 0 !important;
    flex-shrink: 0;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-close:hover {
    background: #e2e8f0 !important;
    color: #be185d !important;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.45rem 0.65rem;
}

body.nikahfinder-site #filing-cabinet-footer .footer-group h4 {
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    text-transform: uppercase;
    margin: 0 0 0.25rem !important;
    padding-left: 0.4rem;
    border-left: 2px solid #db2777;
    letter-spacing: 0.03em;
}

body.nikahfinder-site #filing-cabinet-footer .footer-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.nikahfinder-site #filing-cabinet-footer .footer-group li {
    margin-bottom: 0.15rem;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-link {
    display: block;
    color: #334155 !important;
    text-decoration: none !important;
    font-size: 0.74rem !important;
    line-height: 1.3;
    padding: 0.1rem 0;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-link:hover {
    color: #be185d !important;
    font-weight: 600;
}

body.nikahfinder-site #filing-cabinet-footer .footer-drawer-index-list {
    columns: 4 150px;
    column-gap: 0.75rem;
}

body.nikahfinder-site #filing-cabinet-footer .footer-az-letter {
    break-inside: avoid;
    margin: 0.35rem 0 0.15rem;
    padding-bottom: 0.15rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    color: #be185d !important;
    font-size: 0.82rem !important;
}

body.nikahfinder-site #filing-cabinet-footer .footer-az-link {
    break-inside: avoid;
    margin-bottom: 0.12rem;
}

/* ---- Hero (search-first, FamilySearch-style) ---- */
.mat-hero {
    margin-top: 96px !important;
    margin-top: 96px !important;
    margin-top: 96px !important;
    background: linear-gradient(135deg, var(--mat-primary) 0%, var(--mat-primary-dark) 100%);
    color: #fff;
    padding: clamp(0.7rem, 1.9vw, 1.1rem) 0.85rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    contain: layout style paint;
    margin: 96px auto 0 !important;
    max-width: min(1200px, calc(100% - 1.5rem));
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(190, 24, 93, 0.2);
}
.mat-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='rgba(255,255,255,0.06)' d='M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,101.3C1248,85,1344,75,1392,69.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E") no-repeat bottom;
    background-size: 100% auto;
    opacity: 0.8;
    pointer-events: none;
}
.mat-hero h1 {
    font-size: clamp(1.05rem, 2.15vw, 1.45rem);
    font-weight: 700;
    margin: 0 0 0.2rem;
    position: relative;
    z-index: 1;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.mat-hero p {
    font-size: clamp(0.78rem, 1.25vw, 0.9rem);
    margin: 0 0 0.55rem;
    opacity: 0.92;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 1;
    line-height: 1.35;
}
.mat-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* ---- Pill buttons (Ancestry-style) ---- */
.mat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--mat-radius-pill);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}
.mat-btn:focus-visible {
    outline: 2px solid var(--mat-primary-light);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .mat-btn { transition: none; }
}
.mat-btn-primary {
    background: #fff;
    color: var(--mat-primary-dark);
}
.mat-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--mat-shadow-lg);
}
.mat-btn-secondary {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}
.mat-btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}
.mat-btn-neutral {
    background: #4b5563;
    color: #fff;
}
.mat-btn-neutral:hover {
    background: #374151;
    color: #fff;
}

/* ---- Stats strip ---- */
.mat-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(0.5rem, 1.2vw, 0.85rem);
    margin-top: 0.35rem;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    padding: 0.35rem 0.5rem;
    backdrop-filter: blur(4px);
}
.mat-stat {
    text-align: center;
    min-width: 72px;
}
.mat-stat-num {
    display: block;
    font-size: clamp(0.86rem, 1.35vw, 1.02rem);
    font-weight: 800;
    line-height: 1.2;
}
.mat-stat-label {
    font-size: 0.64rem;
    opacity: 0.88;
    letter-spacing: 0.01em;
}

/* ---- Sections ---- */
.mat-section {
    max-width: var(--mat-max-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 5vw, 4rem) 1.25rem;
    contain: layout style;
}
.mat-section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--mat-text);
    margin: 0 0 0.5rem;
    text-align: center;
}
.mat-section-desc {
    text-align: center;
    color: var(--mat-text-muted);
    font-size: 1rem;
    max-width: 38rem;
    margin: 0 auto 2rem;
}

/* ---- Quick action cards (Ancestry/MyHeritage style) ---- */
.mat-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--mat-gap);
}
.mat-quick-card {
    background: var(--mat-bg-card);
    border-radius: var(--mat-radius);
    padding: 1.5rem;
    box-shadow: var(--mat-shadow);
    border: 1px solid var(--mat-border);
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    contain: layout style paint;
}
.mat-quick-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--mat-shadow-lg);
}
@media (prefers-reduced-motion: reduce) {
    .mat-quick-card:hover { transform: none; }
}
.mat-quick-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--mat-radius);
    background: linear-gradient(135deg, var(--mat-primary-light), var(--mat-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.mat-quick-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
    color: var(--mat-text);
}
.mat-quick-card p {
    font-size: 0.875rem;
    color: var(--mat-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---- Feature grid (landing) ---- */
.mat-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--mat-gap);
}
.mat-feature-card {
    background: var(--mat-bg-card);
    border-radius: var(--mat-radius);
    padding: 1.75rem;
    box-shadow: var(--mat-shadow-sm);
    border: 1px solid var(--mat-border);
    text-align: center;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.mat-feature-card:hover {
    box-shadow: var(--mat-shadow);
    border-color: var(--mat-primary-light);
}
.mat-feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mat-primary-light), var(--mat-primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.mat-feature-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--mat-text);
}
.mat-feature-card p {
    font-size: 0.875rem;
    color: var(--mat-text-muted);
    margin: 0;
    line-height: 1.55;
}

/* ---- Steps (How it works) ---- */
.mat-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--mat-gap);
}
.mat-step {
    text-align: center;
}
.mat-step-num {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mat-primary-light), var(--mat-primary));
    color: #fff;
    font-weight: 700;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mat-step h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.375rem;
    color: var(--mat-text);
}
.mat-step p {
    font-size: 0.875rem;
    color: var(--mat-text-muted);
    margin: 0;
}

/* ---- Search strip (browse page) ---- */
.mat-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.mat-search-form .mat-search-input {
    min-width: 180px;
}
.mat-pill {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--mat-radius-pill);
    background: #fff;
    color: var(--mat-text);
    border: 1px solid var(--mat-border);
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mat-pill:hover {
    background: var(--mat-bg);
    border-color: var(--mat-primary-light);
    color: var(--mat-primary-dark);
}
.mat-pill.active {
    background: var(--mat-primary);
    border-color: var(--mat-primary);
    color: #fff;
}

/* ---- CTA block ---- */
.mat-cta {
    background: linear-gradient(135deg, var(--mat-primary) 0%, var(--mat-primary-dark) 100%);
    color: #fff;
    padding: clamp(2rem, 4vw, 3rem) 1.25rem;
    text-align: center;
    border-radius: var(--mat-radius);
    margin: 0 1.25rem 2rem;
    max-width: var(--mat-max-width);
    margin-left: auto;
    margin-right: auto;
}
.mat-cta h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    margin: 0 0 0.5rem;
}
.mat-cta p {
    margin: 0 0 1.5rem;
    opacity: 0.95;
    font-size: 1rem;
}
.mat-cta .mat-hero-actions {
    margin-top: 0;
}

/* ---- Testimonials ---- */
.mat-testimonials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--mat-gap);
}
.mat-testimonial {
    background: var(--mat-bg-card);
    padding: 1.5rem;
    border-radius: var(--mat-radius);
    box-shadow: var(--mat-shadow-sm);
    border: 1px solid var(--mat-border);
}
.mat-testimonial p {
    font-style: italic;
    color: var(--mat-text-muted);
    margin: 0 0 1rem;
    font-size: 0.9375rem;
}
.mat-testimonial-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.mat-testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mat-primary-light), var(--mat-primary));
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mat-testimonial strong { display: block; font-size: 0.9375rem; }
.mat-testimonial small { color: var(--mat-text-light); font-size: 0.8125rem; }

/* ---- Comparison table (clean) ---- */
.mat-table-wrap {
    overflow-x: auto;
    border-radius: var(--mat-radius);
    box-shadow: var(--mat-shadow);
    border: 1px solid var(--mat-border);
}
.mat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.mat-table th,
.mat-table td {
    padding: 0.875rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--mat-border);
}
.mat-table th {
    background: var(--mat-text);
    color: #fff;
    font-weight: 600;
}
.mat-table td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--mat-text);
}
.mat-table tr:last-child td { border-bottom: none; }
.mat-table .mat-check { color: var(--mat-success); }
.mat-table .mat-cross { color: #dc2626; }

/* ---- Skeleton (perceived performance) ---- */
.mat-skeleton {
    background: linear-gradient(90deg, var(--mat-border) 25%, #f3f4f6 50%, var(--mat-border) 75%);
    background-size: 200% 100%;
    animation: geno-skeleton 1.2s ease-in-out infinite;
    border-radius: 4px;
}
@keyframes geno-skeleton {
    to { background-position: 200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .mat-skeleton { animation: none; background: var(--mat-border); }
}

/* ---- Utility ---- */
.mat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--mat-radius-pill);
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.mat-badge-success {
    background: var(--mat-success);
    color: #fff;
}
.mat-badge-neutral {
    background: var(--mat-border);
    color: var(--mat-muted);
}

/* ---- Content list (Archives page) ---- */
.mat-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}
.mat-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--mat-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
}
.mat-list li:last-child { border-bottom: none; }
.mat-list i {
    color: var(--mat-primary);
    width: 1.5rem;
    text-align: center;
}

/* ---- CTA box (inline call-to-action) ---- */
.mat-cta-box {
    background: #f0f4ff;
    border-radius: var(--mat-radius);
    padding: 1.75rem;
    text-align: center;
    margin-top: 2.5rem;
}
.mat-cta-box h2 { font-size: 1.25rem; margin: 0 0 0.5rem; }
.mat-cta-box p { margin: 0 0 1.25rem; color: var(--mat-text-muted); font-size: 0.9375rem; }
.mat-cta-box .mat-btn { margin: 0 0.25rem; }
.mat-cta-box .mat-btn + .mat-btn { margin-left: 0.5rem; }

/* ---- Content cards (sub-pages) ---- */
.mat-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--mat-gap);
    margin-top: 1.5rem;
}
.mat-card {
    background: var(--mat-bg-card);
    border-radius: var(--mat-radius);
    padding: 1.5rem;
    box-shadow: var(--mat-shadow);
    border: 1px solid var(--mat-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--mat-shadow-lg);
}
.mat-card h3 { font-size: 1.125rem; margin: 0 0 0.5rem; color: var(--mat-text); }
.mat-card p { font-size: 0.9375rem; color: var(--mat-text-muted); margin: 0 0 1rem; line-height: 1.5; }
.mat-card .mat-btn { margin-top: 0.5rem; }
.mat-card-accent {
    border-left: 4px solid var(--mat-primary);
}

/* Social strip: tight centered row */
body.nikahfinder-site .layer-social {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 8px 0 !important;
    box-sizing: border-box !important;
}

body.nikahfinder-site .layer-social > div {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 10px !important;
}

body.nikahfinder-site .layer-social .social-bubble {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    position: relative;
    z-index: 2;
}

body.nikahfinder-site .mat-social-connect-page {
    padding: 1rem 1.25rem 1.5rem;
    max-width: 520px;
    margin: 0 auto;
}

body.nikahfinder-site .mat-social-connect-card {
    text-align: center;
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

body.nikahfinder-site .mat-social-connect-icon {
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    font-size: 1.4rem !important;
    margin: 0 auto 0.85rem;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    touch-action: manipulation;
}

body.nikahfinder-site .mat-social-connect-icon i {
    font-size: 1.25rem !important;
    -webkit-text-fill-color: currentColor !important;
}

body.nikahfinder-site .mat-social-connect-lead {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
}

body.nikahfinder-site .mat-social-connect-open,
body.nikahfinder-site .mat-social-connect-back {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0.5rem auto 0;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
    box-sizing: border-box;
}

body.nikahfinder-site .mat-social-connect-open {
    background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
    color: #fff !important;
}

body.nikahfinder-site .mat-social-connect-back {
    background: #f1f5f9;
    color: #334155 !important;
}

/* Footer cabinet tabs: one row, readable contrast */
body.nikahfinder-site .footer-cabinet-strap {
    justify-content: center !important;
    align-items: stretch !important;
    height: auto !important;
    min-height: 38px !important;
    padding: 0 !important;
}

body.nikahfinder-site .footer-cabinet-strap-spacer {
    display: none !important;
}

body.nikahfinder-site .footer-cabinet-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 4px !important;
    padding: 4px 6px 0 !important;
    height: auto !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 34px !important;
    margin: 0 !important;
    padding: 6px 8px !important;
    border-radius: 8px 8px 0 0 !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-sizing: border-box !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab i {
    margin-right: 4px !important;
    font-size: 0.72rem !important;
    color: inherit !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab-drawer {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab-drawer:hover {
    background: #f8fafc !important;
    color: #be185d !important;
    border-color: #f9a8d4 !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab-drawer.is-active {
    background: #ffffff !important;
    color: #be185d !important;
    border-color: #f472b6 !important;
    font-weight: 700 !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab-donate {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #b91c1c !important;
}

body.nikahfinder-site #filing-cabinet-footer .cabinet-tab-donate:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
    border-color: #991b1b !important;
}

/* ---- Mobile: shrink-to-fit (muslimancestry landing & sub-pages) ---- */
@media (max-width: 980px) {
    body.nikahfinder-site {
        line-height: 1.45;
    }

    body.nikahfinder-site .mat-hero {
        margin-top: 8px !important;
        margin-bottom: 0.35rem !important;
        padding: 0.55rem 0.65rem !important;
        border-radius: 10px;
        max-width: calc(100% - 0.75rem);
    }

    body.nikahfinder-site .mat-hero h1 {
        font-size: 1rem;
        margin-bottom: 0.15rem;
    }

    body.nikahfinder-site .mat-hero p {
        font-size: 0.76rem;
        margin-bottom: 0.4rem;
    }

    body.nikahfinder-site .mat-stats {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.2rem;
        padding: 0.25rem 0.3rem;
        margin-top: 0.2rem;
    }

    body.nikahfinder-site .mat-stat {
        min-width: 0;
    }

    body.nikahfinder-site .mat-stat-num {
        font-size: 0.8rem;
    }

    body.nikahfinder-site .mat-stat-label {
        font-size: 0.58rem;
    }

    body.nikahfinder-site .mat-section {
        padding: 0.4rem 0.6rem !important;
    }

    body.nikahfinder-site .mat-section + .mat-section {
        padding-top: 0.15rem !important;
    }

    body.nikahfinder-site .mat-section-title {
        font-size: 1.02rem;
        margin-bottom: 0.15rem;
        line-height: 1.25;
    }

    body.nikahfinder-site .mat-section-desc {
        font-size: 0.78rem;
        margin-bottom: 0.35rem;
        line-height: 1.35;
    }

    body.nikahfinder-site .mat-quick-grid,
    body.nikahfinder-site .mat-features,
    body.nikahfinder-site .mat-steps,
    body.nikahfinder-site .mat-testimonials {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    body.nikahfinder-site .mat-quick-card,
    body.nikahfinder-site .mat-feature-card,
    body.nikahfinder-site .mat-testimonial {
        padding: 0.6rem;
    }

    body.nikahfinder-site .mat-quick-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
        border-radius: 8px;
    }

    body.nikahfinder-site .mat-feature-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }

    body.nikahfinder-site .mat-quick-card h3,
    body.nikahfinder-site .mat-feature-card h3,
    body.nikahfinder-site .mat-step h3 {
        font-size: 0.8rem;
        margin-bottom: 0.2rem;
        line-height: 1.25;
    }

    body.nikahfinder-site .mat-quick-card p,
    body.nikahfinder-site .mat-feature-card p,
    body.nikahfinder-site .mat-step p {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    body.nikahfinder-site .mat-step-num {
        width: 1.55rem;
        height: 1.55rem;
        font-size: 0.75rem;
        margin-bottom: 0.3rem;
    }

    body.nikahfinder-site .mat-cta {
        padding: 0.65rem 0.6rem;
        margin: 0.35rem 0.6rem 0.35rem;
        border-radius: 10px;
    }

    body.nikahfinder-site .mat-cta h2 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    body.nikahfinder-site .mat-cta p {
        font-size: 0.78rem;
        margin-bottom: 0.55rem;
        line-height: 1.35;
    }

    body.nikahfinder-site .mat-cta p[style] {
        margin-top: 0.5rem !important;
        font-size: 0.68rem !important;
    }

    body.nikahfinder-site .mat-btn {
        padding: 0.42rem 0.8rem;
        font-size: 0.76rem;
        gap: 0.35rem;
    }

    body.nikahfinder-site .mat-testimonial p {
        font-size: 0.72rem;
        margin-bottom: 0.45rem;
        line-height: 1.35;
    }

    body.nikahfinder-site .mat-testimonial-footer {
        gap: 0.45rem;
    }

    body.nikahfinder-site .mat-testimonial-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.68rem;
    }

    body.nikahfinder-site .mat-testimonial strong {
        font-size: 0.76rem;
    }

    body.nikahfinder-site .mat-testimonial small {
        font-size: 0.65rem;
    }

    body.nikahfinder-site .mat-table {
        font-size: 0.66rem;
    }

    body.nikahfinder-site .mat-table th,
    body.nikahfinder-site .mat-table td {
        padding: 0.3rem 0.2rem;
    }

    /* Sub-page cards, lists, badges */
    body.nikahfinder-site .mat-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-top: 0.5rem;
    }

    body.nikahfinder-site .mat-card {
        padding: 0.6rem;
        border-radius: 10px;
    }

    body.nikahfinder-site .mat-card h3 {
        font-size: 0.82rem;
    }

    body.nikahfinder-site .mat-card p {
        font-size: 0.72rem;
        margin-bottom: 0.45rem;
    }

    body.nikahfinder-site .mat-cta-box {
        padding: 0.55rem 0.6rem;
        margin-top: 0.35rem;
        margin-bottom: 0.25rem;
        border-radius: 10px;
    }

    body.nikahfinder-site .mat-cta-box h2 {
        font-size: 0.95rem;
    }

    body.nikahfinder-site .mat-cta-box p {
        font-size: 0.74rem;
        margin-bottom: 0.5rem;
    }

    body.nikahfinder-site .mat-list li {
        font-size: 0.74rem;
        padding: 0.35rem 0;
        gap: 0.45rem;
    }

    body.nikahfinder-site .mat-badge {
        font-size: 0.68rem;
        padding: 0.2rem 0.45rem;
    }

    body.nikahfinder-site .mat-hero-actions {
        gap: 0.35rem;
        flex-wrap: wrap;
    }

    /* Browse & legacy muslimancestry heroes */
    body.nikahfinder-site .nikahfinder-hero {
        padding: 0.65rem 0.75rem !important;
        margin-top: 8px !important;
        margin-bottom: 0.35rem !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .nikahfinder-hero h1 {
        font-size: 1rem !important;
        margin-bottom: 0.2rem !important;
    }

    body.nikahfinder-site .nikahfinder-hero p {
        font-size: 0.76rem !important;
        margin-bottom: 0.4rem !important;
    }

    body.nikahfinder-site .hero-meta,
    body.nikahfinder-site .hero-stats {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.25rem !important;
    }

    body.nikahfinder-site .hero-stat .number,
    body.nikahfinder-site .hero-meta strong {
        font-size: 0.85rem !important;
    }

    body.nikahfinder-site .hero-stat .label,
    body.nikahfinder-site .hero-meta span {
        font-size: 0.6rem !important;
    }

    body.nikahfinder-site .stats-bar {
        padding: 0.5rem 0.65rem !important;
        margin-bottom: 0 !important;
    }

    body.nikahfinder-site .stats-container {
        gap: 0.35rem !important;
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    body.nikahfinder-site .stat-box {
        padding: 0.35rem 0.25rem !important;
    }

    body.nikahfinder-site .stat-number {
        font-size: 0.95rem !important;
        margin-bottom: 0.1rem !important;
    }

    body.nikahfinder-site .stat-text {
        font-size: 0.62rem !important;
    }

    body.nikahfinder-site .ancestor-section {
        padding: 0.4rem 0.75rem !important;
    }

    body.nikahfinder-site .ancestor-section + .ancestor-section {
        padding-top: 0.1rem !important;
    }

    body.nikahfinder-site .section-header {
        margin-bottom: 0.3rem !important;
        gap: 0.35rem;
    }

    body.nikahfinder-site .section-title {
        font-size: 0.95rem !important;
        margin-bottom: 0 !important;
    }

    body.nikahfinder-site .view-all-btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.72rem !important;
    }

    body.nikahfinder-site .ancestor-card {
        flex: 0 0 160px !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .ancestor-photo {
        height: 140px !important;
    }

    body.nikahfinder-site .ancestor-info {
        padding: 0.45rem !important;
    }

    body.nikahfinder-site .ancestor-row-wrapper {
        margin-bottom: 0.35rem !important;
    }

    body.nikahfinder-site .nikahfinder-compact-sections {
        padding: 0 0.65rem !important;
        gap: 0.35rem !important;
        margin: 0.35rem auto 0.35rem !important;
    }

    body.nikahfinder-site .compact-section-header {
        margin-bottom: 0.35rem !important;
    }

    body.nikahfinder-site .compact-section {
        padding: 0.6rem !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .compact-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.4rem !important;
    }

    body.nikahfinder-site .nikahfinder-cta {
        margin: 0.35rem 0.65rem 0.35rem !important;
        padding: 0.65rem !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .nikahfinder-cta h3 {
        font-size: 0.95rem !important;
    }

    body.nikahfinder-site .nikahfinder-cta .cta-actions {
        gap: 0.35rem !important;
        flex-wrap: wrap;
    }

    body.nikahfinder-site .step-card {
        padding: 0.6rem !important;
    }

    body.nikahfinder-site .step-card h3 {
        font-size: 0.85rem !important;
    }

    body.nikahfinder-site .step-card p {
        font-size: 0.72rem !important;
    }

    /* Family tree builder */
    body.nikahfinder-site .tree-container {
        padding: 0 0.65rem !important;
    }

    body.nikahfinder-site .tree-header {
        padding: 0.5rem 0.65rem !important;
        margin-bottom: 0.35rem !important;
        border-radius: 10px !important;
        gap: 0.45rem !important;
    }

    body.nikahfinder-site .tree-header h1 {
        font-size: 1rem !important;
    }

    body.nikahfinder-site .tree-actions {
        gap: 0.35rem !important;
    }

    body.nikahfinder-site .tree-actions .btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.72rem !important;
    }

    body.nikahfinder-site .tree-sidebar {
        padding: 0.45rem 0.55rem !important;
        margin-bottom: 0.35rem !important;
    }

    body.nikahfinder-site .person-card {
        width: 130px !important;
    }

    body.nikahfinder-site .tree-viewer {
        padding: 30px 12px !important;
    }

    body.nikahfinder-site .tree-row {
        margin-bottom: 50px !important;
    }

    /* MuslimAncestry tools */
    body.nikahfinder-site .gt-wrap {
        margin: 8px auto 0.75rem !important;
        padding: 0 0.65rem !important;
    }

    body.nikahfinder-site .gt-hero {
        padding: 0.55rem 0.65rem !important;
        margin-bottom: 0.45rem !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .gt-hero h1 {
        font-size: 1rem !important;
    }

    body.nikahfinder-site .gt-hero p {
        font-size: 0.74rem !important;
    }

    body.nikahfinder-site .gt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.45rem !important;
    }

    body.nikahfinder-site .gt-card {
        padding: 0.55rem !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .gt-card h3 {
        font-size: 0.82rem !important;
        margin-bottom: 0.35rem !important;
    }

    body.nikahfinder-site .gt-input {
        padding: 0.35rem 0.5rem !important;
        font-size: 0.78rem !important;
    }

    body.nikahfinder-site .gt-btn {
        padding: 0.35rem 0.55rem !important;
        font-size: 0.74rem !important;
    }

    body.nikahfinder-site .gt-item,
    body.nikahfinder-site .gt-ok,
    body.nikahfinder-site .gt-err {
        font-size: 0.72rem !important;
        padding: 0.35rem !important;
    }

    /* Breadcrumbs & filter tabs */
    body.nikahfinder-site .page-breadcrumbs,
    body.nikahfinder-site .filter-tabs-container {
        padding: 0.35rem 0.65rem !important;
        font-size: 0.72rem !important;
        margin-bottom: 0 !important;
    }

    body.nikahfinder-site .filter-tabs {
        gap: 0.35rem !important;
        flex-wrap: wrap !important;
    }

    body.nikahfinder-site .filter-tab {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.72rem !important;
    }

    /* Main layout shell */
    body.nikahfinder-site .main-layout-wrapper {
        padding: 0.35rem 0.5rem 0 !important;
        margin-bottom: 0 !important;
    }

    body.nikahfinder-site .content-area,
    body.nikahfinder-site main,
    body.nikahfinder-site .main-content {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    body.nikahfinder-site .card-grid-4,
    body.nikahfinder-site .global-pagination-strip {
        margin-bottom: 0.35rem !important;
    }

    body.nikahfinder-site .pagination {
        margin: 0.35rem 0 0.35rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    body.nikahfinder-site .inline-filter-panel.active {
        margin-bottom: 0.35rem !important;
        padding: 0.5rem !important;
    }

    body.nikahfinder-site #footer-wrapper {
        margin-top: 0.25rem !important;
    }

    body.nikahfinder-site .layer-social {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 4px 0 !important;
        text-align: center !important;
    }

    body.nikahfinder-site .layer-social > div {
        display: inline-flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        width: auto !important;
        max-width: calc(100% - 8px) !important;
        margin: 0 auto !important;
        padding: 0 4px !important;
    }

    body.nikahfinder-site .layer-social .social-bubble {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        min-height: 24px !important;
        font-size: 0.62rem !important;
        line-height: 1 !important;
        border-radius: 50% !important;
    }

    body.nikahfinder-site .layer-social .social-bubble i {
        display: inline-block !important;
        font-size: 0.7rem !important;
        line-height: 1 !important;
        color: inherit !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body.nikahfinder-site .mat-social-connect-page {
        padding: 0.35rem 0.65rem 1rem;
        max-width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }

    body.nikahfinder-site .content-area .mat-social-connect-page .mat-page-header h1 {
        font-size: 1rem !important;
    }

    body.nikahfinder-site .content-area .mat-social-connect-page .mat-page-subtitle {
        font-size: 0.72rem !important;
    }

    body.nikahfinder-site .mat-social-connect-card {
        text-align: center;
        padding: 1.25rem 1rem;
        border-radius: 12px;
        background: #fff;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    }

    body.nikahfinder-site .mat-social-connect-icon {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
        font-size: 1.35rem !important;
        margin: 0 auto 0.75rem;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        touch-action: manipulation;
    }

    body.nikahfinder-site .mat-social-connect-icon i {
        font-size: 1.2rem !important;
        -webkit-text-fill-color: currentColor !important;
    }

    body.nikahfinder-site .mat-social-connect-lead {
        margin: 0 0 1rem;
        font-size: 0.9rem;
        color: #475569;
        line-height: 1.45;
    }

    body.nikahfinder-site .mat-social-connect-open,
    body.nikahfinder-site .mat-social-connect-back {
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto 0;
        padding: 0.65rem 1rem;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.9rem;
        text-align: center;
        text-decoration: none;
        touch-action: manipulation;
        box-sizing: border-box;
    }

    body.nikahfinder-site .mat-social-connect-open {
        background: linear-gradient(135deg, #f472b6 0%, #db2777 100%);
        color: #fff !important;
    }

    body.nikahfinder-site .mat-social-connect-back {
        background: #f1f5f9;
        color: #334155 !important;
    }

    body.nikahfinder-site #glrcf_assist_beacon.glrcf-assist-beacon {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 2147483647 !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .cabinet-tab {
        min-height: 32px !important;
        padding: 5px 4px !important;
        font-size: 0.68rem !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .cabinet-tab i {
        margin-right: 3px !important;
        font-size: 0.65rem !important;
    }

    body.nikahfinder-site .footer-cabinet-tabs {
        gap: 3px !important;
        padding: 3px 4px 0 !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-drawer-panel {
        padding: 0.5rem 0.55rem !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-drawer-header h3 {
        font-size: 0.82rem !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-drawer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem 0.45rem;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-drawer-index-list {
        columns: 2 120px;
        column-gap: 0.5rem;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-group h4 {
        font-size: 0.62rem !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-drawer-link {
        font-size: 0.68rem !important;
    }

    body.nikahfinder-site #filing-cabinet-footer .footer-az-letter {
        font-size: 0.75rem !important;
        margin-top: 0.25rem;
    }

    body.nikahfinder-site #redBannerWrapper {
        margin-top: 6px !important;
        margin-bottom: 6px !important;
    }

    /* Gallery */
    body.nikahfinder-site .gallery-header {
        padding: 0.5rem 0.65rem !important;
    }

    body.nikahfinder-site .gallery-title {
        font-size: 1rem !important;
    }

    body.nikahfinder-site .section-topic {
        font-size: 0.82rem !important;
        padding: 0 0.65rem !important;
        gap: 0.35rem !important;
    }

    body.nikahfinder-site .prime-grid {
        gap: 0.35rem !important;
        padding: 0 0.5rem !important;
    }

    body.nikahfinder-site .media-card {
        min-height: 120px !important;
        border-radius: 10px;
    }

    body.nikahfinder-site .carousel-viewport {
        padding: 0.35rem 0 0.75rem 0 !important;
    }

    body.nikahfinder-site div:has(> .gtrado-section) {
        padding-left: 8px !important;
        padding-right: 8px !important;
        margin-top: 0.25rem !important;
        margin-bottom: 0.25rem !important;
    }

    body.nikahfinder-site .gtrado-section {
        margin: 0.35rem 0 !important;
        padding: 10px !important;
        border-radius: 10px !important;
    }

    body.nikahfinder-site .gtrado-section > div:first-child {
        margin-bottom: 8px !important;
        gap: 6px;
    }

    body.nikahfinder-site .gtrado-section h2 {
        font-size: 0.95rem !important;
        gap: 6px !important;
    }

    body.nikahfinder-site .gtrado-section p {
        font-size: 0.68rem !important;
        margin-top: 2px !important;
    }

    body.nikahfinder-site .gtrado-section a {
        font-size: 0.68rem !important;
    }

    body.nikahfinder-site .trove-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    body.nikahfinder-site .trove-card {
        padding: 7px !important;
    }

    body.nikahfinder-site .trove-card > div:first-child {
        height: 64px !important;
        margin-bottom: 5px !important;
        font-size: 1.35rem !important;
    }

    body.nikahfinder-site .trove-card h3 {
        font-size: 0.7rem !important;
        line-height: 1.25 !important;
    }

    body.nikahfinder-site .trove-card span {
        font-size: 8px !important;
    }
}

@media (max-width: 480px) {
    body.nikahfinder-site .mat-quick-grid,
    body.nikahfinder-site .mat-features,
    body.nikahfinder-site .mat-card-grid,
    body.nikahfinder-site .gt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.nikahfinder-site .mat-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.nikahfinder-site .mat-testimonials {
        grid-template-columns: 1fr;
    }

    body.nikahfinder-site .hero-meta,
    body.nikahfinder-site .hero-stats,
    body.nikahfinder-site .stats-container {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.nikahfinder-site .ancestor-card {
        flex: 0 0 140px !important;
    }

    body.nikahfinder-site .ancestor-photo {
        height: 120px !important;
    }

    body.nikahfinder-site .layer-social > div {
        gap: 1px !important;
        padding: 0 2px !important;
    }

}

/* --- Page content headers (navigator section titles) --- */
body.nikahfinder-site .mat-page-header {
    margin: 0 0 0.4rem !important;
    padding: 0 !important;
}

body.nikahfinder-site .mat-page-header h1,
body.nikahfinder-site .mat-page-header h2 {
    color: #be185d !important;
    font-weight: 700 !important;
    font-size: clamp(0.95rem, 2.5vw, 1.15rem) !important;
    margin: 0 0 0.12rem !important;
    line-height: 1.25 !important;
}

body.nikahfinder-site .mat-page-header p,
body.nikahfinder-site .mat-page-header .mat-page-subtitle {
    color: #475569 !important;
    font-size: 0.78rem !important;
    margin: 0 !important;
    line-height: 1.35 !important;
}

body.nikahfinder-site .content-area .mt-2,
body.nikahfinder-site .content-area .mt-4,
body.nikahfinder-site .content-area .container.mt-4 {
    margin-top: 0.35rem !important;
    margin-bottom: 0.45rem !important;
}

body.nikahfinder-site .content-area .mb-3,
body.nikahfinder-site .content-area .mb-4,
body.nikahfinder-site .content-area .mb-5 {
    margin-bottom: 0.45rem !important;
}

body.nikahfinder-site .content-area .text-muted {
    color: #475569 !important;
}

body.nikahfinder-site .mat-page-header-row {
    margin-bottom: 0.35rem !important;
}

@media (min-width: 981px) {
    body.nikahfinder-site .content-area .mat-page-header-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 0 0.25rem 0.35rem !important;
    }

    body.nikahfinder-site .content-area .mat-page-header {
        text-align: left !important;
    }
}

@media (max-width: 980px) {
    body.nikahfinder-site .content-area .mat-page-header-row {
        display: flex !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 0.35rem !important;
        flex-wrap: nowrap !important;
    }

    body.nikahfinder-site .content-area .mat-page-header-row .mat-page-header {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    body.nikahfinder-site .content-area .mat-page-header-row .btn,
    body.nikahfinder-site .content-area .mat-page-header-row a.btn {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 0.2rem 0.45rem !important;
        font-size: 0.65rem !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        border-radius: 6px !important;
        align-self: flex-start !important;
        margin-bottom: 0 !important;
        display: inline-flex !important;
        justify-content: center !important;
    }

    body.nikahfinder-site .content-area .mat-page-header-row .btn i,
    body.nikahfinder-site .content-area .mat-page-header-row a.btn i {
        font-size: 0.6rem !important;
        margin-right: 0.2rem !important;
    }

    body.nikahfinder-site .profile-view-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 6px auto 12px !important;
        padding: 0 6px 8px !important;
        box-sizing: border-box !important;
    }

    body.nikahfinder-site .profile-header {
        padding: 12px 10px !important;
        border-radius: 10px 10px 0 0 !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        align-items: flex-start !important;
    }

    body.nikahfinder-site .profile-header h1 {
        font-size: 1.05rem !important;
        line-height: 1.2 !important;
    }

    body.nikahfinder-site .profile-header p {
        font-size: 0.72rem !important;
        margin-top: 4px !important;
    }

    body.nikahfinder-site .profile-badges {
        flex-wrap: wrap !important;
        gap: 4px !important;
    }

    body.nikahfinder-site .profile-badges .badge {
        padding: 3px 7px !important;
        font-size: 9px !important;
    }

    body.nikahfinder-site .profile-content {
        display: grid !important;
        grid-template-columns: minmax(96px, 34%) 1fr !important;
        gap: 8px !important;
        margin-top: -16px !important;
    }

    body.nikahfinder-site .profile-sidebar {
        position: static !important;
        top: auto !important;
        min-width: 0 !important;
    }

    body.nikahfinder-site .profile-photo-main {
        margin-bottom: 8px !important;
        border-radius: 8px !important;
    }

    body.nikahfinder-site .profile-photos-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 4px !important;
        margin-bottom: 8px !important;
    }

    body.nikahfinder-site .profile-actions {
        padding: 8px !important;
        border-radius: 8px !important;
    }

    body.nikahfinder-site .action-btn {
        padding: 6px 8px !important;
        font-size: 10px !important;
        margin-bottom: 6px !important;
        gap: 4px !important;
    }

    body.nikahfinder-site .profile-stats {
        padding: 8px 4px !important;
        margin-top: 8px !important;
    }

    body.nikahfinder-site .stat-item .number {
        font-size: 0.85rem !important;
    }

    body.nikahfinder-site .stat-item .label {
        font-size: 8px !important;
    }

    body.nikahfinder-site .profile-main {
        padding: 12px 10px !important;
        border-radius: 8px !important;
        min-width: 0 !important;
    }

    body.nikahfinder-site .info-section {
        margin-bottom: 14px !important;
    }

    body.nikahfinder-site .info-section h2 {
        font-size: 0.82rem !important;
        margin-bottom: 8px !important;
        gap: 4px !important;
    }

    body.nikahfinder-site .info-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    body.nikahfinder-site .info-label {
        font-size: 8px !important;
    }

    body.nikahfinder-site .info-value {
        font-size: 10px !important;
        line-height: 1.25 !important;
    }

    body.nikahfinder-site .about-text {
        font-size: 10px !important;
        line-height: 1.45 !important;
        padding: 8px !important;
    }

    body.nikahfinder-site .partner-preferences {
        padding: 10px !important;
        margin-top: 12px !important;
        border-radius: 8px !important;
    }

    body.nikahfinder-site .mat-profile-escape-nav {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.35rem !important;
        margin: 0 0 0.35rem !important;
        padding: 0 2px !important;
    }

    body.nikahfinder-site .mat-profile-escape-btn {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.25rem !important;
        padding: 0.2rem 0.5rem !important;
        font-size: 0.68rem !important;
        line-height: 1.2 !important;
        font-weight: 600 !important;
        color: #be185d !important;
        background: #fff !important;
        border: 1px solid rgba(219, 39, 119, 0.35) !important;
        border-radius: 6px !important;
        text-decoration: none !important;
        cursor: pointer !important;
        width: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
    }

    body.nikahfinder-site .mat-profile-escape-btn i {
        font-size: 0.62rem !important;
    }
}

@media (min-width: 981px) {
    body.nikahfinder-site .mat-profile-escape-nav {
        display: none !important;
    }
}
