.home-tool-wrapper {
    overflow: hidden;
}

.home-tool-wrapper .tool-head {
    background: #fff;
}

.home-tool-wrapper .scroll-modes {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.home-tool-wrapper .scroll-modes::-webkit-scrollbar {
    display: none;
}

.home-tool-wrapper .modes .btn,
.home-tool-wrapper .sum-modes .btn {
    gap: 8px;
    transition: all 0.3s ease;
}

.home-tool-wrapper .modes .btn .mode-lock-icon {
    width: 12px;
    height: 16px;
    flex-shrink: 0;
}
.mode-active .pen,
.popover-active .pen,
#customModeBtn:hover .pen {
    filter: brightness(0) saturate(100%) invert(12%) sepia(35%) saturate(4418%) hue-rotate(241deg) brightness(96%) contrast(99%);
}

/* While the popover is open, the tab shows as selected regardless of
   whether the tone has actually been confirmed yet — purely visual, it
   doesn't touch mode-active or the real selection state underneath.
   Derived straight from the two real classes (no extra class to fall out
   of sync): #customModeBtn is always the last tab, so this dims every
   .mode-active tab that precedes it whenever it's open, leaving only one
   tab looking selected at a time. */
#customModeBtn.popover-active {
    border-bottom: 3px solid var(--darkblue) !important;
    color: var(--darkblue) !important;
}

.modes ul:has(#customModeBtn.popover-active) li.mode-active:not(#customModeBtn) {
    border-bottom-color: transparent !important;
    color: #866abe !important;
}

#customToneInput {
    height: auto;
    min-height: 46px;
    padding: 10px 12px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.custom-tone-popover {
    position: fixed;
    left: auto;
    right: auto;
    width: 374px;
    padding: 16px;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid #eaedf1;
    cursor: default;
}

.custom-tone-popover::before {
    display: none;
}

.custom-tone-head {
    width: 100%;
}

.custom-tone-title {
    font-size: 14px;
    font-weight: 400;
    color: var(--darkblue);
}

.custom-tone-close {
    background: transparent;
    border: 0;
    padding: 8px;
    line-height: 0;
    cursor: pointer;
    color: #757575;
    position: absolute;
    right: 8px;
    top: 8px;
}

.custom-tone-close img {
    width: 8px;
    height: 8px;
    display: block;
}

.custom-tone-input-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--lightgray);
    border-radius: 8px;
    margin-bottom: 12px;
}
.custom-tone-input-wrap:focus-within {
    border: 1px solid var(--darkblue);
}

.custom-tone-error {
    display: block;
    font-size: 12px;
    color: #d9534f;
    margin: -6px 0 8px 0;
}

.custom-tone-input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0;
    font-size: 14px;
    color: var(--darkblue);
    outline: none;
    background: transparent;
}

.custom-tone-input::placeholder {
    color: #a79fc4;
}

.custom-tone-done {
    flex-shrink: 0;
    background: var(--purple);
    color: #fff;
    border: 0;
    margin-right: 10px;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
    display: none;
}

.custom-tone-input-wrap.has-value .custom-tone-done {
    display: inline-block;
}

.custom-tone-suggestions-label {
    font-size: 14px;
    color: var(--darkblue);
    margin-bottom: 8px;
}

.custom-tone-chips {
    display: flex;
    gap: 12px;
}

.custom-tone-chip {
    background: #f4f8fe;
    color: #6a6097;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.custom-tone-chip:hover {
    border-color: #6a6097;
}

.custom-tone-chip.active {
    border: 1px solid #6a6097;
    color: var(--darkblue);
}

.small-popover .popover__inner.custom-tone-popover {
    display: flex !important;
}

@media screen and (max-width: 992px) {
    .custom-tone-chips {
        flex-wrap: wrap;
    }
}

@media screen and (max-width: 768px) {
    .custom-tone-popover {
        width: calc(100vw - 40px);
        max-width: 374px;
    }
    .scroll-modes-tool-head .paid_mode {
        padding: 0 10px;
    }
}
