/* Search palette is isolated from Bootstrap and the site's display typography. */
body.tl-search-open {
    overflow: hidden;
}

.tl-search-overlay,
.tl-search-overlay *,
.tl-search-overlay *::before,
.tl-search-overlay *::after,
.tl-search-trigger,
.tl-search-trigger * {
    box-sizing: border-box;
}

.tl-search-overlay {
    --tl-search-brand: #af2f2c;
    --tl-search-text: #252b35;
    --tl-search-muted: #707680;
    --tl-search-border: #e7e8eb;
    --tl-search-top-gap: clamp(24px, 10vh, 88px);
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    overflow: auto;
    overscroll-behavior: contain;
    padding: var(--tl-search-top-gap) 24px 24px;
    background: rgba(20, 25, 32, 0.48);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    color: var(--tl-search-text);
    font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: left;
    -webkit-font-smoothing: antialiased;
}

.tl-search-overlay[hidden],
.tl-search-overlay [hidden] {
    display: none !important;
}

.tl-search-overlay button,
.tl-search-overlay input,
.tl-search-overlay kbd {
    font-family: inherit;
}

.tl-search-overlay svg,
.tl-search-trigger svg {
    display: block;
    flex-shrink: 0;
    pointer-events: none;
}

.tl-search-dialog {
    display: flex;
    flex-direction: column;
    width: min(720px, 100%);
    max-width: 100%;
    max-height: calc(100vh - var(--tl-search-top-gap) - 24px);
    max-height: min(740px, calc(100dvh - var(--tl-search-top-gap) - 24px));
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(15, 20, 28, 0.23), 0 4px 16px rgba(15, 20, 28, 0.12);
    animation: tl-search-appear 160ms ease-out both;
}

.tl-search-header {
    flex-shrink: 0;
    padding: 20px;
    border-bottom: 1px solid var(--tl-search-border);
    background: #fff;
}

.tl-search-form {
    margin: 0;
}

.tl-search-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 56px;
    padding: 8px 10px 8px 15px;
    border: 1px solid #d7d9de;
    border-radius: 10px;
    background: #fff;
    transition: border-color 120ms ease, box-shadow 120ms ease;
}

.tl-search-input-row:focus-within {
    border-color: var(--tl-search-brand);
    box-shadow: 0 0 0 3px rgba(175, 47, 44, 0.09);
}

.tl-search-query-icon {
    width: 22px;
    height: 22px;
    color: var(--tl-search-brand);
}

.tl-search-overlay input.tl-search-input {
    flex: 1 1 0;
    width: 100%;
    min-width: 0;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--tl-search-text);
    font-size: 18px;
    font-weight: 400;
    line-height: 36px;
    letter-spacing: normal;
    -webkit-appearance: none;
    appearance: none;
}

.tl-search-input::placeholder {
    color: #8a8e97;
    opacity: 1;
}

.tl-search-input::-webkit-search-decoration,
.tl-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.tl-search-overlay button.tl-search-clear,
.tl-search-overlay button.tl-search-close {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 32px;
    min-height: 32px;
    margin: 0;
    padding: 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--tl-search-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.tl-search-overlay button.tl-search-close {
    padding-right: 8px;
    padding-left: 8px;
    border: 1px solid var(--tl-search-border);
    background: #fafafa;
}

.tl-search-clear svg,
.tl-search-close svg {
    width: 18px;
    height: 18px;
}

.tl-search-overlay button.tl-search-clear:hover,
.tl-search-overlay button.tl-search-close:hover {
    background: #f0f1f3;
    color: var(--tl-search-text);
}

.tl-search-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin-top: 14px;
}

.tl-search-scope {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    min-width: 0;
    margin: 0;
    padding: 3px;
    border: 1px solid var(--tl-search-border);
    border-radius: 9px;
    background: #f4f5f6;
}

