/* ==========================================================================
   FN 09 — Financial Data System
   ==========================================================================
   The presentation layer for every tabular market module: mutual funds, ETFs,
   gemel / hishtalmut, savings policies. Built to be reused by fundList,
   etfList, superfunder, portfolio and secdash without a second stylesheet.

   GEOMETRY — read this before changing anything below.
   ----------------------------------------------------
   Column alignment is the browser's job, not ours. Every module renders a
   REAL <table> with `table-layout: fixed`, so the table algorithm derives one
   column geometry from the first row (the header) and every data row inherits
   it byte for byte. That is what guarantees the header sits over its data and
   every percentage lands on the same axis, whatever the fund name is.

   Two consequences are load-bearing:

   1. The markup must NOT carry `.table-scrollable` or sit inside
      `#scrtable` / `.scrtable`. template.css gives those hooks
      `display:block; float:right; direction:ltr` on thead/tbody/tr/td/th plus
      ~40 `width:…!important` percentages and a `height:194px; overflow-y:auto`
      tbody. That is the legacy float-based fake table. It destroys the table
      algorithm, so no geometry can be shared and an internal scrollbar
      appears. index.aspx drops both hooks on FN modules — nothing here has to
      fight them, and there is not one `!important` in this file.

   2. Widths are declared once, on the header cells: each metric track gets a
      fixed px width wide enough for the widest realistic value, and the name
      track is `auto` — the remainder. Under fixed layout that is the single
      source of truth for the whole table. A name therefore cannot widen a
      metric track and a metric cannot be squeezed by a name. Hiding a metric
      column hides its th and its tds, the column collapses, and the name
      absorbs the space. No second geometry, no adapter, no override.

   Bootstrap 3 keeps: grid, .table infrastructure, nav-tabs + data-toggle,
   .form-control on the selects. FN restyles on top at higher specificity
   (.fn-ui .fn-data-module …) rather than replacing any of it.

   Colour semantics come from common.js formatDataPercHash(), which emits
   .text-success / .text-danger.minusNumb — those are the classes styled here.
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   Module shell
   --------------------------------------------------------------------------
   --compact  phone module, open on the page canvas, intercalated with the feed
   --standard sidebar module, one calm surface that separates it from the feed
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-module {
  /* The module is the query container, so the table adapts to the space it was
     actually given — sidebar, main column, a future two-up list page — instead
     of to the viewport. That is what makes this reusable. */
  container-type: inline-size;
  container-name: fn-data;

  /* Column geometry. Metric tracks are a fixed px width sized to hold the
     widest realistic value ("-999.99%"); the name track is the remainder.
     Consequence: a name can never widen a metric track, and a metric can
     never be squeezed by a name. No percentages to keep summing to 100. */
  --fn-col-metric: 66px;

  /* How the two metrics the active tab does not cover are displayed.
     Flipped to `none` by the collapse switches further down — one property,
     so the two-column rule set exists exactly once. */
  --fn-extra-display: table-cell;

  /* Typography scale, one source of truth for cells and the en-dash glyph */
  --fn-data-name-size: 13px;
  --fn-data-num-size: 12px;
  --fn-data-head-size: 11px;

  --fn-data-row-h: 40px;
  --fn-data-cell-x: 4px;

  position: relative;
  margin: 0 0 var(--fn-space-5);
  color: var(--fn-text-1);
  font-family: var(--fn-font-ui);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.fn-ui .fn-data-module--compact {
  /* Phones default to one metric column. is-cols3 (below) opts a module
     back to name + all three return columns. */
  --fn-extra-display: none;
  --fn-col-metric: 96px;
  --fn-data-name-size: 14px;
  --fn-data-num-size: 15px;
  --fn-data-head-size: 12px;
  --fn-data-row-h: 48px;
  --fn-data-cell-x: 0px;

  padding: 0;
  background: transparent;
  border: 0;
}

.fn-ui .fn-data-module--standard {
  /* Column headers need a clear step above the data so the sidebar
     table still reads as a table at a glance. */
  --fn-data-head-size: 12px;

  padding: var(--fn-space-3) var(--fn-space-3) 0;
  background: var(--fn-bg-surface);
  border: var(--fn-border-width) solid var(--fn-border);
  border-radius: var(--fn-radius-md);
}

/* --headed modules sit under a section header that also links to the list.
   The footer CTA is kept anyway: after six rows of scrolling on a phone, the
   header link is off-screen, and the end of a list is where the intent to see
   more actually forms. It stays quiet enough not to read as a duplicate. */
.fn-ui .fn-data-module--headed .fn-data-footer {
  margin-top: 0;
}

.fn-ui .fn-data-module__title {
  margin: 0;
  color: var(--fn-text-1);
  font-size: var(--fn-fs-md);
  font-weight: var(--fn-fw-bold);
  line-height: 1.3;
}


/* --------------------------------------------------------------------------
   Toolbar — title / kind selector on the reading edge, meta on the far edge
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-toolbar {
  margin: 0 0 var(--fn-space-2);
}

.fn-ui .fn-data-toolbar__row {
  display: flex;
  align-items: center;
  gap: var(--fn-space-2);
  flex-wrap: wrap;
}

/* Updated-at is pushed to the far edge; the loader stays beside it. */
.fn-ui .fn-data-toolbar__row > .fn-data-updated {
  margin-inline-start: auto;
}

.fn-ui .fn-data-updated {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--fn-text-3);
  font-size: var(--fn-fs-xs);
  font-weight: var(--fn-fw-regular);
  line-height: 1.3;
  white-space: nowrap;
}

.fn-ui .fn-data-updated span {
  color: var(--fn-text-2);
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
}

/* Hidden until JS .show() during table refresh. A failed CDN gif was
   otherwise sitting next to the segment as a broken-image icon. */
