.profile-page {
  max-width: 980px;
  margin: 0 auto;
}

.profile-card {
  background: #12131A;
  border: 1px solid #1C1D26;
  border-radius: 16px;
  padding: 24px 20px 22px;
  box-shadow: 0 10px 30px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 14px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #17181D;
  border: 3px solid #FF344E;
  box-shadow: 0 10px 28px rgba(0,0,0,.5);
}

.profile-edit-btn {
  position: absolute;
  border: 0;
  border-radius: 50%;
  background: #FF344E;
  color: #0E0F12;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(255,52,78,.35);
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}

.profile-edit-btn .material-symbols-outlined {
  font-size: 20px;
}

.profile-edit-btn:hover,
.profile-edit-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255,52,78,.45);
  outline: none;
}

.profile-edit-btn:active {
  transform: scale(.95);
}

.profile-edit-avatar {
  bottom: 0;
  right: 4px;
}

.profile-name-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-name {
  font-size: 30px;
  font-weight: 700;
  color: #dd344e;
  line-height: 1.1;
}

.profile-edit-name {
  position: static;
  width: 30px;
  height: 30px;
}

.profile-role {
  margin-top: 2px;
  margin-bottom: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 52, 78, 0.12);
  border: 1px solid rgba(255, 52, 78, 0.32);
  color: #FFD5DB;
  font-size: 0.86rem;
  font-weight: 600;
}

.profile-hint {
  margin-top: 6px;
  font-size: 0.9rem;
  color: #D1D5DB;
  max-width: 420px;
}

.profile-works-section {
  margin-top: 22px;
  background: #12131A;
  border: 1px solid #1C1D26;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.profile-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.profile-section-title {
  font-size: 1.35rem;
  color: #FFFFFF;
  font-weight: 700;
}

.profile-section-count {
  color: #D1D5DB;
  font-size: 0.92rem;
}

.profile-works-status {
  color: #D1D5DB;
  font-size: 0.95rem;
  min-height: 20px;
  margin-bottom: 12px;
}

.profile-works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.profile-work-card {
  background: #17181D;
  border: 1px solid #1C1D26;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.profile-work-card:hover,
.profile-work-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,.38);
  border-color: rgba(255, 52, 78, 0.35);
}

.profile-work-link {
  text-decoration: none;
  color: #FFFFFF;
  display: block;
}

.profile-work-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 0.72 / 1;
  background: #0E0F12;
}

.profile-work-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-work-gradient {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.88) 100%);
}

.profile-work-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-work-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-work-cats span {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(2px);
  font-size: 0.72rem;
  font-weight: 600;
  color: #FFFFFF;
}

.profile-work-name {
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
}

.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1300;
}

.profile-modal.is-open {
  display: flex;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
}

.profile-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(520px, 96vw);
  max-height: 90vh;
  background: #12131A;
  border-radius: 18px;
  border: 1px solid #1C1D26;
  padding: 20px 18px 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-modal-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 2px;
}

.profile-modal-subtitle {
  font-size: 0.9rem;
  color: #D1D5DB;
}

.profile-avatar-scroll {
  margin-top: 10px;
  padding-right: 4px;
  padding-bottom: 4px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.profile-avatar-scroll::-webkit-scrollbar {
  width: 6px;
}

.profile-avatar-scroll::-webkit-scrollbar-thumb {
  background: #2A2C35;
  border-radius: 3px;
}

.profile-avatar-group {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.profile-avatar-group-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #FFFFFF;
  margin-bottom: 6px;
}

.profile-avatar-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.profile-avatar-grid::-webkit-scrollbar {
  height: 6px;
}

.profile-avatar-grid::-webkit-scrollbar-thumb {
  background: #2A2C35;
  border-radius: 3px;
}

.profile-avatar-option {
  border: 0;
  padding: 6px;
  border-radius: 14px;
  background: #0E0F12;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
  flex: 0 0 auto;
}

.profile-avatar-option img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  background: #17181D;
}

.profile-avatar-option.is-selected {
  background: rgba(255,52,78,.08);
  box-shadow: 0 0 0 1px rgba(255,52,78,.6);
}

.profile-avatar-option.is-selected img {
  border-color: #FF344E;
}

.profile-avatar-option:hover,
.profile-avatar-option:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.profile-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.profile-btn-secondary {
  width: auto;
  background: #111216;
  color: #F9FAFB;
  border: 1px solid #4B5563;
}

.profile-btn-primary {
  width: auto;
}

.profile-input {
  margin-top: 6px;
}

.profile-modal-status {
  min-height: 20px;
  margin-top: 4px;
  font-size: 0.85rem;
  text-align: left;
  color: #F9FAFB;
}

.profile-modal-status.error {
  color: #fecaca;
}

.profile-modal-status.success {
  color: #bbf7d0;
}

@media (min-width: 481px) {
  .profile-works-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 260px));
    gap: 12px;
    justify-content: start;
  }

  .profile-work-card {
    width: 100%;
    max-width: 260px;
    border-radius: 14px;
    justify-self: start;
  }

  .profile-work-meta {
    left: 8px;
    right: 8px;
    bottom: 8px;
    gap: 5px;
  }

  .profile-work-cats {
    gap: 5px;
  }

  .profile-work-cats span {
    padding: 3px 6px;
    font-size: 0.64rem;
  }

  .profile-work-name {
    font-size: 0.82rem;
    line-height: 1.15;
  }
}

@media (max-width: 480px) {
  .profile-card {
    padding: 20px 16px 18px;
  }

  .profile-avatar-wrap {
    width: 120px;
    height: 120px;
  }

  .profile-name {
    font-size: 26px;
  }

  .profile-modal-dialog {
    padding: 18px 14px 14px;
  }

  .profile-avatar-scroll {
    max-height: 65vh;
    gap: 16px;
  }

  .profile-avatar-grid {
    gap: 10px;
  }

  .profile-works-section {
    padding: 16px;
  }

  .profile-works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .profile-section-title {
    font-size: 1.2rem;
  }

  .profile-work-name {
    font-size: 0.9rem;
  }
}