.profile-theme-editor { display:grid; gap:14px; min-width:0; padding:18px; border:1px solid var(--line); border-radius:14px; }
.profile-theme-editor h3,.profile-theme-editor p { margin:0; overflow-wrap:anywhere; }
.profile-theme-editor h3 { font-size:16px; line-height:1.5; }
.profile-theme-help,.profile-theme-status { font-size:12px; line-height:1.6; color:var(--muted); }
.profile-theme-toggle { display:flex; align-items:center; gap:10px; min-height:44px; }
.profile-theme-toggle input { flex:0 0 20px; width:20px!important; height:20px; margin:0; }
.profile-theme-toggle span { font-size:13px; overflow-wrap:anywhere; }
.profile-theme-colors { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.profile-theme-color { display:grid; gap:7px; min-width:0; align-content:start; }
.profile-theme-color span,.profile-theme-color output { overflow-wrap:anywhere; font-size:12px; line-height:1.5; }
.profile-theme-color input[type=color] { width:100%; min-height:44px; padding:3px; cursor:pointer; }
.profile-theme-color output { font-variant-numeric:tabular-nums; color:var(--muted); }
.profile-theme-presets,.profile-theme-actions { display:flex; flex-wrap:wrap; gap:8px; }
.profile-theme-editor .setting-action { min-height:44px; max-width:100%; height:auto; white-space:normal; }
.profile-theme-editor [hidden] { display:none!important; }
.profile-theme-preview { min-width:0; overflow:hidden; border:3px solid var(--line); border-radius:17px; color:var(--text); background:var(--panel); }
.profile-theme-preview-banner { height:65px; background:linear-gradient(135deg,var(--raised),var(--accent-bg)); }
.profile-theme-preview-content { padding:0 16px 16px; background:var(--panel); }
.profile-theme-preview-avatar { position:relative; top:-22px; display:grid; place-items:center; width:52px; height:52px; margin-bottom:-12px; border:3px solid var(--panel); border-radius:16px; background:var(--accent); color:var(--bg); font-size:22px; font-weight:800; }
.profile-theme-preview h4 { margin:0 0 12px; font-size:19px; overflow-wrap:anywhere; }
.profile-theme-preview p { margin:8px 0; font-size:12px; line-height:1.6; }
.profile-theme-preview-button { min-height:44px; margin-top:8px; padding:8px 13px; border:1px solid var(--line); border-radius:10px; color:var(--text); background:var(--bg); font:inherit; }
/* These variables inherit only within a profile card, never the app document. */
:is(.member-profile-dialog,.profile-theme-preview)[data-profile-theme=custom] {
  --bg:var(--profile-theme-surface); --panel:var(--profile-theme-surface); --raised:var(--profile-theme-surface); --side:var(--profile-theme-surface);
  --text:var(--profile-theme-foreground); --muted:var(--profile-theme-foreground); --dim:var(--profile-theme-foreground);
  --accent:var(--profile-theme-text-accent); --accent-bg:var(--profile-theme-surface); --line:var(--profile-theme-line);
  color:var(--profile-theme-foreground); border:3px solid transparent;
  background:linear-gradient(to bottom,var(--profile-theme-gradient-primary),var(--profile-theme-gradient-secondary)) border-box;
  background:linear-gradient(to bottom in srgb,var(--profile-theme-gradient-primary),var(--profile-theme-gradient-secondary)) border-box;
  background-attachment:local;
}
.profile-theme-preview[data-profile-theme=custom] .profile-theme-preview-banner,
.member-profile-dialog[data-profile-theme=custom] .member-profile-banner[data-profile-theme-fallback=true] { background:transparent; }
:is(.member-profile-dialog,.profile-theme-preview)[data-profile-theme=custom] :is(.member-profile-content,.profile-theme-preview-content) { background:transparent; color:var(--profile-theme-foreground); }
:is(.member-profile-dialog,.profile-theme-preview)[data-profile-theme=custom] :is(.game-activity-card,.member-live-activity,.spotify-activity-card,.member-profile-stat,.member-profile-activities li,.member-profile-pronouns,.member-profile-context,.member-profile-link,.game-activity-tag) { background:var(--profile-theme-surface); color:var(--profile-theme-foreground); }
:is(.member-profile-dialog,.profile-theme-preview)[data-profile-theme=custom] :is(.member-profile-actions .primary,.profile-theme-preview-button) { background:var(--profile-theme-accent); color:var(--profile-theme-button-text); }
.profile-theme-preview[data-profile-theme=custom] .profile-theme-preview-avatar { background:var(--profile-theme-accent); color:var(--profile-theme-button-text); }
.member-profile-dialog[data-profile-theme=custom] .member-profile-close { background:var(--profile-theme-surface); color:var(--profile-theme-foreground); }
.member-profile-dialog[data-profile-theme=custom] :is(.member-profile-pronouns,.member-profile-context,.member-profile-link a,.member-profile-link:hover,.game-activity-source:hover) { color:var(--profile-theme-text-accent); }
@media(max-width:500px) { .profile-theme-editor { padding:13px; } .profile-theme-colors { grid-template-columns:1fr; } }
