:root {
  color-scheme: light;
  --bg: #fff7fb;
  --panel: rgba(255,255,255,0.88);
  --text: #453747;
  --muted: #8a7a90;
  --line: rgba(100,76,104,0.16);
  --accent: #ff8fc3;
  --danger: #c43a5b;
  --ok: #3f9f68;
  --shadow: 0 18px 60px rgba(87,58,89,0.14);
  --button-bg: rgba(255,255,255,.86);
  --button-text: #453747;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16111a;
  --panel: rgba(35,28,40,.9);
  --text: #fff4fb;
  --muted: #c4aebb;
  --line: rgba(255,255,255,.12);
  --accent: #ff86c5;
  --danger: #ff7898;
  --ok: #77e0a4;
  --shadow: 0 20px 52px rgba(0,0,0,.34);
  --button-bg: #2b2231;
  --button-text: #fff4fb;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 24%, transparent) 0, transparent 32rem),
    radial-gradient(circle at 88% 6%, color-mix(in srgb, #8d7cff 24%, transparent) 0, transparent 30rem),
    var(--bg);
}
a { color: inherit; }
.auth-card {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-bottom: 24px; }
.logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff8fc3, #9ddcff);
  box-shadow: var(--shadow);
}
.brand strong { display: block; font-size: 18px; }
.brand span { color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0 0 8px; font-size: 12px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
h1 { margin: 0 0 10px; line-height: 1.12; }
p { color: var(--muted); line-height: 1.65; }
form { display: grid; gap: 14px; margin-top: 18px; }
label { display: grid; gap: 7px; font-weight: 750; font-size: 13px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  background: rgba(255,255,255,.82);
  color: var(--text);
  outline: none;
  font: inherit;
}
input:focus { border-color: rgba(255, 143, 195, .8); box-shadow: 0 0 0 4px rgba(255,143,195,.18); }
button, .button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--text);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.62);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: pre-wrap;
}
.notice.ok { color: var(--ok); background: rgba(63,159,104,.08); border-color: rgba(63,159,104,.2); }
.notice.error { color: var(--danger); background: rgba(196,58,91,.08); border-color: rgba(196,58,91,.2); }
.hidden { display: none !important; }
.auth-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.role-pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.62); }

/* Public profile */
.profile-card-wide { width: min(760px, 100%); }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.profile-title h1 { margin-bottom: 4px; }
.profile-role-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.profile-links a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; background: rgba(255,255,255,.62); font-weight: 800; font-size: 13px; }
.profile-bio { white-space: pre-wrap; background: rgba(255,255,255,.48); border: 1px solid var(--line); border-radius: 18px; padding: 14px; color: var(--text); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.profile-badge { border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: rgba(255,255,255,.62); }
.profile-badge-img { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 8px; color: #fff; font-weight: 900; background: linear-gradient(135deg, #ff8fc3, #9ddcff); overflow: hidden; }
.profile-badge-img img { width: 100%; height: 100%; object-fit: cover; }
.profile-badge strong { display: block; font-size: 13px; line-height: 1.35; }
.profile-badge small { display: block; margin-top: 4px; color: var(--muted); }
.profile-edit { display: grid; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.profile-edit textarea { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; font: inherit; resize: vertical; color: var(--text); background: rgba(255,255,255,.82); }
.profile-edit select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; font: inherit; color: var(--text); background: rgba(255,255,255,.82); }

/* v2.5 public profile display/editor refinement */
.profile-card-wide { width: min(860px, 100%); }
.profile-actions { display: flex; align-items: flex-start; gap: 8px; }
.profile-actions .button[disabled] { opacity: .62; cursor: not-allowed; }
.profile-section { margin-top: 22px; }
.profile-section h2 { margin: 0 0 10px; font-size: 18px; }
.profile-social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}
.profile-social-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.7);
  box-shadow: 0 8px 24px rgba(87,58,89,.08);
  text-decoration: none;
  transition: transform .18s ease, opacity .18s ease, filter .18s ease;
}
.profile-social-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.profile-social-icon.is-active:hover { transform: translateY(-2px); }
.profile-social-icon.is-disabled {
  opacity: .34;
  filter: grayscale(1);
}
.profile-edit.hidden { display: none; }
.profile-edit .muted { margin: 0; color: var(--muted); font-size: 13px; }
.profile-bio-section { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .profile-head { display: grid; }
  .profile-actions { justify-content: flex-start; }
}

