/* ==========================================================================
   FUNDER — Page canvas
   --------------------------------------------------------------------------
   Applies the design-token page background to the document shell only.
   Requires fn/01-tokens.css (load tokens first).

   Scope: body.fn-ui (and html when themed) — does NOT restyle components,
   Bootstrap boxes, tables, or .bg-black strips.
   ========================================================================== */

html {
  background-color: var(--fn-bg-canvas);
}

/* One content width. Header, ticker, page and footer all use .container;
   the number lives in --fn-container-max (fn/01-tokens.css). */
.fn-ui .container {
  width: 100%;
  max-width: var(--fn-container-max);
  padding-left: var(--fn-container-pad);
  padding-right: var(--fn-container-pad);
}

body.fn-ui {
  background-color: var(--fn-bg-canvas);
  color: var(--fn-text-1);
  font-family: var(--fn-font-sans);
  font-weight: var(--fn-fw-regular);
  font-synthesis: style;
  line-height: var(--fn-leading-base);
  /* Digits stay column-aligned in Hebrew prose and in tables. Open Sans
     ships tabular figures; the feature is a no-op on the Arial fallback. */
  font-variant-numeric: tabular-nums;
  /* iOS default tap overlay reads as a white flash on the canvas. */
  -webkit-tap-highlight-color: transparent;
}

/* Native controls do not inherit font-family in every browser. */
.fn-ui button,
.fn-ui input,
.fn-ui select,
.fn-ui textarea,
.fn-ui optgroup {
  font-family: inherit;
}

/* Shared figure primitive. Markets has a tighter .fn-mkt .fn-num. */
.fn-ui .fn-num {
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  direction: ltr;
  unicode-bidi: isolate;
  white-space: nowrap;
}

/* Chromium/WebKit paint a black rounded ring on :focus after a click/tap.
   That box sits on fund names in homepage tables and on other links.
   Remove it everywhere under FN. Keyboard still gets the green ring. */
.fn-ui a:focus,
.fn-ui a:active {
  outline: none;
}

.fn-ui a:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
}

/* Homepage newsletter CTA — FN presentation only (same href / behaviour) */
.fn-ui a.newsletterBtn.btn,
.fn-ui a.newsletterBtn.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin: 0 0 var(--fn-space-4);
  padding: var(--fn-space-2) var(--fn-space-4);
  border: var(--fn-border-width) solid var(--fn-border-brand);
  border-radius: var(--fn-radius-sm);
  background: var(--fn-brand-soft);
  background-image: none;
  box-shadow: none;
  color: var(--fn-brand);
  font-family: var(--fn-font-ui);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  line-height: var(--fn-leading-tight);
  text-decoration: none;
  text-shadow: none;
  transition:
    background-color var(--fn-dur-fast) var(--fn-ease),
    border-color var(--fn-dur-fast) var(--fn-ease),
    color var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui a.newsletterBtn.btn:hover,
.fn-ui a.newsletterBtn.btn:focus,
.fn-ui a.newsletterBtn.btn-primary:hover,
.fn-ui a.newsletterBtn.btn-primary:focus {
  background: var(--fn-accent);
  border-color: var(--fn-accent);
  color: var(--fn-on-accent);
  text-decoration: none;
}

.fn-ui a.newsletterBtn.btn:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
}

.fn-ui a.newsletterBtn.btn strong {
  font-weight: var(--fn-fw-medium);
}

.fn-ui[data-fn-theme="dark"] a.newsletterBtn.btn,
.fn-ui[data-fn-theme="dark"] a.newsletterBtn.btn-primary,
.darkCont.fn-ui a.newsletterBtn.btn,
.darkCont.fn-ui a.newsletterBtn.btn-primary {
  background: transparent;
  border-color: var(--fn-accent);
  color: var(--fn-accent);
}

:root[data-fn-theme="soft"] .fn-ui a.newsletterBtn.btn,
:root[data-fn-theme="soft"] .fn-ui a.newsletterBtn.btn-primary {
  color: var(--fn-green-800);
}

.fn-ui[data-fn-theme="dark"] a.newsletterBtn.btn:hover,
.fn-ui[data-fn-theme="dark"] a.newsletterBtn.btn-primary:hover,
.darkCont.fn-ui a.newsletterBtn.btn:hover,
.darkCont.fn-ui a.newsletterBtn.btn-primary:hover {
  background: var(--fn-accent);
  color: var(--fn-on-accent);
}



/* ==========================================================================
   Accessibility — shared AA defaults for the FN shell
   --------------------------------------------------------------------------
   Market colours must beat Bootstrap .text-success / .text-danger (which can
   fall below 4.5:1 on table/sunken backgrounds). Brand accent (#67cb35) stays
   for surfaces/icons; body text uses --fn-market-up / --fn-market-down.
   Direction is never colour-only: formatters keep +/- and minusNumb.
   ========================================================================== */

.fn-ui .text-success {
  color: var(--fn-market-up) !important;
}

