.faq-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

.faq-content {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
    min-width: 0;
}

.faq-sidebar { min-width: 0; }

.faq-sidebar-card {
    background: var(--neutral-100);
    border: 1px solid var(--neutral-200);
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
}

.faq-sidebar-title {
    margin: 0 0 1rem;
    padding: 0 .75rem;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent-muted, #7BBFA8);
}

.faq-nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.faq-nav-link {
    display: block;
    padding: .55rem .85rem .55rem .75rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--neutral-500);
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    text-decoration: none;
    line-height: 1.4;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.faq-nav-link:hover {
    color: var(--primary);
    background: rgba(10, 26, 47, .04);
}

.faq-nav-link.is-active {
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--accent-muted, #7BBFA8);
    background: #fff;
}

@media (min-width: 992px) {
    .faq-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
        gap: 4rem;
    }
    .faq-sidebar {
        position: sticky;
        top: 120px;
        align-self: start;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
    }
}

@media (max-width: 991.98px) {
    .faq-sidebar-card {
        padding: 1rem 1rem .75rem;
    }
    .faq-sidebar-title {
        padding: 0 .25rem;
        margin-bottom: .75rem;
    }
    .faq-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: .5rem;
        padding-bottom: .25rem;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .faq-nav-link {
        flex: 0 0 auto;
        white-space: nowrap;
        border-left: none;
        border-radius: 999px;
        padding: .4rem .9rem;
        background: #fff;
        border: 1px solid var(--neutral-200);
    }
    .faq-nav-link.is-active {
        border-color: var(--accent-muted, #7BBFA8);
        background: rgba(168, 230, 207, .12);
    }
}

.faq-section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.faq-items {
    display: flex;
    flex-direction: column;
}

.faq-item {
    background: #fff;
    border-bottom: 1px solid var(--neutral-200);
    border-left: 3px solid transparent;
    transition: border-color .15s ease, background-color .15s ease;
    interpolate-size: allow-keywords;
}

.faq-item::details-content {
    block-size: 0;
    overflow: clip;
    opacity: 0;
    transition: block-size .3s cubic-bezier(.4, 0, .2, 1),
                opacity .25s ease,
                content-visibility .3s allow-discrete;
    transition-behavior: allow-discrete;
}

.faq-item[open]::details-content {
    block-size: auto;
    opacity: 1;
}

.faq-item[open] {
    border-left-color: var(--accent-muted, #7BBFA8);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 600;
    color: var(--primary);
    user-select: none;
}

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

.faq-item:not([open]) summary:hover { background: var(--neutral-100); }

.faq-q { flex: 1; }

.faq-badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--accent-muted, #7BBFA8);
    background: rgba(168, 230, 207, .18);
    padding: .15rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.faq-chevron {
    font-size: 1.4rem;
    color: var(--neutral-500);
    transition: transform .2s ease;
    line-height: 1;
}

.faq-item[open] .faq-chevron {
    transform: rotate(90deg);
    color: var(--accent-muted, #7BBFA8);
}

.faq-a {
    padding: 0 1.25rem 1.25rem;
    color: var(--neutral-500);
    line-height: 1.6;
}

.faq-a a { color: var(--primary); text-decoration: underline; }
.faq-a a:hover { color: var(--accent-muted, #7BBFA8); }
.faq-a em { font-style: italic; opacity: .85; }

/* Draft FAQ answers — visually distinct so John / Benjamin can spot what still needs human review.
   Wrap any AI-drafted answer in <span class="faq-draft">…</span> in the YAML.
   Renders as: amber tint + dashed left border + "DRAFT" tag in the corner. */
.faq-a .faq-draft {
    display: block;
    position: relative;
    background: rgba(255, 196, 0, .08);
    border-left: 3px dashed #d99100;
    padding: .85rem 1rem .85rem 2.5rem;
    margin: .25rem 0;
    border-radius: 0 8px 8px 0;
    color: #5a4500;
}
.faq-a .faq-draft::before {
    content: "DRAFT — review";
    position: absolute;
    top: .6rem;
    left: .9rem;
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .08em;
    color: #d99100;
    background: #fff;
    padding: .15rem .35rem;
    border-radius: 3px;
    border: 1px solid #d99100;
    transform: translateY(-.7rem);
}
.faq-a .faq-draft p { margin: .5rem 0 0; line-height: 1.55; }
.faq-a .faq-draft p:first-child { margin-top: .9rem; }
.faq-a .faq-draft a { color: #5a4500; text-decoration: underline; }
.faq-a .faq-draft em { font-style: italic; opacity: .9; }

/* --- In-place search (mirrors the KB search pattern) --- */
.faq-search-wrap {
    margin: 1.5rem auto 0;
    display: flex;
    justify-content: center;
    max-width: 720px;
}
.faq-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .75rem;
    background: #fff;
    border: 1px solid var(--neutral-200);
    border-radius: 62px;
    transition: box-shadow .2s ease, border-color .2s ease;
}
.faq-search:focus-within {
    box-shadow: 0 0 0 3px rgba(10, 26, 47, .1);
}
.faq-search-icon {
    flex-shrink: 0;
    color: var(--neutral-500);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .4rem;
}
.faq-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    color: var(--neutral-600);
    padding: .4rem .25rem;
}
.faq-search input::placeholder {
    color: var(--neutral-500);
}
.faq-search-clear {
    flex-shrink: 0;
    border: 0;
    background: transparent;
    color: var(--neutral-500);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    opacity: 0;
    transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.faq-search-clear:hover {
    background: rgba(10, 26, 47, .08);
    color: var(--primary);
}
.faq-search.has-query .faq-search-clear {
    opacity: 1;
}
.faq-no-results {
    color: var(--neutral-500);
    font-style: italic;
    padding: 2rem 0;
}
