.profile-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:26px}.profile-heading h1{margin:8px 0;font-size:30px}.profile-account{color:var(--muted);font-size:14px;overflow-wrap:anywhere}.profile-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:24px}.profile-metric,.profile-panel{padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}.profile-metric strong{display:block;font-size:28px;margin:12px 0 6px;color:var(--pine)}.profile-metric span,.profile-note{font-size:13px;line-height:1.7;color:var(--muted)}.profile-panel{margin:18px 0}.profile-panel h2{font-size:21px;margin:0 0 16px}.profile-progress-row{display:grid;grid-template-columns:minmax(80px,1fr) minmax(50px,2fr) auto;gap:12px;align-items:center;margin:14px 0;font-size:14px}.profile-progress-track{height:9px;border-radius:6px;background:var(--soft);overflow:hidden}.profile-progress-track>span{display:block;height:100%;background:var(--pine)}.profile-recent-item{display:flex;justify-content:space-between;gap:14px;align-items:center;padding:14px 0;border-top:1px solid var(--line)}.profile-recent-item p{margin:6px 0;font-size:13px;color:var(--muted)}.profile-recent-item button{flex-shrink:0}#profile-error{color:var(--ink);padding:12px;background:var(--soft);border-radius:9px}body:has(#profile-view:not([hidden])){padding-bottom:24px}@media(max-width:650px){.profile-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.profile-metric,.profile-panel{padding:18px}.profile-metric strong{font-size:24px}.profile-recent-item{align-items:flex-start}.profile-progress-row{gap:8px}}

.nickname-form{max-width:620px;padding:20px;margin:0 0 24px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}.nickname-form>label{font-weight:700;font-size:16px}.nickname-form>p{font-size:14px;line-height:1.6;color:var(--muted)}.nickname-form>div{display:flex;gap:10px}.nickname-form input{flex:1;min-width:0;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:16px}.nickname-form button{flex-shrink:0;min-height:46px}.nickname-form #nickname-status:empty{display:none}@media(max-width:380px){.nickname-form{padding:16px}.nickname-form>div{flex-wrap:wrap}.nickname-form input{flex-basis:100%}}

#profile-view{max-width:1100px;margin-inline:auto}
#profile-view .profile-heading{margin-bottom:12px;align-items:flex-start}
#profile-display-name{display:block;font-size:1.125rem;font-weight:600;line-height:1.6;overflow-wrap:anywhere}
#profile-display-name:empty{display:none}
#profile-view .profile-account{margin:4px 0;color:var(--muted)}
.profile-name-editor{margin-bottom:28px}
.profile-name-editor>summary,.profile-record-note>summary{width:fit-content;min-height:44px;padding:10px 4px;font-size:.875rem;color:var(--pine);cursor:pointer}
.profile-name-editor .nickname-form{margin:8px 0 0;max-width:620px}
#profile-view .profile-metrics{gap:12px;margin-bottom:24px}
#profile-view .profile-metric{padding:20px 22px;min-height:120px;border-radius:18px}
#profile-view .profile-metric>div{font-size:.875rem;font-weight:500}
#profile-view .profile-metric strong{font-size:clamp(1.65rem,3vw,2rem);line-height:1.25;letter-spacing:-.025em;font-variant-numeric:tabular-nums;margin:14px 0 0;overflow-wrap:anywhere}
#profile-view .profile-insights{display:grid;grid-template-columns:1fr 1fr;gap:16px}
#profile-view .profile-panel{margin:0 0 18px;border-radius:18px;min-width:0}
#profile-view .profile-panel h2{font-size:1.125rem;line-height:1.5}
#profile-view .profile-recent-item>div{min-width:0}
#profile-view .profile-recent-item strong{line-height:1.6;overflow-wrap:anywhere}
#profile-view .profile-recent-item button{min-height:44px;font-size:.875rem}
.profile-record-note .profile-note{max-width:65ch;margin-top:0}
@media(max-width:650px){
 #profile-view .profile-heading h1{font-size:1.65rem}
 #profile-view .profile-heading{gap:12px}
 #profile-view .profile-metrics{gap:10px}
 #profile-view .profile-metric{padding:16px;min-height:110px}
 #profile-view .profile-insights{grid-template-columns:1fr;gap:0}
 #profile-view .profile-recent-item{flex-wrap:wrap;align-items:center;gap:8px;padding-block:16px}
 #profile-view .profile-recent-item>div{flex:1 1 190px}
 #profile-view .profile-panel{padding:18px}
 .profile-name-editor{margin-bottom:20px}
}

.account-actions{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 16px}.account-actions .secondary-button{min-height:44px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}.account-actions:has(> [hidden]):not(:has(> :not([hidden]))){display:none}#account-status:empty{display:none}

/* Identity and editing share one calm, responsive account header. */
#profile-view .profile-heading{padding:26px 28px 18px;margin:0;background:var(--surface);border:1px solid var(--line);border-bottom:0;border-radius:20px 20px 0 0}
#profile-view .profile-heading>div{min-width:0;flex:1}
#profile-view .profile-name-editor{margin:12px 0 0}
#profile-view .profile-name-editor>summary{display:flex;align-items:center;gap:12px;padding:0;list-style:none;max-width:100%;min-height:44px}
#profile-view .profile-name-editor>summary::-webkit-details-marker{display:none}
#profile-view .profile-edit-label{flex-shrink:0;font-size:13px;font-weight:500;border:1px solid var(--line);border-radius:999px;padding:5px 12px;background:var(--soft)}
#profile-view .profile-name-editor[open] .profile-edit-label{background:var(--pine);color:white}
#profile-view .profile-name-editor>summary:focus-visible{outline:2px solid var(--pine);outline-offset:4px;border-radius:8px}
#profile-view .profile-name-editor .nickname-form{margin:12px 0}
#profile-view .account-actions{padding:0 28px 22px;margin:0 0 24px;background:var(--surface);border:1px solid var(--line);border-top:0;border-radius:0 0 20px 20px;gap:8px}
#profile-view .account-actions .secondary-button{font-size:13px;padding-inline:16px}
#profile-view .profile-account{font-size:13px;margin-top:4px}
@media(max-width:650px){#profile-view .profile-heading{padding:20px 18px 14px}#profile-view .account-actions{padding:0 18px 18px}#profile-view .profile-heading>div{flex-basis:70%}}

#profile-view .profile-heading:not(:has(+ .account-actions > :not([hidden]))){border-bottom:1px solid var(--line);border-radius:20px;margin-bottom:24px}
#profile-view .profile-name-editor>summary strong{min-width:0}