.fn-ui .fn-data-loader {
  display: none;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  box-sizing: border-box;
  border: 2px solid var(--fn-border-strong, #CFD6CB);
  border-top-color: var(--fn-brand, #3B7E1F);
  border-radius: 50%;
  background: transparent;
  animation: fn-data-spin 0.7s linear infinite;
  vertical-align: middle;
}

@keyframes fn-data-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-data-loader {
    animation: none;
    border-top-color: var(--fn-border-strong, #CFD6CB);
    opacity: 0.7;
  }
}

/* Phone module: updated-at and loader on their own quiet line. */
.fn-ui .fn-data-module--compact .fn-data-toolbar {
  display: flex;
  align-items: center;
  gap: var(--fn-space-2);
  margin-bottom: var(--fn-space-2);
}

/* Headed compact modules sit under .fn-section-header — keep the gap tight
   so title → date → controls → data reads as one short stack. */
.fn-ui .fn-section-header--dense {
  margin-bottom: var(--fn-space-2);
}

.fn-ui .fn-section-header--dense + .fn-data-module--headed {
  margin-top: 0;
}


/* --------------------------------------------------------------------------
   Segment control — קרנות מנוהלות / קרנות מחקות
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-segment {
  display: inline-flex;
  padding: 2px;
  background: var(--fn-bg-sunken);
  border-radius: var(--fn-radius-pill);
}

.fn-ui .fn-data-segment__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0;
  padding: 0 var(--fn-space-3);
  border-radius: var(--fn-radius-pill);
  color: var(--fn-text-2);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--fn-dur-fast) var(--fn-ease),
    background-color var(--fn-dur-fast) var(--fn-ease);
}

/* Phone: primary kind choice stays a real segmented control — full width,
   compact height, clear selected state — then yields the page to the data. */
.fn-ui .fn-data-module--compact .fn-data-segment {
  display: flex;
  width: 100%;
  margin: 0 0 var(--fn-space-2);
  padding: 2px;
}

.fn-ui .fn-data-module--compact .fn-data-segment__option {
  flex: 1 1 0;
  min-height: 32px;
  padding: 0 var(--fn-space-2);
  font-size: var(--fn-fs-sm);
}

/* The radio stays in the DOM for the JS and for keyboard users, but the
   label is the visible control. */
.fn-ui .fn-data-segment input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.fn-ui .fn-data-segment__option:has(input:checked) {
  color: var(--fn-text-1);
  background: var(--fn-bg-surface);
  box-shadow: var(--fn-shadow-sm);
}

.fn-ui .fn-data-segment__option:focus-within {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
}

/* :has() is unavailable — fall back to a visible radio rather than a control
   with no state at all. */
@supports not selector(:has(input)) {
  .fn-ui .fn-data-segment {
    gap: var(--fn-space-3);
    padding: 0;
    background: transparent;
  }

  .fn-ui .fn-data-segment input {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 0 4px;
    clip-path: none;
  }
}


/* --------------------------------------------------------------------------
   Filters — same pill fn-dd language as the header discovery chips.
   Native <select>s stay the data source; fn-fund-filters.js wraps each one.
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-filters {
  display: flex;
  gap: var(--fn-space-2);
  margin: 0 0 var(--fn-space-3);
  align-items: stretch;
  position: relative;
  z-index: 20;
}

.fn-ui .fn-data-filters > .fn-data-filter.fn-dd {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.fn-ui .fn-data-filters .fn-dd__trigger {
  width: 100%;
  max-width: none;
  min-width: 0;
}

.fn-ui .fn-data-filters .fn-dd__panel {
  width: 100%;
  max-width: min(400px, 92vw);
}

.fn-ui .fn-data-filters > .fn-data-filter.fn-dd:last-child .fn-dd__panel {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

/* No-JS / pre-enhance fallback — sunken native field. */
.fn-ui .fn-data-module select.form-control:not(.fn-dd__native) {
  height: 40px;
  min-width: 0;
  flex: 1 1 0;
  padding: 0 24px 0 var(--fn-space-3);
  border: 1px solid var(--fn-border);
  border-radius: var(--fn-radius-pill);
  background-color: var(--fn-bg-surface);
  background-image: var(--fn-icon-caret);
  background-repeat: no-repeat;
  background-position: left var(--fn-space-3) center;
  background-size: 10px 6px;
  box-shadow: none;
  color: var(--fn-text-1);
  font-family: var(--fn-font-ui);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  line-height: 38px;
  text-overflow: ellipsis;
  appearance: none;
}

.fn-ui .fn-data-module select.form-control:not(.fn-dd__native):hover {
  border-color: var(--fn-border-strong);
  background-color: var(--fn-bg-hover);
}

.fn-ui .fn-data-module select.form-control:not(.fn-dd__native):focus {
  border-color: var(--fn-border-brand);
  background-color: var(--fn-bg-surface);
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: 1px;
  box-shadow: none;
}


/* --------------------------------------------------------------------------
   Metric selector — phone / narrow presentation of the existing tab strip
   --------------------------------------------------------------------------
   Injected by fn-data-metric.js. Clicks the real Bootstrap tab anchors; no
   second data path. Hidden on wide desktop where the tab strip stays visible.
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-metric {
  display: none;
  position: relative;
  margin: 0 0 var(--fn-space-2);
}

.fn-ui .fn-data-metric__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fn-space-2);
  width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 var(--fn-space-3);
  border: var(--fn-border-width) solid var(--fn-border);
  border-radius: var(--fn-radius-sm);
  background: var(--fn-bg-surface);
  color: var(--fn-text-1);
  font-family: var(--fn-font-ui);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-bold);
  line-height: 1.2;
  text-align: right;
  cursor: pointer;
  transition:
    border-color var(--fn-dur-fast) var(--fn-ease),
    background-color var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-data-metric__trigger:hover {
  border-color: var(--fn-border-strong);
}

.fn-ui .fn-data-metric__trigger:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: var(--fn-focus-offset);
}

.fn-ui .fn-data-metric__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-block: var(--fn-ink-pad);
  margin-block: calc(var(--fn-ink-pad) * -1);
}

.fn-ui .fn-data-metric__chevron {
  flex: 0 0 auto;
  width: 10px;
  height: 6px;
  background: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 7' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5L5.5 5.5 10 1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 7' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5L5.5 5.5 10 1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-data-metric.is-open .fn-data-metric__chevron {
  transform: rotate(180deg);
}

.fn-ui .fn-data-metric.is-open .fn-data-metric__trigger {
  border-color: var(--fn-border-brand);
}

.fn-ui .fn-data-metric__menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  margin: 0;
  padding: var(--fn-space-1) 0;
  list-style: none;
  border: var(--fn-border-width) solid var(--fn-border);
  border-radius: var(--fn-radius-sm);
  background: var(--fn-bg-surface);
  box-shadow: var(--fn-shadow-md);
}

.fn-ui .fn-data-metric__menu[hidden] {
  display: none;
}

.fn-ui .fn-data-metric__option {
  display: block;
  margin: 0;
  padding: var(--fn-space-2) var(--fn-space-3);
  color: var(--fn-text-2);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  line-height: 1.3;
  cursor: pointer;
}

.fn-ui .fn-data-metric__option:hover,
.fn-ui .fn-data-metric__option:focus {
  background: var(--fn-bg-hover);
  color: var(--fn-text-1);
  outline: 0;
}

.fn-ui .fn-data-metric__option.is-selected,
.fn-ui .fn-data-metric__option[aria-selected="true"] {
  color: var(--fn-text-1);
  font-weight: var(--fn-fw-bold);
}

/* Visually hide the Bootstrap tab strip while keeping anchors for .tab('show'). */
.fn-ui .fn-data-module--compact .fn-data-tabs {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.fn-ui .fn-data-module--compact .fn-data-metric {
  display: block;
}

/* --------------------------------------------------------------------------
   Column view — "עמודה" (one metric) / "שלוש" (name + יומי + חודש + שנה)
   --------------------------------------------------------------------------
   The three return figures are already in every row. Compact layout hides
   two of them so the name keeps the width. is-cols3 puts them back, at the
   same short headers נצפו לאחרונה uses, and the period picker still chooses
   which figure the list is ordered by.
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-cols {
  display: none;
}

.fn-ui .fn-data-module--compact .fn-data-cols {
  display: inline-flex;
  flex: 0 0 auto;
  margin-inline-start: auto;
  padding: 2px;
  background: var(--fn-bg-sunken);
  border-radius: var(--fn-radius-pill);
}

.fn-ui .fn-data-cols__opt {
  margin: 0;
  padding: 0 10px;
  min-height: 26px;
  border: 0;
  border-radius: var(--fn-radius-pill);
  background: transparent;
  color: var(--fn-text-2);
  font-family: var(--fn-font-ui);
  font-size: var(--fn-fs-xs);
  font-weight: var(--fn-fw-medium);
  line-height: 1;
  cursor: pointer;
}

.fn-ui .fn-data-cols__opt.is-active {
  background: var(--fn-bg-surface);
  color: var(--fn-text-1);
  font-weight: var(--fn-fw-bold);
  box-shadow: var(--fn-shadow-sm);
}

.fn-ui .fn-data-cols__opt:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: 1px;
}

.fn-ui .fn-data-module--compact.is-cols3 {
  --fn-extra-display: table-cell;
  --fn-col-metric: 68px;
  --fn-data-name-size: 14px;
  --fn-data-num-size: 13px;
  --fn-data-head-size: 12px;
  /* Two lines of 14px Hebrew plus the cell padding. 44 clips the second line
     once the name track gives up its width to the three figures. */
  --fn-data-row-h: 48px;
}

.fn-ui .fn-data-module--compact.is-cols3 .fn-data-table > thead > tr > th {
  height: auto;
  max-height: none;
  padding: 6px var(--fn-data-cell-x) 6px;
  border-bottom: var(--fn-border-width) solid var(--fn-border);
  overflow: hidden;
  line-height: 1.2;
  font-size: var(--fn-data-head-size);
  font-weight: var(--fn-fw-bold);
  color: var(--fn-text-2);
  background: var(--fn-bubble-bg);
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}

.fn-ui .fn-data-module--compact.is-cols3 .fn-data-body > .tab-pane.fn-data-scroll.active {
  max-height: calc(var(--fn-data-row-h) * var(--fn-data-scroll-rows) + 32px);
}


/* --------------------------------------------------------------------------
   Tabs — secondary navigation, driven by Bootstrap data-toggle
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-module .fn-data-tabs {
  display: flex;
  /* Three Hebrew metric labels do not fit one line in a ~215px sidebar. They
     wrap onto a second line rather than overflowing the column — no hidden
     labels, no horizontal scroll. */
  flex-wrap: wrap;
  gap: 0 var(--fn-space-2);
  margin: 0 0 var(--fn-space-2);
  padding: 0;
  border: 0;
  border-bottom: var(--fn-border-width) solid var(--fn-border);
  list-style: none;
}

.fn-ui .fn-data-module .fn-data-tabs > li {
  margin: 0;
  min-width: 0;
  float: none;
}

.fn-ui .fn-data-module .fn-data-tabs > li > a {
  display: block;
  position: relative;
  margin: 0;
  padding: var(--fn-space-2) var(--fn-space-1) var(--fn-space-2);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--fn-text-3);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  line-height: 1.2;
  white-space: nowrap;
  transition: color var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-data-module .fn-data-tabs > li > a strong {
  font-weight: inherit;
}

/* Active indicator rides the bottom rule, so the tab strip reads as one
   continuous edge with the table header below it. */
.fn-ui .fn-data-module .fn-data-tabs > li > a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: calc(var(--fn-border-width) * -1);
  left: 0;
  height: 2px;
  background: transparent;
  transition: background-color var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui .fn-data-module .fn-data-tabs > li.active > a,
.fn-ui .fn-data-module .fn-data-tabs > li.active > a:hover,
.fn-ui .fn-data-module .fn-data-tabs > li.active > a:focus {
  border: 0;
  background: transparent;
  color: var(--fn-text-1);
  font-weight: var(--fn-fw-bold);
}

.fn-ui .fn-data-module .fn-data-tabs > li.active > a::after {
  background: var(--fn-brand);
}

.fn-ui .fn-data-module .fn-data-tabs > li > a:hover {
  border: 0;
  background: transparent;
  color: var(--fn-text-1);
}

.fn-ui .fn-data-module .fn-data-tabs > li > a:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: -2px;
}


