/* V42: fixed-slot home layout, photo wall, and chat polish. */
#homeScreen #homeScreenWidget {
    display: none !important;
}

#homeScreen .bottom-dock {
    display: flex !important;
}

#homeScreen .profile-widget-container {
    display: block !important;
}

#homeScreen .home-screen-page:first-child {
    overflow-y: hidden !important;
}

#home-screen-pager,
#homeScreen .home-screen-page,
#homeScreen .app,
#homeScreen .v42-app-slot-empty,
#desktop-page-2 .v42-photo-item {
    touch-action: pan-x;
}

#homeScreen .home-screen-page:first-child .app-grid .app,
#homeScreen .v42-app-slot-empty {
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: transform 160ms ease, opacity 160ms ease;
}

#home-screen-pager.v42-sort-mode {
    overflow-x: hidden;
    scroll-snap-type: none;
}

#homeScreen .home-widgets-container .app-icon-container {
    width: 75%;
    max-width: 55px;
    margin: 0 auto;
}

#homeScreen .v42-app-slot-empty {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#homeScreen .v42-app-slot-empty::before {
    content: '';
    display: block;
    width: 75%;
    max-width: 55px;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    border: 1px dashed rgba(128, 128, 128, .28);
    border-radius: var(--app-radius, 14px);
    background: rgba(255, 255, 255, .08);
}

.v42-sort-active {
    z-index: 3;
    transform: scale(1.08) !important;
    opacity: .86;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .18));
}

#desktop-page-2 {
    gap: 20px !important;
    padding: 43px 20px 20px !important;
    overflow-y: hidden !important;
}

#desktop-page-2 .user-profile-area,
#desktop-page-2 .custom-widget,
#desktop-page-2 .icon-grid-placeholder,
#desktop-page-2 .spacer {
    display: none !important;
}

#desktop-page-2 .v42-search-heart-star {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: #888;
}

#desktop-page-2 .v42-photo-wall {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, 110px);
    gap: 15px;
    width: 100%;
    padding-bottom: 0;
}

#desktop-page-2 .v42-photo-slot {
    min-width: 0;
    min-height: 0;
    border-radius: 12px;
}

#desktop-page-2 .v42-photo-slot:nth-child(-n + 5) {
    aspect-ratio: auto;
}

#desktop-page-2 .v42-photo-slot:nth-child(1) { grid-column: 1; grid-row: 1; }
#desktop-page-2 .v42-photo-slot:nth-child(2) { grid-column: 2; grid-row: 1; }
#desktop-page-2 .v42-photo-slot:nth-child(3) { grid-column: 3; grid-row: 1; }
#desktop-page-2 .v42-photo-slot:nth-child(4) { grid-column: 3; grid-row: 2; }
#desktop-page-2 .v42-photo-slot:nth-child(5) { grid-column: 3; grid-row: 3; }
#desktop-page-2 .v42-photo-slot:nth-child(6) {
    grid-column: 1 / 3;
    grid-row: 2 / 4;
}

#desktop-page-2 .v42-photo-item {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 12px !important;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background-position: center;
    background-size: cover;
    color: #9a9aa1;
    cursor: pointer;
    touch-action: pan-x;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 160ms ease, opacity 160ms ease;
}

#desktop-page-2 .v42-photo-item::after {
    content: '';
    position: absolute;
}

.friend-avatar,
.chat-avatar,
#chatScreen .friend-avatar,
#chatScreen .chat-avatar {
    border-radius: 50% !important;
}

.friend-item .friend-info {
    min-width: 0;
    padding-right: 58px;
}

.friend-item {
    position: relative;
}

.v42-friend-time {
    position: absolute;
    top: 14px;
    right: 15px;
    max-width: 60px;
    color: var(--text-secondary, #999);
    font-size: 11px;
    line-height: 16px;
    white-space: nowrap;
    text-align: right;
}

#chatScreen .nav-bar {
    justify-content: flex-start;
}

#chatScreen #navBarBackButton {
    flex: 0 0 auto;
    margin: 0;
    order: 0;
}

#chatScreen .v42-chat-identity {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    max-width: none !important;
    min-width: 0;
    flex: 1 1 auto;
    margin: 0 4px 0 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    text-align: left;
    order: 1;
}

#chatScreen .v42-chat-actions {
    flex: 0 0 auto;
    margin-left: auto;
    order: 2;
}

.v42-chat-head-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-hover, #e8e8e8);
    background-position: center;
    background-size: cover;
    color: var(--text-color, #333);
    font-size: 13px;
    overflow: hidden;
}

.v42-chat-head-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
}

#chatTitle {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 18px;
    font-weight: 600;
}

#v42ChatStatus {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary, #999);
    font-size: 10px;
    line-height: 14px;
    font-weight: 400;
}

.v42-online-dot {
    width: 6px;
    height: 6px;
    flex: 0 0 6px;
    border-radius: 50%;
    background: #52b46b;
    box-shadow: 0 0 0 1px rgba(82, 180, 107, .12);
}

#v42ChatStatusText {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v42-typing-message {
    pointer-events: none;
}

.v42-typing-message .message-content {
    min-width: 48px;
    height: 38px;
    padding: 0 15px !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v42-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.v42-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: .35;
    animation: v42-typing-dot .9s ease-in-out infinite;
}

.v42-typing-dots span:nth-child(2) { animation-delay: .14s; }
.v42-typing-dots span:nth-child(3) { animation-delay: .28s; }

@keyframes v42-typing-dot {
    0%, 65%, 100% { transform: translateY(0); opacity: .3; }
    32% { transform: translateY(-5px); opacity: .82; }
}
