.tpcf-faq {
    padding-bottom: clamp(2rem, 5vw, 4rem);
    overflow-wrap: anywhere;
}

.tpcf-faq [hidden] {
    display: none;
}

.tpcf-faq-search {
    margin-bottom: 1.25rem;
    padding: clamp(.85rem, 2.5vw, 1.3rem);
    border: 1px solid #c5ded8;
    border-radius: var(--tpcf-radius);
    background: linear-gradient(115deg, #f6faf7, #e4f2ed);
}

.tpcf-faq-search label {
    display: block;
    margin-bottom: .45rem;
}

.tpcf-faq-search-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .45rem;
    padding-inline: .7rem .3rem;
    border: 1px solid #a3bbb9;
    border-radius: .5rem;
    color: var(--tpcf-teal-dark);
    background: var(--tpcf-surface);
}

.tpcf-faq-search-field:focus-within {
    outline: 3px solid #077f94;
    outline-offset: 2px;
}

.tpcf-faq-search-field #faq-query {
    appearance: none;
    width: 100%;
    min-width: 0;
    padding-inline: .25rem;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
}

.tpcf-faq-search-field input::-webkit-search-cancel-button {
    display: none;
}

.tpcf-faq-clear {
    min-height: 2.75rem;
    padding: .4rem .6rem;
    border: 0;
    border-radius: .35rem;
    color: var(--tpcf-teal-dark);
    background: transparent;
    cursor: pointer;
}

.tpcf-faq-clear:hover {
    background: var(--tpcf-wash);
}

.tpcf-refresh .tpcf-faq .tpcf-faq-search-status {
    margin: 0;
    color: var(--tpcf-muted);
    font-size: .875rem;
}

.tpcf-refresh .tpcf-faq .tpcf-faq-search-status:not(:empty) {
    margin-top: .5rem;
}

.tpcf-faq-layout {
    display: grid;
    grid-template-columns: minmax(12rem, 24%) minmax(0, 1fr);
    align-items: start;
    gap: clamp(1rem, 3vw, 2rem);
}

.tpcf-faq-nav {
    position: sticky;
    top: 1rem;
    padding: .85rem;
    border: 1px solid var(--tpcf-border);
    border-radius: var(--tpcf-radius);
    background: var(--tpcf-surface);
}

.tpcf-refresh .tpcf-main .tpcf-faq-nav h2 {
    margin: 0 .45rem .35rem;
    font-size: 1.125rem;
}

.tpcf-faq-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tpcf-faq-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    min-height: 2.75rem;
    padding: .4rem .45rem;
    border-radius: .35rem;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
}

.tpcf-faq-nav a:hover {
    background: var(--tpcf-wash);
}

.tpcf-faq-nav a .fa {
    flex: none;
}

.tpcf-faq-topics {
    display: grid;
    gap: clamp(1.4rem, 3vw, 2rem);
    min-width: 0;
}

.tpcf-faq-topic {
    scroll-margin-top: 1rem;
}

.tpcf-refresh .tpcf-main .tpcf-faq-topic h2 {
    margin-bottom: .7rem;
    font-size: clamp(1.25rem, 2.5vw, 1.55rem);
}

.tpcf-faq-question {
    border: 1px solid var(--tpcf-border);
    border-radius: .65rem;
    background: var(--tpcf-surface);
}

.tpcf-faq-question + .tpcf-faq-question {
    margin-top: .45rem;
}

.tpcf-faq-question[open] {
    border-color: #b1c9c5;
}

.tpcf-faq-question summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    min-height: 3rem;
    padding: .65rem 1rem;
    border-radius: .6rem;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

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

.tpcf-faq-question summary:hover,
.tpcf-faq-question[open] summary {
    background: var(--tpcf-wash);
}

.tpcf-faq-question[open] summary {
    border-radius: .6rem .6rem 0 0;
}

.tpcf-faq-question summary .fa {
    color: var(--tpcf-teal-dark);
    font-size: .8rem;
}

.tpcf-faq-question[open] summary .fa {
    transform: rotate(180deg);
}

.tpcf-faq-answer {
    padding: .85rem 1rem 1rem;
    border-top: 1px solid var(--tpcf-border);
    color: var(--tpcf-muted);
    font-size: .9375rem;
    line-height: 1.65;
}

.tpcf-faq-match {
    border-radius: .15em;
    color: inherit;
    background: #ffe69c;
}

.tpcf-faq-answer > p,
.tpcf-faq-answer > ul,
.tpcf-faq-answer > ol,
.tpcf-faq-fallback {
    max-width: 72ch;
}

.tpcf-refresh .tpcf-main .tpcf-faq-answer > :last-child {
    margin-bottom: 0;
}

.tpcf-faq-help,
.tpcf-faq-empty {
    padding: 1rem;
    border: 1px solid var(--tpcf-border);
    border-radius: var(--tpcf-radius);
    background: var(--tpcf-surface);
}

.tpcf-faq-help {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-top: 1.5rem;
    background: var(--tpcf-wash);
}

.tpcf-refresh .tpcf-main .tpcf-faq-help h2 {
    margin: 0;
    font-size: 1.2rem;
}

.tpcf-faq-help h2 .fa {
    margin-right: .3em;
    color: var(--tpcf-teal-dark);
}

@media (max-width: 740px) {
    .tpcf-faq-layout { grid-template-columns: minmax(0, 1fr); }
    .tpcf-faq-nav { position: static; }
    .tpcf-faq-nav ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; }
}
