.pm-page { max-width:960px; }
.pm-page h1,.pm-page h2 { overflow-wrap:anywhere; }
.pm-inbox-row { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem; }
.pm-inbox-row h2 { margin:0 0 .5rem; }
.pm-thread-actions { display:flex; gap:.8rem; flex-wrap:wrap; margin:1rem 0; }
.pm-inline-form { margin:0; }
.pm-history { display:flex; flex-direction:column; gap:1rem; margin:1.5rem 0; }
.pm-message { border:1px solid var(--line); border-radius:12px; padding:1rem 1.2rem; background:var(--panel); width:94%; }
.pm-sent { align-self:flex-end; border-inline-end:3px solid var(--a); }
.pm-received { align-self:flex-start; }
.pm-message-meta { font-size:.85rem; color:var(--muted); margin:0 0 .8rem; }
.pm-message-body { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; }
.pm-compose { margin:1.5rem 0; }
.pm-compose textarea { resize:vertical; min-height:150px; line-height:1.6; }
.pm-page .muted { line-height:1.6; }
[data-pm-read] { margin:1rem 0 2rem; }
[data-pm-read] button[hidden] { display:none; }
[data-pm-read-status] { display:block; margin-top:.6rem; }
@media(max-width:550px) { .pm-message { width:100%; padding:.9rem; } }

/* Keep profile contact actions aligned, with space when narrow layouts wrap. */
.profile > .profile-actions {
    display:flex;
    flex:0 1 220px;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
}
.profile > .profile-actions > form { margin:0; }
.profile > .profile-actions :is(button,a.button) {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:100px;
    min-height:44px;
    padding:10px 16px;
    line-height:1.25;
}
@media(max-width:600px) {
    .profile > .profile-actions { flex-basis:100%; justify-content:flex-start; }
}

/* Portrait uploads must fill the fixed circular avatar without growing its grid track. */
.profile > .avatar {
    position:relative;
    overflow:hidden;
    aspect-ratio:1 / 1;
    border-radius:50%;
}
.profile > .avatar > img {
    position:absolute;
    inset:0;
    display:block;
    width:100%;
    height:100%;
    min-width:0;
    min-height:0;
    max-width:100%;
    max-height:100%;
    object-fit:cover;
    object-position:center;
    border-radius:50%;
}
