.header-top {
    height: auto;
    align-items: center;
}

.header-top > * {
    min-width: 0;
}

.am-form,
.am-facets {
    min-width: 0;
}

.am-form {
    flex-wrap: wrap;
}

.am-form > fieldset {
    flex: 1 1 100%;
    display: flex;
    align-items: stretch;
}

.am-form .query-input {
    flex: 1 1 auto;
    min-width: 0;
}

.am-facets {
    display: flex;
    flex: 1 1 100%;
    width: 100%;
    gap: 6px;
    margin-top: 8px;
}

.am-facet {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.am-facet__button {
    width: 100%;
    height: 38px;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
    color: #16447e;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    padding: 0 26px 0 10px;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%2316447e' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 9px;
}

.am-facet__button--on {
    border-color: #16447e;
    box-shadow: inset 0 0 0 1px #16447e;
}

.am-facet--busy .am-facet__button {
    opacity: .6;
}

.am-facet__panel {
    position: absolute;
    z-index: 100002;
    top: calc(100% + 4px);
    left: 0;
    width: 260px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    padding: 8px;
}

.am-facet:last-child .am-facet__panel {
    left: auto;
    right: 0;
}

.am-facet__search {
    width: 100%;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 0 8px;
    font-size: 13px;
    margin-bottom: 6px;
}

.am-facet__list {
    max-height: 300px;
    overflow-y: auto;
}

.am-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    font-size: 13px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
    margin: 0;
}

.am-opt:hover {
    background: #eef3fa;
}

.am-opt--on {
    font-weight: 700;
    color: #16447e;
}

.am-opt--on .am-opt__count {
    color: #16447e;
}

.am-opt input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
}

.am-opt__box {
    position: relative;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    border: 1px solid #b6b6b6;
    border-radius: 2px;
    background: #fff;
}

.am-opt input:checked ~ .am-opt__box {
    background: #16447e;
    border-color: #16447e;
}

.am-opt input:checked ~ .am-opt__box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.am-opt input:focus-visible ~ .am-opt__box {
    outline: 2px solid #16447e;
    outline-offset: 1px;
}

.am-opt__text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.am-opt__count {
    flex: 0 0 auto;
    color: #999;
    font-size: 12px;
}

.am-opt-group {
    padding: 8px 4px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #999;
    border-top: 1px solid #eee;
    margin-top: 4px;
}

.am-facet__list > .am-opt-group:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 2px;
}

.am-opt-empty {
    padding: 8px 4px;
    font-size: 13px;
    color: #999;
}

.am-facet__foot {
    border-top: 1px solid #eee;
    margin-top: 6px;
    padding-top: 6px;
}

.am-facet__clear {
    border: 0;
    background: none;
    padding: 0;
    color: #16447e;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.am-reset {
    margin-left: auto;
    margin-top: 6px;
    border: 0;
    background: none;
    padding: 0;
    color: #16447e;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

.am-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 16px;
}

.am-bar__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef3fa;
    border: 1px solid #cfdcec;
    border-radius: 3px;
    padding: 5px 10px;
    font-size: 14px;
}

.am-bar__clear {
    color: #16447e;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
}

.am-bar__clear:hover {
    color: #c0392b;
}

.am-bar__count {
    color: #777;
    font-size: 13px;
}

.am-note {
    background: #fff8e6;
    border: 1px solid #f0dda8;
    border-radius: 3px;
    padding: 10px 12px;
    margin: 0 0 16px;
    font-size: 14px;
    color: #6b5626;
}

.am-footer {
    margin: 20px 0 0;
    text-align: center;
}

.am-loading {
    color: #777;
    font-size: 14px;
}

.am-empty {
    color: #555;
}

.am-form--busy .am-facet__button,
.am-form--busy .query-input {
    opacity: .6;
    pointer-events: none;
}

@media (max-width: 767px) {
    .am-facets {
        gap: 5px;
    }

    .am-facet__button {
        padding: 0 22px 0 8px;
        background-position: right 7px center;
    }

    .am-facet__panel {
        width: 240px;
    }

    .am-facet--make .am-facet__panel {
        left: auto;
        right: 0;
    }
}

.am-bar__chip--off {
    opacity: .55;
    text-decoration: line-through;
}

.am-bar__chip--off .am-bar__clear {
    text-decoration: none;
}
