.limit-cards-wrapper {
  min-width: 100%;
  width: 100%;
  /* flex: 1; */
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 32px;
  overflow: hidden;
  isolation: isolate;
  position: relative;
  z-index: 1;
  max-height: 300px;
    @media (max-width: 768px) {
        padding: 0 0 18px 0;
    }
}

.limit-line--expanded {
    display: flex;
    color: var(--neutral-white);
    margin-bottom: 8px;
    margin-top: 32px;
}

.limit-line--collapsed {
    display: none !important;
}

.limit-overdue_debt--expanded {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.limit-overdue_debt--collapsed {
    display: none;
}

.limit-cards--collapsed .progress-linear {
    height: 26px;
    overflow: hidden;
    margin-top: 8px;
}

.limit-cards--collapsed .limit-subtitle { display: none; }
.limit-cards--collapsed .limit-increase-link { display: none; }

.limit-cards--collapsed .limit-line--expanded { display: none; }
.limit-cards--collapsed .limit-line--collapsed {
    margin-top: 1px;
    display: flex !important;
    height: 26px;
    position: absolute;
    inset: 0;
    /* align-items: center; */
    top: 2px;
    left: 16px;
    color: var(--neutral-white);
    white-space: nowrap;
    z-index: 1;
    font-family: Commissioner;
    font-weight: 300;
    font-size: 16px;
    line-height: 110%;
}

.limit-cards--collapsed .limit-overdue_debt--expanded { display: none; }
.limit-cards--collapsed .limit-overdue_debt--collapsed {
    display: flex;
    flex-direction: row;
}

.limit-cards--collapsed .progress-linear {
    height: 26px;
    overflow: hidden;
}

.limit-toggle-btn {
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  width: 29px;
  height: 29px;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 17px;
  border-width: 0.5px;
  backdrop-filter: blur(10px);
  border: 0.5px solid;
  border-image-source: linear-gradient(45deg, rgba(107, 158, 255, 0.7) 0%, rgba(107, 158, 255, 0) 50%, rgba(107, 158, 255, 0.7) 100%);
  background: linear-gradient(90deg, rgba(72, 110, 181, 0.3) 0%, rgba(107, 158, 255, 0.3) 100%);

}

.limit-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.limit-cards-container {
    min-width: 100%;
    width: 100%;
    flex: 1;
    padding: 0;
    border-radius: 64px;
    background: url('../image/bg.png') top / cover no-repeat;
    background-size: 100% 120%;
    overflow: visible;
    position: relative;
    z-index: 1;
        @media (max-width: 768px) {
            border-radius: 0;
        }
}

.limit-cards-subcontainer {
    gap: 32px !important;
    min-width: 100%;
    width: 100%;
    padding: 1rem;
    border-radius: 64px;
    display: grid;
    grid-template-columns: repeat(3, minmax(359px, 1fr));
    column-gap: 24px;
    scroll-padding-inline-end: 1rem;
    overflow: auto hidden;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    /* transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1); */
    transition: all 0.3s ease;
        @media (max-width: 768px) {
            border-radius: 0;
        }
}


.limit-cards-subcontainer {
    height: 232px; 
}

.limit-cards-subcontainer::-webkit-scrollbar {
  display: none;
}

.limit-card {
  min-width: 377px;
  text-align: left;
  display: grid;
  grid-template: 'content' 1fr 'progress' auto / 1fr;
  gap: 0 16px;
  height: 200px;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  border: 1px solid;
  border-image-source: linear-gradient(
    146.08deg,
    rgba(255, 255, 255, 0) 9.62%,
    rgba(255, 255, 255, 0.4) 49.8%,
    rgba(255, 255, 255, 0) 89.98%
  );

  background:#FFFFFF24;

  border-radius: 48px;
  box-shadow: 0px 33.25px 33.25px 0px #FFFFFF0D inset;
  transform: translateZ(0);
  
  /* transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1); */
  backdrop-filter: blur(7px);
}

.limit-card-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../image/limit_pattern.svg');
  background-repeat: repeat;
  background-size: 100%;
  opacity: 0.3;
  pointer-events: none;
  z-index: -1;
}

