/* =============================================================================
   Finboard Search — Modal + Page Results
   Version: 2.2.0
   ============================================================================= */

/* ─────────────────────────────────────────────────────────────────────────────
   CSS custom-property bridge (inherits from finboard-v4.css design tokens).
   All colours reference the same tokens so light/dark mode works automatically.
   ───────────────────────────────────────────────────────────────────────────── */

/* Defensive reset for every descendant of the modal — the modal is
 * lazily injected into document.body on community pages, blog posts,
 * broker reviews etc., and ambient rules like
 *   .entry-content a { text-decoration: underline; color: #xxx }
 * inherit in with higher specificity + source-order wins. Strip
 * text-decoration on every text element inside the modal once; leave
 * background/background-image alone on generic `*` so icon gradients
 * and the .fb-search-spinner render intact. Per-link catch below
 * covers the gradient-underline theme trick (background-image on
 * the anchor itself). */
.finboard-search-modal,
.finboard-search-modal * {
    text-decoration: none !important;
    text-shadow: none !important;
}
.finboard-search-modal a,
.finboard-search-modal a:link,
.finboard-search-modal a:visited,
.finboard-search-modal a:hover,
.finboard-search-modal a:focus,
.finboard-search-modal a:active {
    text-decoration: none !important;
    background-image: none !important;
    border-bottom: none !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Search Trigger Button (shortcode [finboard_search])
   ───────────────────────────────────────────────────────────────────────────── */

.finboard-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--fb-bg-card, #232838);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    color: var(--fb-text-muted, #9ca3af);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    min-width: 180px;
}

