/* Mutual Fund NAV — reuses the theme's design tokens (var(...) with literal
   fallbacks so the plugin still looks right without the theme's
   ir-tokens.css loaded). Returns use the site's price-delta colors: NOTE
   the token names are direction-based (--price-up = costlier = bad for a
   shopper, --price-down = cheaper = good), which is the OPPOSITE semantic
   direction from a fund return (up = good for an investor) - classes here
   are named by MEANING (pos/neg), not direction, and just point at
   whichever token color is actually green vs red to avoid repeating a
   mismatch bug already seen elsewhere in this codebase's history. */

.mfn-page, .mfn-widget, .mfn-calc-result {
    font-variant-numeric: tabular-nums;
}

.mfn-nav-big { font-size: 2rem; }

/* Only used by mfn_render_list_search()/mfn_render_list_pagination()'s
   fallback path (when ir_render_list_search()/ir_render_list_pagination()
   aren't available) - the normal case reuses the theme's own already-
   styled .ir-list-search/.ir-pagination markup, which needs no CSS here. */
.mfn-list-search {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    max-width: 420px;
}
.mfn-list-search input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-strong, #c4c4c4);
    border-radius: 8px;
    font-size: 15px;
}
.mfn-list-search button {
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--brand, #FF6200);
    color: var(--on-brand, #1A1C22);
    cursor: pointer;
}
.mfn-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 16px 0;
}
.mfn-pagination a, .mfn-pagination span {
    padding: 6px 12px;
    border: 1px solid var(--border, #ddd);
    border-radius: 6px;
    text-decoration: none;
    color: var(--ink, #000);
}
.mfn-pagination span[aria-current] {
    background: var(--brand, #FF6200);
    color: var(--on-brand, #1A1C22);
    border-color: transparent;
}

.mfn-ret-pos { color: var(--price-down, #1E7E4C); font-weight: 600; }
.mfn-ret-neg { color: var(--price-up, #C0392B); font-weight: 600; }

.mfn-source-note, .mfn-empty-note {
    margin-top: 16px;
    font-size: 13px;
    color: var(--ink-3, #555);
}

.mfn-crosslink {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.mfn-faq { margin-top: 12px; }
.mfn-faq-item { margin-bottom: 18px; }
.mfn-faq-item h3 { font-size: 16px; margin: 0 0 6px; color: var(--ink, #000); }
.mfn-faq-item p { margin: 0; color: var(--ink-2, #333); }

.mfn-disclaimer {
    font-size: 12px;
    color: var(--ink-3, #555);
    padding: 16px 0 24px;
}

/* ── Affiliate CTA ─────────────────────────────────────────────── */
.mfn-cta { margin: 20px 0; }
.hbtn.hbtn-brand {
    background: var(--brand, #FF6200);
    color: var(--on-brand, #1A1C22);
    border-color: transparent;
}

/* ── AMC / category tile grid ─────────────────────────────────── */
.mfn-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.mfn-tile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    background: var(--surface, #fff);
    text-decoration: none;
    color: var(--ink, #000);
}
.mfn-tile:hover { border-color: var(--brand, #FF6200); }
.mfn-tile-name { font-weight: 600; }
.mfn-tile-count {
    font-size: 12px;
    color: var(--ink-3, #555);
    background: var(--surface-2, #f5f5f5);
    border-radius: 999px;
    padding: 2px 8px;
}

/* ── Chart ─────────────────────────────────────────────────────── */
.mfn-chart-wrap { margin-top: 12px; }
.mfn-chart {
    width: 100%;
    height: 200px;
    display: block;
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    background: var(--surface, #fff);
}

/* ── Search widget ─────────────────────────────────────────────── */
.mfn-widget { max-width: 480px; }
.mfn-widget-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--ink, #000);
}
.mfn-widget-search { position: relative; }
.mfn-widget-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-strong, #c4c4c4);
    border-radius: 8px;
    font-size: 15px;
}
.mfn-widget-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    max-height: 340px;
    overflow-y: auto;
}
.mfn-widget-result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    text-decoration: none;
    border-bottom: 1px solid var(--border, #ddd);
    color: var(--ink, #000);
}
.mfn-widget-result:last-child { border-bottom: none; }
.mfn-widget-result:hover { background: var(--surface-2, #f5f5f5); }
.mfn-widget-result-name { font-weight: 600; font-size: 14px; }
.mfn-widget-result-meta { font-size: 12px; color: var(--ink-3, #555); }
.mfn-widget-empty { padding: 12px; color: var(--ink-3, #555); font-size: 13px; }

/* ── Calculators ───────────────────────────────────────────────── */
.mfn-calc-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.mfn-calc-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-2, #333); }
.mfn-calc-field input {
    padding: 10px 12px;
    border: 1px solid var(--border-strong, #c4c4c4);
    border-radius: 8px;
    font-size: 15px;
}