.common-page__top-profile-info .limit-card {
    min-height: 70px;
    background: url('../image/bg_blur.png') no-repeat center center / cover;
    backdrop-filter: blur(5px);
    border-left: unset
}

.limit-card-trans_invest {
    cursor: unset !important;
}

.common-page__top-profile-info .limit-card.limit-card-chem_invest {
    display: none;
    @media (max-width: 1166px) {
        display: flex;
    }
}

.common-page__top-profile-info .limit-card.limit-card-fin_invest, .common-page__top-profile-info .limit-card.limit-card-fi_personal {
    display: none;
    @media (max-width: 900px) {
        display: flex;
    }
}

.limit-header {
    min-height: 30px;
    max-height: 48px;
    flex-shrink: 0; 
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.limit-card-content {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 16px 24px;
    overflow: hidden;
    box-sizing: border-box;
}

.limit-cards--collapsed .limit-cards-subcontainer {
    height: 140px;
}
.limit-cards--collapsed .limit-card {
    height: 110px;
}


.limit-card.common-page__top-profile.common-page__top-profile-main {
    padding-right: 64px;
    position: relative;

    @media (max-width: 576px) {
        width: 100%;
        flex: 1 0 auto;
        background: none;
        border-left: none;
    }
}

.limit-card.common-page__top-profile {
    padding-right: 64px;
}

.limit-card.common-page__top-profile::after, .limit-card.common-page__top-profile.common-page__top-profile-main::after {
    content: '';
    position: absolute;
    height: 100%;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: url('../image/profile-icon.svg') no-repeat right 10px center / 44px 44px;
}

.limit-card.common-page__top-profile.common-page__top-profile-main::after {
    @media (max-width: 576px) {
        background: url('../image/profile-icon.svg') no-repeat center center / 50px 50px;
    }
}

.limit-card.common-page__top-profile.common-page__top-profile-main>.limit-card-content {
    @media (max-width: 576px) {
        display: none;
    }
}

.limit-title, .limit-subtitle, .limit-title-prev, .limit-line {
    color: var(--neutral-white);
    text-decoration: none;
    font-weight: 400;
}

.limit-title {

    font-size: 18px;
    color: var(--neutral-white);
    font-weight: 500;
    font-size: 24px;
    line-height: 90%;
    letter-spacing: 0%;
    font-family: Commissioner;
}


.limit-subtitle {
    margin-top: 4px;
    font-weight: 300;
    font-size: 16px;
    line-height: 110%;
    letter-spacing: 0%;
    margin-bottom: 1rem;
    font-family: Commissioner;

}

.limit-title-prev {
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 2px;
}

.limit-line {
    display: flex;
    width: 100%;
    align-items: baseline;
    gap: 5px;
    justify-content: flex-start;
    font-family: Commissioner;
    font-weight: 300;
    font-size: 16px;
    line-height: 110%;
    letter-spacing: 0%;
}


.limit-value {
    width: 100%;
    font-size: 16px;
    font-weight: 300;
    line-height: 1;
    white-space: nowrap;
    display: flex;
    align-items: baseline;
}

.limit-label {
    font-size: 12px;
    font-weight: 200;
    line-height: 1;
    opacity: 0.8;
    white-space: nowrap;
}

.limit-source .limit-value {
    font-size: 13px;
}

.progress-linear {
    overflow: hidden;
    position: relative;
    width: 100%;
    min-height: 20px;
    height: 20px;
    gap: 10px;
    border-radius: 25px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.15);
}

.progress-linear__background {
    background-color: rgba(255, 255, 255, 0.2);
    inset: 0;
    position: absolute;
}

.progress-linear__determinate {
    background:rgba(104, 155, 250, 0.8);
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 22px;
    gap: 10px;
    /* transition: width 0.5s ease; */
}

.progress-linear__label {
    position: absolute;
    inset: 0;
    z-index: 1;
    height: 26px;
    display: none;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    color: var(--neutral-white);
    white-space: nowrap;
}

.limit-progress {
    grid-area: progress;
    margin: 0;
}

.limit-overdue_debt {
    background-color:var(--rich-dark-red);
    color: var(--neutral-white);
    font-weight: 300;
    font-size: 14px;
    border-radius: 100px;
    padding: 8px 16px;
    white-space: nowrap;
    line-height: 111%;
    font-family: Commissioner;
    align-self: flex-start;
    letter-spacing: 1%;
}