.fn-ui .text-danger,
.fn-ui .minusNumb {
  color: var(--fn-market-down) !important;
}

/* Interactive controls: visible keyboard focus across the product surface. */
.fn-ui button:focus-visible,
.fn-ui input:focus-visible,
.fn-ui select:focus-visible,
.fn-ui textarea:focus-visible,
.fn-ui [role="button"]:focus-visible,
.fn-ui [tabindex]:not([tabindex="-1"]):focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
}

.fn-ui .sr-only,
.fn-ui .fn-hub-search__sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui *,
  .fn-ui *::before,
  .fn-ui *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Phone homepage keeps publishing / DOM order. An earlier flex `order`
   redistribution interleaved editorial vs market blocks; that was reverted
   so the column reads as authored again. */

/* Soft (ירקרק) canvas is saturated green artwork. Components that sit on it
   with no surface of their own remap their text and market tokens to the
   on-canvas ink, so their own rules keep working whatever loads after. */
:root[data-fn-theme="soft"] .fn-ui .fn-ticker,
:root[data-fn-theme="soft"] .fn-ui .fn-qstate,
:root[data-fn-theme="soft"] .fn-ui .fn-movers__status,
:root[data-fn-theme="soft"] .fn-ui .fn-sectors__status,
:root[data-fn-theme="soft"] .fn-ui .fn-sectors__more,
:root[data-fn-theme="soft"] .fn-ui .fn-view-switch,
:root[data-fn-theme="soft"] .fn-ui .fn-section-header,
:root[data-fn-theme="soft"] .fn-ui .fn-mkt-brandbar,
:root[data-fn-theme="soft"] .fn-ui .fn-mkt-section__note,
:root[data-fn-theme="soft"] .fn-ui .fn-mkt-toolbar__count,
:root[data-fn-theme="soft"] .fn-ui .fn-mkt .mr14t .lastChartDatas,
:root[data-fn-theme="soft"] .fn-ui .fn-discover-kicker,
:root[data-fn-theme="soft"] .fn-ui .fn-discover-lede,
:root[data-fn-theme="soft"] .fn-ui .fn-discover-chips__label,
:root[data-fn-theme="soft"] .fn-ui .fn-hub-else__link,
:root[data-fn-theme="soft"] .fn-ui .fn-hub-pro__label,
:root[data-fn-theme="soft"] .fn-ui .fn-hub-pro__caption,
:root[data-fn-theme="soft"] .fn-ui .fn-pd-hero--quote {
  --fn-text-2: var(--fn-on-canvas-ink);
  --fn-text-3: var(--fn-on-canvas-ink);
  --fn-brand: var(--fn-on-canvas-ink);
  --fn-green-800: var(--fn-on-canvas-ink);
  --fn-interactive-ink: var(--fn-on-canvas-ink);
  --fn-up: var(--fn-on-canvas-up);
  --fn-down: var(--fn-on-canvas-down);
  --fn-market-up: var(--fn-on-canvas-up);
  --fn-market-down: var(--fn-on-canvas-down);
}

/* The focus ring of those same text controls: --fn-focus (green-600) is 1.7:1
   against this canvas; the on-canvas ink clears 3:1. Only the controls that
   stand on the wallpaper bare, not the whole remap list above. */
:root[data-fn-theme="soft"] .fn-ui .fn-movers__status,
:root[data-fn-theme="soft"] .fn-ui .fn-sectors__status,
:root[data-fn-theme="soft"] .fn-ui .fn-sectors__more {
  --fn-focus: var(--fn-on-canvas-ink);
}

/* That remap leaves hover nothing to change: rest and hover ink are the same
   on-canvas ink. A text control standing on the wallpaper lights a pale
   backing instead. The 4px ring widens it past labels that have no padding
   without moving anything; (hover: hover) keeps it off a phone's tap. */
@media (hover: hover) {
  :root[data-fn-theme="soft"] .fn-ui .fn-view-switch__opt:hover,
  :root[data-fn-theme="soft"] .fn-ui .fn-section-header__cta:hover,
  :root[data-fn-theme="soft"] .fn-ui .fn-pd-hero--quote .fn-pd-act:not(.fn-pd-act--primary):hover {
    background-color: var(--fn-on-canvas-hover-bg);
    box-shadow: 0 0 0 4px var(--fn-on-canvas-hover-bg);
    border-radius: 4px;
  }
}

:root[data-fn-theme="soft"] .fn-ui .fn-ticker .fn-ticker__name,
:root[data-fn-theme="soft"] .fn-ui .fn-ticker .ticker-stock-name {
  color: var(--fn-text-1);
}

/* anychart-tools/style.css pins this to #a8a49a !important (~2.4:1 on any
   canvas); hand it back to the token 20-markets.css asks for. */
.fn-ui .fn-mkt .mr14t .lastChartDatas {
  color: var(--fn-text-3) !important;
}

