.search-open-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-right: 1rem;
    padding: 0.35rem 0.7rem;
    color: #003366;
    background: #ffffff;
    border: 1px solid #9fb1c4;
    border-radius: 999px;
    font: inherit;
    cursor: pointer;
}

.search-shortcut {
    color: #526579;
    font-size: 0.75rem;
}

.search-modal[hidden] {
    display: none;
}

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgb(2 14 29 / 0.42);
}

.search-panel {
    position: relative;
    width: min(92vw, 760px);
    margin: 8vh auto 0;
    color: #102033;
    background: #ffffff;
    border: 1px solid #c7d3df;
    border-radius: 16px;
    box-shadow: 0 30px 90px rgb(0 0 0 / 0.28);
    overflow: hidden;
}

.search-panel-header,
.search-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: #f7f9fb;
    border-bottom: 1px solid #d8e1ea;
}

.search-panel-header h2 {
    margin: 0;
    font-size: 1rem;
}

.search-close {
    border: 0;
    background: transparent;
    color: #003366;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.search-input-shell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid #d8e1ea;
}

.search-input {
    width: 100%;
    border: 0;
    outline: 0;
    font: inherit;
    font-size: 1.05rem;
}

.search-results {
    max-height: min(62vh, 620px);
    overflow: auto;
}

.search-result-list {
    display: grid;
}

.search-result {
    display: grid;
    grid-template-columns: minmax(110px, 160px) 1fr;
    gap: 1rem;
    padding: 0.8rem 1rem;
    color: #003366;
    text-decoration: none;
    border-bottom: 1px solid #eef2f6;
}

.search-result:hover,
.search-result:focus {
    background: #eef5fb;
    outline: 0;
}

.search-result span,
.search-result small {
    display: block;
}

.search-result small,
.search-footer,
.search-empty {
    color: #526579;
    font-size: 0.85rem;
}

.search-empty {
    margin: 0;
    padding: 1.5rem 1rem;
}

.search-footer {
    border-top: 1px solid #d8e1ea;
    border-bottom: 0;
}

@media (max-width: 760px) {
    .search-panel {
        width: calc(100vw - 1rem);
        margin: 0.5rem auto 0;
        border-radius: 12px;
    }

    .search-panel-header,
    .search-footer,
    .search-input-shell {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .search-input-shell {
        gap: 0.5rem;
    }

    .search-shortcut,
    .search-footer {
        display: none;
    }

    .search-results {
        max-height: calc(100vh - 9rem);
    }

    .search-result {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding: 0.75rem;
    }
}
