:root {
    --bg: #f4f2f0;
    --card: #ffffff;
    --text: #171717;
    --muted: #8d8d8d;
    --accent: #ff445f;
    --green: #29d366;
    --green-soft: rgba(41, 211, 102, 0.24);
    --red: #ef5548;
    --shadow: 0 20px 40px rgba(47, 33, 18, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.98), rgba(244, 242, 240, 0.9) 52%, rgba(236, 232, 227, 0.96)),
        linear-gradient(180deg, #fbf9f8 0%, #f4f2f0 100%);
    color: var(--text);
    font-family: "Trebuchet MS", "Nirmala UI", "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.page-shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 36px 0 110px;
}

.page-header {
    text-align: center;
    margin-bottom: 26px;
}

.page-header p {
    margin: 0;
    color: #ff433d;
    font-size: clamp(1.2rem, 2vw, 2rem);
    font-weight: 700;
}

.profiles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 16px;
}

.profile-card {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 110px;
    padding: 12px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    animation: card-in 0.45s ease both;
}

.profile-card:nth-child(2n) {
    animation-delay: 0.08s;
}

.profile-card:nth-child(3n) {
    animation-delay: 0.16s;
}

.profile-main {
    display: grid;
    grid-template-columns: 78px 1fr;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.avatar-wrap {
    position: relative;
    width: 78px;
    height: 78px;
}

.avatar-wrap img {
    width: 78px;
    height: 78px;
    display: block;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent);
    background: #ffe5eb;
}

.status-dot {
    position: absolute;
    right: -2px;
    bottom: 2px;
    width: 20px;
    height: 20px;
    border: 3px solid #eef8ef;
    border-radius: 50%;
    background: var(--green);
}

.status-offline .status-dot {
    background: var(--red);
}

.profile-copy {
    min-width: 0;
}

.profile-copy h2 {
    margin: 0 0 3px;
    font-size: clamp(1.55rem, 1.9vw, 2rem);
    line-height: 1.05;
    font-weight: 800;
}

.profile-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 1.2rem;
}

.profile-copy strong {
    display: block;
    margin-top: 2px;
    color: var(--accent);
    font-size: 1.55rem;
    font-weight: 800;
}

.profile-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-left: 12px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 10px var(--green-soft);
    transform: translateZ(0);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-action:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 12px rgba(41, 211, 102, 0.18);
}

.profile-action svg {
    width: 29px;
    height: 29px;
    fill: #fff;
}

.floating-cta {
    position: fixed;
    right: 18px;
    bottom: 18px;
    padding: 18px 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, #32d66d 0%, #1bb856 100%);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    box-shadow: 0 18px 32px rgba(35, 171, 88, 0.28);
}

.chat-bubble {
    position: fixed;
    left: 16px;
    bottom: 72px;
    min-width: 122px;
    max-width: 240px;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(46, 33, 19, 0.12);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.2s ease, color 0.2s ease;
}

.chat-bubble.is-changing {
    opacity: 0.15;
    transform: translateY(8px);
}

.chat-bubble strong {
    display: block;
    margin-bottom: 4px;
    color: #ff4376;
    font-size: 1.05rem;
}

.chat-bubble span {
    display: block;
    color: #232323;
    font-size: 1rem;
}

.moon-toggle {
    position: fixed;
    left: 16px;
    bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 0;
    border-radius: 50%;
    background: #050505;
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.moon-icon {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    box-shadow: 7px 0 0 0 #f7ce4a;
    transform: translateX(-5px);
}

body.night-preview {
    background:
        radial-gradient(circle at top center, rgba(64, 85, 123, 0.22), rgba(14, 20, 32, 0.96) 48%, rgba(8, 12, 20, 1)),
        linear-gradient(180deg, #0d1320 0%, #091018 100%);
    color: #eef3ff;
}

body.night-preview .page-header p {
    color: #ff7d7d;
}

body.night-preview .profile-card {
    background: rgba(20, 29, 45, 0.94);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

body.night-preview .profile-copy h2 {
    color: #f6f8ff;
}

body.night-preview .profile-copy p {
    color: #9fb0cc;
}

body.night-preview .profile-copy strong {
    color: #ff7f98;
}

body.night-preview .chat-bubble {
    background: rgba(19, 28, 43, 0.96);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
}

body.night-preview .chat-bubble span {
    color: #eef3ff;
}

body.night-preview .moon-toggle {
    background: #f3f6ff;
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.28);
}

body.night-preview .moon-icon {
    box-shadow: 0 0 0 0 #f7ce4a;
    background: #ffb54d;
    transform: none;
}

body.night-preview .floating-cta {
    box-shadow: 0 18px 34px rgba(21, 116, 65, 0.42);
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1120px) {
    .profiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 740px) {
    .page-shell {
        width: min(100vw - 12px, 520px);
        padding-top: 12px;
        padding-bottom: 92px;
    }

    .page-header {
        margin-bottom: 14px;
    }

    .page-header p {
        font-size: 1.55rem;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-card {
        min-height: 92px;
        padding: 10px 10px 10px 12px;
        border-radius: 20px;
    }

    .profile-main {
        grid-template-columns: 64px 1fr;
        gap: 12px;
    }

    .avatar-wrap,
    .avatar-wrap img {
        width: 64px;
        height: 64px;
    }

    .profile-copy h2 {
        font-size: 1.16rem;
    }

    .profile-copy p {
        font-size: 0.9rem;
    }

    .profile-copy strong {
        font-size: 1.06rem;
    }

    .profile-action {
        width: 44px;
        height: 44px;
        margin-left: 8px;
        box-shadow: 0 0 0 7px var(--green-soft);
    }

    .profile-action svg {
        width: 24px;
        height: 24px;
    }

    .floating-cta {
        right: 8px;
        bottom: 12px;
        padding: 13px 18px;
        font-size: 0.96rem;
    }

    .chat-bubble {
        left: 8px;
        bottom: 64px;
        padding: 12px 14px;
    }

    .moon-toggle {
        left: 8px;
        bottom: 12px;
        width: 48px;
        height: 48px;
    }
}