/* --------------------------------------------------------------------------
   Table — the shared column geometry
   --------------------------------------------------------------------------
   `table-layout: fixed` + percentage widths on the header cells. Everything
   else in this block only undoes Bootstrap's .table chrome so the separators
   and rhythm are FN's.
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-module .fn-data-table {
  table-layout: fixed;
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  background: transparent;
  font-family: var(--fn-font-ui);
}

/* The one width declaration. Fixed layout propagates it to every row.
   `auto` on the name means "take what is left after the metric tracks", which
   under fixed layout is resolved once, for the whole table. */
.fn-ui .fn-data-module .fn-data-table > thead > tr > th.index_hd1 {
  width: auto;
}

.fn-ui .fn-data-module .fn-data-table > thead > tr > th.index_hd2,
.fn-ui .fn-data-module .fn-data-table > thead > tr > th.index_hd3,
.fn-ui .fn-data-module .fn-data-table > thead > tr > th.index_hd4 {
  width: var(--fn-col-metric);
}

.fn-ui .fn-data-module .fn-data-table > thead > tr > th,
.fn-ui .fn-data-module .fn-data-table > tbody > tr > td {
  height: auto;
  border: 0;
  background: transparent;
  vertical-align: middle;
}

.fn-ui .fn-data-module .fn-data-table > thead > tr > th {
  padding: var(--fn-ink-pad) var(--fn-data-cell-x) var(--fn-space-2);
  border-bottom: var(--fn-border-width) solid var(--fn-border);
  color: var(--fn-text-3);
  font-size: var(--fn-data-head-size);
  font-weight: var(--fn-fw-medium);
  line-height: 1.25;
  letter-spacing: 0.01em;
  /* Header labels are longer than their data. They wrap inside their own
     track instead of widening it. */
  white-space: normal;
  overflow-wrap: break-word;
}

