.waves-profile-search {
    background-color: var(--color-white);
    border-radius: 15px;
    padding: 20px;
    text-align: left;
    width: 100%;
    max-width: 360px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.waves-profile-search form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.waves-profile-search__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.waves-profile-search__actions .waves-button,
.waves-profile-search__actions .waves-info {
    flex-shrink: 0;
}

.waves-profile-search__field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.waves-profile-search__field input,
.waves-profile-search__field select,
.waves-profile-search__field textarea {
    width: 100%;
}

.waves-profile-search__field input[type="checkbox"] {
    width: auto;
}

.waves-profile-search__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.waves-profile-search__option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 0;
}

.waves-profile-search__option span {
    font-weight: 500;
}

#profile-results-header {
    font-size: 32px !important;
    color: #403F3F;
    text-align: center;
    margin-bottom: 24px;
}

.waves-profile-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 60px 55px;
    max-width: calc(3 * 264px + 2 * 100px);
    margin: 0 auto;
}

.waves-profile-tile {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1px solid #E3E5E8;
    width: 264px;
    overflow: hidden;
    background: var(--color-white);
    box-shadow: 0 10px 40px rgba(25, 36, 56, 0.06);
}

.waves-profile-tile__thumbnail {
    background-color: var(--color-gray);
    padding: 20px;
    min-height: 194px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waves-profile-tile__body {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    position: relative;
}

.waves-profile-details {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 16px;
    line-height: 1.4;
    color: #383C41;
}

.waves-profile-details h3 {
    font-size: 24px;
    margin: 0;
    color: #121314;
}

.waves-profile-details--clamped {
    max-height: 140px;
    overflow: hidden;
}

.waves-profile-details--clamped::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--color-white) 100%);
}

.waves-profile-more-button {
    align-self: stretch;
    background-color: var(--color-primary-light) !important;
    color: var(--color-white) !important;
    border-radius: 8px !important;
    border: none;
    padding: 10px 18px !important;
    font-weight: 600 !important;
    text-transform: none;
    cursor: pointer;
    font-size: var(--font-size-button);
    font-family: var(--font-primary);
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.waves-profile-more-button:hover,
.waves-profile-more-button:focus {
    transform: translateY(-1px);
    background-color: var(--color-primary) !important;
}

.waves-rating-stars,
.waves-rating-stars-row,
.waves-rating-stars span {
    margin: 0;
    padding: 0;
    line-height: 1;
}

.waves-no-ratings {
    font-size: 16px;
    font-style: italic;
}

.waves-pagination {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 40px auto 60px;
    gap: 12px;
}

.waves-pagination a {
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #3C4451;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.waves-pagination-current {
    background-color: var(--color-primary-light);
    color: #fff !important;
    border-color: var(--color-primary-light);
}

.waves-pagination-link:hover {
    border-color: var(--color-primary-light);
}

/* Modal styles */
body.waves-profile-modal-open {
    overflow: hidden;
}

.waves-profile-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
    overflow-y: auto;
}

.waves-profile-modal.is-open {
    display: flex;
}

.waves-profile-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(12, 20, 31, 0.48);
    backdrop-filter: blur(4px);
}

.waves-profile-modal__dialog {
    position: relative;
    background: var(--color-white);
    border-radius: 16px;
    width: min(680px, 100%);
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(12, 20, 31, 0.24);
    display: flex;
    flex-direction: column;
}

.waves-profile-modal__content {
    padding: 48px 32px 32px;
    overflow-y: auto;
    max-height: 100%;
    flex: 1 1 auto;
}

.waves-profile-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #6F7783;
}

.waves-profile-modal__header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.waves-profile-modal__thumbnail {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.waves-profile-modal__thumbnail img,
.waves-profile-modal__thumbnail .profile-avatar-img {
    max-width: 140px;
    max-height: 140px;
    border-radius: 12px;
}

.waves-profile-modal__header h3 {
    margin: 0;
    font-size: 28px;
}

.waves-profile-modal__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px 24px;
    margin-bottom: 24px;
}

.waves-profile-modal__meta-item label {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    color: #495062;
}

.waves-profile-modal__meta-item span,
.waves-profile-modal__meta-item a {
    color: #21242C;
    word-break: break-word;
}

.waves-profile-modal__description {
    margin-bottom: 24px;
    color: #2F333D;
    line-height: 1.6;
}

.waves-profile-modal__footer {
    display: flex;
    justify-content: flex-end;
}

.waves-profile-modal__primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: var(--color-primary-light);
    color: var(--color-white);
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.waves-profile-modal__primary:hover {
    background-color: var(--color-primary);
}

/* Preferred solution specific tweaks */
.waves-profile-ps-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid #E3E5E8;
    background: #fff;
    padding: 12px;
}

.waves-profile-ps-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (max-width: 960px) {
    .waves-profile-grid {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .waves-profile-search {
        max-width: 100%;
    }

    .waves-profile-modal__dialog {
        border-radius: 12px;
    }

    .waves-profile-modal__content {
        padding: 40px 20px 24px;
    }
}