.meminsta {
    width: 100%;
    max-width: 445px;
    background-color: rgba(var(--d87, 255, 255, 255), 1);
    border-radius: 40px;
    margin-bottom: 15px;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meminsta:before {
    content: '...';
    font-size: 27px;
    color: #afc1d9;
    align-self: flex-end;
    margin-top: -10px;
    margin-bottom: -20px;
}


.meminsta > m {
    order: 5;
    width: 100%;
    height: 37px;
    background: url(https://i.imgur.com/lSlKE8m.png) no-repeat center;
    background-size: contain;
    margin: 5px 0;
}

.meminsta > mphoto, .meminsta > mphoto_prev {
    order: 4;
    width: 100%;
height: 100%;
    aspect-ratio: 1 / 1;
    margin: 10px 0;
}

.meminsta > mphoto img, .meminsta > mphoto_prev img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
    box-shadow: 0px 6px 13px 3px #48464442;
}

.meminsta > mavatar, .meminsta > mavatar_prev {
    order: 1;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--mem-bac-v4);
    align-self: flex-start;
    transform: translateY(-22px);
}

.meminsta > mavatar img, .meminsta > mavatar_prev img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.meminsta > mnick, .meminsta > mnick_prev {
    order: 2;
    color: #202020;
    font-weight: bold;
    font-size: 12px;
    margin-top: -75px;
    margin-left: 15%;
    text-align: left;
}

.meminsta > mnick:before, .meminsta > mnick_prev:before {
    content: '@';
    margin-right: 1px;
    color: #adb3bc;
}

.meminsta > mlocation, .meminsta > mlocation_prev {
    order: 3;
    color: #767676;
    font-size: 12px;
    text-transform: lowercase;
    margin-top: -9px;
    margin-left: 16%;
    text-align: left;
}

.meminsta > memtex, .meminsta > memtex_prev {
    order: 6;
    color: #40474e;
    line-height: 1.4;
    padding: 0 5px;
	margin: -6px 5% 0% 5%;
	text-align: justify;
}

.memreels {
    width: 100%;
    max-width: 400px;
    background-color: rgba(var(--d87, 255, 255, 255), 1);
    border-radius: 30px;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    display: flex;
    flex-direction: column;
}

.memreels > mrphoto, .memreels > mrphoto_prev {
    width: 100%;
    display: block;
    flex-grow: 1;
    margin-top: 6px;
}

.memreels > mrphoto img, .memreels > mrphoto_prev img {
    width: 97%;
    height: 99%;
    object-fit: cover;
    border-radius: 30px;
    display: block;
}

.memreels > mravatar, .memreels > mravatar_prev {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--mem-bac-v4);
    bottom: 59px;
    left: 4%;
    position: absolute;
    z-index: 2;
}

.memreels > mravatar img, .memreels > mravatar_prev img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.memreels > mrnick, .memreels > mrnick_prev {
    position: absolute;
    z-index: 2;
    color: #e2dcdc !important;
    font-weight: bold;
    font-size: 11px;
    display: block;
    width: calc(100% - 100px);
    bottom: 85px;
    left: 19%;
    text-align: left;
}

.memreels > mrnick:before, .memreels > mrnick_prev:before {
    content: '@';
    margin-right: 1px;
    color: #c9c2c2;
}

.memreels > memrtex, .memreels > memrtex_prev {
    position: absolute;
    z-index: 2;
    color: #ededed !important;
    padding: 0px 25px 15px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: block;
    width: calc(100% - 50px);
    bottom: 5px;
    max-height: 40px;
    overflow: auto;
    text-align: justify;
}

.memreels > rb {
background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    height: 110px;
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    border-radius: 0 0 30px 30px;
    opacity: 30%;
}

.wrapper {
    display: grid;
    grid-template-areas: 'template template'
        'insta reels';
    gap: 10px;
    justify-items: center;
}

.meminst_template {
    grid-area: template;
    margin: 0 auto;
    width: 100%;
    text-align: center;
    padding: 10px;
}

.meminsta_wrp {
    grid-area: insta;
}

.memreels_wrp {
    grid-area: reels;
}

.meminsta_label {
    margin: 0 5px 0 0;
    font-weight: bold;
}

.meminsta_wrp .meminsta_label,
.memreels_wrp .meminsta_label {
    display: block;
}

.meminsta_input,
.meminsta_textarea {
    margin: 0 0 15px 0;
    width: 400px;
}

.meminst_template .meminsta_input {
    margin: 0 15px 0 0;
    width: 200px;
}

.meminsta_textarea {
    resize: vertical;
}

#meminst_warning,
#meminsta_template_warning_photo,
#meminsta_template_warning_reel {
    display: none;
    margin: 5px 0 0;
    font-weight: bold;
    color: darkred;
}

.night .meminsta, 
.night .memreels {
        filter: brightness(0.8) contrast(1.1);
}

@media (max-width: 540px) {
    .wrapper {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "template"
            "insta"
            "reels";
        padding: 0 15px;
        box-sizing: border-box;
    }
	
	.wrapper .meminsta_input {
	width: 100%;
}
    
    .meminst_template {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
		padding: 0;
    }
    
    .meminst_template .meminsta_label {
        display: block;
        width: 100%;
    }
    
    .meminst_template .meminsta_input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .meminst_template > label {
        width: 100%;
    }
}