/* Desktop sidebar: quiet, precise column labels — present but not loud.
   Sticky so they stay put while the body scrolls underneath. */
.fn-ui .fn-data-module--standard .fn-data-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--fn-bg-surface);
  color: var(--fn-text-2);
  font-weight: var(--fn-fw-bold);
  letter-spacing: 0.02em;
  padding-bottom: var(--fn-space-2);
}

/* Phone / two-column mode: context already names the metric. Collapse the
   visual header while keeping <th> width declarations for fixed layout. */
.fn-ui .fn-data-module--compact .fn-data-table > thead {
  border: 0;
}

.fn-ui .fn-data-module--compact .fn-data-table > thead > tr > th {
  height: 0;
  max-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
  color: transparent;
}

.fn-ui .fn-data-module--compact .fn-data-table {
  margin-top: 0;
}

.fn-ui .fn-data-module--compact .fn-data-body {
  margin-top: 0;
}

.fn-ui .fn-data-module--compact .fn-data-body > .tab-pane {
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 0;
}

.fn-ui .fn-data-module .fn-data-table > tbody > tr > td {
  height: var(--fn-data-row-h);
  padding: var(--fn-space-1) var(--fn-data-cell-x);
  border-bottom: var(--fn-border-width) solid
    color-mix(in srgb, var(--fn-border) 45%, transparent);
  color: var(--fn-text-1);
  font-size: var(--fn-data-num-size);
  line-height: 1.3;
}

/* The last separator would double the module's own bottom edge. */
.fn-ui .fn-data-module .fn-data-table > tbody > tr:last-child > td {
  border-bottom-color: transparent;
}


/* Name — the only flexible-feeling track, though its width is fixed too.
   Two lines, then it clamps. It can never widen and never push a number. */
.fn-ui .fn-data-module .fn-data-table .index_hd1 {
  color: var(--fn-text-2);
  text-align: right;
}

.fn-ui .fn-data-module .fn-data-table .index_cnt1 {
  padding-right: 0;
  overflow: hidden;
  text-align: right;
}

.fn-ui .fn-data-module .fn-data-table .index_cnt1 a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--fn-text-1);
  font-size: var(--fn-data-name-size);
  font-weight: var(--fn-fw-regular);
  line-height: 1.35;
  text-align: right;
  text-decoration: none;
  /* Mixed Hebrew/English names — "S&P 500", "Large Cap", "WTI" — are ordered
     by their own first strong character rather than the table's RTL. */
  unicode-bidi: plaintext;
  /* A single unbreakable token (a long ticker) breaks instead of overflowing. */
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  padding-block: var(--fn-ink-pad);
  margin-block: calc(var(--fn-ink-pad) * -1);
}

/* Mouse click sets :focus but not :focus-visible. Keep the brand ring for keyboard. */
.fn-ui .fn-data-module .fn-data-table a:focus,
.fn-ui .fn-data-module .fn-data-table a:active {
  outline: none;
  box-shadow: none;
}

.fn-ui .fn-data-module .fn-data-table a:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: 2px;
  box-shadow: none;
}


/* Values — an isolated LTR run on fixed-width digits. Aligned to the end of
   the run, so every "%" lands on one axis and a minus sign never detaches
   from its number in the RTL row. */
.fn-ui .fn-data-module .fn-data-table .index_hd2,
.fn-ui .fn-data-module .fn-data-table .index_hd3,
.fn-ui .fn-data-module .fn-data-table .index_hd4 {
  text-align: right;
}

.fn-ui .fn-data-module .fn-data-table .index_cnt2,
.fn-ui .fn-data-module .fn-data-table .index_cnt3,
.fn-ui .fn-data-module .fn-data-table .index_cnt4 {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: var(--fn-font-num);
  font-size: var(--fn-data-num-size);
  font-weight: var(--fn-fw-bold);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  text-align: right;
  white-space: nowrap;
}

/* Colour is carried by the value, never by the row, and never used to
   establish hierarchy — only direction of change. */
.fn-ui .fn-data-module .fn-data-table .index_cnt2 .text-success,
.fn-ui .fn-data-module .fn-data-table .index_cnt3 .text-success,
.fn-ui .fn-data-module .fn-data-table .index_cnt4 .text-success {
  color: var(--fn-market-up);
}

.fn-ui .fn-data-module .fn-data-table .index_cnt2 .text-danger,
.fn-ui .fn-data-module .fn-data-table .index_cnt3 .text-danger,
.fn-ui .fn-data-module .fn-data-table .index_cnt4 .text-danger,
.fn-ui .fn-data-module .fn-data-table .index_cnt2 .minusNumb,
.fn-ui .fn-data-module .fn-data-table .index_cnt3 .minusNumb,
.fn-ui .fn-data-module .fn-data-table .index_cnt4 .minusNumb {
  color: var(--fn-market-down);
}

/* Missing value. formatDataPercHash() emits a tooltipped "#" for no data;
   a financial table reads an en-dash. The title attribute is untouched, so
   the tooltip still explains why the cell is empty. */