/* v2.6 VRC-inspired public profile layout */
body[data-auth-page="profile"] {
  display: block;
  place-items: initial;
  padding: 24px;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--accent) 24%, transparent) 0, transparent 32rem),
    radial-gradient(circle at 88% 6%, color-mix(in srgb, #8d7cff 24%, transparent) 0, transparent 30rem),
    var(--bg);
}
body[data-auth-page="profile"] .profile-card-wide {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: 32px;
  background: rgba(255,255,255,.9);
}
body[data-auth-page="profile"] .brand {
  margin: 22px 24px 12px;
}
body[data-auth-page="profile"] #notice,
body[data-auth-page="profile"] .auth-links {
  margin-left: 24px;
  margin-right: 24px;
  margin-bottom: 20px;
}
.vrc-profile-shell {
  overflow: hidden;
}
.profile-cover {
  position: relative;
  height: 160px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.34), transparent 22%),
    linear-gradient(135deg, #19b5c8, #ff9ac8 72%, #ffe5f2);
  border-bottom: 1px solid rgba(255,255,255,.72);
}
.profile-status-chip {
  position: absolute;
  right: 24px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(20, 25, 33, .86);
  color: #fff;
  font-weight: 850;
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
.profile-status-chip span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #54e6a2;
  box-shadow: 0 0 0 4px rgba(84,230,162,.16);
}
.profile-identity-card {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 0 28px 24px;
  margin-top: -54px;
}
.profile-avatar {
  width: 132px;
  height: 132px;
  border-radius: 36px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 7px solid rgba(255,255,255,.92);
  background: linear-gradient(135deg, #ff8fc3, #9ddcff);
  color: #fff;
  font-size: 48px;
  font-weight: 1000;
  box-shadow: 0 16px 42px rgba(47,32,54,.2);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-identity-main {
  min-width: 0;
  padding-top: 60px;
}
.profile-identity-main h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 48px);
  letter-spacing: -.04em;
}
.profile-handle {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 800;
}
.profile-role-line .role-pill.strong {
  color: #6e3554;
  background: rgba(255,143,195,.18);
  border-color: rgba(255,143,195,.28);
}
.profile-actions .button {
  background: rgba(255,255,255,.86);
  color: var(--text);
  border: 1px solid var(--line);
}
[data-theme="dark"] .profile-actions .button {
  background: rgba(255,255,255,.08);
  color: var(--text);
}
.profile-actions .button.secondary {
  background: rgba(255,255,255,.86);
  color: var(--text);
  border: 1px solid var(--line);
}
[data-theme="dark"] .profile-actions .button.secondary {
  background: rgba(255,255,255,.08);
}
.profile-stats-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 28px 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.55);
}
.profile-stats-card div {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.6);
}
.profile-stats-card strong {
  font-size: 22px;
}
.profile-stats-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.vrc-profile-shell .profile-section,
.vrc-profile-shell .profile-edit {
  margin-left: 28px;
  margin-right: 28px;
}
.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.profile-section-head h2 { margin: 0; }
.profile-section-head span { color: var(--muted); font-size: 13px; font-weight: 850; }
.badge-showcase-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255,255,255,.56);
}
.badge-showcase-section .badge-grid {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.profile-empty-text { margin: 0; }
.vrc-profile-shell .profile-edit {
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  background: rgba(255,255,255,.68);
}
.profile-bio-section {
  margin-bottom: 28px;
}
.profile-bio {
  min-height: 96px;
  font-size: 15px;
  line-height: 1.75;
}
@media (max-width: 720px) {
  body[data-auth-page="profile"] { padding: 12px; }
  .profile-cover { height: 132px; }
  .profile-status-chip { right: 16px; bottom: 16px; }
  .profile-identity-card {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: end;
    padding: 0 18px 20px;
    margin-top: -38px;
  }
  .profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 28px;
    border-width: 5px;
    font-size: 34px;
  }
  .profile-identity-main { padding-top: 42px; }
  .profile-actions {
    grid-column: 1 / -1;
    flex-wrap: wrap;
  }
  .profile-actions .button { flex: 1 1 auto; }
  .profile-stats-card,
  .vrc-profile-shell .profile-section,
  .vrc-profile-shell .profile-edit {
    margin-left: 18px;
    margin-right: 18px;
  }
  .profile-stats-card { grid-template-columns: 1fr 1fr 1fr; padding: 10px; }
}


/* shared auth/profile theme refinements */
[data-theme="dark"] .auth-card,
[data-theme="dark"] body[data-auth-page="profile"] .profile-card-wide {
  background: var(--panel);
}
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: rgba(255,255,255,.08);
  color: var(--text);
}
[data-theme="dark"] .profile-stats-card,
[data-theme="dark"] .profile-stats-card div,
[data-theme="dark"] .badge-showcase-section,
[data-theme="dark"] .vrc-profile-shell .profile-edit,
[data-theme="dark"] .profile-bio,
[data-theme="dark"] .profile-badge,
[data-theme="dark"] .profile-social-icon {
  background: rgba(255,255,255,.06);
}
