/* Theme 2.0 Find Funds. Owner: Frontend Builder B. Prefix .fn-. Tokens and shared classes only. */
.fn { padding-bottom: 168px; }   /* room for the docked search bar and the selection bar */
.fn h1, .fn h2, .fn h3 { font-family: var(--font); text-transform: none; }
.fn .t2-h1 { letter-spacing: -0.03em; }
.fn b, .fn strong { font-family: inherit; }

.fn-head .t2-lead { max-width: 620px; }
.fn-asof { margin-top: 8px; max-width: 700px; }

.fn-bar2 { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
.fn-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fn-chips .t2-chip { height: 36px; padding: 0 16px; }
.fn-chips .t2-btn { height: 36px; }
.fn-badge { margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ink); color: var(--inktx); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.fn-badge[hidden] { display: none; }
.fn-sortwrap { display: flex; align-items: center; gap: 10px; }

.fn-critrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fn-critrow:empty { display: none; }
.fn-critrow .t2-chip--criteria { cursor: default; }
.fn-count { margin: 12px 0 8px; min-height: 18px; }

.fn-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }   /* 4 by 4 from 1280px (16 funds per load) */
.fn-card { display: flex; flex-direction: column; gap: 14px; }
.fn-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 22px; }
.fn-name { min-height: 48px; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fn-name a:hover { text-decoration: underline; }
.fn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fn-stats .t2-num-l { font-size: 26px; margin-top: 4px; white-space: nowrap; }
.fn-arr { font-size: 12px; vertical-align: 3px; }
.fn-stats .t2-label .t2-badge { margin-left: 4px; vertical-align: 1px; }
.t2-badge.is-q34 { background: var(--ghost); }
.fn-risk { display: flex; align-items: center; gap: 10px; }
.fn-risk .t2-strong { font-size: 13px; }
.fn-meter { display: inline-flex; gap: 3px; }
.fn-meter i { width: 14px; height: 4px; border-radius: 2px; background: var(--track); }
.fn-meter i.on { background: var(--tx); }

/* sector light bar: 8px bar built from the sector mix, with a blurred glow copy that fades downward */
.fn-lightbar { position: relative; height: 8px; margin: 4px 0 10px; }
.fn-lightbar-bar { position: absolute; inset: 0; border-radius: 4px; }
.fn-lightbar-glow { position: absolute; left: 6%; right: 6%; top: 6px; height: 14px; border-radius: 8px; filter: blur(16px); opacity: 0.6; -webkit-mask-image: linear-gradient(180deg, #000, transparent); mask-image: linear-gradient(180deg, #000, transparent); }
.fn-seclist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fn-seclist li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; color: var(--t2); }
.fn-seclist .t2-dot { width: 10px; height: 10px; }
.fn-seclist b { font-weight: 700; color: var(--tx); }
.fn-nosec { min-height: 52px; }
.fn-actions { display: flex; gap: 6px; margin-top: auto; }
.fn-actions .t2-btn { flex: 1; text-decoration: none; }
.fn-cmp[aria-pressed="true"] { background: var(--ink); color: var(--inktx); border-color: var(--ink); }

.fn-state { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 18px; border: 1px dashed var(--grid); border-radius: var(--rad-panel); color: var(--td); text-align: center; }
.fn-state p { margin: 0; }
.fn-skel { min-height: 420px; }
.fn-more { display: flex; justify-content: center; margin-top: 18px; }
.fn-more[hidden] { display: none; }

/* selection bar (above the search bar) and docked search */
.fn-selbar { position: fixed; left: 50%; bottom: calc(var(--ask-h, 132px) + 8px); transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 16px; padding: 10px 12px 10px 20px; border-radius: 16px; background: var(--panelsolid); border: 1px solid var(--pbd); box-shadow: var(--shadow); font-size: 14px; font-weight: 500; }
.fn-selbar[hidden] { display: none; }
.fn-selbar .t2-btn { height: 40px; text-decoration: none; }
.fn-selbar .t2-btn[aria-disabled="true"] { pointer-events: none; }
.fn-search { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 45; width: min(640px, calc(100vw - 112px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 16px; }
.fn-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--td); stroke-width: 1.9; stroke-linecap: round; }
.fn-search .t2-input { flex: 1; border: 0; background: transparent; height: 40px; min-width: 0; }
.fn-search .t2-input:focus { outline: none; }
.fn-search .t2-btn { height: 40px; }

/* filter sheet (right) */
.fn-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.fn-scrim:not([hidden]) { display: block; }   /* .t2-scrim is display:none until .is-open; this scrim is toggled with [hidden] */
.fn-scrim[hidden], .fn-sheet[hidden] { display: none; }
.fn-sheet { position: fixed; top: 0; bottom: 0; right: 0; z-index: 61; width: 440px; max-width: 100vw; display: flex; flex-direction: column; background: var(--drawer); border-left: 1px solid var(--pbd); box-shadow: var(--shadow); }
.fn-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 24px 24px 12px; }
.fn-sheet-body { flex: 1; overflow: auto; padding: 0 24px 16px; }
.fn-group { border: 0; margin: 18px 0 0; padding: 0; min-width: 0; }
.fn-group legend { padding: 0; margin-bottom: 10px; }
.fn-group-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fn-sheet-foot { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; border-top: 1px solid var(--grid); }

@media (max-width: 1279px) {
  .fn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.fn-asof-tag { font-weight: 400; margin-left: 2px; }

/* 1:1 pass (Luke's Find Funds screenshot): values 26/400, no triangles, uppercase pills, 40px buttons */
.fn-stats .t2-num-l { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fn-card-top { align-items: flex-start; }
.fn-pills { display: inline-flex; gap: 6px; flex: none; }
.fn-pills .t2-badge { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; font-weight: 500; }
.fn-sectors > .t2-label { margin-bottom: 8px; }
.fn-actions .t2-btn { height: 40px; border-radius: var(--rad-btn); }
.fn-actions .fn-cmp { background: var(--ghost); }
.fn-actions a.t2-btn { background: transparent; }

/* base.css sets `body.t2 .t2-page .t2-num-l` to 32px; match its specificity so the card values stay 26px (target) */
body.t2 .t2-page .fn-stats .t2-num-l { font-size: 26px; font-weight: 400; letter-spacing: -0.03em; line-height: 1.1; }

/* ═══ Below 900px (GM gate 11): one column, no sideways page scroll, text 16px, tap targets 44px ═══ */
@media (max-width: 899px) {
  .fn-grid { grid-template-columns: minmax(0, 1fr); }
  body.t2 .t2-page.fn :is(p, li) { font-size: 16px !important; line-height: 1.55; }
  .fn-stats { gap: 8px; }
  .fn-stats > * { min-width: 0; }
  .fn-stats .t2-num-l, body.t2 .t2-page .fn-stats .t2-num-l { font-size: 24px; white-space: normal; overflow-wrap: anywhere; }
  .fn-risk { flex-wrap: wrap; min-width: 0; }
  .fn-risk .t2-strong { font-size: 14px; white-space: normal; }
  .fn-risk .t2-micro { font-size: 12px; }
  .fn-actions .t2-btn, .fn-actions .fn-cmp, .fn-actions a.t2-btn { height: 44px; min-height: 44px; }
  .fn .t2-chip, .fn .t2-btn, .fn-bar2 .t2-btn { min-height: 44px; }
  .fn-sort button, #fnSort button, .fn .t2-seg button { min-height: 44px; }
  .fn-bar2 { flex-direction: column; align-items: stretch; gap: 12px; }
  .fn-chips { flex-wrap: wrap; }
  .fn-sortwrap { width: 100%; justify-content: space-between; }
  .fn-critrow button, .fn-critrow .t2-chip { min-height: 44px; }
  body.t2 .t2-page.fn .fn-critrow .t2-chip--criteria button { min-width: 44px; }
  .fn-selbar { left: 12px; right: 12px; width: auto; transform: none; flex-wrap: wrap; gap: 8px; box-sizing: border-box; }
  .fn-search { left: 12px; right: 12px; width: auto; transform: none; box-sizing: border-box; }
  .fn-search .t2-input { min-width: 0; min-height: 44px; }
  .fn-sheet { width: 100vw; max-width: 100vw; }
  .fn-sheet-body, .fn-sheet-foot { padding-left: 16px; padding-right: 16px; }
  .fn-group-chips .t2-chip { min-height: 44px; }
  .fn-name a { display: inline-block; min-height: 44px; }
}

/* 4 by 4 grid: a card is about 300px wide, so lay it out by its own width (container query) so nothing clips */
.fn-card { container-type: inline-size; min-width: 0; }
.fn-risk { flex-wrap: wrap; row-gap: 4px; }
@container (max-width: 340px) {
  .fn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .fn-stats .t2-num-l, body.t2 .t2-page .fn-stats .t2-num-l { font-size: 24px; }
  .fn-name { min-height: 0; }
  .fn-pills { flex-wrap: wrap; justify-content: flex-end; }
}

/* Luke's target pass (1:1 with his card screenshot): hairline above the risk rows, volatility meter and value pushed right with no date tag
   (the as-at date stays in the tooltip), glow above the sector bar, sector legend as one wrapping row of dot, name, bold share */
.fn-stats + .fn-risk { border-top: 1px solid var(--grid); padding-top: 14px; }
.fn-risk .fn-meter { margin-left: auto; }
.fn-risk .fn-asof-tag { display: none; }
.fn-lightbar { height: 8px; margin: 40px 0 14px; }
.fn-lightbar-bar { border-radius: 5px; }
.fn-lightbar-glow { left: -6px; right: -6px; top: auto; bottom: 4px; height: 56px; border-radius: 0; filter: blur(12px); opacity: 0.6;   /* fades to transparency on every side: no hard top or side edge (Luke) */
  -webkit-mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0.15) 65%, transparent 100%), linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0.15) 65%, transparent 100%), linear-gradient(90deg, transparent 0, #000 12%, #000 88%, transparent 100%); mask-composite: intersect; }
.fn-seclist { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
.fn-seclist li { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.fn-seclist li .t2-ellip { overflow: visible; text-overflow: clip; white-space: nowrap; }

/* FAQ at the foot (mirrors the FAQPage JSON-LD) */
.fn-faq { margin-top: var(--gap); }
.fn-faq summary { cursor: pointer; list-style: none; }
.fn-faq summary::-webkit-details-marker { display: none; }
.fn-faq summary .t2-title { display: inline; }
.fn-faq dl { margin: 12px 0 0; max-width: 760px; }
.fn-faq dt { font-weight: 500; color: var(--tx); margin-top: 12px; }
.fn-faq dd { margin: 4px 0 0; color: var(--t2); }
@media (max-width: 899px) { .fn-faq summary { display: block; min-height: 44px; padding: 10px 0; } .fn-faq dd, body.t2 .t2-page.fn .fn-faq dd { font-size: 16px; } }

/* selection toast (Luke): floats above the docked Ask bar, centred, slides in from the first selected fund; below menus and modals */
.fn-selbar { bottom: calc(max(var(--askbar-h, var(--ask-h, 96px)) + 16px, var(--t2-follow-bottom, 0px) + 4px) + env(safe-area-inset-bottom, 0px)); z-index: 51;   /* above the cookie banner when it is open (consent.js sets --t2-follow-bottom to the space above it) */
  opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 14px);
  transition: opacity 0.22s var(--ease, ease), transform 0.22s var(--ease, ease), visibility 0s linear 0.22s; }
.fn-selbar.is-on { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0); transition-delay: 0s; }
.fn-selbar[hidden] { display: none; }
.fn-selbar .t2-btn, .fn-selbar .t2-link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.fn-selbar .t2-btn[aria-disabled="true"] { opacity: 0.6; }
@media (max-width: 899px) {
  .fn-selbar { left: 16px; right: 16px; width: auto; transform: translateY(14px); }
  .fn-selbar.is-on { transform: none; }
  .fn-selbar .t2-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .fn-selbar { transition: none; } }
