/* Pixel3DLab social / responsive finish: sticky page footer without a fixed overlay. */
html, body { min-height: 100%; }
body.pxh-home-page:not(.pxh-mini-chat-mode) {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex !important;
    flex-direction: column !important;
}
body.pxh-home-page:not(.pxh-mini-chat-mode) #pxh-main-content {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}
body.pxh-home-page:not(.pxh-mini-chat-mode) #pxh-main-content > #pxh-home {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}
body.pxh-home-page:not(.pxh-mini-chat-mode) #pxh-main-content > #pxh-home > .pxh-footer {
    flex: 0 0 auto !important;
    margin-top: auto !important;
}
body.pxh-inner-page:not(.pxh-mini-chat-mode) {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex !important;
    flex-direction: column !important;
}
body.pxh-inner-page:not(.pxh-mini-chat-mode) #pxh-main-content {
    display: flex !important;
    flex: 1 0 auto !important;
    flex-direction: column !important;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
}
body.pxh-inner-page:not(.pxh-mini-chat-mode) #pxh-main-content > .pxh-inner-main {
    flex: 1 0 auto !important;
    min-height: 0 !important;
    box-sizing: border-box !important;
}
body.pxh-inner-page:not(.pxh-mini-chat-mode) #pxh-main-content > .pxh-inner-footer {
    flex: 0 0 auto !important;
    margin-top: auto !important;
}

