.fts-search-wrap {
    position: relative;
    display: inline-block;
    width: 260px;
    max-width: 100%;
}
.fts-search-form {
    display: flex;
    gap: 6px;
}

/* The full-width bar auto-injected on blog listing + single post
   pages (see maybe_auto_inject in class-fts-frontend.php). Kept
   visually neutral (white background, subtle border) so it doesn't
   clash with whichever theme is actually rendering those pages. */
.fts-top-bar {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 10px 20px;
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 999;
}
.fts-top-bar .fts-search-wrap {
    width: 320px;
}

/* Fallback variant (used when the theme doesn't call wp_body_open, so
   this got injected at wp_footer instead — position:fixed pins it to
   the top of the viewport regardless of where it sits in the HTML). */
.fts-top-bar-fixed {
    position: fixed;
    top: 0;
    left: 0;
}
.fts-search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    box-sizing: border-box;
}
.fts-search-input:focus {
    border-color: #999;
}
.fts-search-button {
    flex-shrink: 0;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #1a1a1a;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.fts-search-button:hover {
    background: #333;
}

.fts-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 340px;
    max-width: 90vw;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1000;
    padding: 6px;
}

.fts-result-item {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}
.fts-result-item:hover,
.fts-result-item.fts-active {
    background: #f5f5f5;
}
.fts-result-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.fts-result-title {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}
.fts-result-score {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: #a30f16;
    background: #fdecea;
    border-radius: 10px;
    padding: 2px 8px;
    white-space: nowrap;
}
.fts-result-snippet {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
}

.fts-no-results,
.fts-loading {
    padding: 14px;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}

@media (max-width: 600px) {
    .fts-search-wrap {
        width: 100%;
    }
    .fts-search-results {
        width: 100%;
    }
}

/* Full results page (templates/search-results-template.php) */
.fts-results-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1a1a;
}
.fts-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap;
}
.fts-results-logo {
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    color: #1a1a1a;
}
.fts-results-header .fts-search-results {
    left: auto;
    right: 0;
}

.fts-results-body-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}
.fts-results-title {
    font-size: 1.6rem;
    margin: 0 0 6px;
    word-break: break-word;
}
.fts-results-count {
    color: #777;
    margin: 0 0 28px;
}

.fts-results-empty {
    padding: 30px 0;
}

.fts-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fts-results-item {
    padding: 18px 0;
    border-bottom: 1px solid #eee;
}
.fts-results-item-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.fts-results-item-title {
    font-size: 1.05rem;
    font-weight: 600;
}
.fts-results-item-title-row:hover .fts-results-item-title {
    text-decoration: underline;
}
.fts-results-item-score {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: #a30f16;
    background: #fdecea;
    border-radius: 10px;
    padding: 2px 9px;
    white-space: nowrap;
}
.fts-results-item-snippet {
    margin: 6px 0 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}
