/* Profile page layout — tokens only (see DESIGN.md). Loaded after member-pages.css. */

.profile-shell{max-width:960px;padding-top:44px}
.profile-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:28px}
.profile-heading h1{margin:10px 0 0;font-size:clamp(36px,4.5vw,56px);line-height:1;letter-spacing:-.04em}
.profile-shell .profile-billing-link{display:inline-flex;align-items:center;gap:8px;min-height:40px;padding:0 18px;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--text);font-size:13px;font-weight:600;text-decoration:none;transition:background .15s ease,border-color .15s ease}
.profile-shell .profile-billing-link:hover{background:var(--surface-2);color:var(--text)}

/* Cards */
.profile-shell .member-card{min-height:0;max-width:none;width:100%;margin:0;padding:28px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:none;align-items:stretch;overflow:visible}
.profile-shell .profile-overview{display:flex;flex-direction:row;align-items:center;gap:24px}
.profile-details{flex:1;min-width:0}
.profile-name-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.profile-name-row #profileUsername{margin:0;font-family:var(--font-display);font-size:30px;line-height:1.05;letter-spacing:-.035em;overflow-wrap:anywhere}
.profile-name-row .profile-special-tag{margin:0}
.profile-shell #credentialStatus{font-size:14px;margin:8px 0 0;line-height:1.55;color:var(--muted)}
.profile-avatar-actions{align-items:center;margin-top:18px}
.profile-photo-hint{font-size:12px;color:var(--faint);margin-left:6px}

/* Legacy two-column settings grid (kept for older markup) */
.profile-settings-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:20px;margin-top:20px;align-items:start}
.profile-shell .profile-settings-grid h2{font-size:22px;margin:12px 0 0}
.profile-shell .profile-settings-grid p{font-size:14px;margin:10px 0 20px}
.profile-settings-side{display:grid;gap:20px;min-width:0}

/* Forms inside settings */
.profile-security form{width:100%}
.profile-security .field-label{margin:18px 0 8px}
.profile-security form .field-label:first-child{margin-top:0}
.profile-security .creator-name{width:100%;min-height:48px;border-radius:var(--radius-s)}
.profile-security .create-model-button{min-height:48px;margin-top:22px;border-radius:999px;background:var(--ink);color:var(--ink-text);box-shadow:none;transform:none;font-size:14px}
.profile-security .create-model-button:not(:disabled):hover{opacity:.86;transform:none;box-shadow:none}

/* Membership */
.profile-plus-focus{margin-top:20px}
.profile-plus-label{display:inline-block;font-family:var(--font-mono);font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--accent-text)}
.profile-plus-focus .profile-membership h2{margin:14px 0 0;font-size:26px;letter-spacing:-.03em}
.profile-plus-focus .profile-membership p{font-size:14px;line-height:1.6;margin:10px 0 24px;color:var(--muted)}
.profile-membership ul{padding:0;list-style:none;display:grid;gap:14px;font-size:14px;line-height:1.5;margin:0 0 26px;color:var(--text)}
.profile-plus-focus .profile-membership ul{grid-template-columns:1fr 1fr;gap:14px 28px}
.profile-membership li{position:relative;padding-left:30px}
.profile-membership li:before{content:'✓';position:absolute;left:0;top:1px;display:inline-grid;place-items:center;width:20px;height:20px;border-radius:999px;background:var(--accent-soft);color:var(--accent-text);font-size:11px;font-weight:700}
.profile-membership li strong{font-weight:600}
.profile-plus-focus .profile-membership-actions{max-width:300px;display:grid;gap:10px}
.profile-shell .profile-membership-actions a,.profile-membership-actions button{display:inline-flex;justify-content:center;align-items:center;width:100%;min-height:48px;margin:0;padding:0 22px;border:1px solid transparent;border-radius:999px;background:var(--accent);color:#fff;font:inherit;font-size:14px;font-weight:600;line-height:1;text-decoration:none;box-sizing:border-box;cursor:pointer;transition:background .15s ease,opacity .15s ease}
.profile-shell .profile-membership-actions a:hover,.profile-membership-actions button:hover{background:var(--accent-ink);color:#fff}
.profile-membership-actions button[data-portal]{background:var(--surface);border-color:var(--line-strong);color:var(--text)}
.profile-membership-actions button[data-portal]:hover{background:var(--surface-2);color:var(--text)}
.profile-membership-actions button:disabled{opacity:.5;cursor:not-allowed}
.profile-membership-actions a[hidden],.profile-membership-actions button[hidden],.profile-membership [data-active-benefits][hidden],.membership-comparison[hidden]{display:none}
.profile-membership [role=status]{margin:14px 0 0;font-size:13px;color:var(--muted)}
.profile-membership [role=status]:empty{display:none}
.profile-shell .profile-membership-actions a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

/* Plan comparison table */
.membership-comparison{overflow-x:auto;margin-bottom:24px;border:1px solid var(--line);border-radius:var(--radius-s)}
.membership-comparison table{width:100%;min-width:520px;border-collapse:collapse;text-align:left;font-size:13px;line-height:1.5}
.membership-comparison th,.membership-comparison td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:top}
.membership-comparison tbody tr:last-child th,.membership-comparison tbody tr:last-child td{border-bottom:0}
.membership-comparison th{font-weight:600;color:var(--text)}
.membership-comparison thead th{font-family:var(--font-mono);font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);background:var(--surface-2)}
.membership-comparison td{color:var(--muted)}
.membership-comparison td:nth-child(3){color:var(--text)}
.membership-comparison th:last-child,.membership-comparison td:last-child{background:var(--accent-soft);color:var(--accent-text)}
.membership-comparison thead th:last-child{color:var(--accent-text)}