/* Community directory / friendship controls. */
.pxh-social-locked { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.pxh-social-lock-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--border-color); border-radius: 14px; color: var(--pl-accent,#3ea0ff); background: rgba(62,160,255,.1); }
.pxh-social-lock-icon svg { width: 24px; height: 24px; }
.pxh-upgrade-info { display: flex; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box; padding: 13px 15px; border: 1px solid rgba(62,160,255,.22); border-radius: 12px; background: rgba(62,160,255,.07); color: var(--text-muted); line-height: 1.55; }
.pxh-upgrade-info > svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--pl-accent,#3ea0ff); margin-top: 2px; }
.pxh-community-search { display: grid; gap: 9px; width: 100%; box-sizing: border-box; margin: 0 0 18px; }
.pxh-community-search > label { font-weight: 750; color: var(--text-main); }
.pxh-community-search-row { display: flex; align-items: stretch; gap: 9px; }
.pxh-community-search-row input { flex: 1 1 auto; min-width: 0; }
.pxh-community-search > small { color: var(--text-muted); line-height: 1.5; }
.pxh-community-section { width: 100%; box-sizing: border-box; margin: 0 0 18px; }
.pxh-community-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.pxh-community-section-heading h2 { margin: 5px 0 0; font-size: clamp(18px,2.5vw,23px); }
.pxh-community-count { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; box-sizing: border-box; border-radius: 999px; font-size: 12px; font-weight: 800; color: var(--pl-accent,#3ea0ff); background: rgba(62,160,255,.12); }
.pxh-community-list { display: grid; gap: 9px; }
.pxh-community-member { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 11px; border: 1px solid var(--border-color); border-radius: 12px; background: var(--pl-glass,rgba(255,255,255,.28)); }
.pxh-community-avatar { position: relative; display: grid; place-items: center; flex: 0 0 42px; width: 42px; min-width: 42px; max-width: 42px; height: 42px; min-height: 42px; max-height: 42px; overflow: hidden; box-sizing: border-box; border-radius: 50%; background: rgba(62,160,255,.14); color: var(--pl-accent,#3ea0ff); font-weight: 800; }
.pxh-community-avatar img { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; min-width: 0 !important; max-width: 100% !important; min-height: 0 !important; max-height: 100% !important; object-fit: cover; border-radius: inherit; }
.pxh-community-member-info { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.pxh-community-member-info strong { color: var(--text-main); line-height: 1.35; }
.pxh-community-member-info small { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
.pxh-community-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex: 0 0 auto; flex-wrap: wrap; }
.pxh-community-actions form { margin: 0; }
.pxh-community-actions .pxh-button { min-height: 36px; padding: 8px 10px; white-space: normal; }
.pxh-community-state { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 999px; background: var(--hover-bg); color: var(--text-muted); font-size: 11px; font-weight: 750; }
.pxh-community-state.is-friend { color: #16824b; background: rgba(22,163,74,.1); }
.pxh-dock-actions [data-pxh-count-friend-requests][hidden] { display: none !important; }

/* Touch-first control-centre sizing for 7-inch tablets and phones. */
@media (max-width: 900px), (pointer: coarse) {
    .pxh-account-dock { right: max(10px,env(safe-area-inset-right)); bottom: max(10px,env(safe-area-inset-bottom)); width: min(440px,calc(100vw - 20px)); }
    .pxh-account-dock-trigger { min-height: 52px; touch-action: manipulation; }
    .pxh-account-dock-links { max-height: min(84dvh,780px); padding-bottom: max(8px,env(safe-area-inset-bottom)); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
    .pxh-mini-chat-controls { gap: 5px; }
    .pxh-mini-chat-controls button { width: 42px; height: 42px; min-width: 42px; min-height: 42px; border-radius: 10px; touch-action: manipulation; }
    .pxh-mini-chat-controls button svg { width: 20px; height: 20px; }
    .pxh-mini-chat-panel.pxh-mini-chat-integrated-panel { height: min(44dvh,380px); min-height: 220px; max-height: none; }
}
@media (max-width: 620px) {
    .pxh-account-dock { right: max(7px,env(safe-area-inset-right)); bottom: max(7px,env(safe-area-inset-bottom)); width: calc(100vw - 14px); max-width: none; }
    .pxh-account-dock-trigger { min-height: 50px; padding: 8px 10px; }
    .pxh-account-dock-links { max-height: calc(100vh - 62px - env(safe-area-inset-top)); max-height: calc(100dvh - 62px - env(safe-area-inset-top)); }
    .pxh-mini-chat-panel.pxh-mini-chat-integrated-panel { height: min(46dvh,400px); min-height: 205px; }
    .pxh-mini-chat-title > small { display: none; }
    .pxh-mini-chat-header { min-height: 48px; box-sizing: border-box; }
    .pxh-mini-chat-controls button { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
    .pxh-mini-chat-panel.is-fullscreen { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; min-height: 0; max-height: 100vh; max-height: 100dvh; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
    .pxh-community-heading { align-items: flex-start; flex-direction: column; }
    .pxh-community-search-row { align-items: stretch; flex-direction: column; }
    .pxh-community-search-row .pxh-button { width: 100%; min-height: 42px; }
    .pxh-community-section { padding: 14px; }
    .pxh-community-member { align-items: flex-start; flex-wrap: wrap; gap: 9px; }
    .pxh-community-avatar { flex-basis: 38px; width: 38px; min-width: 38px; max-width: 38px; height: 38px; min-height: 38px; max-height: 38px; }
    .pxh-community-member-info { flex: 1 1 calc(100% - 52px); }
    .pxh-community-actions { width: 100%; justify-content: flex-start; padding-left: 47px; box-sizing: border-box; }
    .pxh-community-actions form { display: flex; flex: 1 1 auto; }
    .pxh-community-actions .pxh-button { flex: 1 1 auto; min-height: 40px; }
}
@media (max-height: 520px) and (orientation: landscape) {
    .pxh-account-dock-links { max-height: 88dvh; }
    .pxh-mini-chat-panel.pxh-mini-chat-integrated-panel { height: min(68dvh,280px); min-height: 170px; }
    .pxh-mini-chat-panel.is-fullscreen { height: 100dvh; max-height: 100dvh; }
}
@media (prefers-reduced-motion: reduce) { .pxh-community-actions .pxh-button { transition: none !important; } }
