.ng-home-filter-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin: 4px 0 18px;
    padding: 10px 2px 14px;
    border-bottom: 1px solid var(--ng-border);
}

.ng-home-filter-tools__button {
    display: inline-flex;
    min-width: 0;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #d8d8d8;
    border-radius: 16px;
    background: #fff;
    color: #111;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.ng-home-filter-tools__button:hover,
.ng-home-filter-tools__button:focus-visible {
    border-color: var(--ng-accent);
    color: var(--ng-accent);
    outline: none;
}

.ng-home-filter-tools__icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ng-alpha-modal[hidden] {
    display: none !important;
}

.ng-alpha-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 18px;
}

.ng-alpha-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, 0.48);
    cursor: default;
}

.ng-alpha-modal__panel {
    position: relative;
    z-index: 1;
    width: min(92vw, 430px);
    max-height: min(82vh, 560px);
    overflow: hidden;
    border: 1px solid #dddddd;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.24);
}

.ng-alpha-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 16px 10px;
    border-bottom: 1px solid #eeeeee;
}

.ng-alpha-modal__title {
    margin: 0;
    color: #111;
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.2;
}

.ng-alpha-modal__close {
    display: inline-flex;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f4f4f4;
    color: #111;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.ng-alpha-modal__grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ng-alpha-modal__cell {
    display: flex;
    aspect-ratio: 1 / 1;
    min-width: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid #dedede;
    border-radius: 10px;
    background: #fff;
    color: #111;
    font-size: 1rem;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.ng-alpha-modal__cell:hover,
.ng-alpha-modal__cell:focus-visible {
    border-color: var(--ng-accent);
    color: var(--ng-accent);
    outline: none;
}

.ng-alpha-modal__cell.is-active {
    border-color: var(--ng-accent);
    background: var(--ng-accent);
    color: #fff;
}

.ng-alpha-modal-open {
    overflow: hidden;
}

@media (max-width: 390px) {
    .ng-home-filter-tools {
        gap: 8px;
    }

    .ng-home-filter-tools__button {
        gap: 6px;
        padding-inline: 9px;
        font-size: 0.86rem;
    }

    .ng-home-filter-tools__icon {
        flex-basis: 18px;
        width: 18px;
        height: 18px;
    }

    .ng-alpha-modal {
        padding: 12px;
    }

    .ng-alpha-modal__panel {
        width: min(94vw, 400px);
    }

    .ng-alpha-modal__grid {
        gap: 7px;
        padding: 12px;
    }

    .ng-alpha-modal__cell {
        border-radius: 9px;
        font-size: 0.95rem;
    }
}

@media (min-width: 768px) {
    .ng-home-filter-tools {
        max-width: 620px;
        margin-inline: auto;
        margin-bottom: 24px;
    }

    .ng-alpha-modal__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}