/* Quiet settings (collapsible rows) */
.profile-quiet-settings{margin-top:28px;border-top:1px solid var(--line)}
.profile-quiet-settings details{border-bottom:1px solid var(--line)}
.profile-quiet-settings summary{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 2px;font-size:15px;font-weight:500;color:var(--text);cursor:pointer;list-style:none;transition:color .15s ease}
.profile-quiet-settings summary::-webkit-details-marker{display:none}
.profile-quiet-settings summary:after{content:'+';flex:0 0 auto;display:inline-grid;place-items:center;width:28px;height:28px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font-family:var(--font-mono);font-size:14px;font-weight:400;line-height:1;color:var(--muted);transition:background .15s ease,border-color .15s ease,color .15s ease}
.profile-quiet-settings details[open] summary:after{content:'−';background:var(--ink);border-color:var(--ink);color:var(--ink-text)}
.profile-quiet-settings summary:hover,.profile-quiet-settings details[open] summary{color:var(--text)}
.profile-quiet-settings summary:hover:after{border-color:var(--line-strong);background:var(--surface-2)}
.profile-quiet-settings summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
.profile-settings-content{max-width:460px;padding:2px 2px 28px}
.profile-settings-content>p{color:var(--muted);font-size:14px;line-height:1.6;margin:0 0 16px}

/* Footer */
.profile-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:24px;border-top:1px solid var(--line);padding-top:18px}
.profile-shell .profile-footer{border-top:0;margin-top:12px;padding-top:8px}
.profile-footer p{margin:0;font-size:13px;line-height:1.55;color:var(--muted)}
.profile-shell .profile-footer button{flex-shrink:0;min-height:38px;padding:0 16px;border:1px solid var(--line-strong);border-radius:999px;background:var(--surface);color:var(--text);font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:background .15s ease}
.profile-shell .profile-footer button:hover{background:var(--surface-2);color:var(--text)}
.profile-shell button:focus-visible,.profile-billing-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}

@media(max-width:700px){
  .profile-settings-grid{grid-template-columns:1fr}
  .profile-shell .member-card{padding:22px}
  .profile-shell .profile-overview{align-items:flex-start;gap:16px}
  .profile-photo-hint{width:100%;margin:3px 0 0}
  .profile-heading{align-items:flex-start;flex-direction:column;gap:14px}
  .profile-name-row #profileUsername{font-size:24px}
}
@media(max-width:600px){.profile-plus-focus .profile-membership ul{grid-template-columns:1fr}.profile-plus-focus .profile-membership-actions{max-width:none}.membership-comparison th,.membership-comparison td{padding:10px 10px;font-size:12px}}
@media(max-width:420px){.profile-shell .profile-overview{flex-direction:column}.profile-details{width:100%}.profile-footer{flex-direction:column;align-items:flex-start}}
