.expert-profile-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 22, 40, 0.45);
    z-index: 18000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.expert-profile-modal.open {
    display: flex;
}

.expert-profile-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    background: #fff;
    border: 1px solid #e7ecf8;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(22, 34, 66, 0.26);
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
}

.expert-profile-card::before {
    content: "";
    position: sticky;
    top: -24px;
    left: 0;
    right: 0;
    display: block;
    height: 4px;
    margin: -24px -24px 16px;
    background: linear-gradient(90deg, #4d5ee8 0%, #8a4ad6 50%, #00a896 100%);
}

.expert-profile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.expert-profile-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.expert-profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid #e7ecf8;
    flex-shrink: 0;
}

.expert-profile-name {
    font-size: 20px;
    font-weight: 700;
    color: #2f3850;
}

.expert-profile-title {
    margin-top: 2px;
    color: #6f7891;
    font-size: 14px;
}

.expert-profile-close {
    width: 36px;
    height: 36px;
    border: 1px solid #dce3f8;
    border-radius: 999px;
    background: #fff;
    color: #5f6a86;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expert-profile-close:hover {
    background: #f5f7ff;
    color: #2f3850;
}

.expert-profile-section {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid #edf1fb;
    border-radius: 12px;
    background: #fcfdff;
}

.expert-profile-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #2f3850;
    margin-bottom: 10px;
}

.expert-profile-title-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4a5bd2;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe3ff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.expert-profile-title-text {
    line-height: 1;
}

.expert-profile-meta {
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    color: #5c6784;
}

.expert-profile-about {
    margin-top: 10px;
    color: #495674;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-line;
}

.expert-profile-subgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.expert-profile-subcard {
    border: 1px solid #edf1fb;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.expert-profile-subcard-title {
    font-size: 12px;
    font-weight: 700;
    color: #5c6784;
    margin-bottom: 8px;
}

.expert-profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.expert-profile-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #eef2ff;
    color: #4a5bd2;
}

.expert-profile-item {
    padding: 10px 12px;
    background: #f8fafc;
    border-radius: 10px;
    margin-bottom: 8px;
    border: 1px solid #edf1fb;
}

.expert-profile-item:last-child {
    margin-bottom: 0;
}

.expert-profile-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #2f3850;
}

.expert-profile-item-sub {
    font-size: 12px;
    color: #6f7891;
    margin-top: 2px;
}

.expert-profile-item-desc {
    font-size: 13px;
    color: #495674;
    line-height: 1.5;
    margin-top: 6px;
}

.expert-profile-cert-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.expert-profile-cert {
    width: 72px;
    height: 72px;
    min-width: 72px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e7ecf8;
    background: #f8fafc;
}

.expert-profile-portfolio {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.expert-profile-portfolio img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e7ecf8;
    cursor: pointer;
    transition: transform 0.15s;
    background: #f8fafc;
}

.expert-profile-portfolio img:hover {
    transform: scale(1.02);
}

.expert-profile-portfolio-item {
    margin-bottom: 16px;
}

.expert-profile-portfolio-item:last-child {
    margin-bottom: 0;
}

.expert-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 19000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.expert-lightbox.open {
    display: flex;
}

.expert-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.expert-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 999px;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 640px) {
    .expert-profile-subgrid {
        grid-template-columns: 1fr;
    }

    .expert-profile-card {
        padding: 16px;
    }

    .expert-profile-card::before {
        top: -16px;
        margin: -16px -16px 12px;
    }
}