.tl-search-overlay label.tl-search-scope-option {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    margin: 0;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #656b75;
    font-size: 13px;
    font-weight: 500;
    line-height: 20px;
    cursor: pointer;
    transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.tl-search-scope-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.tl-search-scope-option svg {
    width: 16px;
    height: 16px;
}

.tl-search-scope-option:hover {
    color: var(--tl-search-text);
}

.tl-search-overlay label.tl-search-scope-option:has(input:checked),
.tl-search-overlay label.tl-search-scope-option[data-active="true"] {
    border-color: #e4e5e8;
    background: #fff;
    box-shadow: 0 1px 3px rgba(25, 30, 40, 0.06);
    color: var(--tl-search-brand);
}

.tl-search-scope-option:has(input:focus-visible) {
    box-shadow: 0 0 0 2px rgba(175, 47, 44, 0.35) !important;
}

.tl-search-shortcut {
    flex-shrink: 0;
    color: #8a8f97;
    font-size: 11px;
    line-height: 20px;
    white-space: nowrap;
}

.tl-search-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #d5d7dc transparent;
}

.tl-search-status {
    margin: 0;
    padding: 14px 22px 9px;
    color: var(--tl-search-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 19px;
    overflow-wrap: anywhere;
}

.tl-search-results {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0 10px 12px;
    list-style: none;
}

.tl-search-results > li {
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tl-search-overlay a.tl-search-result {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #fff;
    color: var(--tl-search-text);
    text-decoration: none !important;
    transition: border-color 100ms ease, background-color 100ms ease;
}

.tl-search-overlay a.tl-search-result:hover {
    background: #f6f7f8;
    color: var(--tl-search-text);
}

.tl-search-overlay a.tl-search-result[data-active="true"] {
    border-color: #efd8d6;
    background: #fcf5f4;
}

.tl-search-result-icon {
    display: flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-top: 2px;
    border: 1px solid #e8e9ec;
    border-radius: 8px;
    background: #f6f7f8;
    color: #7d838d;
}

.tl-search-result-icon svg {
    width: 18px;
    height: 18px;
}

.tl-search-result[data-active="true"] .tl-search-result-icon {
    border-color: #f1dedd;
    background: #fff;
    color: var(--tl-search-brand);
}

.tl-search-result-body {
    display: block;
    flex: 1 1 0;
    min-width: 0;
}

.tl-search-result-category,
.tl-search-result-title,
.tl-search-result-excerpt {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-search-result-category {
    color: #7a808a;
    font-size: 11px;
    font-weight: 500;
    line-height: 16px;
}

.tl-search-overlay strong.tl-search-result-title {
    margin: 2px 0 0;
    color: var(--tl-search-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 21px;
    letter-spacing: normal;
}

.tl-search-result-excerpt {
    margin-top: 3px;
    color: #747a84;
    font-size: 12px;
    font-weight: 400;
    line-height: 19px;
}

.tl-search-result mark {
    padding: 0 1px;
    border-radius: 2px;
    background: #fae9b6;
    color: inherit;
    font-weight: 600;
}

.tl-search-result-arrow {
    width: 17px;
    height: 17px;
    margin-top: 19px;
    color: #a5a9b0;
}

.tl-search-result[data-active="true"] .tl-search-result-arrow {
    color: var(--tl-search-brand);
}

.tl-search-empty {
    padding: 30px 28px 42px;
    text-align: center;
}

.tl-search-empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 1px solid #e8e9ed;
    border-radius: 13px;
    background: #f7f8f9;
    color: #969ba4;
}

.tl-search-empty-icon svg {
    width: 24px;
    height: 24px;
}

.tl-search-overlay .tl-search-empty h3 {
    margin: 0 0 8px;
    color: var(--tl-search-text);
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: normal;
    text-transform: none;
}

.tl-search-empty p {
    max-width: 440px;
    margin: 0 auto;
    color: var(--tl-search-muted);
    font-size: 13px;
    line-height: 21px;
    overflow-wrap: anywhere;
}

.tl-search-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 20px;
}

.tl-search-overlay button.tl-search-suggestion {
    max-width: 100%;
    margin: 0;
    padding: 6px 11px;
    border: 1px solid var(--tl-search-border);
    border-radius: 7px;
    background: #fff;
    color: #59616d;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    white-space: normal;
    cursor: pointer;
}

.tl-search-overlay button.tl-search-suggestion:hover {
    border-color: #e3c5c3;
    background: #fcf5f4;
    color: var(--tl-search-brand);
}

.tl-search-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 18px;
    min-height: 43px;
    padding: 10px 20px;
    border-top: 1px solid var(--tl-search-border);
    background: #fafbfc;
    color: #858a93;
    font-size: 11px;
    line-height: 20px;
}

.tl-search-footer > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.tl-search-footer-scope {
    overflow: hidden;
    margin-left: auto;
    text-overflow: ellipsis;
}

.tl-search-overlay kbd,
.tl-search-trigger kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 20px;
    margin: 0;
    padding: 0 4px;
    border: 1px solid #dfe1e5;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 1px 0 #e8e9eb;
    color: #858b95;
    font-size: 10px;
    font-weight: 400;
    line-height: 18px;
    white-space: nowrap;
}

