/* Step105 — robust mobile layout with enlarged system fonts + compact slider dots. */

/* Dating pages must never widen the viewport when Android/WebView font scaling is >100%. */
.dating-page,
.dating-page *,
.dating-booksy,
.dating-booksy * {
    box-sizing: border-box;
    min-width: 0;
}

.dating-page,
.dating-booksy {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.dating-booksy input,
.dating-booksy select,
.dating-booksy button,
.dating-booksy a,
.dating-booksy span,
.dating-booksy p,
.dating-booksy h1,
.dating-booksy h2,
.dating-booksy h3 {
    overflow-wrap: anywhere;
}

.db-top,
.db-search,
.db-actions,
.db-tools,
.db-sort,
.db-filter-panel,
.db-age,
.db-heading,
.db-grid,
.db-card,
.db-card-body,
.db-vip,
.db-vip-features {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.db-search input,
.db-filter-panel input,
.db-filter-panel select,
.db-filter-panel button,
.db-sort select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.db-tools {
    flex-wrap: wrap;
    align-items: stretch;
}
.db-tools > * {
    min-width: 0;
    max-width: 100%;
}
.db-sort {
    flex: 1 1 220px;
}
.db-filter-toggle {
    flex: 0 1 auto;
}

/* Horizontal rails scroll inside themselves, never the whole document. */
.db-categories,
.db-quick,
.db-rail {
    max-width: 100%;
    min-width: 0;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

.db-categories a,
.db-quick a,
.db-card.compact {
    max-width: calc(100vw - 36px);
}

/* Booksy-like slider pagination: small centered dots over the image. */
.dating-slider__bars {
    position: absolute;
    left: 50%;
    right: auto;
    top: auto;
    bottom: 13px;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    max-width: calc(100% - 110px);
    padding: 4px 7px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: rgba(17, 24, 39, .42);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: none;
}

.dating-slider__bars i {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255,255,255,.55);
    box-shadow: 0 0 0 1px rgba(0,0,0,.05);
    transition: transform .18s ease, background .18s ease;
}
.dating-slider__bars i.is-active {
    background: #fff;
    transform: scale(1.18);
}

/* The dots are enough on mobile; remove the bulky numeric badge. */
@media (max-width: 760px) {
    .dating-slider__counter { display: none !important; }

    .dating-booksy {
        padding-left: 10px;
        padding-right: 10px;
    }

    .db-top {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
        max-width: none;
    }

    /* One column is deliberately used when controls are open. It survives 130–200% font scaling. */
    .db-filter-panel.open {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 10px;
    }
    .db-filter-panel.open > *,
    .db-filter-panel.open .db-age {
        grid-column: 1 / -1 !important;
        width: 100%;
        max-width: 100%;
    }
    .db-age {
        display: grid;
        grid-template-columns: minmax(0,1fr) minmax(0,1fr);
        gap: 8px;
    }
    .db-age input { width: 100% !important; }

    .db-tools {
        gap: 8px;
    }
    .db-filter-toggle {
        flex: 0 1 auto;
        white-space: normal;
    }
    .db-sort {
        flex: 1 1 180px;
    }
    .db-tools button,
    .db-sort select {
        min-height: 46px;
        padding: 10px 12px;
        font-size: clamp(14px, 4vw, 16px);
        line-height: 1.15;
        white-space: normal;
    }

    .db-search {
        padding-left: 12px;
        padding-right: 12px;
    }
    .db-search span { flex: 0 0 auto; }
    .db-search input {
        font-size: clamp(16px, 4.5vw, 18px);
        padding-left: 8px;
        padding-right: 4px;
    }

    .db-heading {
        gap: 10px;
        align-items: flex-end;
    }
    .db-heading > * { min-width: 0; }
    .db-heading h1,
    .db-heading h2 {
        font-size: clamp(24px, 7vw, 30px);
        line-height: 1.08;
    }

    .db-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .db-card h3 {
        font-size: clamp(15px, 4.5vw, 18px);
        line-height: 1.1;
    }

    .dating-slider__bars {
        bottom: 10px;
        gap: 4px;
        padding: 4px 6px;
        max-width: calc(100% - 34px);
    }
    .dating-slider__bars i {
        width: 6px;
        height: 6px;
    }
}

/* Very narrow screens or extreme text scaling: collapse cards to one column. */
@media (max-width: 390px) {
    .db-grid { grid-template-columns: minmax(0, 1fr); }
    .db-card.compact { min-width: min(220px, calc(100vw - 44px)); width: min(220px, calc(100vw - 44px)); }
}