/* DataTables locks pager ink to #333 / #666 !important. On a dark canvas
   הקודם, הבא and the page number disappear. One rule for every table. */
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
  color: var(--fn-text-1) !important;
  background: transparent;
  background-image: none;
  border-color: transparent;
  opacity: 1;
}

:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--fn-bg-raised);
  border-color: var(--fn-border);
}

:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,
:root[data-fn-theme="dark"] .fn-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active {
  color: var(--fn-text-2) !important;
}

/* One container for data tables. The corner is --fn-radius-table
   (01-tokens.css). List decks and the advanced-search results panel
   both use this and nothing else. */
.fn-ui .fn-table-shell,
.fn-ui .fn-list-page .fn-list-deck {
  border: 1px solid var(--fn-border);
  border-radius: var(--fn-radius-table);
  background: var(--fn-bg-surface);
  box-shadow: none;
}

/* The content wrapper was floated, so the body collapsed and the side
   banners (position:absolute, 640px) painted over the footer on short pages.
   The banners stay beside the content and end when the content ends. */
.fn-ui .fullwidth {
  float: none;
  width: 100%;
}

.fn-ui .fullwidth > .container {
  position: relative;
}

.fn-ui .fullwidth > .container:has(> .bannerLeft:not(.hide)),
.fn-ui .fullwidth > .container:has(> .bannerRight:not(.hide)) {
  min-height: 640px;
}

.fn-ui .bannerLeft,
.fn-ui .bannerRight {
  position: absolute;
  top: 0;
  height: 640px;
  max-height: 100%;
  margin: 0;
  overflow: hidden;
  float: none;
  z-index: 1;
}

.fn-ui .bannerLeft {
  left: auto;
  right: calc(100% + 12px);
}

.fn-ui .bannerRight {
  right: auto;
  left: calc(100% + 12px);
}


/* ==========================================================================
   Inner panes — the vertical scrollbar goes on the RIGHT
   --------------------------------------------------------------------------
   THE one place for this setting.

   A scroll container in an RTL document paints its vertical scrollbar on
   the LEFT. That is correct for the page. On a pane inside the page it is
   a stray line down the wrong edge of a right-aligned list, and on a pane
   at the page's edge (the fund rail) it lands in the gap between columns.

   `direction: ltr` is what moves the bar: it follows the box's own
   direction, not the document's. What matters is the SCOPE. ltr is set on
   the scrolling box ONLY, and every direct child takes the document's
   direction straight back, so nothing inherits ltr: no row flips, no
   column order changes, no text re-aligns. `> *` rather than named
   children, so a child added later cannot be missed.

   TO ADD A PANE: put its selector in BOTH lists, as the component writes
   it. This file loads before every component file, so a component that
   sets `direction` on a child for a reason of its own (the markets table
   wrapper, a figure) still wins at equal specificity.

   A PANE THAT MUST NOT BE ADDED
   - A box with logical properties of its own (inset-inline-start,
     border-inline-end, padding-inline-start): they follow the box's
     direction and would change sides with it. The phone nav drawer
     (#navbar.fn-drawer) is one.
   - A row flexbox or a grid of several columns: its items would reverse.
   - A box holding a child narrower than itself (a fixed width, a margin
     on one side): such a child sits at the start edge of its CONTAINER's
     direction and would jump to the left. The accessibility panel
     (.fn-a11y-panel) is one: its title moved 23px when this was tried.
   - A box that also scrolls sideways: direction sets where that scroll
     starts. The list grid (.fn-list-viewport, 14-list.css) and the
     discover panes (18-discover.css) do it themselves, with the script
     that anchors their start edge.

   WHAT IS NOT HERE: the bar's width, colour and gutter. They differ from
   pane to pane for reasons written at each one; only the side is common.

   .fn-data-scroll__view hides its native bar and draws a rail instead
   (09-data.css). It is listed so that its box and its table carry the
   same two directions as every other pane.
   ========================================================================== */

/* What a pane's children go back to. An ltr page needs no flip, and its
   children must not be forced to rtl. */
html {
  --fn-pane-content-dir: rtl;
}

html[dir="ltr"] {
  --fn-pane-content-dir: ltr;
}

.fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list,
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll,
.fn-ui .fn-data-scroll__view,
.fn-ui .fn-dd__list,
.fn-fund-sheet__step,
.fn-ui .fn-pd-rail,
.fn-ui .fn-board__pane,
.fn-mkt-comp__list,
.fn-ui .fn-sf-dd__list,
.fn-ui .stockSearchResults {
  direction: ltr;
}

.fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list > *,
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll > *,
.fn-ui .fn-data-scroll__view > *,
.fn-ui .fn-dd__list > *,
.fn-fund-sheet__step > *,
.fn-ui .fn-pd-rail > *,
.fn-ui .fn-board__pane > *,
.fn-mkt-comp__list > *,
.fn-ui .fn-sf-dd__list > *,
.fn-ui .stockSearchResults > * {
  direction: var(--fn-pane-content-dir, rtl);
}