.fn-ui .fn-data-module .fn-data-table .index_cnt2 span[data-toggle="tooltipss"],
.fn-ui .fn-data-module .fn-data-table .index_cnt3 span[data-toggle="tooltipss"],
.fn-ui .fn-data-module .fn-data-table .index_cnt4 span[data-toggle="tooltipss"] {
  font-size: 0;
}

.fn-ui .fn-data-module .fn-data-table .index_cnt2 span[data-toggle="tooltipss"]::before,
.fn-ui .fn-data-module .fn-data-table .index_cnt3 span[data-toggle="tooltipss"]::before,
.fn-ui .fn-data-module .fn-data-table .index_cnt4 span[data-toggle="tooltipss"]::before {
  content: "\2013";
  color: var(--fn-text-3);
  font-size: var(--fn-data-num-size);
}

@media (hover: hover) and (pointer: fine) {
  .fn-ui .fn-data-module .fn-data-table > tbody > tr:hover > td {
    background: var(--fn-bg-hover);
  }

  .fn-ui .fn-data-module .fn-data-table .index_cnt1 a:hover {
    color: var(--fn-brand);
  }
}


/* --------------------------------------------------------------------------
   Body scroll — fixed viewport, all rows reachable
   --------------------------------------------------------------------------
   The old homepage used mCustomScrollbar on the tbody. That plugin rewrites
   the DOM and breaks `table-layout: fixed`, so FN keeps native overflow on
   the pane instead: same right-side thumb, same sticky header feel, geometry
   untouched. index.js still skips mCustomScrollbar inside .fn-data-module.
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-module {
  /* Visible window ≈ old 194px preview: six compact rows / seven standard. */
  --fn-data-scroll-rows: 7;
}

.fn-ui .fn-data-module--compact {
  --fn-data-scroll-rows: 6;
}

.fn-ui .fn-data-module .fn-data-table > tbody {
  height: auto;
  max-height: none;
  overflow: visible;
}

/* Custom scroll shell: pane clips, inner view scrolls, rail stays put.
   Native scrollbar is fully suppressed — Chrome/Windows still draws ↑↓
   steppers on ::-webkit-scrollbar even when buttons are zeroed.

   IMPORTANT: never set `display` on inactive panes — Bootstrap hides them
   with `display:none`. Forcing flex on every .fn-data-scroll stacked all
   three panes and blew the module height open. */
