.invest {
    position: relative;
}

.invest__per {
    position: absolute;
    right: 0;
    top: -30px;
}

.invest_wrapper {
    display: table;
    width: 100%;
    padding: 0 24px;
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
    color: var(--clr-cnn-grey-4);
    border: 1px solid var(--clr-cnn-placeholder);
    border-radius: 4px;
    margin-bottom: 8px;
}

.invest_header,
.invest_body {
    display: table-row-group;
}

.invest__item {
    display: table-row;
}
 

.invest__th,
.invest__td {
    display: table-cell;
    vertical-align: middle;
}

.invest__th:first-child,
.invest__td:first-child {
    padding-left: 8px;
}

.invest__th {
    text-align: left;
    font-weight: 500;
    height: 50px;
}

.invest__th:not(:first-child):not(:last-child) {
    padding-right: 16px;
}

.invest__td {
    border-top: 1px solid var(--clr-cnn-placeholder);
    height: 72px;
}

.invest__apply {
    text-align: right;
    padding-right: 8px;
}

.invest_wrapper:not(:has(.invest_header)) .invest__item:first-child .invest__td {
    border-top: none;
}

.invest__icon,
.invest__label {
    display: none;
}

.invest__company {
    display: grid;
    grid-template-areas: 'a b' 'a c';
    grid-template-columns: min-content auto;
    column-gap: 16px;
}

.invest__logo {
    width: 40px;
    height: 100%;
    border-radius: 50%;
    grid-area: a;
    display: flex;
    justify-content: center;
    align-items: center;
}

.invest__logo__img {
    max-width: 40px;
    max-height: 40px;
}

.invest__name {
    font-size: 16px;
    font-weight: 700;
    line-height: 20px;
    grid-area: b;
    display: flex;
    align-items: flex-end;
}

.invest__description {
    color: var(--clr-cnn-grey-2);
    font-size: 12px;
    line-height: 20px;
    grid-area: c;
    max-width: 180px;
}

.invest__positive {
    color: var(--clr-economy);
}

.invest__negative {
    color: var(--clr-cnn);
}

.invest__button {
    border: none;
    padding: 6px 24px;
    border-radius: 4px;
    background: #FF7A00;
    color: #fff;
    font-weight: 500;
    line-height: normal;
    transition: all 0.2s;
}

.invest__button--white {
    background-color: #fff;
    color: var(--clr-cnn-placeholder);
    border: 1px solid var(--clr-cnn-placeholder);
}

.invest__button:hover {
    opacity: .5;
}

/* modal */
.invest__modal {
    width: 100%;
    height: 100%;
    background-color: #0c0c0c33;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    display: flex;
    visibility: hidden;
    opacity: 0;
    transition: all .5s;
}

.invest__modal--show {
    opacity: 1;
    visibility: visible;
}

.invest__popup {
    width: 364px;
    border-radius: 8px;
    background: #FFF;
    padding: 16px;
    color: var(--clr-cnn-grey-4);
}

.invest__popup__close-top {
    text-align: right;
    margin-bottom: 12px;
}

.invest__popup__close-top .invest__popup__button--close {
    background-color: #fff;
    border: none;
    transition: all 0.2s;
    background: url('../img/close.svg') no-repeat center center;
    text-indent: -999px;
    overflow: hidden;
    width: 12px;
    height: 12px;
}

.invest__popup__close-top .invest__popup__button--close:hover {
    opacity: .5;
}

.invest__popup__app {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 16px;
}

.invest__popup__app__link {
    width: 88px;
    height: 88px;
}

.invest__popup__app span {
    max-width: 225px;
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
}

.invest__popup__app span .invest__popup__ticker {
    font-size: 16px;
    font-weight: 700;
}

.invest__popup__how-to {
    padding: 16px 0;
    margin-bottom: 16px;
    border-top: 1px solid var(--clr-cnn-placeholder);
    border-bottom: 1px solid var(--clr-cnn-placeholder);
    font-size: 12px;
    color: var(--clr-cnn-grey-2);
    line-height: normal;
}

.invest__popup__without-account {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    row-gap: 16px;
    column-gap: 8px;
    margin-bottom: 16px;
}

.invest__popup__without-account__text {
    font-weight: 700;
}

.invest__popup__without-account__close {
    flex: 1;
}

.invest__popup__without-account__link {
    font-size: 14px;
}

.invest__popup__without-account__close,
.invest__popup__without-account__link {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 991px) {
    .invest__per {
        position: initial;
        margin-bottom: 32px;
    }

    .invest_header {
        display: none;
    }

    .invest__label {
        display: initial;
    }

    .invest_wrapper {
        display: flex;
        border: none;
        padding: 0;
    }

    .invest_body {
        display: flex;
        flex-wrap: wrap;
        gap: 32px;
    }

    .invest__item {
        display: flex;
        height: initial;
        flex-wrap: wrap;
        border: 1px solid var(--clr-cnn-placeholder);
        border-radius: 4px;
        padding: 24px 16px;
        width: 100%;
        row-gap: 24px;
    }

    .invest__td {
        width: 50%;
        height: inherit;
        border: none;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .invest__company {
        width: 100%; 
        padding: 0 0 16px 0;
        border-bottom: 1px solid var(--clr-cnn-placeholder);
        justify-content: flex-start;
        order: 1;
        display: grid;
        grid-template-areas: 
            'a b'
            'a c';
    }

    .invest__price {
        order: 2;
    }

    .invest__price .invest__icon {
        background: url('../img/price.svg') no-repeat;
    }

    .invest__recommendation {
        order: 3;
    }

    .invest__recommendation .invest__icon {
        background: url('../img/recommendation.svg') no-repeat;
    }

    .invest__upside {
        order: 4;
    }

    .invest__upside .invest__icon {
        background: url('../img/upside.svg') no-repeat;
    }

    .invest__variation {
        order: 5;
    }

    .invest__variation .invest__icon {
        background: url('../img/variation.svg') no-repeat;
    }

    .invest__apply {
        width: 100%;
        padding: 0;
        order: 6;
    }

    .invest__icon {
        height: 17px;
        display: initial;
    }

    .invest__label {
        color: var(--clr-cnn-grey-2);
        line-height: 24px;
    }

    .invest__value {
        font-weight: 700;
    }
}

@media (max-width: 350px) {
    .invest__button {
        width: 100%;
    }
}