.profile-page {
    box-sizing: border-box;
    width: 950px;
    max-width: 100%;
    padding: 30px 16px 50px;
    /* Base size for the whole page: the sizes below are in em, so they all follow it */
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.profile-page .hidden {
    display: none;
}

/* ---------- Identity ---------- */
.profile-identity {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-identity > i {
    font-size: 56px;
    color: var(--bleu-clair);
}

.profile-identity h1 {
    margin: 0;
    color: var(--bleu);
}

.profile-identity p {
    margin: 2px 0 0;
    color: #777;
}

/* ---------- Empty state ---------- */
.profile-empty {
    padding: 30px;
    background: white;
    border: 1px solid var(--bleu-clair);
    border-radius: 10px;
    text-align: center;
}

.profile-cta {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 18px;
    border-radius: 5px;
    background: var(--bleu-clair);
    color: white;
    font-weight: 700;
    text-decoration: none;
}

.profile-cta:hover {
    background: rgb(from var(--bleu-clair) r g b / 80%);
}

/* ---------- Stat tiles ---------- */
.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 10px;
    background: white;
    border: 1px solid var(--bleu-clair);
    border-radius: 10px;
    text-align: center;
}

.stat-flame {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 1.1em;
}

.stat-value {
    font-size: 1.7em;
    font-weight: 700;
    color: var(--bleu-clair);
}

.stat-label {
    margin-top: 4px;
    font-size: 0.75em;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ---------- Cards ---------- */
.profile-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
}

.profile-row .profile-card {
    flex: 1 1 300px;
}

.profile-card {
    box-sizing: border-box;
    padding: 18px 20px;
    background: white;
    border: 1px solid var(--bleu-clair);
    border-radius: 10px;
}

.profile-card h3 {
    margin: 0 0 14px;
    color: var(--bleu);
}

/* ---------- Last dailies ---------- */
.recent-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.recent-list li {
    display: grid;
    grid-template-columns: 90px 1fr 44px;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid #f6e6d2;
}

.recent-list li:last-child {
    border-bottom: none;
}

.recent-date {
    color: #555;
    font-size: 0.9em;
}

.recent-bar,
.category-bar {
    height: 10px;
    background: rgb(from var(--bleu-clair) r g b / 30%);
    border-radius: 5px;
    overflow: hidden;
}

.recent-bar > div,
.category-bar > div {
    height: 100%;
    background: var(--bleu-clair);
    border-radius: 5px;
}

.recent-score {
    font-weight: 700;
    color: var(--bleu);
    text-align: right;
}

/* ---------- Categories ---------- */
.category-row {
    display: grid;
    /* No column for .category-count while it's hidden, so the bar reaches the right edge */
    grid-template-columns: 140px 1fr 44px;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    margin-bottom: 5px;
    /*background-color: #eff7ff;*/
}

.category-name {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 500px) {
    .category-row {
        grid-template-columns: 130px 1fr 40px;
        gap: 8px;
    }

    .category-name {
        font-size: 13px;
    }
}

.category-name > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-pct {
    font-weight: 700;
    color: var(--bleu);
    text-align: right;
}

.category-count {
    /*color: #888;
    font-size: 0.85em;*/
    display: none;
}

/* ---------- Phone ---------- */
@media (max-width: 600px) {
    .profile-page {
        padding-top: 16px;
    }

    .profile-identity > i {
        font-size: 44px;
    }

    .profile-identity h1 {
        font-size: 22px;
    }

    .stat-tiles {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .profile-card {
        padding: 16px;
    }
}
