/* Flirtable Home: page-scoped styling. No changes to global profile cards. */
.flirtable-home {
    --home-ink: var(--bs-body-color, #24383e);
    --home-muted: #647981;
    --home-border: #d7e4e5;
    --home-soft: #f3f8f8;
    width: 100%;
    max-width: 900px;
    min-width: 0;
    margin: 0 auto;
    padding: clamp(14px, 2.5vw, 24px);
    color: var(--home-ink);
    background: var(--bs-body-bg, #fff);
}
.flirtable-home *, .flirtable-home *::before, .flirtable-home *::after { box-sizing: border-box; }
.flirtable-home a { color: var(--brand, #008080); }
.flirtable-home .home-page-heading, .flirtable-home .home-section-heading {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.flirtable-home .home-page-heading { margin: 2px 0 22px; justify-content: flex-start; }
.flirtable-home .home-heading-icon {
    width: 46px; height: 46px; flex: 0 0 46px;
    display: grid; place-items: center; border-radius: 14px;
    color: var(--brand, #008080); background: rgba(var(--rgb, 0,128,128), .11);
    font-size: 20px;
}
.flirtable-home h1, .flirtable-home h2, .flirtable-home p { margin-top: 0; }
.flirtable-home .home-page-heading h1 { margin: 0 0 3px; font-size: clamp(22px, 2.5vw, 28px); font-weight: 750; line-height: 1.2; }
.flirtable-home .home-page-heading p { color: var(--home-muted); margin: 0; font-size: 14px; line-height: 1.5; }
.flirtable-home .home-kicker { color: var(--brand, #008080); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.flirtable-home .home-section-heading h2 { margin: 3px 0 0; font-size: clamp(17px, 2vw, 21px); font-weight: 750; }
.flirtable-home .home-text-link { font-size: 12px; text-decoration: none; font-weight: 700; white-space: nowrap; }
.flirtable-home .home-text-link:hover { text-decoration: underline; }
.flirtable-home .home-text-link i { margin-left: 4px; }

.flirtable-home .home-discover-section {
    border: 1px solid var(--home-border); border-radius: 17px;
    padding: clamp(12px, 2vw, 18px); background: var(--home-soft);
    margin-bottom: 22px; overflow: hidden;
}
.flirtable-home .home-discover-section > .home-section-heading { margin-bottom: 12px; }
.flirtable-home #carouselContainer {
    width: 100%; min-height: 120px; padding: 3px 2px 10px;
    display: flex; gap: 12px; overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x proximity; scroll-padding-left: 4px;
    box-shadow: none; border: 0; border-radius: 0;
    -webkit-overflow-scrolling: touch;
}
.flirtable-home #carouselContainer .carcard {
    flex: 0 0 clamp(155px, 23%, 186px); border-radius: 13px;
    border: 1px solid var(--home-border); box-shadow: 0 2px 7px rgba(20,55,60,.07);
    overflow: hidden; background: var(--bs-body-bg, #fff);
}
.flirtable-home #carouselContainer .carcard:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(20,55,60,.13); }
.flirtable-home #carouselContainer .car-avatar { aspect-ratio: 1/1; }
.flirtable-home #carouselContainer .carcontainer { padding: 10px; }
.flirtable-home .home-carousel-loading {
    width: 100%; min-height: 125px; display: flex; align-items: center; justify-content: center;
    gap: 10px; color: var(--home-muted); font-size: 13px;
}
.flirtable-home .home-spinner {
    width: 18px; height: 18px; border: 2px solid var(--home-border);
    border-top-color: var(--brand, #008080); border-radius: 50%; animation: homeSpin .7s linear infinite;
}
@keyframes homeSpin { to { transform: rotate(360deg); } }
.flirtable-home .home-discover-footer {
    margin-top: 4px; height: auto; min-height: 45px; box-shadow: none;
    border-top: 1px solid var(--home-border); padding-top: 10px;
}
.flirtable-home .home-discover-footer .avatar-row { width: 100%; display: flex; gap: 8px; overflow: hidden; }
.flirtable-home #avatarsContainer { flex: 1; min-width: 0; gap: 5px; padding: 3px; }
.flirtable-home #avatarsContainer .avatar img { width: 35px; height: 35px; object-fit: cover; border-radius: 50%; border: 2px solid white; }
.flirtable-home #carRefreshButton.home-icon-button {
    margin: 0 !important; height: 38px; width: 38px; min-width: 38px; padding: 0 !important;
    display: grid; place-items: center; color: var(--brand, #008080) !important;
    background: var(--bs-body-bg, #fff) !important;
    border: 1px solid var(--home-border); border-radius: 11px;
}

.flirtable-home .home-main-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(205px, 240px); gap: 16px; align-items: start; }
.flirtable-home .home-feed-section.updates {
    width: 100%; min-width: 0; margin: 0;
    border: 1px solid var(--home-border); border-radius: 17px;
    padding: clamp(12px, 2vw, 17px); box-shadow: none;
    background: var(--bs-body-bg, #fff); overflow: visible !important;
}
.flirtable-home .home-feed-heading { margin-bottom: 13px; }
.flirtable-home #reload.home-refresh-button {
    margin: 0 !important; padding: 9px 12px !important;
    border-radius: 10px !important; font-weight: 700;
    font-size: 12px; line-height: 1.1; white-space: nowrap;
}
.flirtable-home .home-feed-tools { display: flex; flex-direction: column; gap: 11px; margin-bottom: 15px; }
.flirtable-home .home-sort-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--home-muted); font-size: 12px; font-weight: 600; }
.flirtable-home select[name="sort"] {
    min-width: 0; max-width: min(210px, 68%); width: 100%; border: 1px solid var(--home-border);
    border-radius: 10px; padding: 9px 12px; background: var(--home-soft);
    color: var(--home-ink); font-size: 13px; font-weight: 600;
}
.flirtable-home .home-filter-group { display: flex; gap: 6px; align-items: stretch; padding-bottom: 3px; overflow-x: auto; }
.flirtable-home .home-filter-group .update-buttons {
    min-width: 42px; width: auto; flex: 1 0 42px; height: 38px;
    padding: 8px 10px !important; margin: 0 !important;
    background: var(--home-soft) !important; color: #466167 !important;
    border: 1px solid var(--home-border); border-radius: 10px !important;
    font-size: 13px; font-weight: 750; display: inline-flex; justify-content: center; align-items: center;
}
.flirtable-home .home-filter-group .updateactive {
    background: var(--brand, #008080) !important; color: #fff !important;
    border-color: var(--brand, #008080) !important;
}
.flirtable-home .home-filter-group .update-buttons:focus-visible,
.flirtable-home a:focus-visible, .flirtable-home button:focus-visible { outline: 3px solid rgba(var(--rgb,0,128,128),.35); outline-offset: 2px; }
/* Activity cards: consistent identity header, clear content, contextual action. */
.flirtable-home #updatebox { display: flex; flex-direction: column; gap: 14px; }
.flirtable-home #updatebox .post-item { min-width: 0; }
.flirtable-home #updatebox .feed-post {
    display: block;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--home-border);
    border-left: 1px solid var(--home-border);
    border-radius: 15px;
    background: var(--home-card, var(--bs-body-bg, #fff));
    color: var(--home-ink);
    box-shadow: 0 2px 9px rgba(20,55,60,.055);
    transition: border-color .18s, box-shadow .18s;
}
.flirtable-home #updatebox .feed-post:hover {
    transform: none;
    border-color: rgba(var(--rgb, 0,128,128), .34);
    box-shadow: 0 6px 22px rgba(20,55,60,.09);
}
.flirtable-home #updatebox .feed-post-header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 16px 12px;
    min-width: 0;
}
.flirtable-home #updatebox .feed-avatar {
    display: block;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin: 0;
}
.flirtable-home #updatebox .feed-avatar a { display: block; width: 100%; height: 100%; }
.flirtable-home #updatebox .feed-avatar img {
    display: block;
    width: 46px;
    height: 46px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--home-card, var(--bs-body-bg, #fff));
    box-shadow: 0 0 0 1px var(--home-border);
}
.flirtable-home #updatebox .feed-post-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    gap: 2px;
    line-height: 1.3;
}
.flirtable-home #updatebox .feed-username {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--brand, #008080);
    font-size: 15px;
    font-weight: 780;
    line-height: 1.3;
    text-decoration: none;
}
.flirtable-home #updatebox .feed-username:hover { text-decoration: underline; }
.flirtable-home #updatebox .feed-post-action {
    color: var(--home-muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}
.flirtable-home #updatebox .feed-kind {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    max-width: 45%;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(var(--rgb, 0,128,128), .095);
    color: var(--brand, #008080);
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}
.flirtable-home #updatebox .feed-kind i { font-size: 12px; }
.flirtable-home #updatebox .feed-post-content {
    min-width: 0;
    padding: 0 16px 15px;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.58;
}
.flirtable-home #updatebox .feed-post-content :is(p,ul,ol,blockquote) { margin: 0 0 9px; }
.flirtable-home #updatebox .feed-post-content :is(p,ul,ol,blockquote):last-child { margin-bottom: 0; }
.flirtable-home #updatebox .feed-post-content ul,
.flirtable-home #updatebox .feed-post-content ol { padding-left: 20px; }
.flirtable-home #updatebox .feed-entry-label {
    margin-bottom: 8px;
    color: var(--home-muted);
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .015em;
}
.flirtable-home #updatebox .feed-quote {
    min-width: 0;
    padding: 13px 15px;
    border-left: 3px solid var(--brand, #008080);
    border-radius: 0 10px 10px 0;
    background: var(--home-soft);
    white-space: pre-wrap;
}
.flirtable-home #updatebox .feed-entry-title {
    display: inline-block;
    margin: 0 0 8px;
    color: var(--home-ink);
    font-size: clamp(16px, 2vw, 19px);
    font-weight: 750;
    line-height: 1.32;
    text-decoration: none;
}
.flirtable-home #updatebox .feed-entry-title:hover { color: var(--brand, #008080); text-decoration: underline; }
.flirtable-home #updatebox .feed-preview { color: var(--home-ink); white-space: pre-wrap; }
.flirtable-home #updatebox .feed-question-answer {
    display: block;
    padding: 12px 14px;
    margin-bottom: 9px;
    border-radius: 10px;
    background: var(--home-soft);
    color: var(--home-ink);
    font-size: 14px;
    font-weight: 700;
}
.flirtable-home #updatebox .feed-photo {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 95px;
    max-height: 390px;
    overflow: hidden;
    border-radius: 11px;
    background: var(--home-soft);
}
.flirtable-home #updatebox .feed-photo img {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 390px;
    height: auto;
    object-fit: contain;
    border-radius: 0;
}
.flirtable-home #updatebox .feed-caption { margin: 10px 1px 0; color: var(--home-ink); }
.flirtable-home #updatebox .feed-welcome { margin: 0 0 5px; font-size: 17px; font-weight: 750; }
.flirtable-home #updatebox .feed-post-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 42px;
    margin: 0 16px;
    border-top: 1px solid var(--home-border);
}
.flirtable-home #updatebox .feed-post-footer a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 1px;
    color: var(--brand, #008080);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    text-decoration: none;
}
.flirtable-home #updatebox .feed-post-footer a:hover { text-decoration: underline; }
.flirtable-home #updatebox .feed-post-footer i { font-size: 11px; }
.flirtable-home #updatebox .ad-item, .flirtable-home #updatebox .update-post { border-radius: 12px; }
.flirtable-home .home-feed-end .update-post { text-align: center; padding: 20px 6px; color: var(--home-muted); }
.flirtable-home .home-feed-end i { color: var(--brand, #008080); }
.flirtable-home .home-feed-end p { margin: 6px 0 0; }
.flirtable-home .home-suggestions { min-width: 0; }
.flirtable-home #similarusers {
    position: sticky; top: 70px; padding: 12px; margin: 0;
    background: var(--home-soft); border: 1px solid var(--home-border);
    border-radius: 15px; box-shadow: none;
}
.flirtable-home #similarusers .profilecard { padding: 9px; gap: 8px; border-radius: 11px; }
.flirtable-home #similarusers h2 { font-size: 15px; }

:root[data-theme="dark"] .flirtable-home {
    --home-ink: var(--bs-body-color, #e3eeee);
    --home-muted: #a4b8bd;
    --home-border: #3a5053;
    --home-soft: #243437;
    --home-card: #1d2b2e;
}

@media (max-width: 1350px) {
    .flirtable-home .home-main-grid { grid-template-columns: minmax(0,1fr); }
    .flirtable-home .home-suggestions { display: none; }
}
@media (max-width: 600px) {
    .flirtable-home { padding: 12px; }
    .flirtable-home .home-page-heading { margin-bottom: 14px; }
    .flirtable-home .home-discover-section { padding: 11px; margin-bottom: 13px; }
    .flirtable-home #carouselContainer .carcard { flex-basis: 157px; }
    .flirtable-home .home-feed-section.updates { padding: 12px; }
    .flirtable-home .home-section-heading h2 { font-size: 17px; }
    .flirtable-home .home-text-link { font-size: 11px; }
    .flirtable-home #updatebox { gap: 10px; }
    .flirtable-home #updatebox .feed-post-header { gap: 9px; padding: 12px 12px 10px; }
    .flirtable-home #updatebox .feed-avatar,
    .flirtable-home #updatebox .feed-avatar img { width: 42px; height: 42px; }
    .flirtable-home #updatebox .feed-avatar { flex-basis: 42px; }
    .flirtable-home #updatebox .feed-post-content { padding: 0 12px 12px; font-size: 13px; }
    .flirtable-home #updatebox .feed-post-footer { margin: 0 12px; }
    .flirtable-home #updatebox .feed-kind { padding: 6px 7px; font-size: 10px; }
    .flirtable-home #updatebox .feed-kind span { display: none; }
    .flirtable-home #updatebox .feed-kind i { font-size: 14px; }

}
@media (prefers-reduced-motion: reduce) {
    .flirtable-home .home-spinner { animation: none; }
    .flirtable-home .carcard, .flirtable-home .feed-post { transition: none; }
}


/* Home popups use the original .tooltip and .popup-* rules from style.css. */

/* Home-only floating Back to Top: tap scrolls to top and fetches a new feed. */
#homeBackToTop.home-back-to-top {
    position: fixed !important;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(var(--navbar-height, 50px) + var(--safe-bottom, env(safe-area-inset-bottom)) + 16px);
    z-index: 850;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--brand, #008080);
    color: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
    cursor: pointer;
}
#homeBackToTop.home-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
@media (min-width: 1024px) {
    #homeBackToTop.home-back-to-top {
        bottom: max(24px, env(safe-area-inset-bottom));
        right: calc(260px + 20px);
    }
}
