.x-avatar > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.x-profile-cover { position: relative; height: auto; aspect-ratio: 3 / 1; padding: 0; overflow: hidden; }
.site-profile-cover-image { display: block; width: 100%; height: 100%; object-fit: cover; }
.x-profile-info { padding-top: calc(12% + 12px); }
.x-profile-avatar { top: 0; transform: translateY(-50%); width: 24%; max-width: 145px; min-width: 80px; height: auto; aspect-ratio: 1; flex-basis: auto; }
.x-profile-info h1 { margin: 0; font-size: 20px; line-height: 24px; }
.site-profile-bio { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 20px; }
.site-profile-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0; color: var(--x-muted); font-size: 15px; line-height: 20px; }
.site-profile-meta > span, .site-profile-meta > a { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; overflow-wrap: anywhere; }
.site-profile-meta svg { width: 18px; height: 18px; }
.site-profile-meta > a { color: var(--accent); }
.site-profile-meta > a:hover { text-decoration: underline; }
.x-detail.x-profile { padding-top: 0; }
.site-profile-editor, .site-image-crop { width: min(600px,calc(100% - 32px)); max-width: 600px; max-height: calc(100dvh - 40px); margin: min(8vh,80px) auto auto; padding: 0; overflow: auto; border: 0; border-radius: 16px; color: var(--x-ink); background: var(--x-panel-bg, var(--x-bg)); box-shadow: 0 0 15px #65778633; }
.site-profile-editor::backdrop, .site-image-crop::backdrop, .site-mobile-drawer::backdrop { background: #0006; }
.site-profile-edit-page { width: min(600px,100%); min-height: 100dvh; margin: 0 auto; background: var(--x-bg); }
.site-editor-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 20px; min-height: 53px; padding: 8px 16px; background: var(--x-header); backdrop-filter: blur(12px); }
.site-editor-header h2 { flex: 1; min-width: 0; margin: 0; font-size: 20px; line-height: 24px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.site-profile-save { min-height: 32px; padding: 6px 17px; border: 0; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--x-primary-text); background: var(--x-primary-bg); }
.site-profile-save:hover { background: var(--x-primary-hover); }
.site-profile-save:disabled { opacity: .5; cursor: wait; }
.site-editor-cover { position: relative; aspect-ratio: 3 / 1; background: var(--x-border); overflow: hidden; }
.site-editor-cover > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.site-editor-cover::after { content: ''; position: absolute; inset: 0; background: #0003; pointer-events: none; }
.site-cover-controls { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: center; gap: 20px; }
.site-photo-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 10px; border: 0; border-radius: 50%; color: #fff; background: #0f1419bf; cursor: pointer; }
.site-photo-button:hover { background: #0f141999; }
.site-photo-button svg { width: 22px; height: 22px; }
.site-editor-avatar-row { position: relative; display: flex; justify-content: flex-end; min-height: 82px; padding: 16px; }
.site-editor-avatar { position: absolute; top: 0; left: 12px; transform: translateY(-50%); width: 120px; height: 120px; flex-basis: 120px; border: 4px solid var(--x-bg); font-size: 36px; }
.site-editor-avatar > .site-photo-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.site-avatar-remove { margin: 0; font-size: 13px; }
.site-editor-fields { display: grid; gap: 20px; padding: 0 16px 24px; }
.site-editor-fields > .x-form-error { margin: 0; }
.site-profile-field { position: relative; display: block; padding: 8px 12px; border: 1px solid var(--x-border); border-radius: 4px; color: var(--x-muted); font-size: 13px; line-height: 18px; }
.site-profile-field:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.site-profile-field > input, .site-profile-field > textarea { display: block; width: 100%; min-height: 26px; margin-top: 4px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--x-ink); font-size: 17px; line-height: 24px; }
.site-profile-field > textarea { min-height: 72px; resize: vertical; }
.site-profile-field > [data-profile-count] { position: absolute; top: 8px; right: 12px; color: var(--x-muted); font-size: 12px; }
.site-crop-stage { display: flex; align-items: center; justify-content: center; min-height: min(62vh,520px); padding: 20px; background: #000; }
.site-crop-stage > canvas { display: block; width: 100%; height: auto; max-height: calc(100dvh - 220px); touch-action: none; cursor: move; object-fit: contain; }
.site-image-crop[data-kind='avatar'] canvas { max-width: 400px; border-radius: 50%; box-shadow: 0 0 0 1px #ffffff70; }
.site-crop-zoom { display: grid; gap: 8px; padding: 16px 24px; color: var(--x-muted); font-size: 13px; }
.site-crop-zoom input { width: 100%; min-height: 36px; accent-color: var(--accent); }
.site-crop-hint { margin: 0; padding: 0 16px 20px; text-align: center; }
.site-mobile-drawer { position: fixed; inset: 0 auto 0 0; width: min(320px,85vw); height: 100dvh; max-height: 100dvh; margin: 0; padding: 0 0 env(safe-area-inset-bottom); overflow: auto; border: 0; border-radius: 0; color: var(--x-ink); background: var(--x-panel-bg, var(--x-bg)); box-shadow: 0 0 24px #0005; }
.site-mobile-drawer .site-editor-header { gap: 8px; }
.site-mobile-drawer h2 { font-size: 17px; }
.site-drawer-account { padding: 16px; }
.site-drawer-account strong, .site-drawer-account > span { display: block; overflow-wrap: anywhere; }
.site-drawer-account strong { margin-top: 12px; font-size: 20px; line-height: 24px; }
.site-drawer-account > span { margin-top: 3px; color: var(--x-muted); font-size: 15px; }
.site-drawer-nav > a, .site-drawer-nav > button { display: flex; align-items: center; gap: 20px; width: 100%; min-height: 56px; padding: 16px; border: 0; color: var(--x-ink); background: transparent; font-size: 20px; line-height: 24px; font-weight: 700; text-align: left; }
.site-drawer-nav > a:hover, .site-drawer-nav > button:hover { background: var(--x-hover); }
.site-drawer-theme { display: flex; align-items: center; justify-content: space-between; margin: 12px 16px 0; padding: 12px 0; border-top: 1px solid var(--x-line); }
.site-drawer-logout { padding: 8px 16px; }
.x-mobile-avatar { border: 0; padding: 0; }
body.site-profile-modal-open { overflow: hidden; }
:is(.site-profile-editor,.site-image-crop)[open] { animation: site-panel-in 180ms ease-out both; }
:is(.site-profile-editor,.site-image-crop)[open].is-closing { animation: site-panel-out 140ms ease-in both; pointer-events: none; }
:is(.site-profile-editor,.site-image-crop,.site-mobile-drawer)[open]::backdrop { animation: site-backdrop-in 180ms ease-out both; }
:is(.site-profile-editor,.site-image-crop,.site-mobile-drawer)[open].is-closing::backdrop { animation: site-backdrop-out 140ms ease-in both; }
.site-mobile-drawer[open] { animation: site-drawer-in 180ms ease-out both; }
.site-mobile-drawer[open].is-closing { animation: site-drawer-out 140ms ease-in both; pointer-events: none; }
@keyframes site-drawer-in { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes site-drawer-out { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media(max-width:600px) {
    .site-profile-editor, .site-image-crop { width: 100%; max-width: 100%; height: 100dvh; min-height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
    .site-editor-header { min-height: calc(53px + env(safe-area-inset-top)); padding-top: calc(8px + env(safe-area-inset-top)); }
    .x-column-header { padding-top: env(safe-area-inset-top); }
    .x-profile-cover { height: auto; }
    .x-profile-avatar { height: auto; top: 0; font-size: 28px; }
    .x-profile-info { padding-top: calc(12% + 12px); }
    .x-inline-composer:has([data-community-form]) { display: none; }
    .site-editor-avatar { width: 100px; height: 100px; flex-basis: 100px; }
    .site-editor-avatar-row { min-height: 70px; }
    .site-crop-stage { padding: 16px; }
    .site-editor-fields { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media(prefers-reduced-motion:reduce) {
    .site-profile-editor[open], .site-image-crop[open], .site-mobile-drawer[open] { animation: none !important; }
}
@media(max-width:360px) {
    .site-editor-header { gap: 12px; }
    .site-profile-editor h2, .site-image-crop h2, .site-profile-edit-page h2 { font-size: 18px; }
}
:root[data-theme='dark'] :is(.site-profile-editor, .site-image-crop, .site-mobile-drawer) .site-editor-header { background: var(--x-panel-bg); }
:root[data-theme='dark'] .site-profile-field { background: var(--x-panel-control-bg); }
:root[data-theme='dark'] .site-photo-button { color: var(--x-ink); background: var(--x-primary-bg); }
:root[data-theme='dark'] .site-photo-button:hover { background: var(--x-primary-hover); }
:root[data-theme='dark'] .site-crop-stage { background: var(--x-bg); }
:root[data-theme='dark'] .site-image-crop[data-kind='avatar'] canvas { box-shadow: 0 0 0 1px var(--x-border); }
