/* Shared profile hierarchy: identity, evidence, actions, then grouped details. */
.profile-page{max-width:760px;margin-inline:auto;padding-top:18px}
.profile-page h1{font-size:24px;letter-spacing:-.5px;margin-bottom:16px}
.profile-page .profile-summary,.profile-page .player-public-card{border:1px solid #dce6df;border-radius:20px;background:#fff;padding:18px;margin:0 0 14px;box-shadow:0 4px 18px #163c2705}
.profile-page .profile-summary{grid-template-columns:68px minmax(0,1fr);gap:6px 14px;align-items:center}
.profile-page .profile-summary>div:first-child{grid-column:1;grid-row:1/3;align-self:center}
.profile-page .profile-summary-avatar,.profile-page .profile-summary-placeholder{width:68px;height:68px}
.profile-page .profile-summary-name{grid-column:2;grid-row:1;justify-self:start;text-align:start;font-size:22px;align-self:end;line-height:1.25}
.profile-page .profile-summary-personal{grid-column:2;grid-row:2;justify-self:start;align-self:start;text-align:start;font-size:12px;color:#67796e}
.profile-page .profile-summary-stats{grid-column:1/-1;grid-row:3;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:auto auto;grid-template-areas:'rating self' 'reliability trust';gap:8px;margin-top:12px}
.profile-page .profile-summary-stats>div{border-radius:12px!important;padding:12px!important;min-height:82px;display:flex!important;flex-direction:column;align-items:flex-start!important;justify-content:center!important;gap:7px!important;text-align:start!important;background:#f3f6f3}
.profile-page .profile-summary-stats>div:has([data-rating-stat='0']){background:#eaf3e1;container-type:normal}
.profile-page .profile-summary-stats dt,.profile-page .profile-summary-stats>div:has([data-rating-stat='0']) dt{font-size:12px;font-weight:600;color:#52695a}
.profile-page .profile-summary-stats dd,.profile-page .profile-summary-stats [data-rating-stat='0']{font-size:27px;letter-spacing:-.5px;margin:0;text-align:start;line-height:1.15}
.profile-page .profile-summary-stats [data-rating-stat='0']:not(.profile-z-numeric){font-size:20px}
.profile-page .profile-summary-stats .profile-reliability-ring{width:auto;height:auto;display:block;background:none;border-radius:0;font-size:24px;line-height:1.2;margin:0}
.profile-page .profile-reliability-ring::before{display:none}
.profile-page .profile-z-description{font-size:11px;text-align:start;font-weight:500;color:#607768}
.profile-page .profile-social-placeholders{grid-column:1/-1;grid-row:4;display:flex;flex-wrap:wrap;gap:8px;margin:8px 0 0}
.profile-page .profile-social-placeholders button{flex:1;min-width:80px;background:#fff;border:1px solid #dce6df;border-radius:12px;font-size:13px;min-height:42px}
.profile-page .profile-summary-note{font-size:12px;line-height:1.5;color:#637669;margin:0 4px 16px}
.profile-section-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:5px;background:#e9efea;border-radius:13px;margin-bottom:2px}
.profile-section-nav a{display:flex;align-items:center;justify-content:center;text-align:center;min-height:40px;font-size:12px;color:#315443;text-decoration:none;border-radius:9px;padding:4px;line-height:1.3}
.profile-section-nav a:hover,.profile-section-nav a:focus-visible{background:#fff}
.profile-page .profile-editor-section,.profile-page .player-shared-section{padding:18px;border:1px solid #dce6df;border-radius:18px;background:white;scroll-margin-top:18px}
.profile-page .profile-section-title{font-size:18px;font-weight:750;margin-bottom:16px}
.profile-page .profile-editor-heading{padding-bottom:12px;border-bottom:1px solid #edf1ed;margin-bottom:16px}
.profile-page .profile-editor-heading .profile-section-title{margin:0}
.profile-page .profile-editor-heading .profile-password-button{font-size:11px;padding:7px 8px;background:#f4f7f3;border-color:#dce6df;min-height:36px}
.profile-page .profile-section-body{column-gap:12px;row-gap:16px}
.profile-page .profile-field-container{min-width:0}
.profile-page .profile-extra-field{font-size:13px;color:#294c39;gap:6px}
.profile-page .profile-field-container input,.profile-page .profile-field-container select{border:1px solid #d7e0d8;border-radius:10px;background:#fff;min-height:44px;box-shadow:none}
.profile-page .profile-privacy-control{font-size:11px!important;color:#728075}
.profile-page .profile-privacy-control select{background:#f6f8f5;font-size:12px}
.profile-page .profile-playing-city{margin:0 0 16px}
.profile-page .profile-location-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-top:10px}
.profile-page .profile-location-actions .week-quick{margin:0;display:contents}
.profile-page .profile-location-actions button{font-size:12px;min-height:38px;padding:8px 10px;margin:0}
.profile-page #profile-places>.profile-field-container{margin-top:16px;padding-top:16px;border-top:1px solid #edf1ed}
.profile-page #profile-playing>fieldset{margin:0 0 18px}
.profile-page #profile-playing>.profile-field-container{margin-bottom:18px}
.profile-page #profile-playing>.profile-section-body{padding-top:16px;border-top:1px solid #edf1ed}
.profile-page .week-table{border:1px solid #e1e8e0;border-radius:10px;overflow:hidden;border-spacing:0}
.profile-page .week-table th{color:#647669;font-weight:600;background:#f5f8f2}
.profile-page .week-time-shortcuts .ghost-btn{border-radius:9px;background:#f5f8f2;border:1px solid #e1e8e0}
.profile-page .profile-save-bar{border-top:0;background:#f5f8f5f5;padding:10px 0;gap:5px}
.profile-page .profile-save-bar .primary-btn{border-radius:13px;min-height:46px}
.profile-page .profile-secondary-tools{font-size:12px}
.profile-page .player-identity{display:flex;align-items:center;gap:14px;min-width:0}
.profile-page .player-identity>.profile-avatar-trigger,.profile-page .player-identity>.profile-summary-placeholder{flex:none}
.profile-page .player-name-block{min-width:0}
.profile-page .player-name-block h1{font-size:25px;line-height:1.2;margin:0 0 6px;overflow-wrap:anywhere}
.profile-page .player-location,.profile-page .player-friend-count{font-size:12px;color:#637669;margin:4px 0;line-height:1.5;overflow-wrap:anywhere}
.profile-page .player-rating-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:20px 0 16px}
.profile-page .player-rating-grid>div{background:#f3f6f3;border-radius:12px;padding:12px 9px;min-width:0}
.profile-page .player-rating-grid>div:first-child{background:#eaf3e1}
.profile-page .player-rating-grid dt{font-size:11px;color:#52695a;min-height:30px;line-height:1.35}
.profile-page .player-rating-grid dd{font-size:clamp(18px,5vw,25px);font-weight:750;margin:7px 0 0;line-height:1.25;overflow-wrap:anywhere}
.profile-page .player-primary-actions{margin:0;gap:8px;display:flex;flex-wrap:wrap}
.profile-page .player-primary-actions button{flex:1 1 110px;min-height:44px;border-radius:11px;font-size:13px;padding:10px}
.profile-page .player-primary-actions>p{flex-basis:100%;margin:0;font-size:13px}
.profile-page .player-primary-actions>p:empty{display:none}
.profile-page .player-shared-section{margin:14px 0}
.profile-page .player-shared-section h3{font-size:17px;margin:0 0 8px}
.profile-page .profile-visible-details{margin:0}
.profile-page .profile-visible-details>div{display:grid;grid-template-columns:minmax(80px,.7fr) minmax(0,1.3fr);gap:12px;padding:12px 0;border-color:#edf1ed}
.profile-page .profile-visible-details>div:last-child{border:0;padding-bottom:0}
.profile-page .profile-visible-details dt{font-size:12px;font-weight:500;color:#637669}
.profile-page .profile-visible-details dd{font-size:14px;margin:0;line-height:1.5}
.profile-page .player-secondary-actions{display:flex;justify-content:space-between;gap:16px;flex-wrap:wrap;padding:8px 4px 20px;font-size:13px}
@media(max-width:600px){.profile-page{padding:12px 12px 24px}.profile-page .profile-editor-section,.profile-page .player-shared-section{padding:16px 14px}.profile-page .profile-summary,.profile-page .player-public-card{padding:16px}.profile-page .profile-summary-name{font-size:21px}.profile-page .profile-editor-heading{gap:8px}.profile-page .profile-editor-heading .profile-section-title{font-size:17px}}
@media(prefers-reduced-motion:no-preference){.profile-page{scroll-behavior:smooth}}

/* Identity actions align beside the nickname; the Z value opens its history. */
.profile-page .profile-summary{grid-template-columns:96px minmax(0,1fr) 98px;column-gap:10px}.profile-page .profile-summary-avatar,.profile-page .profile-summary-placeholder{width:96px;height:96px}.profile-page .profile-summary-name{font-size:20px}.profile-page .profile-summary .profile-social-placeholders{grid-column:3;grid-row:1/3;display:flex;flex-direction:column;gap:6px;margin:0;align-self:center}.profile-page .profile-social-placeholders button{width:100%;min-width:0;min-height:36px;padding:6px;font-size:12px;flex:none}.profile-page .profile-summary-stats [data-rating-stat="0"].profile-z-numeric{font-size:clamp(36px,10vw,46px);line-height:1.1}.profile-rating-history-link{color:#075438;text-decoration:none;display:inline-block;border-bottom:1px dashed #82a674;padding-bottom:2px}.profile-rating-history-link:focus-visible{outline:2px solid #075438;outline-offset:4px}.profile-page .player-rating-grid>div:first-child dd{font-size:clamp(26px,7vw,36px)}

/* Three playing traits remain one compact row on phones. */
.profile-page .profile-playing-traits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;grid-column:1/-1;min-width:0}
.profile-page .profile-playing-traits .profile-extra-field{display:grid;grid-template-rows:minmax(32px,auto) auto;gap:5px;font-size:12px;line-height:16px;margin:0}
.profile-page .profile-playing-traits select{width:100%;min-width:0;padding:8px 5px;font-size:12px;min-height:44px}
/* Own-profile shortcuts span the card, never the former narrow side column. */
.profile-page .profile-summary{grid-template-columns:96px minmax(0,1fr)}
.profile-page .profile-summary .profile-social-placeholders{grid-column:1/-1;grid-row:3;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:center;gap:8px;width:100%;margin:8px 0 0}
.profile-page .profile-summary .profile-summary-stats{grid-row:4}
.profile-page .profile-summary .profile-social-placeholders>button,.profile-page .profile-summary .profile-social-placeholders>.settings-gear{box-sizing:border-box;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:9px;border-radius:50%}
/* Name and actions share the top row; avatar and personal details sit below. */
.profile-page .profile-summary .profile-summary-name{grid-column:1/-1;grid-row:1;align-self:center;justify-self:start;max-width:calc(100% - 208px);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}
.profile-page .profile-summary .profile-social-placeholders{grid-column:1/-1;grid-row:1;justify-self:end;align-self:start;width:auto;margin:0;gap:8px}
.profile-page .profile-summary>div:first-child{grid-column:1;grid-row:2;align-self:center}
.profile-page .profile-summary .profile-summary-personal{grid-column:2;grid-row:2;align-self:center}
.profile-page .profile-summary .profile-summary-stats{grid-row:3}
@media(max-width:350px){.profile-page .profile-summary .profile-social-placeholders{gap:4px}.profile-page .profile-summary .profile-summary-name{max-width:calc(100% - 196px);font-size:18px}}
/* Personal details and shortcut icons share a row below the identity. */
.profile-page .profile-summary>div:first-child{grid-column:1;grid-row:1;align-self:center}
.profile-page .profile-summary .profile-summary-name{grid-column:2;grid-row:1;max-width:100%;align-self:center;white-space:normal;overflow-wrap:anywhere}
.profile-page .profile-summary .profile-summary-personal{grid-column:1/-1;grid-row:2;justify-self:start;align-self:center;max-width:calc(100% - 208px);min-width:0;margin:0;overflow-wrap:anywhere}
.profile-page .profile-summary .profile-social-placeholders{grid-column:1/-1;grid-row:2;justify-self:end;align-self:center}
@media(max-width:350px){.profile-page .profile-summary .profile-summary-personal{max-width:calc(100% - 196px)}}
/* Identity stays in three columns: photo | name/details | shortcut row. */
.profile-page .profile-summary{grid-template-columns:96px minmax(0,1fr) auto;column-gap:10px}
.profile-page .profile-summary>div:first-child{grid-column:1;grid-row:1/3;align-self:center}
.profile-page .profile-summary .profile-summary-name{grid-column:2;grid-row:1;align-self:end;max-width:100%;font-size:20px;min-width:0}
.profile-page .profile-summary .profile-summary-personal{grid-column:2;grid-row:2;align-self:start;max-width:100%;font-size:12px;min-width:0}
.profile-page .profile-summary .profile-social-placeholders{grid-column:3;grid-row:1/3;align-self:center;gap:4px;justify-self:end}
@media(max-width:600px){
 .profile-page .profile-summary{grid-template-columns:clamp(72px,23vw,96px) minmax(0,1fr) auto;column-gap:8px}
 .profile-page .profile-summary-avatar,.profile-page .profile-summary-placeholder{width:clamp(72px,23vw,96px);height:clamp(72px,23vw,96px)}
 .profile-page .profile-summary .profile-social-placeholders{gap:2px}
 .profile-page .profile-summary .profile-social-placeholders>button,.profile-page .profile-summary .profile-social-placeholders>.settings-gear{flex:0 0 clamp(28px,8.2vw,36px);width:clamp(28px,8.2vw,36px);min-width:0;height:clamp(28px,8.2vw,36px);min-height:0!important;padding:5px}
 .profile-page .profile-summary .profile-social-placeholders svg{width:20px;height:20px}
 .profile-page .profile-summary .profile-summary-name{font-size:18px}
}
/* Two-row action cluster preserves room for the full-size portrait and name. */
.profile-page .profile-summary{grid-template-columns:96px minmax(0,1fr) auto;column-gap:8px}
.profile-page .profile-summary-avatar,.profile-page .profile-summary-placeholder{width:96px;height:96px;min-width:96px;min-height:96px}
.profile-page .profile-summary .profile-social-placeholders{display:grid;grid-template-columns:repeat(2,44px);grid-template-rows:repeat(2,44px);gap:4px;width:auto;align-self:center}
.profile-page .profile-summary .profile-social-placeholders>.settings-gear{grid-column:1;grid-row:1}
.profile-page .profile-summary .profile-social-placeholders>.profile-share-button{grid-column:2;grid-row:1}
.profile-page .profile-summary .profile-social-placeholders>button:nth-child(2){grid-column:1;grid-row:2}
.profile-page .profile-summary .profile-social-placeholders>button:nth-child(3){grid-column:2;grid-row:2}
.profile-page .profile-summary .profile-social-placeholders>button,.profile-page .profile-summary .profile-social-placeholders>.settings-gear{width:44px;height:44px;min-width:44px;min-height:44px!important;padding:9px}
.profile-page .profile-summary .profile-social-placeholders svg{width:24px;height:24px}

/* Keep evidence and available Points together beneath the two Z cards. */
.profile-page .profile-summary-stats{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-areas:'rating rating rating self self self' 'reliability reliability trust trust points points'}
.profile-page .profile-summary-stats>.profile-summary-points{grid-area:points}
.profile-page .profile-summary-stats>div:has([data-rating-stat='2']),
.profile-page .profile-summary-stats>div:has([data-rating-stat='3']),
.profile-page .profile-summary-stats>.profile-summary-points{align-items:center!important;text-align:center!important;padding:10px 4px!important}
.profile-page .profile-summary-stats .profile-reliability-ring{position:relative;isolation:isolate;width:56px;height:56px;flex:none;display:grid;place-items:center;border-radius:50%;background:conic-gradient(#5ca51c var(--reliability-progress,0%),#dce6df 0);font-size:18px;line-height:1;letter-spacing:0;text-align:center}
.profile-page .profile-summary-stats .profile-reliability-ring::before{display:block;content:'';position:absolute;inset:4px;border-radius:50%;background:#e7f1e8;z-index:-1}
.profile-page .profile-summary-stats .profile-trust-ring::before{background:#f3f7f4}
.profile-page .profile-summary-points .profile-points-stat{min-height:56px;min-width:44px}
.profile-page .profile-summary-points .profile-points-stat strong{font-size:24px}
.profile-page .profile-z-description{font-size:13px}

.profile-page .profile-summary-stats>div:has([data-rating-stat='0']) dt{display:flex;align-items:center;gap:2px;width:100%;min-width:0}
.profile-page .profile-summary-stats>div:has([data-rating-stat='0']) dt>a:first-child{flex:none}
.profile-page .profile-summary-stats dt .score-help-button{flex:none;width:24px;min-width:24px}
.profile-page .profile-summary-stats dt .profile-z-description{font-size:13px;min-width:0;line-height:1.25;overflow-wrap:anywhere}

/* Prioritise the main rating while keeping both rating cards centred. */
.profile-page .profile-summary-stats{grid-template-areas:'rating rating rating rating self self' 'reliability reliability trust trust points points'}
.profile-page .profile-summary-stats>div:has([data-rating-stat='0']),
.profile-page .profile-summary-stats>div:has([data-rating-stat='1']){align-items:center!important;text-align:center!important;padding:12px 8px!important}
.profile-page .profile-summary-stats>div:has([data-rating-stat='0']) dt{justify-content:center;flex-wrap:wrap}
.profile-page .profile-summary-stats>div:has([data-rating-stat='0']) dd,
.profile-page .profile-summary-stats>div:has([data-rating-stat='1']) dd{text-align:center}
.profile-page .profile-summary-stats dt .profile-z-description{text-align:center;overflow-wrap:normal}

/* Compact score rings and plain, clickable metric labels. */
.profile-page .profile-summary-stats .profile-reliability-ring{width:40px;height:40px;font-size:13px}.profile-page .profile-summary-stats .profile-reliability-ring::before{inset:3px}.profile-page .profile-summary-stats a,.profile-page .profile-summary-stats .score-help-button{text-decoration:none!important;border-bottom:0}.profile-page .profile-summary-points .profile-points-stat{min-height:40px}