.tl-search-overlay button:focus-visible,
.tl-search-overlay a.tl-search-result:focus-visible,
.tl-search-trigger:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(175, 47, 44, 0.35) !important;
}

.tl-search-overlay a.tl-search-result:focus-visible {
    box-shadow: inset 0 0 0 2px var(--tl-search-brand) !important;
}

.siteSearch button.tl-search-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    max-width: 100%;
    min-height: 40px;
    margin: 0;
    padding: 8px 11px;
    border: 1px solid #dedfe3;
    border-radius: 8px;
    background: #fff;
    color: #626a76;
    box-shadow: 0 1px 2px rgba(20, 25, 30, 0.03);
    font: 400 13px/20px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: left;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease;
    -webkit-appearance: none;
    appearance: none;
}

.tl-search-trigger > svg {
    width: 18px;
    height: 18px;
    color: #af2f2c;
}

.tl-search-trigger > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-search-trigger kbd {
    flex-shrink: 0;
    margin-left: 10px;
    font-family: inherit;
}

.siteSearch button.tl-search-trigger:hover {
    border-color: #c7aaab;
    background: #fcf8f7;
    color: #af2f2c;
}

.tl-search-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

@keyframes tl-search-appear {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .tl-search-overlay {
        --tl-search-top-gap: 16px;
        padding: var(--tl-search-top-gap) 12px 12px;
    }

    .tl-search-dialog {
        max-height: calc(100vh - 28px);
        max-height: calc(100dvh - 28px);
        border-radius: 13px;
    }

    .tl-search-header {
        padding: 14px;
    }

    .tl-search-input-row {
        gap: 8px;
        min-height: 52px;
        padding-left: 11px;
    }

    .tl-search-overlay input.tl-search-input {
        font-size: 16px;
    }

    .tl-search-overlay button.tl-search-close {
        min-width: 30px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .tl-search-toolbar {
        margin-top: 12px;
    }

    .tl-search-scope {
        display: grid;
        grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
        flex: 1 1 auto;
        width: 100%;
    }

    .tl-search-overlay label.tl-search-scope-option {
        flex: 1 1 0;
        gap: 6px;
        padding: 7px 6px;
        font-size: 12px;
        line-height: 18px;
        text-align: center;
    }

    .tl-search-shortcut {
        display: none;
    }

    .tl-search-status {
        padding: 12px 16px 8px;
    }

    .tl-search-results {
        padding-right: 6px;
        padding-left: 6px;
    }

    .tl-search-overlay a.tl-search-result {
        gap: 9px;
        padding: 10px 8px;
    }

    .tl-search-result-icon {
        flex-basis: 30px;
        width: 30px;
        height: 32px;
    }

    .tl-search-overlay strong.tl-search-result-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 13px;
        line-height: 20px;
        white-space: normal;
    }

    .tl-search-result-arrow {
        width: 14px;
        height: 14px;
        margin-top: 20px;
    }

    .tl-search-empty {
        padding: 24px 20px 32px;
    }

    .tl-search-footer {
        gap: 12px;
        padding: 9px 15px;
    }

    .tl-search-footer > span:not(.tl-search-footer-scope) {
        display: none;
    }

    .tl-search-footer-scope {
        margin-left: 0;
    }

    .tl-search-trigger kbd {
        display: none;
    }
}

@media (max-width: 360px) {
    .tl-search-scope-option svg {
        display: none;
    }
}

@media (max-height: 560px) and (min-width: 601px) {
    .tl-search-overlay {
        --tl-search-top-gap: 16px;
        padding-bottom: 16px;
    }

    .tl-search-dialog {
        max-height: calc(100vh - 32px);
        max-height: calc(100dvh - 32px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tl-search-dialog {
        animation: none;
    }

    .tl-search-overlay *,
    .siteSearch button.tl-search-trigger {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