.fn-ui .fn-data-module .fn-data-body > .tab-pane.fn-data-scroll.active {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: calc(
    var(--fn-data-row-h) * var(--fn-data-scroll-rows)
    + 2.5em
  );
  padding-right: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.fn-ui .fn-data-module--compact .fn-data-body > .tab-pane.fn-data-scroll.active {
  max-height: calc(var(--fn-data-row-h) * var(--fn-data-scroll-rows));
}

.fn-ui .fn-data-scroll__view {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fn-ui .fn-data-scroll__view::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
  background: transparent;
}

.fn-ui .fn-data-scroll__view > .fn-data-table {
  width: 100%;
}

/* Custom rail + thumb (fn-data-scroll.js). Slim pill, inset from table edges. */
.fn-ui .fn-data-scroll__rail {
  position: absolute;
  top: 10px;
  right: 4px;
  bottom: 10px;
  z-index: 2;
  width: 3px;
  pointer-events: auto;
}

.fn-ui .fn-data-scroll__thumb {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: none;
  min-height: 20px;
  border-radius: var(--fn-radius-pill);
  background: color-mix(in srgb, var(--fn-brand) 42%, var(--fn-text-3));
  cursor: grab;
  pointer-events: auto;
  transition: background-color var(--fn-dur-fast) var(--fn-ease);
  will-change: transform;
}

.fn-ui .fn-data-scroll__thumb:hover,
body.fn-data-scroll--dragging .fn-ui .fn-data-scroll__thumb {
  background: color-mix(in srgb, var(--fn-brand) 62%, var(--fn-text-3));
}

body.fn-data-scroll--dragging {
  cursor: grabbing;
  user-select: none;
}

body.fn-data-scroll--dragging .fn-ui .fn-data-scroll__thumb {
  cursor: grabbing;
}


/* --------------------------------------------------------------------------
   Collapse to two columns — name + the metric the active tab selects
   --------------------------------------------------------------------------
   Four columns need room for a name plus three 66px metric tracks. Under
   ~350px of module there isn't any, and compressing four tracks is how you get
   an unreadable table. So the table becomes two: the name, and the one metric
   the active tab is about. The tab strip is already the control for that
   choice, so nothing new has to be learned and no value becomes unreachable —
   it is a different presentation of the same data, not a subset of it.

   Mechanism: the active pane carries fn-data-focus--colN, and the two metrics
   it does not cover take their display from --fn-extra-display. Under fixed
   layout those columns collapse and the name track absorbs the space. The
   rule set below is written once; the switches only flip the property.
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-module .fn-data-focus--col2 .index_hd3,
.fn-ui .fn-data-module .fn-data-focus--col2 .index_hd4,
.fn-ui .fn-data-module .fn-data-focus--col2 .index_cnt3,
.fn-ui .fn-data-module .fn-data-focus--col2 .index_cnt4,
.fn-ui .fn-data-module .fn-data-focus--col3 .index_hd2,
.fn-ui .fn-data-module .fn-data-focus--col3 .index_hd4,
.fn-ui .fn-data-module .fn-data-focus--col3 .index_cnt2,
.fn-ui .fn-data-module .fn-data-focus--col3 .index_cnt4,
.fn-ui .fn-data-module .fn-data-focus--col4 .index_hd2,
.fn-ui .fn-data-module .fn-data-focus--col4 .index_hd3,
.fn-ui .fn-data-module .fn-data-focus--col4 .index_cnt2,
.fn-ui .fn-data-module .fn-data-focus--col4 .index_cnt3 {
  display: var(--fn-extra-display);
}

/* Switch 1 — the container is too narrow for four tracks. This is the one
   that makes the module portable: it fires in a 290px sidebar at 992px and in
   a 290px column anywhere else, identically. */
@container fn-data (max-width: 349px) {
  /* Set on the table, not the module: a container query can only style
     DESCENDANTS of its container, and the module IS the container. */
  .fn-ui .fn-data-module--standard .fn-data-table {
    --fn-extra-display: none;
    --fn-col-metric: 96px;
    --fn-data-num-size: 14px;
    --fn-data-head-size: 12px;
    --fn-data-row-h: 44px;
  }

  /* Narrow container: same phone chrome — one metric control, no repeated header. */
  .fn-ui .fn-data-module--standard .fn-data-metric {
    display: block;
  }

  .fn-ui .fn-data-module--standard .fn-data-tabs {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
  }

  .fn-ui .fn-data-module--standard .fn-data-table > thead > tr > th {
    height: 0;
    max-height: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
    color: transparent;
  }
}

/* Switch 2 — phones, regardless of how wide the container happens to be.
   A 430px phone has room for four columns and still should not show them. */
@media (max-width: 767px) {
  .fn-ui .fn-data-module--standard .fn-data-table {
    --fn-extra-display: none;
    --fn-col-metric: 96px;
    --fn-data-num-size: 14px;
    --fn-data-head-size: 12px;
    --fn-data-row-h: 44px;
  }

  .fn-ui .fn-data-module--standard .fn-data-metric {
    display: block;
  }

  .fn-ui .fn-data-module--standard .fn-data-tabs {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    white-space: nowrap;
  }

  .fn-ui .fn-data-module--standard .fn-data-table > thead > tr > th {
    height: 0;
    max-height: 0;
    padding: 0;
    border: 0;
    overflow: hidden;
    line-height: 0;
    font-size: 0;
    color: transparent;
  }

  .fn-ui .fn-data-module--standard .fn-data-table > thead {
    border: 0;
  }

  .fn-ui .fn-data-module--standard .fn-data-body > .tab-pane {
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    padding-left: 0;
  }

  .fn-ui .fn-data-filters {
    flex-wrap: wrap;
  }

  .fn-ui .fn-data-filters > .fn-data-filter.fn-dd,
  .fn-ui .fn-data-module select.form-control:not(.fn-dd__native) {
    flex-basis: 100%;
  }

  /* Compact segment also applies to standard modules that land on a phone. */
  .fn-ui .fn-data-module--standard .fn-data-segment {
    display: flex;
    width: 100%;
    margin: 0 0 var(--fn-space-2);
  }

  .fn-ui .fn-data-module--standard .fn-data-segment__option {
    flex: 1 1 0;
    min-height: 32px;
  }

  .fn-ui .fn-data-module--standard {
    --fn-data-scroll-rows: 6;
  }

  .fn-ui .fn-data-module--standard .fn-data-body > .tab-pane.fn-data-scroll.active {
    max-height: calc(var(--fn-data-row-h) * var(--fn-data-scroll-rows));
  }
}

/* No container-query support — fall back to the viewport. col-sm-4 / col-lg-4
   is narrower than 350px below roughly 1200px, so that is the cut. */
@supports not (container-type: inline-size) {
  @media (max-width: 1199px) {
    .fn-ui .fn-data-module--standard .fn-data-table {
      --fn-extra-display: none;
      --fn-col-metric: 96px;
      --fn-data-num-size: 14px;
      --fn-data-head-size: 12px;
      --fn-data-row-h: 44px;
    }

    .fn-ui .fn-data-module--standard .fn-data-metric {
      display: block;
    }

    .fn-ui .fn-data-module--standard .fn-data-tabs {
      position: absolute;
      width: 1px;
      height: 1px;
      margin: -1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      border: 0;
      white-space: nowrap;
    }

    .fn-ui .fn-data-module--standard .fn-data-table > thead > tr > th {
      height: 0;
      max-height: 0;
      padding: 0;
      border: 0;
      overflow: hidden;
      line-height: 0;
      font-size: 0;
      color: transparent;
    }
  }
}

/* Narrow phones — 320–359. The tab strip is the tightest thing on the page. */
@media (max-width: 359px) {
  .fn-ui .fn-data-segment__option {
    padding: 0 var(--fn-space-2);
    font-size: var(--fn-fs-xs);
  }

  .fn-ui .fn-data-module .fn-data-tabs > li > a {
    padding-inline: 2px;
    font-size: var(--fn-fs-xs);
  }

  .fn-ui .fn-data-module--compact {
    --fn-col-metric: 84px;
    --fn-data-name-size: 13px;
    --fn-data-num-size: 14px;
  }
}


/* --------------------------------------------------------------------------
   Footer CTA — a quiet link to the full list, not a button
   -------------------------------------------------------------------------- */

.fn-ui .fn-data-footer {
  margin: 0;
  padding: 0;
  border-top: var(--fn-border-width) solid var(--fn-border);
  text-align: center;
}

.fn-ui .fn-data-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: var(--fn-space-2);
  background: transparent;
  color: var(--fn-interactive-ink);
  font-size: var(--fn-fs-sm);
  font-weight: var(--fn-fw-medium);
  letter-spacing: 0.01em;
  text-decoration: none;
  transition:
    color var(--fn-dur-fast) var(--fn-ease),
    background-color var(--fn-dur-fast) var(--fn-ease);
}

/* RTL chevron — points to the reading direction of travel. */
.fn-ui .fn-data-footer a::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M6.3 1.2L1.4 6l4.9 4.8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M6.3 1.2L1.4 6l4.9 4.8'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.8;
}

.fn-ui .fn-data-footer a:hover {
  background: var(--fn-interactive-wash);
  color: var(--fn-interactive-ink);
  text-decoration: none;
}

/* Mouse click sets :focus but not :focus-visible — kill the browser's
   default black/dotted ring. Keep brand ring for keyboard only. */
.fn-ui .fn-data-footer a:focus,
.fn-ui .fn-data-footer a:active {
  outline: none;
}

.fn-ui .fn-data-footer a:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: calc(var(--fn-focus-offset) * -1);
}

/* The sidebar card's own edge is the footer's bottom edge. */
.fn-ui .fn-data-module--standard .fn-data-footer {
  margin-inline: calc(var(--fn-space-3) * -1);
}


/* --------------------------------------------------------------------------
   Dark — native, not an inversion
   --------------------------------------------------------------------------
   Every colour above already resolves through a token that flips in
   :root[data-fn-theme="dark"], so almost nothing belongs here. What remains is
   the two things a token cannot express: an SVG stroke baked into a data URI,
   and a shadow that has to become a border because shadows do not read on a
   near-black canvas.

   .darkCont (the acc_box.js high-contrast mode) needs no rules at all —
   01-tokens.css collapses the tokens to pure black/white on body.darkCont, so
   this module follows it for free.
   -------------------------------------------------------------------------- */

