/* Profile surfaces use the same palette as Graphite chats and settings. */
body.workspace-design.graphite-interface .graphite-profile-card { overflow:hidden; border:1px solid var(--line); border-radius:14px; background:var(--panel); color:var(--text); min-width:0; }
body.workspace-design.graphite-interface .graphite-profile-banner { height:142px; background:linear-gradient(125deg,var(--panel-soft),color-mix(in srgb,var(--accent) 26%,var(--panel))); overflow:hidden; }
.graphite-profile-banner img { display:block; width:100%; height:100%; object-fit:cover; }
body.workspace-design.graphite-interface .graphite-profile-body { padding:0 24px 24px; }
.graphite-profile-identity { width:max-content; position:relative; margin-top:-43px; margin-bottom:18px; }
body.workspace-design.graphite-interface .graphite-profile-avatar { display:grid; place-items:center; width:88px; height:88px; border:5px solid var(--panel); border-radius:50%; background:var(--panel-soft); color:var(--accent); font-size:26px; font-weight:650; overflow:hidden; box-sizing:content-box; }
.graphite-profile-avatar img { width:100%; height:100%; object-fit:cover; grid-area:1/1; }
.graphite-profile-avatar:has(img) { font-size:0; }
body.workspace-design.graphite-interface .graphite-presence-dot { position:absolute; right:3px; bottom:3px; width:19px; height:19px; border:4px solid var(--panel); border-radius:50%; background:var(--muted); }
body.workspace-design.graphite-interface .graphite-presence-dot[data-presence=online] { background:var(--accent); }
.graphite-presence-dot[data-presence=idle] { background:#e5b65c!important; }
.graphite-presence-dot[data-presence=dnd] { background:#ed7e90!important; }
body.workspace-design.graphite-interface .graphite-profile-name { font-size:25px; font-weight:650; line-height:1.2; margin:0 0 6px; letter-spacing:-.3px; overflow-wrap:anywhere; }
body.workspace-design.graphite-interface .graphite-profile-card p { font-size:13px; line-height:1.6; margin:6px 0; color:var(--text); overflow-wrap:anywhere; }
body.workspace-design.graphite-interface .graphite-profile-card :is(.graphite-profile-handle,.graphite-profile-pronouns,.graphite-profile-subtitle,.graphite-profile-empty) { color:var(--muted); }
body.workspace-design.graphite-interface .graphite-profile-presence { display:flex; align-items:center; gap:8px; margin:14px 0; color:var(--muted); }
.graphite-profile-presence:before { content:''; display:block; width:9px; height:9px; border-radius:50%; background:currentColor; }
body.workspace-design.graphite-interface .graphite-profile-presence[data-presence=online] { color:var(--accent); }
body.workspace-design.graphite-interface .graphite-profile-custom-status { padding:12px 14px; background:var(--panel-soft); border-radius:9px; white-space:pre-wrap; }
body.workspace-design.graphite-interface :is(.graphite-profile-about,.graphite-profile-group) { padding-top:18px; margin-top:20px; border-top:1px solid var(--line); }
body.workspace-design.graphite-interface :is(.graphite-profile-about,.graphite-profile-group) h3 { font-size:11px; font-weight:650; letter-spacing:.6px; text-transform:uppercase; color:var(--muted); margin:0 0 10px; }
.graphite-profile-about p { white-space:pre-wrap; }
.graphite-profile-tags { display:flex; flex-wrap:wrap; gap:7px; }
body.workspace-design.graphite-interface .graphite-profile-tags span { padding:5px 9px; border-radius:7px; border:1px solid var(--line); background:var(--panel-soft); font-size:12px; overflow-wrap:anywhere; }
body.workspace-design.graphite-interface .graphite-profile-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:24px; flex-wrap:wrap; }
body.workspace-design.graphite-interface .graphite-profile-actions button { min-height:40px; padding:0 16px; border-radius:9px; border:1px solid var(--line); background:var(--panel-soft); color:var(--text); }
body.workspace-design.graphite-interface .graphite-profile-actions .profile-primary { background:var(--accent); color:var(--bg); border-color:var(--accent); font-weight:600; }
body.workspace-design.graphite-interface .friend-profile { width:min(440px,calc(100vw - 32px)); padding:0; border-radius:15px; overflow:visible; max-height:calc(100dvh - 48px); }
body.workspace-design.graphite-interface .friend-profile .graphite-profile-card { max-height:calc(100dvh - 48px); overflow:auto; border:0; }
body.workspace-design.graphite-interface .graphite-profile-close { position:absolute; z-index:1; top:12px; right:12px; display:grid; place-items:center; width:32px; height:32px; padding:0; min-height:32px; border-radius:9px; border:1px solid #ffffff24; background:#101417b8; color:#fff; font-size:22px; }

/* Existing server-member panel keeps its navigation and authorized actions. */
body.workspace-design.graphite-interface .community-member-card.graphite-member-profile { padding:0; background:var(--panel); border-color:var(--line); border-radius:12px; }
body.workspace-design.graphite-interface .graphite-member-profile>.graphite-member-back { margin:12px; min-height:32px; border:0; padding:0 10px; color:var(--muted); background:var(--panel-soft); }
body.workspace-design.graphite-interface .graphite-member-profile>.graphite-profile-card { border:0; border-radius:0; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-profile-banner { height:96px; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-profile-body { padding:0 16px 18px; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-profile-identity { margin-top:-31px; margin-bottom:12px; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-profile-avatar { width:64px; height:64px; font-size:20px; border-width:4px; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-profile-name { font-size:21px; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-presence-dot { width:14px; height:14px; border-width:3px; }
body.workspace-design.graphite-interface .graphite-profile-card--compact .graphite-profile-group { margin-top:16px; padding-top:14px; }
body.workspace-design.graphite-interface .graphite-member-profile .community-member-roles { margin-top:12px; }

/* My profile follows the reference's edit/preview split. */
body.workspace-design.graphite-interface .graphite-profile-editor { width:min(1000px,calc(100vw - 48px)); padding:28px; box-sizing:border-box; background:var(--bg); border-color:var(--line); }
.graphite-profile-editor-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:24px; }
body.workspace-design.graphite-interface .graphite-profile-editor-header h2 { font-size:26px; margin:0 0 8px; }
body.workspace-design.graphite-interface .graphite-profile-editor-header p { margin:0; color:var(--muted); }
body.workspace-design.graphite-interface .graphite-profile-editor-header button { flex-shrink:0; min-width:34px; min-height:34px; border-radius:9px; border:1px solid var(--line); background:var(--panel); color:var(--muted); font-size:20px; }
body.workspace-design.graphite-interface .graphite-profile-editor form { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.85fr); gap:24px; align-items:start; }
.graphite-profile-fields { display:flex; flex-direction:column; gap:18px; min-width:0; }
body.workspace-design.graphite-interface .graphite-profile-fields label { display:flex; flex-direction:column; gap:8px; font-size:13px; color:var(--muted); }
body.workspace-design.graphite-interface .graphite-profile-fields :is(input,select,textarea) { width:100%; box-sizing:border-box; border-radius:9px; background:var(--panel); border:1px solid var(--line); color:var(--text); }
body.workspace-design.graphite-interface .graphite-profile-fields input[readonly] { color:var(--muted); }
body.workspace-design.graphite-interface .graphite-profile-fields textarea { min-height:110px; height:110px; resize:vertical; }
body.workspace-design.graphite-interface .graphite-profile-fields input[type=color] { width:64px; height:40px; padding:4px; }
body.workspace-design.graphite-interface .graphite-profile-upload { padding:16px; border:1px solid var(--line); border-radius:12px; background:var(--panel); }
body.workspace-design.graphite-interface .graphite-profile-upload input[type=file] { padding:8px; min-height:40px; font-size:11px; }
.graphite-profile-upload button { justify-self:start; }
.graphite-profile-avatar-edit { display:flex; align-items:center; gap:20px; margin-bottom:6px; }
body.workspace-design.graphite-interface .graphite-profile-avatar-edit button { min-height:40px; border-radius:9px; border:1px solid var(--line); background:var(--panel); color:var(--text); padding:0 14px; }
body.workspace-design.graphite-interface .graphite-profile-preview { position:sticky; top:0; min-width:0; padding:18px; border:1px solid var(--line); background:var(--panel); border-radius:14px; }
body.workspace-design.graphite-interface .graphite-profile-preview>h3 { font-size:17px; margin:0 0 18px; }
body.workspace-design.graphite-interface .graphite-profile-preview .graphite-profile-card { background:var(--bg); }
body.workspace-design.graphite-interface .graphite-profile-preview .graphite-profile-avatar { border-color:var(--bg); }
body.workspace-design.graphite-interface .graphite-profile-preview .graphite-presence-dot { border-color:var(--bg); }
body.workspace-design.graphite-interface .graphite-profile-preview>p { color:var(--muted); font-size:12px; line-height:1.6; margin-bottom:0; }
.graphite-profile-editor-footer { grid-column:1/-1; }
body.workspace-design.graphite-interface .graphite-profile-editor-footer>[role=alert]:empty { display:none; }
body.workspace-design.graphite-interface .graphite-profile-editor-footer>[role=alert] { color:#f2a5b2; white-space:pre-wrap; }
.graphite-profile-editor-footer .graphite-profile-actions { justify-content:flex-start; margin:0; }
@media(max-width:760px) {
    body.workspace-design.graphite-interface .graphite-profile-editor { width:calc(100vw - 24px); padding:20px; max-height:calc(100dvh - 24px); }
    body.workspace-design.graphite-interface .graphite-profile-editor form { grid-template-columns:minmax(0,1fr); gap:20px; }
    body.workspace-design.graphite-interface .graphite-profile-preview { position:static; }
    body.workspace-design.graphite-interface .graphite-profile-preview .graphite-profile-banner { height:120px; }
    body.workspace-design.graphite-interface .graphite-profile-editor-footer { grid-column:1; }
    body.workspace-design.graphite-interface .graphite-profile-avatar-edit { gap:12px; }
    body.workspace-design.graphite-interface .graphite-profile-body { padding-left:18px; padding-right:18px; }
}

/* Approved My Profile screen is a settings page, never a modal inside settings. */
body.workspace-design.graphite-interface .reference-settings #settings-category-account>.profile-editor-entry,
body.workspace-design.graphite-interface .reference-settings #settings-category-account>.setting:has(#avatar-file) { display:none; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor--inline {
    width:100%; max-width:none; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; margin:0;
}
body.workspace-design.graphite-interface .reference-settings[data-section=account] .settings-body { padding-top:26px; }
body.workspace-design.graphite-interface .reference-settings[data-section=account] .settings-header { top:20px; }
.reference-settings[data-section=account] .settings-header>span { display:none; }
body.workspace-design.graphite-interface .reference-settings #settings-category-account>.settings-section-description { margin-bottom:14px; font-size:17px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor--inline form {
    grid-template-columns:minmax(0,1.22fr) minmax(280px,1fr); gap:38px; align-items:start;
}
.graphite-profile-editor--inline .graphite-profile-fields { gap:16px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-fields>label { display:flex; flex-direction:column; align-items:stretch; gap:7px; margin:0; font-size:16px; color:var(--muted); }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-fields :is(input,select,textarea) { min-height:44px; padding:9px 14px; font:inherit; font-size:15px; font-weight:400; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--panel); }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-fields input[readonly] { color:var(--muted); cursor:default; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-fields textarea { min-height:88px; height:88px; padding-bottom:26px; line-height:1.5; }
.graphite-profile-editor--inline .profile-about-field { position:relative; }
.graphite-profile-editor--inline .profile-about-count { position:absolute; right:12px; bottom:8px; color:var(--muted); font-size:12px; pointer-events:none; }
.graphite-profile-editor--inline .profile-avatar-feedback { font-size:13px; color:var(--muted); margin:0; }
.graphite-profile-editor--inline .profile-avatar-feedback:empty { display:none; }
.graphite-profile-editor--inline .profile-avatar-edit-picture { position:relative; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit { gap:26px; margin-bottom:0; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit .graphite-profile-avatar { width:178px; height:178px; border:2px solid var(--line); font-size:48px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit>button { min-height:48px; padding:10px 24px; font-size:15px; font-weight:400; }
body.workspace-design.graphite-interface .reference-settings .profile-avatar-camera { position:absolute; right:0; bottom:4px; width:50px; height:50px; min-height:50px; padding:12px; display:grid; place-items:center; border-radius:50%; background:var(--panel); border:1px solid var(--muted); }
.profile-avatar-camera>.interface-icon { width:24px; height:24px; }
.graphite-profile-editor--inline .profile-account-data { border-top:1px solid var(--line); padding-top:20px; margin-top:4px; }
.graphite-profile-editor--inline .profile-account-data>h3 { font-size:15px; margin:0 0 18px; }
.graphite-profile-editor--inline .profile-account-email { display:flex; gap:22px; align-items:center; font-size:14px; color:var(--text); }
.graphite-profile-editor--inline .profile-account-email>.interface-icon { width:44px; height:44px; padding:11px; box-sizing:border-box; border-radius:12px; background:var(--panel); }
.graphite-profile-editor--inline .profile-account-email>span { flex:1; min-width:0; }
.graphite-profile-editor--inline .profile-account-email strong { display:block; margin-top:6px; font-size:15px; font-weight:400; overflow-wrap:anywhere; }
.graphite-profile-editor--inline .profile-account-email small { color:var(--muted); white-space:nowrap; font-size:13px; }
.graphite-profile-editor--inline .graphite-profile-preview-wrap { min-width:0; position:sticky; top:0; margin-top:-36px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview { padding:22px; border-radius:10px; position:static; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview>h3 { font-size:22px; margin:0 0 20px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-card { border-radius:10px; background:var(--panel); }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-banner { height:204px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-body { padding:0 26px 28px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-identity { margin-top:-78px; margin-bottom:14px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-avatar { width:136px; height:136px; border:4px solid var(--panel); }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-presence-dot { width:23px; height:23px; border:4px solid var(--panel); }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-name { font-size:30px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-card p { font-size:15px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-presence { font-size:17px; margin:14px 0; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-presence::before { width:14px; height:14px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-about { margin:20px 0 0; padding:0; border:0; }
.graphite-profile-editor--inline .graphite-profile-preview .graphite-profile-about>h3 { display:none; }
.graphite-profile-editor--inline .profile-member-since { display:flex; gap:13px; align-items:center; border-top:1px solid var(--line); padding-top:22px; margin-top:24px!important; color:var(--muted)!important; }
.graphite-profile-editor--inline .profile-preview-note { font-size:15px; margin:16px 4px 0; line-height:1.5; color:var(--text); }
.graphite-profile-editor--inline .profile-preview-note em { display:block; color:var(--muted); }
.graphite-profile-editor--inline .graphite-profile-editor-footer { grid-column:auto; margin-top:10px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor-footer .graphite-profile-actions { margin:0; justify-content:flex-start; gap:20px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor-footer button { min-height:50px; padding:10px 26px; font-size:16px; }
body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor-footer .profile-primary { color:var(--bg); }
.graphite-profile-editor--inline .profile-save-status { font-size:14px; color:#f2a5b2; margin:0 0 12px; }
.graphite-profile-editor--inline .profile-save-status:empty { display:none; }
.graphite-profile-editor--inline .profile-save-status.saved { color:var(--accent); }
.graphite-profile-editor--inline .profile-extra-settings { margin-top:12px; border-top:1px solid var(--line); padding-top:18px; }
.graphite-profile-editor--inline .profile-extra-settings>summary { cursor:pointer; color:var(--muted); font-size:14px; }
.graphite-profile-editor--inline .profile-extra-settings>label { margin:20px 0; }
.graphite-profile-editor--inline .profile-extra-settings input[type=color] { min-height:40px; }
@media(min-width:901px) and (max-width:1240px) {
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor--inline form { gap:24px; grid-template-columns:minmax(0,1fr) minmax(260px,.85fr); }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit .graphite-profile-avatar { width:120px; height:120px; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit { gap:16px; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit>button { padding:10px 14px; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview { padding:16px; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-preview .graphite-profile-banner { height:150px; }
    .graphite-profile-editor--inline .profile-account-email { flex-wrap:wrap; gap:12px; }
}
@media(max-width:900px) {
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-editor--inline form { grid-template-columns:minmax(0,1fr); gap:28px; }
    .graphite-profile-editor--inline .graphite-profile-preview-wrap { position:static; margin-top:0; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit .graphite-profile-avatar { width:110px; height:110px; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit { gap:14px; }
    body.workspace-design.graphite-interface .reference-settings .graphite-profile-avatar-edit>button { padding:8px 12px; }
    .graphite-profile-editor--inline .profile-account-email { flex-wrap:wrap; gap:12px; }
}
