.input__box__container {
    gap: 0 !important;
}
.tool_options .modes__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: max-content;
    gap: 3px;
    background: var(--color-light-gray);
    box-shadow: var(--box-shadow-small-inner);
    border-radius: 99px;
    padding: 4px;
}

#activeMode {
    gap: 4px;
}

.tool_options .modes__list span {
    display: flex;
    cursor: pointer;
    position: relative;
    justify-content: center;
    align-items: center;
    line-height: 20px;
    min-width: fit-content;
    border-radius: 100px;
    padding: 6px 12px;
    color: var(--color-gray);
    font-size: var(--font-size-xsmall);
    font-weight: 400;
}
.tool_options .modes__list span:not(.custom_mode) {
    flex: 1;
}

.tool_options .modes__list span img {
    margin-right: 4px;
    width: 16px;
    height: 16px;
}

.modes-tag {
    width: 24px !important;
    height: 20px !important;
    position: absolute;
    top: -10px;
    right: 5px;
    filter: none !important;
}

.tool_options .modes__list .mode.ai_mode>span>img {
    filter: var(--filter-gray);
}

.tool_options .modes__list .active {
    background: white;
    box-shadow: var(--box-shadow-xsmall);
    color: black;
    filter: none !important;
}

.tool_options .modes__list span:not(.active):hover {
    background: var(--color-hover-modes);
}

.tool_options .modes__list .active span {
    color: var(--color-dark-gray) !important;
}

.tool_options .modes__list .active img:not(.no-filter) {
    filter: grayscale(100%) saturate(0%) brightness(70%) contrast(1000%);
}

.active_mode_container {
    position: relative;
    display: flex;
    padding: 5px 10px 5px 0;
    gap: 5px;
    flex: 1;
    max-width: 100%;
    justify-content: space-between;
    background-color: white;
    border-radius: var(--border-radius-default);
}

.active_mode_container .active_mode {
    display: none;
    cursor: pointer;
    border-radius: 10px;
    border: 1px solid #eee;
    padding: 5px 10px;
}


.tool_options .modes__list {
    position: relative;
    max-width: 100% !important;
}

.mobile_modes_list {
    align-items: center;
}



@media (max-width: 1024px) {
    .active_mode_container {
        justify-content: center !important;
    }
}



.mobile-tab-scroll-icon {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.modes-div {
    position: relative;
}

.tool_options .modes__list {
    flex-wrap: nowrap;
}


@media screen and (max-width:992px) {
    .active_mode_container {
        justify-content: start !important;
        overflow: auto;
        padding-right: 50px;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE and Edge */
        position: relative;
    }

    .active_mode_container::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Opera */
    }

    .tool_options .modes__list {
        min-width: fit-content;
        background: transparent;
        box-shadow: none;
        gap: 4px;
        flex-wrap: nowrap;
        padding-right: 30px;
    }

    .tool_options .modes__list span {
        background: #F9F9F9;
    }

    .tool_options .modes__list .active {
        background: #ECECEC;
    }
}

.custom_mode {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    width: fit-content;
}

.tool_options .modes__list span {
    flex: unset;
}

.tool_options .modes__list span.custom_mode {
    justify-content: start;
}

.custom_mode.popup-trigger::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.custom_mode .custom_icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* hide icon when input has text */

.custom_mode_input {
    border: none;
    outline: none;
    padding: 0;
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
    background: transparent;
    cursor: pointer;
    max-width: 124px;
    white-space: nowrap;     /* single line */
    overflow: hidden !important;        /* hide overflow */
    text-overflow: ellipsis; /* show ... */
}

.custom_mode_input::placeholder {
    text-transform: capitalize;
}

.custom-length-change .custom_mode_input::placeholder {
    text-transform: unset;
}

.custom-length-change .custom_mode_input {
    margin-right: 12px;
}

.custom-tooltip::after {
    content: attr(data-word-limit);
    position: absolute;
    top: calc(100% + 12px);
    /* tooltip above element */
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 5px 8px;
    border-radius: 4px;
    white-space: nowrap;
    transition: opacity 0.3s;
    font-size: 12px;
    z-index: 10;
}

/* Tooltip arrow */
.custom-tooltip::before {
    content: "";
    position: absolute;
    top: 100%;
    /* slightly above the element, aligns with tooltip */
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
    transition: opacity 0.3s;
    z-index: 10;
}

.tool_options .modes__list span {
    font-size: 16px;
    line-height: 20px;
    font-weight: 400;
}

@media (max-width: 1024px) {
    .active_mode_container {
        justify-content: start !important;
    }
}


.custom-mode-modal-container {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 10px;
    background: linear-gradient(180deg, rgba(89, 91, 99, 0.15) 0%, rgba(89, 91, 99, 0.15) 100%);
}

.custom-mode-modal-container.active {
    display: flex;
}

.custom-mode-modal {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 15px;
    background: #FFFFFF;
    border-radius: 16px;
    overflow-y: auto;
    position: relative;
    width: 100%;
    height: fit-content;
    max-width: 493px;
    max-height: 60vh;
}

.custom-mode-modal>div {
    width: 100%;
}

.custom-mode-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.custom-mode-modal-title {
    font-weight: 500;
    font-size: 16px;
    line-height: 18px;
    color: #101010;
}

.custom-mode-modal-close {
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-mode-modal-input-wrapper {
    position: relative;
    margin-bottom: 24px;
}

.custom-mode-modal:has(.custom-mode-modal-error.show) .custom-mode-modal-input-wrapper {
    margin-bottom: 0;
}

.custom-mode-modal-input {
    outline: none;
    padding: 14px 80px 14px 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #FFFFFF;
    border: 0.5px solid #E5E5E5;
    border-radius: 35px;
    width: 100%;
}

.custom-mode-modal-input:focus {
    border-color: #333333;
}

.custom-mode-modal-input.error {
    border-color: #ff4444;
}

.custom-mode-modal-error {
    display: none;
    color: #ff4444;
    font-size: 12px;
    line-height: 16px;
    margin-top: 8px;
    width: fit-content;
}

.custom-mode-modal-error.show {
    display: block;
    margin-bottom: 24px;
}

.custom-mode-modal-done-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    gap: 4px;
    min-width: 70px;
    min-height: 36px;
    background: #333333;
    border-radius: 99px;
    z-index: 2;
    border: none !important;
    outline: none !important;
    cursor: pointer;

    font-weight: 500;
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    color: #FFFFFF;
}

.custom-mode-modal-done-btn:hover {
    background: #1a1a1a;
}

#recent-modes-section {
    margin-bottom: 24px;
}

.custom-mode-modal-section-title {
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #101010;
    margin-bottom: 12px;
    width: fit-content;
}

.custom-mode-modal-tags {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.custom-mode-modal-tags::-webkit-scrollbar {
    display: none;
}

.custom-mode-modal-tag {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px 12px;
    gap: 4px;
    background: #F9F9F9;
    border-radius: 99px;
    transition: all 0.2s;
    cursor: pointer;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
    color: #101010;
    text-wrap: nowrap;
}

.custom-mode-modal-tag:hover {
    background: #ECECEC;
}