.finboard-search-trigger:hover,
.finboard-search-trigger:focus-visible {
    border-color: var(--fb-gold, #E8A910);
    color: var(--fb-text, #e2e8f0);
    background: var(--fb-bg-hover, #2a2f42);
    outline: none;
}

.finboard-search-trigger__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.finboard-search-trigger__label {
    flex: 1;
    text-align: left;
}

.finboard-search-trigger__kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: var(--fb-bg, #1a1e28);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 4px;
    font-size: 11px;
    font-family: monospace;
    line-height: 1.5;
    color: var(--fb-text-muted, #9ca3af);
}

@media (max-width: 480px) {
    .finboard-search-trigger__kbd { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Search Modal Overlay
   ───────────────────────────────────────────────────────────────────────────── */

.finboard-search-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 80px 16px 16px;
}

.finboard-search-modal[hidden] {
    display: none;
}

.finboard-search-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.finboard-search-modal__panel {
    position: relative;
    width: 100%;
    max-width: 680px;
    background: var(--fb-bg-card, #232838);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.1));
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.5);
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fb-search-modal-in 0.18s cubic-bezier(0.4,0,0.2,1);
}

@keyframes fb-search-modal-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.finboard-search-modal__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}

.finboard-search-modal__search-icon {
    width: 20px;
    height: 20px;
    color: var(--fb-text-muted, #9ca3af);
    flex-shrink: 0;
}

.finboard-search-modal__input {
    flex: 1;
    background: none !important;
    border: none !important;
    outline: none;
    font-size: 17px !important;
    color: var(--fb-text, #e2e8f0) !important;
    -webkit-text-fill-color: var(--fb-text, #e2e8f0) !important;
    caret-color: var(--fb-gold, #E8A910);
    line-height: 1.4;
    box-shadow: none !important;
    padding: 0 !important;
    text-decoration: none !important;
}

.finboard-search-modal__input::placeholder {
    color: var(--fb-text-muted, #9ca3af);
}

/* Remove browser search input X button */
.finboard-search-modal__input::-webkit-search-decoration,
.finboard-search-modal__input::-webkit-search-cancel-button { display: none; }

.finboard-search-modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none !important;
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08)) !important;
    border-radius: 8px;
    color: var(--fb-text-muted, #9ca3af) !important;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.finboard-search-modal__close:hover,
.finboard-search-modal__close:focus-visible {
    background: var(--fb-bg-raised, #1a1e28) !important;
    color: var(--fb-text, #e2e8f0) !important;
    outline: none;
}

/* The inline SVG was computing to width:0px — the close button is
 * display:flex with align/justify center, so without flex-shrink:0
 * the SVG can be squashed to zero by sibling rules (and in practice
 * was, probably by an ambient `svg { width: 100% }` from the theme
 * that interacts badly with the flex parent's intrinsic sizing).
 * Pin width/height/flex-shrink with !important and explicit stroke
 * so the X renders regardless of the outer theme context. */
.finboard-search-modal__close svg {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    flex-shrink: 0 !important;
    stroke: currentColor !important;
    fill: none !important;
    display: block !important;
}
.finboard-search-modal__close svg line {
    stroke: currentColor !important;
    stroke-width: 2 !important;
}

/* Body — scrollable results */
.finboard-search-modal__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 0;
    min-height: 80px;
}

/* Status / loading */
.finboard-search-modal__status {
    padding: 12px 20px;
    font-size: 13px;
    color: var(--fb-text-muted, #9ca3af);
    display: none;
}

.finboard-search-modal__status:not(:empty) {
    display: block;
}

/* Results listbox */
.finboard-search-modal__results {
    padding: 4px 0;
}

/* Footer */
.finboard-search-modal__footer {
    padding: 12px 20px;
    border-top: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}

.finboard-search-modal__footer[hidden] { display: none; }

.finboard-search-modal__see-all,
.finboard-search-modal__see-all:link,
.finboard-search-modal__see-all:visited {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fb-gold, #E8A910) !important;
    -webkit-text-fill-color: var(--fb-gold, #E8A910) !important;
    text-decoration: none !important;
    transition: opacity 0.15s;
    background-image: none !important;
}

.finboard-search-modal__see-all:hover,
.finboard-search-modal__see-all:focus,
.finboard-search-modal__see-all:focus-visible {
    opacity: 0.8;
    color: var(--fb-gold, #E8A910) !important;
    -webkit-text-fill-color: var(--fb-gold, #E8A910) !important;
    text-decoration: none !important;
}

.finboard-search-modal__see-all svg {
    width: 16px;
    height: 16px;
}

/* Empty state */
.finboard-search-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--fb-text-muted, #9ca3af);
    text-align: center;
}

.finboard-search-modal__empty[hidden] { display: none; }

.finboard-search-modal__empty svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.finboard-search-modal__empty p {
    font-size: 14px;
    margin: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Modal Result Group Header
   ───────────────────────────────────────────────────────────────────────────── */

.fb-search-group {
    margin-bottom: 4px;
}

.fb-search-group__heading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px 4px;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fb-text-muted, #9ca3af) !important;
    -webkit-text-fill-color: var(--fb-text-muted, #9ca3af) !important;
    border-top: 1px solid var(--fb-border, rgba(255,255,255,0.06));
    text-decoration: none !important;
}

.fb-search-group:first-child .fb-search-group__heading {
    border-top: none;
}

.fb-search-group__heading svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.fb-search-group__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Individual Result Item (modal)
   ───────────────────────────────────────────────────────────────────────────── */

.fb-search-result {
    list-style: none;
}

/* !important on text-decoration / color because the search modal can
 * render on top of any page — some pages (blog posts, broker reviews,
 * Elementor templates) apply `.entry-content a { text-decoration:
 * underline; color: #... }` that inherits into the modal via source-
 * order precedence. Pinning these ensures the result links always
 * render clean regardless of where the modal appears. */
.fb-search-result__link,
.fb-search-result__link:link,
.fb-search-result__link:visited {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    text-decoration: none !important;
    color: var(--fb-text, #e2e8f0) !important;
    -webkit-text-fill-color: var(--fb-text, #e2e8f0) !important;
    transition: background 0.12s;
    cursor: pointer;
    outline: none;
    background-image: none !important;
}

.fb-search-result__link:hover,
.fb-search-result__link:focus,
.fb-search-result__link:focus-visible,
.fb-search-result__link[aria-selected="true"] {
    background: var(--fb-bg-raised, #1a1e28) !important;
    color: var(--fb-text, #e2e8f0) !important;
    -webkit-text-fill-color: var(--fb-text, #e2e8f0) !important;
    text-decoration: none !important;
}

.fb-search-result__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--fb-bg, #1a1e28);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    flex-shrink: 0;
    color: var(--fb-gold, #E8A910);
}

.fb-search-result__icon svg {
    width: 16px;
    height: 16px;
}

.fb-search-result__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
}

.fb-search-result__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fb-search-result__body {
    flex: 1;
    min-width: 0;
}

.fb-search-result__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fb-text, #e2e8f0) !important;
    -webkit-text-fill-color: var(--fb-text, #e2e8f0) !important;
    text-decoration: none !important;
    background-image: none !important;
}

.fb-search-result__excerpt {
    font-size: 12px;
    color: var(--fb-text-muted, #9ca3af) !important;
    -webkit-text-fill-color: var(--fb-text-muted, #9ca3af) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
    text-decoration: none !important;
}

.fb-search-result__where {
    font-size: 11px;
    color: var(--fb-gold, #E8A910) !important;
    -webkit-text-fill-color: var(--fb-gold, #E8A910) !important;
    margin-top: 2px;
    display: block;
    opacity: 0.85;
    text-decoration: none !important;
}

.fb-search-result__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.fb-search-result__arrow {
    color: var(--fb-border, rgba(255,255,255,0.2));
    flex-shrink: 0;
}

.fb-search-result__arrow svg {
    width: 14px;
    height: 14px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Search Page (/community/search/)
   ───────────────────────────────────────────────────────────────────────────── */

/* Flattened to match the News / Broker-Ratings header rhythm:
   compact heading, no oversized card wrapper, single-line search
   bar using the same 22px title + 14px input scale as the rest of
   the primary surfaces. */
.finboard-search-page__hero {
    margin-bottom: 14px;
}

.finboard-search-page__heading {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    color: var(--fb-text, #e2e8f0);
}

.finboard-search-page__form {
    width: 100%;
    /* Relative so the suggestions dropdown positions against it */
    position: relative;
}

/* Single-border search bar — gold focus ring, no inner border on the input */
.finboard-search-page__input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--fb-bg-card, var(--fb-bg, #1a1e28));
    border: 1px solid var(--fb-border-strong, rgba(255,255,255,0.12));
    border-radius: 10px;
    padding: 2px 4px 2px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.finboard-search-page__input-wrap:focus-within {
    border-color: var(--fb-gold, #E8A910);
    box-shadow: 0 0 0 3px rgba(232, 169, 16, 0.15);
}

.finboard-search-page__form-icon {
    width: 16px;
    height: 16px;
    color: var(--fb-text-muted, #9ca3af);
    flex-shrink: 0;
}

.finboard-search-page__input,
.finboard-search-page__input:focus,
.finboard-search-page__input:focus-visible {
    flex: 1;
    background: none !important;
    /* !important because the theme's reset.css + tic-custom.css apply a
       gold neumorphic border + inset shadow to every input on the site;
       without this override we'd render as a gold pill inside the already-
       gold focus ring on the wrap — the "double gold bar" UX bug. */
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    padding: 8px 10px;
    font-size: 14px;
    font-family: var(--fb-font);
    color: var(--fb-text, #e2e8f0);
    caret-color: var(--fb-gold, #E8A910);
}

.finboard-search-page__input::placeholder { color: var(--fb-text-muted, #9ca3af); }
.finboard-search-page__input::-webkit-search-cancel-button,
.finboard-search-page__input::-webkit-search-decoration { display: none; }

.finboard-search-page__btn,
.finboard-search-page__btn:hover,
.finboard-search-page__btn:focus,
.finboard-search-page__btn:focus-visible {
    /* !important needed because hello-elementor's reset.css paints
       button:hover crimson (#c36); our :where() override elsewhere in
       finboard-v4.css flips that to transparent, but that still leaves
       the Search button with no background on hover. Pin the gold
       explicitly so the button stays branded through every state. */
    padding: 8px 22px !important;
    background: var(--fb-gold, #E8A910) !important;
    color: var(--fb-bg, #1a1e28) !important;
    border: 0 !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s, box-shadow 0.15s;
    text-decoration: none !important;
}

.finboard-search-page__btn:hover { opacity: 0.88; }
.finboard-search-page__btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(232, 169, 16, 0.3);
}

/* ── Search-page autocomplete suggestions dropdown ── */
.finboard-search-page__suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--fb-bg-card, #232838);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.12));
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
    padding: 6px 0;
    z-index: 9999;
    max-height: 420px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.finboard-search-page__suggestions[hidden] { display: none; }

.finboard-search-page__sug-group-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--fb-text-muted, #9ca3af);
    padding: 6px 16px 3px;
    border-top: 1px solid var(--fb-border, rgba(255,255,255,0.06));
}

.finboard-search-page__sug-group:first-child .finboard-search-page__sug-group-label {
    border-top: none;
}

.finboard-search-page__sug-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    text-decoration: none;
    color: var(--fb-text, #e2e8f0);
    cursor: pointer;
    transition: background 0.12s;
    font-size: 14px;
}

.finboard-search-page__sug-item:hover,
.finboard-search-page__sug-item:focus,
.finboard-search-page__sug-item[aria-selected="true"] {
    background: var(--fb-bg, #1a1e28);
    outline: none;
}

.finboard-search-page__sug-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--fb-bg, #1a1e28);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 8px;
    flex-shrink: 0;
    color: var(--fb-gold, #E8A910);
}

.finboard-search-page__sug-icon svg {
    width: 14px;
    height: 14px;
}

.finboard-search-page__sug-body {
    flex: 1;
    min-width: 0;
}

.finboard-search-page__sug-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.finboard-search-page__sug-where {
    font-size: 11px;
    color: var(--fb-gold, #E8A910);
    opacity: 0.8;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finboard-search-page__sug-status {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--fb-text-muted, #9ca3af);
    display: flex;
    align-items: center;
    gap: 8px;
}

.finboard-search-page__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.finboard-search-page__count {
    font-size: 14px;
    color: var(--fb-text-muted, #9ca3af);
}

.finboard-search-page__count strong {
    color: var(--fb-text, #e2e8f0);
}

.finboard-search-page__clear-filter {
    font-size: 13px;
    color: var(--fb-gold, #E8A910);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.finboard-search-page__clear-filter:hover { text-decoration: underline; }

/* Type filter tabs */
.finboard-search-page__type-tabs {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.finboard-search-page__type-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--fb-border, rgba(255,255,255,0.1));
    border-radius: 20px;
    font-size: 13px;
    color: var(--fb-text-muted, #9ca3af);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.finboard-search-page__type-tab:hover {
    border-color: var(--fb-gold, #E8A910);
    color: var(--fb-text, #e2e8f0);
    background: rgba(232,169,16,0.06);
}

.finboard-search-page__type-tab.active {
    background: var(--fb-gold, #E8A910);
    border-color: var(--fb-gold, #E8A910);
    color: #1a1e28;
    font-weight: 600;
}

.finboard-search-page__tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
}

.finboard-search-page__type-tab.active .finboard-search-page__tab-count {
    background: rgba(0,0,0,0.2);
    color: #1a1e28;
}

/* Prompt / no-results / loading states */
.finboard-search-page__prompt,
.finboard-search-page__no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 60px 20px;
    text-align: center;
    color: var(--fb-text-muted, #9ca3af);
}

.finboard-search-page__prompt svg,
.finboard-search-page__no-results svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.finboard-search-page__no-results h2 {
    font-size: 20px;
    color: var(--fb-text, #e2e8f0);
    margin: 0;
}

.finboard-search-page__no-results p {
    font-size: 14px;
    margin: 0;
    max-width: 400px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Result sections on the full page
   ───────────────────────────────────────────────────────────────────────────── */

.finboard-search-section {
    background: var(--fb-bg-card, #232838);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
}

.finboard-search-section__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--fb-border, rgba(255,255,255,0.06));
}

.finboard-search-section__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(232,169,16,0.1);
    border-radius: 8px;
    color: var(--fb-gold, #E8A910);
    flex-shrink: 0;
}

.finboard-search-section__icon svg {
    width: 16px;
    height: 16px;
}

.finboard-search-section__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--fb-text, #e2e8f0);
    margin: 0;
    flex: 1;
}

.finboard-search-section__count {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    background: rgba(232,169,16,0.12);
    color: var(--fb-gold, #E8A910);
    border-radius: 20px;
}

.finboard-search-section__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Full-page result item */
.finboard-search-result {
    border-bottom: 1px solid var(--fb-border, rgba(255,255,255,0.05));
}

.finboard-search-result:last-child {
    border-bottom: none;
}

.finboard-search-result__link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    text-decoration: none;
    color: var(--fb-text, #e2e8f0);
    transition: background 0.12s;
}

.finboard-search-result__link:hover {
    background: rgba(255,255,255,0.025);
}

.finboard-search-result__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--fb-bg, #1a1e28);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    flex-shrink: 0;
    color: var(--fb-gold, #E8A910);
}

.finboard-search-result__icon svg {
    width: 18px;
    height: 18px;
}

.finboard-search-result__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}

.finboard-search-result__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.finboard-search-result__body {
    flex: 1;
    min-width: 0;
}

.finboard-search-result__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--fb-text, #e2e8f0);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.finboard-search-result__excerpt {
    font-size: 13px;
    color: var(--fb-text-muted, #9ca3af);
    margin-top: 3px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.finboard-search-result__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.finboard-search-result__where {
    font-size: 12px;
    color: var(--fb-gold, #E8A910);
    opacity: 0.85;
}

.finboard-search-result__badge {
    font-size: 11px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--fb-border, rgba(255,255,255,0.08));
    border-radius: 10px;
    color: var(--fb-text-muted, #9ca3af);
}

.finboard-search-result__badge--stock {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.2);
    color: var(--fb-green, #22c55e);
    font-weight: 700;
}

.finboard-search-result__arrow {
    flex-shrink: 0;
    color: var(--fb-border, rgba(255,255,255,0.2));
}

.finboard-search-result__arrow svg {
    width: 16px;
    height: 16px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Light-mode overrides (body.finboard-light or [data-theme="light"])
   ───────────────────────────────────────────────────────────────────────────── */

.finboard-light .finboard-search-modal__panel,
[data-theme="light"] .finboard-search-modal__panel {
    background: #ffffff;
    border-color: rgba(0,0,0,0.08);
    box-shadow: 0 24px 80px rgba(0,0,0,0.15);
}

.finboard-light .finboard-search-trigger,
[data-theme="light"] .finboard-search-trigger {
    background: #f0f2f5;
    border-color: rgba(0,0,0,0.1);
    color: #6b7280;
}

.finboard-light .fb-search-result__link:hover,
[data-theme="light"] .fb-search-result__link:hover {
    background: #f8f9fb;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Nav tab for search (finboard-community-tab)
   ───────────────────────────────────────────────────────────────────────────── */

.finboard-community-tab.finboard-community-tab--search-trigger {
    cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive
   ───────────────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .finboard-search-modal {
        padding: 0;
        align-items: flex-end;
    }

    .finboard-search-modal__panel {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }

    .finboard-search-page__hero {
        padding: 20px 16px;
    }

    .finboard-search-page__heading {
        font-size: 22px;
    }

    .finboard-search-page__btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .finboard-search-section__header {
        padding: 12px 14px;
    }

    .finboard-search-result__link {
        padding: 12px 14px;
    }
}

/* Loading spinner */
.fb-search-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--fb-border, rgba(255,255,255,0.1));
    border-top-color: var(--fb-gold, #E8A910);
    border-radius: 50%;
    animation: fb-spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes fb-spin {
    to { transform: rotate(360deg); }
}