:root[data-fn-theme="dark"] .fn-data-module {
  --fn-icon-caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 7' fill='none' stroke='%239AA69C' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5L5.5 5.5 10 1.5'/%3E%3C/svg%3E");
}

/* The raised "selected" segment reads as a lighter surface, not a shadow. */
:root[data-fn-theme="dark"] .fn-data-segment__option:has(input:checked) {
  background: var(--fn-bg-raised);
  box-shadow: none;
}


/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-data-segment__option,
  .fn-ui .fn-data-module .fn-data-tabs > li > a,
  .fn-ui .fn-data-module .fn-data-tabs > li > a::after,
  .fn-ui .fn-data-module select.form-control,
  .fn-ui .fn-data-module .fn-data-table > tbody > tr,
  .fn-ui .fn-data-footer a {
    transition: none;
  }
}


/* ==========================================================================
   The two "נצפו לאחרונה" widgets — one inset, both widgets, both sizes
   --------------------------------------------------------------------------
   They look like a matched pair and sit one above the other, but they are
   built differently:

     נצפו לאחרונה          <ul> of <li class="recently-viewed-row">
     נצפו לאחרונה - קרנות   <table> with <tr class="rv-funds-row">

   Every attempt to inset them had been written per widget, and each one
   worked on one of the two and silently failed on the other. Measured:

                         phone 390      desktop 1440
       quotes            12px inset     FLUSH
       funds             FLUSH          13px inset

   — a mirror-image bug, wrong at the opposite size in each widget. The
   funds one is the visible case: a table flush against a rounded bubble
   puts its row dividers and its cell backgrounds hard against the corner.

   THE RULE: the MODULE stops owning the horizontal inset for these two,
   and its own children own it instead — one value, applied to the heading
   row, the body and the footer alike. That makes the inset independent of
   whether the module is --compact (phone, 11px of its own padding) or
   --standard (desktop, none), which is what the per-widget versions kept
   tripping over.

   It is deliberately NOT applied to .fn-data-module at large: the big fund
   tables are full-bleed on a phone on purpose, because fifty rows of fund
   names need every pixel of width. These two are short widgets where
   containment reads better than width.
   ========================================================================== */

/* The MODULE owns the inset. Its children add nothing — that is what makes
   this one number instead of a sum that has to be kept in step.

   On a phone 21-mobile.css already pads --compact modules by
   --fn-bubble-pad and loads after this file, so it supplies the same value
   there; on desktop there is no such rule and this one provides it. Either
   way both widgets end up with the same inset as each other. */
.fn-ui .recently-viewed-module,
.fn-ui .rv-funds-module {
  padding-inline: var(--fn-bubble-pad, 14px);
}

/* `.fn-data-module` is repeated in these selectors on purpose. 21-mobile.css
   full-bleeds EVERY --compact body —

     .fn-ui .fn-data-module--compact .fn-data-body { margin-inline: -pad }

   which is right for the big fund tables (fifty rows that need the width)
   and wrong for these two short widgets. That rule is (0,3,0) and loads
   after this file, so a (0,3,0) selector here loses on order. Naming the
   module class as well makes these (0,4,0): they win on specificity, with
   no !important anywhere. */
.fn-ui .fn-data-module.recently-viewed-module > .fn-data-toolbar,
.fn-ui .fn-data-module.recently-viewed-module > .fn-data-body,
.fn-ui .fn-data-module.recently-viewed-module > .fn-data-footer,
.fn-ui .fn-data-module.rv-funds-module > .fn-data-toolbar,
.fn-ui .fn-data-module.rv-funds-module > .fn-data-body,
.fn-ui .fn-data-module.rv-funds-module > .fn-data-footer {
  margin-inline: 0;
  padding-inline: 0;
}

/* The funds table does not always fit the sidebar, and it never did.
   --------------------------------------------------------------------
   It is `table-layout: fixed` with three 66px metric columns, so its
   width has a floor of about 288px whatever the container does. Measured
   against the sidebar's body:

       768-991    body 205px   table 288px   over by 83
       992-1199   body 283px   table 288px   over by  5
       1200+      body 350px   table 350px   fits

   On the live page `.rv-funds-scroll` carries `overflow-x: hidden`, so the
   result is not a visible overflow — it is a CLIPPED last column. A figure
   the reader cannot reach is worse than one they have to scroll to, and
   neither is "uniform and professional".

   So the overflow becomes a scroll rather than a clip. No breakpoint: when
   the table fits, `auto` does nothing at all. No column is dropped and no
   figure loses a digit — the brief has been consistent that data does not
   get removed to make a layout work.

   It scrolls INSIDE the padded body, so the content still starts at the
   module's inset and the clipped edge is the padding edge — nothing runs
   into the bubble's rounded corner at either end. */
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  /* `scrollbar-width: thin` used to be here for the horizontal bar. It had
     to go: in Chromium, any non-auto `scrollbar-width` on a box makes the
     engine ignore every ::-webkit-scrollbar rule on it, so this one
     declaration — about the horizontal bar — silently replaced the styled
     6px vertical bar below with the stock 10px one. Measured: this widget
     reserved 10-11px against the quotes widget's 5-6px, and the pair
     stopped lining up. Both axes are sized by ::-webkit-scrollbar now
     (width AND height are set), and Firefox gets `thin` further down,
     where there are no pseudo-elements for it to cancel. */
}

/* ONE scroll container, not two. .rv-funds-scroll handles both axes, so the
   body must not become a scroller of its own — nested scrollers on the same
   axis are the "double scroll" that makes a wheel or a thumb feel stuck.
   When the script has not run there is no table either, so there is nothing
   for the body to need to scroll. */
.fn-ui .fn-data-module.rv-funds-module > .fn-data-body {
  overflow: visible;
}


