.qa-feature {
    --qa-line: rgba(0, 0, 0, .1);
    --qa-muted: #6c757d;
    --qa-soft: #f8f8f9;
    --qa-shadow: 0 0 45px rgba(0, 0, 0, .06);
}

.qa-nav-search {
    --qa-muted: #6c757d;
    display: grid;
    grid-template-columns: 34px minmax(120px, 190px) auto;
    align-items: center;
    gap: .15rem;
    margin-left: 1.25rem;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    padding: .18rem;
    background: rgba(255, 255, 255, .1);
}

.qa-nav-search:focus-within {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 .16rem rgba(52, 152, 219, .22);
}

.qa-nav-search-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    color: rgba(255, 255, 255, .72);
    pointer-events: none;
}

.qa-nav-search:focus-within .qa-nav-search-icon {
    color: var(--qa-muted);
}

#headerQueryInput {
    width: 100%;
    min-width: 0;
    height: 38px;
    border: 0;
    border-radius: 0;
    padding: 0 .25rem;
    color: #fff;
    background: transparent;
    font-size: .9rem;
    outline: none;
}

#headerQueryInput::placeholder {
    color: rgba(255, 255, 255, .72);
}

.qa-nav-search:focus-within #headerQueryInput {
    color: var(--primary);
}

.qa-nav-search:focus-within #headerQueryInput::placeholder {
    color: var(--qa-muted);
}

#headerAskButton {
    display: inline-grid;
    place-items: center;
    width: 38px;
    min-height: 38px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 0;
    background: var(--accent);
    color: #fff;
    font-size: .98rem;
    transition: .3s;
}

#headerAskButton:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.qa-overview,
.query-panel,
.answer-panel,
.source-card,
.assistant-dock,
.assistant-source {
    background: #fff;
    box-shadow: var(--qa-shadow);
}

.qa-overview,
.query-panel,
.answer-panel {
    border-top: 5px solid var(--accent);
    border-radius: 8px;
}

.qa-overview {
    padding: 2rem;
}

.qa-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
    max-width: 980px;
    margin: 0 auto;
}

.query-panel,
.answer-panel {
    padding: clamp(1.4rem, 3vw, 2rem);
}

.query-panel {
    display: grid;
    gap: 1.25rem;
}

.query-intro h2 {
    margin: 0;
    color: var(--primary);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.eyebrow,
.query-box label:not(.visually-hidden) {
    display: block;
    margin: 0 0 .45rem;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.query-row,
.assistant-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .6rem;
}

.query-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    align-items: center;
    gap: .25rem;
    border: 1px solid var(--qa-line);
    border-radius: 8px;
    padding: .25rem;
    background: #fff;
}

.query-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(52, 152, 219, .16);
}

.query-icon {
    display: inline-grid;
    place-items: center;
    width: 42px;
    color: var(--qa-muted);
    pointer-events: none;
}

#queryInput,
#assistantInput {
    width: 100%;
    min-width: 0;
    height: 58px;
    border: 1px solid var(--qa-line);
    border-radius: 8px;
    padding: 0 .85rem;
    color: var(--primary);
    background: #fff;
    outline: none;
}

#queryInput {
    height: 50px;
    border: 0;
    border-radius: 0;
    padding: 0 .25rem;
    font-size: 1rem;
}

#queryInput:focus,
#assistantInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 .2rem rgba(52, 152, 219, .16);
}

#queryInput:focus {
    box-shadow: none;
}

#askButton,
#assistantSubmit,
.site-entry {
    min-height: 46px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 0 1rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    transition: .3s;
}

#askButton {
    display: inline-grid;
    place-items: center;
    width: 50px;
    min-height: 50px;
    border-radius: 8px;
    padding: 0;
    font-size: 1.15rem;
}

#askButton:hover,
#assistantSubmit:hover,
.site-entry:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.mode-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    overflow: hidden;
    border: 1px solid var(--qa-line);
    border-radius: 6px;
}

.mode {
    min-height: 40px;
    border: 0;
    border-right: 1px solid var(--qa-line);
    background: var(--qa-soft);
    color: var(--primary);
    font-size: .86rem;
    font-weight: 700;
}

.mode:last-child {
    border-right: 0;
}

.mode.is-active {
    background: var(--primary);
    color: #fff;
}

.quick-grid {
    display: grid;
    gap: .6rem;
}

.quick-grid button,
.assistant-prompts button {
    border: 1px solid var(--qa-line);
    border-radius: 6px;
    background: #fff;
    color: var(--primary);
    font-weight: 600;
    text-align: left;
    transition: .3s;
}

.quick-grid button {
    min-height: 44px;
    padding: .45rem .75rem;
}

.quick-grid button:hover,
.assistant-prompts button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.frequent-searches {
    display: grid;
    gap: .7rem;
}

.frequent-searches h3 {
    margin: 0;
    color: var(--primary);
    font-family: "Montserrat", sans-serif;
    font-size: .96rem;
    font-weight: 700;
}

.frequent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .65rem;
}

.frequent-grid button {
    min-height: 46px;
    border: 1px solid var(--qa-line);
    border-radius: 8px;
    padding: .6rem .75rem;
    background: var(--qa-soft);
    color: var(--primary);
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    transition: .2s;
}

.frequent-grid button:hover,
.frequent-grid button:focus {
    border-color: var(--accent);
    background: #fff;
    color: var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .6rem;
    margin: .25rem 0 0;
}

.stats-grid div {
    border: 1px solid var(--qa-line);
    border-radius: 6px;
    padding: .8rem .5rem;
    background: var(--qa-soft);
    text-align: center;
}