.limit-increase-link {
    color: var(--light-green-new);
    background: none;
    gap: 8px;
    margin-top: 8px;
    cursor: pointer;
    align-self: flex-end;
    font-family: Commissioner;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
}

button.limit-increase-link {
    border: none;
    padding: 0;
}

/* ─── Модалка «Заявка на лимит» ─── */

.limit-request-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.limit-request-modal[hidden],
.limit-request-modal[style*="display: none"],
.limit-request-modal[style*="display:none"] {
    display: none !important;
}

.limit-request-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 36, 48, 0.45);
}

.limit-request-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    padding: 32px;
    border-radius: 24px;
    background: var(--neutral-white, #fff);
    box-shadow: 0 24px 48px rgba(30, 36, 48, 0.18);
    transform: none;
}

.limit-request-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    padding-right: 48px;
}

.limit-request-modal__title {
    margin: 0;
    font-family: Commissioner, sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 110%;
    color: var(--blue-plaza-active, #2e343b);
}

.limit-request-modal__close {
    position: absolute;
    top: 14px;
    right: 20px;
    z-index: 2;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.limit-request-modal__close-icon {
    display: block;
}

.limit-request-modal__close-icon--desktop {
    width: 48px;
    height: 48px;
}

.limit-request-modal__close-icon--mobile {
    display: none;
    width: 40px;
    height: 40px;
}

.limit-request-modal__close:hover {
    background: rgba(0, 0, 0, 0.04);
}

.limit-request-modal__form {
    display: flex;
    flex-direction: column;
}

.limit-request-modal__body {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.limit-request-modal__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.limit-request-modal__label {
    font-family: Commissioner, sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 90%;
    color: var(--blue-plaza, rgba(46, 52, 59, 0.5));
}

.limit-request-modal__required {
    color: #e53935;
}

.limit-request-modal__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 32px;
}

.limit-request-modal__btn {
    flex: 1;
    min-height: 48px;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-family: Commissioner, sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    cursor: pointer;
    transition: opacity 0.15s, background 0.15s;
}

.limit-request-modal__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.limit-request-modal__btn--cancel {
    background: #f0f0f0;
    color: var(--blue-plaza-active, #2e343b);
}

.limit-request-modal__btn--cancel:hover:not(:disabled) {
    background: #e8e8e8;
}

.limit-request-modal__btn--submit {
    background: var(--blue-plaza-active, #2e343b);
    color: var(--neutral-white, #fff);
}

.limit-request-modal__btn--submit:hover:not(:disabled) {
    opacity: 0.9;
}

body.limit-request-modal-open {
    overflow: hidden;
}

@media (max-width: 1279px) {
    .limit-request-modal {
        display: block;
        padding: 0;
    }

    .limit-request-modal__backdrop {
        background: rgba(0, 0, 0, 0.4);
    }

    .limit-request-modal__dialog {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 20px 20px 0 0;
        padding: 24px 20px 40px;
        box-shadow: none;
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .limit-request-modal.is-open .limit-request-modal__dialog {
        transform: translateY(0);
    }

    .limit-request-modal__header {
        margin-bottom: 32px;
    }

    .limit-request-modal__footer {
        flex-direction: column;
        gap: 8px;
    }

    .limit-request-modal__btn {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 768px) {
    .limit-request-modal__title {
        font-family: Commissioner, sans-serif;
        font-weight: 600;
        font-size: 16px;
        line-height: 110%;
        letter-spacing: 0;
    }

    .limit-request-modal__close {
        width: 40px;
        height: 40px;
    }

    .limit-request-modal__close-icon--desktop {
        display: none;
    }

    .limit-request-modal__close-icon--mobile {
        display: block;
    }

    .limit-request-modal__btn {
        height: 40px;
        min-height: 40px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .limit-request-modal .light-field.light-field--input {
        height: 40px !important;
        min-height: 40px;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
        padding-right: 40px !important;
    }

    .limit-request-modal .light-field-input-wrap::after {
        width: 40px;
        height: 40px;
        background-size: 40px 40px;
    }
}
