/* ============================================================================
   PROFILE PAGE (redesign stage 4)
   Identity panel is strict white; statistics and destinations carry the four
   author colors; white text over color always sits on the scrim (tokens.css).
   ========================================================================= */

.main-container {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 4px;
    gap: var(--gap-block);
}

/* ---------- Identity panel ---------- */

.pf-head {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--s-5);
    box-shadow: var(--elev-1);
}

.pf-head__avatar {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
}

.pf-head__id {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.pf-head__name {
    margin: 0;
    font-family: var(--font-display);
    font-weight: var(--w-semi);
    font-size: var(--t-title);
    line-height: var(--t-title-lh);
    letter-spacing: var(--track-tight);
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.pf-head__meta {
    margin: 0;
    font-size: var(--t-cap);
    line-height: var(--t-cap-lh);
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.pf-head__edit {
    flex: 0 0 auto;
    margin-left: auto;
    display: grid;
    place-items: center;
    width: var(--tap-min);
    height: var(--tap-min);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
}

@media (hover: hover) {
    .pf-head__edit:hover {
        background: var(--surface-sunken);
        color: var(--accent-action);
    }
}

/* ---------- Stat tiles: same geometry and colors as test cards ---------- */

.pf-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--s-3);
}

.pf-tile {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 2px;
    min-height: 92px;
    border-radius: var(--r-md);
    padding: var(--s-4);
    color: var(--text-on-color);
}

.pf-tile--blue { background: var(--blue-500); }
.pf-tile--amber { background: var(--amber-500); }

.pf-tile__art {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: auto;
    pointer-events: none;
}

.pf-tile__label,
.pf-tile__value {
    position: relative;
    z-index: 1;
}

.pf-tile__label {
    font-size: var(--t-cap);
    font-weight: var(--w-semi);
    line-height: var(--t-cap-lh);
}

.pf-tile__value {
    font-family: var(--font-display);
    font-weight: var(--w-bold);
    font-size: var(--t-title);
    line-height: var(--t-title-lh);
    font-variant-numeric: tabular-nums;
}

/* ---------- Subscription tile: facts, not a banner ---------- */

.pf-plan {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    border-radius: var(--r-md);
    padding: var(--s-5);
    color: var(--text-on-color);
    background: var(--green-500);
    box-shadow: 0 4px 12px rgba(22, 30, 57, .12);
}

.pf-plan .pf-tile__art {
    opacity: .5;
}

.pf-plan__top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: var(--s-3);
    flex-wrap: wrap;
}

.pf-plan__name {
    font-family: var(--font-display);
    font-weight: var(--w-semi);
    font-size: var(--t-head);
    line-height: var(--t-head-lh);
}

.pf-plan__until {
    font-size: var(--t-cap);
    opacity: .9;
}

.pf-quota {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 6px;
}

.pf-meter {
    height: 6px;
    border-radius: var(--r-full);
    background: rgba(255, 255, 255, .28);
    overflow: hidden;
}

    .pf-meter i {
        display: block;
        height: 100%;
        border-radius: var(--r-full);
        background: var(--white);
    }

.pf-quota__row {
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
    font-size: var(--t-cap);
    line-height: var(--t-cap-lh);
    font-variant-numeric: tabular-nums;
}

.pf-plan__btn {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    min-height: var(--ctl-sm);
    padding: 0 var(--s-4);
    border-radius: var(--r-sm);
    background: var(--surface-raised);
    color: var(--text-primary);
    font-size: var(--t-sub);
    font-weight: var(--w-semi);
    text-decoration: none;
}

@media (hover: hover) {
    .pf-plan__btn:hover {
        background: var(--accent-soft);
    }
}

/* ---------- Colored destination rows ---------- */

.pf-rows {
    display: grid;
    gap: var(--s-2);
}

.pf-row {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    min-height: 64px;
    border-radius: var(--r-md);
    padding: 0 var(--s-4);
    color: var(--text-on-color);
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(22, 30, 57, .10);
    transition: transform var(--d-fast) var(--ease-out);
}

    .pf-row:active {
        transform: scale(.98);
    }

.pf-row--blue { background: var(--blue-500); }
.pf-row--red { background: var(--red-500); }

.pf-row__title {
    font-size: var(--t-ui);
    font-weight: var(--w-semi);
}

/* ---------- Strict service links ---------- */

.pf-links {
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--elev-1);
    display: grid;
}

    .pf-links a {
        display: flex;
        align-items: center;
        gap: var(--s-3);
        min-height: var(--ctl-lg);
        padding: 0 var(--s-4);
        color: var(--text-primary);
        font-size: var(--t-ui);
        font-weight: var(--w-medium);
        text-decoration: none;
        border-bottom: 1px solid var(--border);
    }

        .pf-links a:last-child {
            border-bottom: none;
        }

        .pf-links a > svg:first-child {
            color: var(--text-tertiary);
            flex: 0 0 auto;
        }

@media (hover: hover) {
    .pf-links a:hover {
        background: var(--surface);
    }
}

.pf-links__chev {
    margin-left: auto;
    color: var(--text-tertiary);
    flex: 0 0 auto;
}

/* ---------- Tablet and up ---------- */

@media (min-width: 768px) {
    .main-container {
        gap: var(--gap-section);
        padding: 0;
    }

    .pf-tile {
        min-height: 100px;
    }
}
