body {
    /* Keep the navbar offset while removing default browser side margins. */
    margin: 70px 0 0 0 !important;
    padding: 0;
}

:root {
    --profile-surface: rgb(46, 46, 46);
    --profile-text: whitesmoke;
    --profile-link: #62abef;
}

.profile-hero {
    --profile-bg: linear-gradient(120deg, #2f2f2f, #1f1f1f);
    position: relative;
    min-height: 360px;
    margin: 0;
    background-image: var(--profile-bg);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.profile-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.2) 100%);
}

.profile-hero-overlay {
    position: relative;
    z-index: 1;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 26px;
}

.profile-identity {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-top: auto;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.75);
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.profile-name-block h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.profile-subtitle,
.profile-warning {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.profile-warning {
    color: #ffeaa9;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px;
    backdrop-filter: blur(2px);
}

.profile-stat {
    text-align: center;
}

.stat-value {
    font-size: clamp(1.2rem, 2.4vw, 2rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
}

.stat-label {
    margin-top: 2px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
}

.uploadPhoto {
    width: auto;
    flex-wrap: wrap;
}

@media (prefers-color-scheme: light) {
    :root {
        --profile-surface: #e8e8e8;
        --profile-text: #121212;
        --profile-link: #005fcc;
    }

    body {
        background-color: #f7f7f7;
        color: var(--profile-text);
    }

    .userPhotos,
    .uploadButton,
    .charts,
    .options,
    .formcontainer {
        background-color: var(--profile-surface);
        color: var(--profile-text);
        border: 1px solid rgba(0, 0, 0, 0.12);
    }

    .uploadPhoto a,
    .options a,
    a,
    a:visited {
        color: var(--profile-link);
    }

    .profile-stats {
        background: rgba(255, 255, 255, 0.78);
        border-color: rgba(0, 0, 0, 0.18);
    }

    .stat-value,
    .stat-label {
        color: #101010;
        text-shadow: none;
    }
}

@media (max-width: 900px) {
    .profile-hero,
    .profile-hero-overlay {
        min-height: 320px;
    }

    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .profile-hero,
    .profile-hero-overlay {
        min-height: 280px;
    }

    .profile-hero-overlay {
        padding: 18px;
    }

    .profile-identity {
        align-items: center;
    }

    .profile-avatar {
        width: 96px;
        height: 96px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }
}