/* ==========================================================================
   The height cap
   --------------------------------------------------------------------------
   A sidebar module that grows with however many securities the reader
   happened to open is not a sidebar module. Four of the modules beside
   these two are already capped at seven rows by --fn-data-scroll-rows, and
   the funds widget had its own hard-coded 240px. The quotes widget had
   nothing at all — ten rows in the screenshot, about 500px.

   One formula for both, so they stay the same height as each other:

       max-height = row height x --fn-rv-rows

   --fn-data-row-h already resolves per context (44px on a phone, 48px on
   desktop), so one declaration gives a size-appropriate cap at both.

   DELIBERATELY max-height and not height: a list with three rows is three
   rows tall. Nothing is padded out to fill a cap.

   The cap is on the LIST, never on the module, so the heading and its
   controls stay put and only the rows move.

   overscroll-behavior-y is `auto` on purpose. `contain` would be right for
   a dialog; here it means a thumb that lands inside a 300px box in the
   middle of a long page cannot scroll the page until it leaves the box,
   which is the single most irritating thing a nested scroller does. At the
   end of the list the page takes over, which is what a reader expects.
   ========================================================================== */

.fn-ui .recently-viewed-module,
.fn-ui .rv-funds-module {
  --fn-rv-rows: 7;
}

.fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list,
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll {
  max-height: calc(var(--fn-data-row-h, 44px) * var(--fn-rv-rows));
  overflow-y: auto;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;

  /* The bar is on the right: the shared pane rule in 00-page.css. The
     strip it occupies is reserved whether or not it is there.
     Without this the gutter appears only once a reader has opened eight
     securities, so the rows of a scrolling widget sit 6px further in than
     the rows of a short one directly above it — the two widgets stop
     agreeing, which is the exact fault corrected in the previous round.
     Reserving it always also means the list does not jump sideways when a
     row is added or removed. Ignored by Safari, which draws an overlay
     bar and so has no gutter to stabilise. */
  scrollbar-gutter: stable;
}

/* The bar itself, matched to the fund tables' custom rail: a slim pill in
   the same mix of brand and muted ink, so the six scrollers look like one
   control rather than two.
   ------------------------------------------------------------------------
   Which mechanism paints it is NOT a free choice. Chromium ignores every
   ::-webkit-scrollbar rule on a box that also sets `scrollbar-width` to
   anything other than `auto`. The first version of this set both, so the
   6px pill below was dead code and what actually shipped was the 10px
   stock `thin` bar — measured in a headed browser, since a headless shell
   has no scrollbars to measure and reports zero either way.

   So: the pseudo-elements are the primary, unqualified path, and the two
   standard properties are given only to engines that have no pseudo-
   elements to ignore them with. Chromium answers true to
   `selector(::-webkit-scrollbar)`, Firefox false — verified, not assumed. */
.fn-ui .recently-viewed-module,
.fn-ui .rv-funds-module {
  --fn-rv-thumb: color-mix(in srgb, var(--fn-brand) 42%, var(--fn-text-3));
}

@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .fn-ui .recently-viewed-module,
  .fn-ui .rv-funds-module {
    --fn-rv-thumb: var(--fn-text-3);
  }
}

.fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list::-webkit-scrollbar,
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list::-webkit-scrollbar-track,
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list::-webkit-scrollbar-thumb,
.fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll::-webkit-scrollbar-thumb {
  border-radius: var(--fn-radius-pill);
  background: var(--fn-rv-thumb);
  /* The border is what makes a 6px track carry a 3px pill, matching the
     rail's width without the track being too thin to hit with a pointer. */
  border: 1.5px solid transparent;
  background-clip: padding-box;
}

/* Firefox: no pseudo-elements, so the standard properties are safe here and
   nowhere else. `thin` is its own ~10px bar — not the 6px above — which is
   as close as the engine allows without drawing it by hand. */
@supports not selector(::-webkit-scrollbar) {
  .fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list,
  .fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll {
    scrollbar-width: thin;
    scrollbar-color: var(--fn-rv-thumb) transparent;
  }
}

/* A touch device has no pointer to aim with and draws its own overlay bar,
   so the reserved gutter is wasted width on the screen that can least
   afford it. */
@media (hover: none) {
  .fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list,
  .fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll {
    scrollbar-width: none;
  }

  .fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list::-webkit-scrollbar,
  .fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}

/* A row cut in half by the cap reads as a rendering fault; the same cut
   under a short fade reads as "there is more below" — the same signal the
   phone's fund tables use. It is only drawn while the list actually
   overflows, so a three-row list is not faded for no reason.

   `scroll-timeline` is not needed: the fade sits on the container, and a
   container whose content fits has nothing under the faded band.

   TOUCH ONLY, and that restriction is load-bearing. A mask applies to the
   scrollbar as well as the content, so on a pointer device the fade ate
   the bottom of the thumb — and the thumb is at the bottom precisely when
   the reader has scrolled to the end, so the bar dissolved at the moment
   it was being used. (Measured: thumb painted y63-67 of an expected
   y63-80.) The two signals are alternatives, not a pair: where there is a
   visible bar it says "there is more", and where the bar is suppressed —
   `hover: none`, a few rules above — the fade says it instead. */
@supports (mask-image: linear-gradient(#000, #000)) {
  @media (hover: none) {
    .fn-ui .fn-data-module.recently-viewed-module .recently-viewed-list,
    .fn-ui .fn-data-module.rv-funds-module .rv-funds-scroll {
      -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
      mask-image: linear-gradient(to bottom, #000 calc(100% - 18px), transparent 100%);
    }
  }
}

/* The row no longer carries the inset — the body does — so a row that kept
   its own would double it. Its vertical padding is untouched. */
.fn-ui .recently-viewed-row {
  padding-inline: 0;
}

/* A table inside a padded body is already inset, so the first and last
   cells must not add to it or the figures drift away from the edge the
   heading above them sits on. */
/* Same reason for the extra class here: 21-mobile.css pads the first and
   last cell of every --compact table by --fn-bubble-pad, to put back what
   its negative margin took away. With the negative margin gone, that
   padding would push the figures a second inset in from the heading above
   them. (0,6,0) beats its (0,5,0). */
.fn-ui .fn-data-module.rv-funds-module .fn-data-table > thead > tr > th:first-child,
.fn-ui .fn-data-module.rv-funds-module .fn-data-table > tbody > tr > td:first-child {
  padding-inline-start: 0;
}

.fn-ui .fn-data-module.rv-funds-module .fn-data-table > thead > tr > th:last-child,
.fn-ui .fn-data-module.rv-funds-module .fn-data-table > tbody > tr > td:last-child {
  padding-inline-end: 0;
}
