#decisions-search-form .search-fields-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "country"
        "or"
        "city"
        "keyword"
        "institution";
    gap: 20px;
    align-items: start;
}

#decisions-search-form .field-group {
    min-width: 0;
}

#decisions-search-form .field-group--country {
    grid-area: country;
}

#decisions-search-form .field-group--city {
    grid-area: city;
}

#decisions-search-form .field-group--keyword {
    grid-area: keyword;
}

#decisions-search-form .field-group--institution {
    grid-area: institution;
}

#decisions-search-form .search-divider {
    grid-area: or;
    text-align: center;
}

#decisions-search-form .field-group > input,
#decisions-search-form .field-group > select {
    margin-bottom: 0;
}

#decisions-search-form .search-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 2rem;
}

#decisions-search-form .search-actions__filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin: 0 0 0 auto;
}

#decisions-search-form .search-actions .button {
    margin-bottom: 0;
}

.directory-toast:empty {
    display: none;
}

.directory-toast {
    background: #eef6fc;
    border: 1px solid #c5dfef;
    border-left: .3rem solid #02669f;
    border-radius: .5rem;
    box-shadow: 0 .2rem .6rem rgba(0, 0, 0, .08);
    color: #17435d;
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    overflow-wrap: anywhere;
}

.directory-toast--fading {
    opacity: 0;
    transition: opacity 300ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .directory-toast--fading {
        transition: none;
    }
}

.directory-toast[data-state="success"] {
    background: #eef8f1;
    border-color: #bedfc8;
    border-left-color: #287943;
    color: #205d34;
}

.directory-toast[data-state="error"] {
    background: #fff2f2;
    border-color: #ebc6c6;
    border-left-color: #b33232;
    color: #842525;
}

@media (min-width: 40em) {
    #decisions-search-form .search-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "country keyword"
            "or ."
            "city institution";
    }
}

@media (min-width: 64em) {
    #decisions-search-form .search-actions__filters {
        width: 100%;
        margin-left: 0;
    }

    #decisions-search-form #download-programs-excel {
        margin-right: auto;
    }
}

.results-pagination:not([hidden]) {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    margin: 1rem 0;
}

.results-pagination select {
    margin: 0;
    width: auto;
}

.results-pagination p,
.results-pagination .button {
    margin-bottom: 0;
}

.results-pagination nav {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.results-pagination button:disabled {
    cursor: default;
    opacity: .5;
}

.results-pagination :focus-visible {
    outline: 2px solid #02669f;
    outline-offset: 3px;
}

/*
|--------------------------------------------------------------------------
| Program Detail Modal
|--------------------------------------------------------------------------
|
| A native <dialog> supplies the modal behavior (focus trapping, Escape to
| close, and an inert background), so these rules only cover appearance.
| Fonts, colors and spacing are inherited from the site stylesheet.
|
*/

/*
| The results table's program titles are buttons that open the modal.
| They are styled as inline text links so a row still reads as data
| rather than as a row of form controls.
*/
.program-details-trigger {
    background: none;
    border: 0;
    color: #02669f;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-align: left;
    text-decoration: underline;
}

.program-details-trigger:hover,
.program-details-trigger:focus {
    text-decoration: none;
}

.results-sort-button {
    align-items: center;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: .35rem;
    padding: 0;
    text-align: left;
}

.results-sort-button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.results-sort-indicator {
    white-space: nowrap;
}

.search-tips-trigger {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    padding: 0;
    text-decoration: underline;
}

.search-tips-trigger:hover,
.search-tips-trigger:focus {
    text-decoration: none;
}

#program-details-modal,
#search-tips-modal {
    border: 1px solid #c8c8c8;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
    color: inherit;
    max-height: 85vh;
    max-width: 44rem;
    padding: 1.5rem;
    width: calc(100% - 2rem);
}

#program-details-modal::backdrop,
#search-tips-modal::backdrop {
    background-color: rgba(0, 0, 0, .55);
}

/*
| Keep the title and close button on one line, with the title free to
| wrap and the button holding its size.
*/
.program-details-modal__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.program-details-modal__header h2 {
    margin: 0;
}

.program-details-modal__close {
    background: none;
    border: 0;
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0 .25rem;
}

#program-details-table {
    margin: 1rem 0 0 0;
    width: 100%;
}

#program-details-table th,
#program-details-table td {
    border: 1px solid #e9e9e9;
    padding: 8px 10px 10px;
    text-align: left;
    vertical-align: top;
}

#program-details-table th {
    white-space: normal;
    width: 35%;
}

#program-details-body ul {
    margin: 0;
    padding-left: 1.25rem;
}

#program-details-table a {
    font-weight: 700;
}