.faq-page {
    display: grid;
    gap: 20px;
    width: min(100%, 980px);
    margin: 0 auto;
}

.faq-hero,
.faq-section,
.faq-help {
    padding: clamp(20px, 4vw, 34px);
    border: 1px solid var(--theme-border, #dce3ed);
    border-radius: 18px;
    background: var(--theme-surface, #fff);
}

.faq-hero h1,
.faq-section h2,
.faq-help h2 {
    margin: 0;
}

.faq-hero > p:not(.faq-hero__eyebrow):not(.faq-search-result) {
    max-width: 720px;
    margin: 10px 0 22px;
    color: var(--theme-muted, #607089);
}

.faq-hero__eyebrow {
    margin: 0 0 7px;
    color: #3b82f6;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.faq-search {
    display: grid;
    gap: 8px;
    max-width: 680px;
    font-weight: 800;
}

.faq-search input {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 0 15px;
    border: 1px solid var(--theme-border, #dce3ed);
    border-radius: 12px;
    background: var(--theme-surface-soft, #f6f8fb);
    color: inherit;
    font: inherit;
}

.faq-search input:focus {
    border-color: #3b82f6;
    outline: 3px solid rgba(59, 130, 246, .18);
}

.faq-search-result {
    min-height: 1.2em;
    margin: 8px 0 0;
    color: var(--theme-muted, #607089);
    font-size: .86rem;
}

.faq-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.faq-categories a {
    padding: 9px 13px;
    border: 1px solid var(--theme-border, #dce3ed);
    border-radius: 999px;
    background: var(--theme-surface, #fff);
    color: inherit;
    font-size: .88rem;
    font-weight: 800;
    text-decoration: none;
}

.faq-categories a:hover,
.faq-categories a:focus-visible {
    border-color: #3b82f6;
    color: #2563eb;
}

.faq-sections {
    display: grid;
    gap: 16px;
}

.faq-section {
    scroll-margin-top: 90px;
}

.faq-section > header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.faq-section > header > span {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .8rem;
    font-weight: 900;
}

.faq-section > header p {
    margin: 5px 0 0;
    color: var(--theme-muted, #607089);
}

.faq-list {
    display: grid;
    gap: 9px;
}

.faq-list details {
    border: 1px solid var(--theme-border, #dce3ed);
    border-radius: 12px;
    background: var(--theme-surface-soft, #f6f8fb);
    overflow: hidden;
}

.faq-list details[open] {
    border-color: #93c5fd;
}

.faq-list summary {
    position: relative;
    padding: 15px 48px 15px 16px;
    cursor: pointer;
    font-weight: 850;
    list-style: none;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    content: '+';
    position: absolute;
    top: 50%;
    right: 16px;
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: var(--theme-surface, #fff);
    color: #2563eb;
    font-size: 1.1rem;
    transform: translateY(-50%);
}

.faq-list details[open] summary::after {
    content: '−';
}

.faq-list details > div {
    padding: 0 16px 16px;
    color: var(--theme-muted, #607089);
}

.faq-list details > div > :first-child {
    margin-top: 0;
}

.faq-list details > div > :last-child {
    margin-bottom: 0;
}

.faq-list a,
.faq-help a:not(.button) {
    color: #2563eb;
    font-weight: 750;
}

.faq-list code {
    overflow-wrap: anywhere;
}

.faq-empty {
    margin: 0;
    padding: 24px;
    border: 1px dashed var(--theme-border, #dce3ed);
    border-radius: 14px;
    color: var(--theme-muted, #607089);
    text-align: center;
}

.faq-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.faq-help p {
    max-width: 700px;
    margin: 8px 0 0;
    color: var(--theme-muted, #607089);
}

.faq-help .button {
    flex: 0 0 auto;
}

html[data-theme="dark"] .faq-hero,
html[data-theme="dark"] .faq-section,
html[data-theme="dark"] .faq-help,
html[data-theme="dark"] .faq-categories a,
html[data-theme="dark"] .faq-list details {
    color: #f8fafc;
}

html[data-theme="dark"] .faq-section > header > span {
    background: #172554;
    color: #93c5fd;
}

html[data-theme="dark"] .faq-list details[open] {
    border-color: #2563eb;
}

@media (max-width: 640px) {
    .faq-page {
        gap: 14px;
    }

    .faq-hero,
    .faq-section,
    .faq-help {
        padding: 17px;
        border-radius: 14px;
    }

    .faq-hero h1 {
        font-size: 1.65rem;
    }

    .faq-section > header {
        gap: 10px;
    }

    .faq-section > header > span {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
    }

    .faq-section h2,
    .faq-help h2 {
        font-size: 1.2rem;
    }

    .faq-section > header p,
    .faq-list details > div,
    .faq-help p {
        font-size: .9rem;
    }

    .faq-list summary {
        padding: 13px 44px 13px 14px;
        font-size: .94rem;
    }

    .faq-categories {
        flex-wrap: nowrap;
        padding-bottom: 3px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .faq-categories a {
        flex: 0 0 auto;
    }

    .faq-help {
        align-items: stretch;
        flex-direction: column;
    }

    .faq-help .button {
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }
}
