.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.profile-modal.is-open {
  display: flex;
}

.profile-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 36, 48, 0.48);
}

.profile-modal__card {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(18, 44, 90, 0.28);
  padding: 22px 22px 18px;
}

.profile-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8b93a0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.profile-modal__close:hover {
  background: #f3f5f8;
  color: #334155;
}

.profile-modal__head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding-right: 28px;
}

.profile-modal__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(145deg, #9bbcff, #2f6bff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.profile-modal__name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.profile-modal__name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--navy-deep);
  letter-spacing: -0.03em;
}

.profile-modal__grade {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: #eaf1ff;
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}

.profile-modal__bio {
  margin: 0;
  font-size: 13px;
  color: #6b7480;
  line-height: 1.45;
}

.profile-modal__msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 42px;
  margin-bottom: 16px;
  border: 1px solid #dbe3ee;
  border-radius: 10px;
  background: #fff;
  color: #163a73;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.profile-modal__card.is-member .profile-modal__grade,
.profile-modal__card.is-member .profile-modal__bio,
.profile-modal__card.is-member .profile-modal__stats,
.profile-modal__card.is-member .profile-modal__recent-head,
.profile-modal__card.is-member .profile-modal__posts {
  display: none;
}

.profile-modal__org {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
}

.profile-modal__org[hidden] {
  display: none;
}

.profile-modal__org li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid #f3f5f8;
  font-size: 13.5px;
}

.profile-modal__org li:last-child {
  border-bottom: 0;
}

.profile-modal__org .label {
  color: #6b7480;
}

.profile-modal__org .value {
  color: #243044;
  font-weight: 700;
  text-align: right;
}

.profile-modal__card.is-member .profile-modal__msg {
  margin-bottom: 0;
  margin-top: 12px;
}

.profile-modal__msg[hidden] {
  display: none !important;
}

.profile-modal__msg:hover {
  border-color: #9cbcff;
  color: var(--blue);
  background: #f5f8ff;
}

.profile-modal__stats {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid #eef1f5;
  border-bottom: 1px solid #eef1f5;
}

.profile-modal__stats li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid #f3f5f8;
  font-size: 13.5px;
}

.profile-modal__stats li:last-child {
  border-bottom: 0;
}

.profile-modal__stats .ico {
  width: 20px;
  text-align: center;
  color: #8b93a0;
  font-size: 14px;
}

.profile-modal__stats .label {
  color: #6b7480;
  flex: 1;
}

.profile-modal__stats .value {
  color: #243044;
  font-weight: 700;
}

.profile-modal__recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.profile-modal__recent-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-deep);
}

.profile-modal__more {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.profile-modal__posts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.profile-modal__posts li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.profile-modal__posts a {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  line-height: 1.4;
}

.profile-modal__posts a:hover {
  color: var(--blue);
}

.profile-modal__posts time {
  flex-shrink: 0;
  font-size: 12px;
  color: #93a0ae;
}

body.profile-modal-open {
  overflow: hidden;
}

button.js-member-profile,
.board-table td button.js-member-profile {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

button.js-member-profile:hover,
.bd-post__meta .js-member-profile:hover,
.bd-comment__meta .js-member-profile:hover {
  color: var(--blue);
  text-decoration: underline;
}