.stats-grid dt {
    color: var(--primary);
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
}

.stats-grid dd {
    margin: .2rem 0 0;
    color: var(--qa-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--qa-line);
}

#resultMeta {
    flex: 0 0 auto;
    color: var(--qa-muted);
    font-size: .86rem;
    font-weight: 600;
}

.answer-text,
.assistant-result {
    border-left: 4px solid var(--accent);
    background: var(--qa-soft);
    color: var(--primary);
    line-height: 1.58;
}

.answer-text {
    margin: 1.2rem 0;
    padding: 1rem;
}

.answer-text mark,
.source-card mark,
.assistant-result mark,
.assistant-source mark {
    border-radius: 3px;
    padding: 0 .15rem;
    background: rgba(52, 152, 219, .18);
    color: inherit;
}

.source-list {
    display: grid;
    gap: .85rem;
}

.starter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.starter-grid button {
    min-height: 72px;
    border: 1px solid var(--qa-line);
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
    color: var(--primary);
    text-align: left;
    font-weight: 700;
    transition: .3s;
}

.starter-grid button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.source-card {
    display: grid;
    gap: .7rem;
    border: 1px solid var(--qa-line);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: .2s;
}

.source-card:hover,
.source-card:focus {
    border-color: var(--accent);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .08);
    outline: none;
}

.source-card[data-result-type*="Resource"] {
    border-color: rgba(52, 152, 219, .28);
}

.source-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.source-title,
.assistant-source-title {
    color: var(--primary);
    font-weight: 700;
}

.source-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.source-title:hover {
    color: var(--accent);
}

.source-path {
    margin-top: .2rem;
    color: var(--qa-muted);
    font-size: .78rem;
    word-break: break-word;
}

.source-score {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: .82rem;
    font-weight: 700;
}

.source-snippet {
    margin: 0;
    color: #343a40;
    font-size: .95rem;
    line-height: 1.5;
}

.source-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.source-open {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 0 .75rem;
    background: var(--accent);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
}

.source-open:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.tag-row,
.assistant-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 .55rem;
    background: var(--qa-soft);
    color: var(--qa-muted);
    font-size: .72rem;
    font-weight: 700;
}

.empty-state {
    border: 1px dashed var(--qa-line);
    border-radius: 8px;
    padding: 1rem;
    color: var(--qa-muted);
}

.assistant-scrim {
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(0, 0, 0, .18);
}

.assistant-launcher {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 1031;
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    min-height: 50px;
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 0 1rem 0 .65rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
}

.assistant-launcher[aria-expanded="true"] {
    display: none;
}

.assistant-launcher-mark {
    display: inline-grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
}

.assistant-dock {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 1032;
    display: grid;
    grid-template-rows: auto auto auto minmax(86px, auto) minmax(0, 1fr);
    gap: .85rem;
    width: min(430px, calc(100vw - 28px));
    height: min(720px, calc(100vh - 128px));
    border: 1px solid var(--qa-line);
    border-radius: 8px;
    padding: 1rem;
    overflow: hidden;
}

.assistant-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--qa-line);
}

.assistant-close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--qa-line);
    border-radius: 6px;
    background: #fff;
    color: var(--qa-muted);
    font-size: 1.2rem;
    line-height: 1;
}

.assistant-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.assistant-prompts button {
    min-height: 32px;
    padding: 0 .7rem;
    font-size: .8rem;
}

.assistant-result {
    max-height: 190px;
    overflow: auto;
    padding: .85rem;
    font-size: .94rem;
}

.assistant-sources {
    display: grid;
    gap: .55rem;
    overflow: auto;
    padding-right: .2rem;
}

.assistant-source {
    display: grid;
    gap: .35rem;
    border: 1px solid var(--qa-line);
    border-radius: 6px;
    padding: .75rem;
}

.assistant-source a,
.assistant-source-title {
    color: var(--primary);
    font-size: .92rem;
    font-weight: 700;
}

.assistant-source p {
    margin: 0;
    color: #343a40;
    font-size: .86rem;
    line-height: 1.45;
}

.assistant-source span {
    color: var(--qa-muted);
    font-size: .74rem;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .qa-shell {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .qa-overview,
    .query-panel,
    .answer-panel {
        padding: 1.15rem;
    }

    .assistant-search,
    .source-head,
    .starter-grid,
    .source-actions {
        grid-template-columns: 1fr;
        display: grid;
    }

    #askButton,
    #assistantSubmit {
        width: 100%;
    }

    #askButton {
        width: 46px;
        min-height: 46px;
    }

    #queryInput,
    #headerQueryInput {
        height: 46px;
    }

    .qa-nav-search {
        grid-template-columns: 40px 1fr auto;
        margin: 0 1.5rem 1.5rem;
        background: #fff;
    }

    .qa-nav-search-icon {
        width: 40px;
        color: var(--qa-muted);
    }

    #headerQueryInput {
        color: var(--primary);
    }

    #headerQueryInput::placeholder {
        color: var(--qa-muted);
    }

    #headerAskButton {
        width: 46px;
        min-height: 46px;
    }

    .mode-row {
        grid-template-columns: 1fr;
    }

    .mode,
    .mode:nth-child(2) {
        border-right: 0;
    }

    .mode:not(:last-child),
    .mode:nth-child(-n+2) {
        border-bottom: 1px solid var(--qa-line);
    }

    .assistant-launcher {
        right: 14px;
        bottom: 92px;
    }

    .assistant-dock {
        right: 14px;
        bottom: 92px;
        width: calc(100vw - 28px);
        height: calc(100vh - 112px);
    }
}
