.hpn-ag {
    --hpn-ag-purple: var(--hpn-primary, #613e91);
    --hpn-ag-purple-dark: #4d2f78;
    --hpn-ag-border: var(--hpn-border-soft, #d9cde8);
    --hpn-ag-surface: #fbf8ff;
    --hpn-ag-filter-surface: var(--hpn-surface-soft, #f3ecfb);
    --hpn-ag-text: var(--hpn-body-color, #666666);

    background: var(--hpn-ag-surface);
    color: var(--hpn-ag-text);
    display: flow-root;
    margin: 0 0 clamp(28px, 5vw, 64px);
    padding: 0 0 clamp(28px, 5vw, 56px);
}

.hpn-ag *,
.hpn-ag *::before,
.hpn-ag *::after {
    box-sizing: border-box;
}

.hpn-ag__filters {
    background: var(--hpn-ag-filter-surface);
    padding: clamp(24px, 4vw, 36px);
    margin-bottom: 20px;
}

.hpn-ag__filter-title {
    color: var(--hpn-ag-purple);
    font-size: var(--hpn-font-size-h2, 19px);
    font-weight: 700;
    line-height: 1em;
    margin: 0 0 22px;
    padding-bottom: 0;
}

.hpn-ag__filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.hpn-ag__filter-button {
    appearance: none;
    background: #fff;
    border: 2px solid var(--hpn-ag-border);
    border-radius: 6px;
    color: var(--hpn-ag-purple);
    cursor: pointer;
    font: inherit;
    font-size: var(--hpn-font-size-body, 14px);
    font-weight: 700;
    line-height: 1.2;
    min-height: 58px;
    min-width: 118px;
    padding: 12px 24px;
    text-align: center;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.hpn-ag__filter-button:hover,
.hpn-ag__filter-button:focus-visible {
    border-color: var(--hpn-ag-purple);
    outline: none;
    transform: translateY(-1px);
}

.hpn-ag__filter-button.is-active {
    background: linear-gradient(180deg, var(--hpn-ag-purple), var(--hpn-ag-purple-dark));
    border-color: var(--hpn-ag-purple);
    color: #fff;
}

.hpn-ag__filter-footer {
    align-items: center;
    display: flex;
    gap: 24px;
    justify-content: flex-start;
    margin-top: 42px;
}

.hpn-ag__reset {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--hpn-ag-purple);
    cursor: pointer;
    font: inherit;
    font-size: var(--hpn-font-size-body, 14px);
    font-weight: 700;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hpn-ag__toggle {
    align-items: center;
    color: #5b5067;
    display: inline-flex;
    font-size: var(--hpn-font-size-body, 14px);
    font-weight: 700;
    gap: 16px;
}

.hpn-ag__toggle input {
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    position: absolute;
}

.hpn-ag__toggle-ui {
    background: #d7c9e6;
    border-radius: 999px;
    display: inline-flex;
    height: 30px;
    position: relative;
    transition: background-color 160ms ease;
    width: 54px;
}

.hpn-ag__toggle-ui::after {
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    content: "";
    height: 24px;
    left: 3px;
    position: absolute;
    top: 3px;
    transition: transform 160ms ease;
    width: 24px;
}

.hpn-ag__toggle input:checked + .hpn-ag__toggle-ui {
    background: var(--hpn-ag-purple);
}

.hpn-ag__toggle input:checked + .hpn-ag__toggle-ui::after {
    transform: translateX(24px);
}

.hpn-ag__toggle input:focus-visible + .hpn-ag__toggle-ui {
    outline: 3px solid rgba(109, 31, 177, 0.28);
    outline-offset: 3px;
}

.hpn-ag__grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 clamp(6px, 1.5vw, 12px);
}

.hpn-ag__card {
    min-width: 0;
}

.hpn-ag__card[hidden] {
    display: none;
}

.hpn-ag__card-link {
    background: #fff;
    border: 1px solid #bbb6c4;
    display: block;
    min-height: 150px;
    overflow: hidden;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.hpn-ag__card-link:hover,
.hpn-ag__card-link:focus-visible {
    border-color: var(--hpn-ag-purple);
    box-shadow: 0 10px 24px rgba(63, 45, 86, 0.14);
    outline: none;
    transform: translateY(-2px);
}

.hpn-ag__card-link--disabled {
    cursor: default;
}

.hpn-ag__image {
    aspect-ratio: 3.3 / 1;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.hpn-ag__placeholder {
    align-items: center;
    aspect-ratio: 3.3 / 1;
    color: #81758d;
    display: flex;
    font-size: var(--hpn-font-size-h1, 32px);
    justify-content: center;
    line-height: 1.2;
    min-height: 150px;
    padding: 24px;
    text-align: center;
}

.hpn-ag__empty {
    color: #5b5067;
    font-size: var(--hpn-font-size-body, 14px);
    font-weight: 700;
    margin: 24px clamp(6px, 1.5vw, 12px) 0;
}

@media (max-width: 780px) {
    .hpn-ag__filter-buttons {
        gap: 12px;
    }

    .hpn-ag__filter-button {
        flex: 1 1 calc(50% - 12px);
        min-width: 0;
        padding-inline: 14px;
    }

    .hpn-ag__filter-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .hpn-ag__toggle {
        align-items: flex-start;
    }

    .hpn-ag__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 460px) {
    .hpn-ag__filter-button {
        flex-basis: 100%;
    }
}
