/* ── Misprise Global Header Alignment & Inspection / Ticker Search ── */

/* Keep Twenty Twenty desktop nav links, dropdown arrows, and Menu toggle on one clean vertical center axis */
@media (min-width: 1000px) {
    #site-header .header-inner {
        align-items: center;
    }

    #site-header .header-titles {
        align-items: center;
    }

    #site-header .header-navigation-wrapper {
        align-items: center;
    }

    #site-header ul.primary-menu {
        align-items: center;
    }

    #site-header ul.primary-menu > li {
        display: inline-flex;
        align-items: center;
    }

    #site-header ul.primary-menu > li > a {
        display: inline-flex;
        align-items: center;
        line-height: 1.25;
    }

    #site-header ul.primary-menu > li > .icon {
        top: 50%;
        transform: translateY(-60%) rotate(-45deg);
    }

    #site-header .header-toggles {
        align-items: center;
    }

    #site-header .header-toggles .toggle {
        align-items: center;
        display: inline-flex;
    }
}

/* Shared inspection / search icon button */
#site-header .msp-hdr-search-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.6rem;
    height: 3.6rem;
    padding: 0;
    margin: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #0a0a0a;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

#site-header .msp-hdr-search-btn:hover,
#site-header .msp-hdr-search-btn:focus-visible {
    background: #f3f3f3;
    border-color: #d4d4d8;
    color: #000000;
    outline: none;
}

#site-header .msp-hdr-search-btn:active {
    transform: scale(0.95);
}

#site-header .msp-hdr-search-btn .msp-hs-ico {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Desktop icon: sits right next to the website slogan (.site-description) inside .header-titles */
#site-header .header-titles .msp-hdr-search-desktop {
    margin: 1rem 0 0 1.4rem;
    vertical-align: middle;
}

@media (max-width: 999px) {
    #site-header .header-titles .msp-hdr-search-desktop {
        display: none !important;
    }
}

/* Mobile & tablet icon: sits cleanly beside ... Menu toggle, vertically centered */
#site-header .msp-hdr-search-mobile {
    position: absolute;
    right: 6.2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 4rem;
    height: 4rem;
}

#site-header .msp-hdr-search-mobile:active {
    transform: translateY(-50%) scale(0.95);
}

@media (min-width: 1000px) {
    #site-header .msp-hdr-search-mobile {
        display: none !important;
    }
}

@media (max-width: 999px) {
    #site-header .header-titles-wrapper {
        position: relative;
        padding-right: 10.6rem;
    }
}

@media (max-width: 480px) {
    #site-header .msp-hdr-search-mobile {
        right: 5.4rem;
        width: 3.8rem;
        height: 3.8rem;
    }
    #site-header .header-titles-wrapper {
        padding-right: 9.6rem;
    }
}

/* ── Search Popover / Command Palette Modal ── */
.msp-hs-modal[hidden] {
    display: none !important;
}

.msp-hs-modal,
.msp-hs-modal *,
.msp-hs-modal *::before,
.msp-hs-modal *::after {
    box-sizing: border-box;
}

.msp-hs-modal {
    position: fixed;
    inset: 0;
    z-index: 100600 !important;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: clamp(56px, 9vh, 96px) 16px 24px;
    font-family: "Inter var", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: #0a0a0a;
    -webkit-font-smoothing: antialiased;
}

.msp-hs-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.msp-hs-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 620px;
    background: #ffffff;
    border: 1px solid #d4d4d8;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: mspHsIn 0.14s ease-out;
}

@keyframes mspHsIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.99);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.msp-hs-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 12px 16px;
    border-bottom: 1px solid #e4e4e7;
    background: #ffffff;
    margin: 0;
}

.msp-hs-bar-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #52525b;
    flex-shrink: 0;
}

.msp-hs-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 36px;
    padding: 0 4px !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    font-family: inherit !important;
    font-size: 16px !important;
    font-weight: 500;
    color: #0a0a0a !important;
    letter-spacing: -0.01em;
}

.msp-hs-input::placeholder {
    color: #71717a;
    font-weight: 400;
}

.msp-hs-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.msp-hs-clear {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #f4f4f5;
    color: #52525b;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

.msp-hs-clear:hover {
    background: #e4e4e7;
    color: #0a0a0a;
}

.msp-hs-esc-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 8px;
    border: 1px solid #e4e4e7;
    border-radius: 6px;
    background: #fafafa;
    color: #52525b;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    flex-shrink: 0;
}

.msp-hs-esc-btn:hover {
    background: #f4f4f5;
    border-color: #a1a1aa;
    color: #0a0a0a;
}

.msp-hs-x-btn {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #e4e4e7;
    border-radius: 7px;
    background: #ffffff;
    color: #18181b;
    font-family: inherit;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.msp-hs-x-btn:hover {
    background: #0a0a0a;
    border-color: #0a0a0a;
    color: #ffffff;
}

/* Autocomplete Results List */
.msp-hs-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 6px !important;
    max-height: min(380px, 52vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.msp-hs-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.msp-hs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 9px;
    text-decoration: none !important;
    color: #0a0a0a !important;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.msp-hs-row:hover,
.msp-hs-item.is-active .msp-hs-row {
    background: #f4f4f5;
}

.msp-hs-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
}

.msp-hs-ticker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #0a0a0a;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.msp-hs-company {
    font-size: 14px;
    font-weight: 500;
    color: #18181b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msp-hs-right {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.msp-hs-score {
    padding: 2px 7px;
    border-radius: 999px;
    background: #f4f4f5;
    border: 1px solid #e4e4e7;
    font-size: 11px;
    font-weight: 700;
    color: #27272a;
    font-variant-numeric: tabular-nums;
}

.msp-hs-arrow {
    font-size: 14px;
    color: #a1a1aa;
}

.msp-hs-item.is-active .msp-hs-arrow,
.msp-hs-row:hover .msp-hs-arrow {
    color: #0a0a0a;
}

.msp-hs-empty {
    padding: 24px 16px;
    text-align: center;
    font-size: 14px;
    color: #71717a;
}

/* Featured quick chips */
.msp-hs-featured {
    padding: 12px 16px 14px;
    background: #fafafa;
}

.msp-hs-feat-label {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #71717a;
}

.msp-hs-feat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.msp-hs-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid #d4d4d8;
    background: #ffffff;
    color: #0a0a0a !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.msp-hs-chip:hover,
.msp-hs-chip:focus-visible {
    background: #0a0a0a;
    border-color: #0a0a0a;
    color: #ffffff !important;
    outline: none;
}

/* Footer status bar */
.msp-hs-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 16px;
    border-top: 1px solid #e4e4e7;
    background: #fafafa;
    font-size: 12px;
    color: #71717a;
}

.msp-hs-hints {
    font-size: 11px;
    color: #71717a;
}

@media (max-width: 640px) {
    .msp-hs-modal {
        padding: 14px 10px 20px;
    }
    .msp-hs-esc-btn,
    .msp-hs-hints {
        display: none;
    }
    .msp-hs-x-btn {
        width: 32px;
        height: 32px;
    }
    .msp-hs-row {
        padding: 11px 10px;
    }
}
