/* ==========================================================================
   FUNDER — Homepage index strip (cards + sparklines)
   --------------------------------------------------------------------------
   Layout contract:
     .fn-index-strip  → the scroller: one flex row, overflow-x, scroll-snap
     .item            → the slot (fixed basis; it never shrinks)
     .fn-index-card   → fills the slot, height from content
     .fn-index-card__chart → fixed px band (--fn-idx-chart-h), SVG fills it

   There is no carousel library here any more. The bar shows a fixed list of
   eight indices (CORE_INDICES in chart-live.js) at every width: wide screens
   fit all eight in the row, narrow ones scroll the same finite strip. Owl was
   only ever here to page through 53 of them with arrows, so the stage, the
   nav buttons, the clones and the item/page-size bookkeeping went with it.

   Owl IS still used elsewhere on the page (the quick-links rail), so none of
   its own rules were touched — only the ones scoped to #mdlFrame.
   ========================================================================== */
.fn-ui #mdlFrame,
.fn-ui .mainindex #mdlFrame {
  --fn-idx-radius: var(--fn-radius-card);
  --fn-idx-accent-h: 3px;
  --fn-idx-accent-inset: 0px;
  /*
    Chart band MUST be px, not %. Card is height:auto + column flex —
    % flex-basis/height is indefinite and becomes auto, so the SVG viewBox
    was sizing the band no matter what a % variable said.
  */
  --fn-idx-chart-h: 44px;
  --fn-idx-gap: var(--fn-index-gap);

  height: auto;
  min-height: 0;
  margin-bottom: var(--fn-space-3);
  text-align: center;
  overflow: visible;
}

.fn-ui #mdlFrame .indices-carousel-wrap {
  position: relative;
  z-index: 5;
  /* Same column as the Hero. The 32–36px side padding that used to reserve
     room for the page arrows is gone with the arrows. */
  padding: 0;
  margin: 0;
  overflow: visible;
}

/* --------------------------------------------------------------------------
   The strip
   --------------------------------------------------------------------------
   One scroller for every width. Why it behaves the way it does:

     - the browser's own compositor scrolls it, so momentum, rubber-band and
       the interplay with vertical page scroll are the platform's rather than
       a re-implementation in JavaScript on a transformed stage;
     - `scroll-snap-type: x proximity` parks cards on a tidy edge without ever
       yanking the strip away from where the thumb left it — which is what
       `mandatory` does, and what reads as "jumpy";
     - it ENDS. Eight cards, a hard stop at each end, and the native overscroll
       bounce to say so.

   On a wide screen all eight fit and it never actually scrolls, so the same
   element is a plain row there. No second code path, no breakpoint to forget.
   -------------------------------------------------------------------------- */

.fn-ui #mdlFrame .fn-index-strip {
  display: flex;
  flex-direction: row;
  gap: var(--fn-idx-gap);
  width: 100%;
  margin: 0;
  padding: 2px 0;

  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  /* A sideways flick must not chain into the page scroll, and on iOS must
     not become the browser's back-navigation gesture. */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.fn-ui #mdlFrame .fn-index-strip::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* The slot. `flex: 1 1 0` with a min-width is the whole responsive story:
   above ~1000px eight cards share the row and nothing scrolls; below it the
   min-width wins, the row overflows, and the strip becomes a scroller. */
.fn-ui #mdlFrame .fn-index-strip > .item {
  flex: 1 1 0;
  min-width: var(--fn-idx-card-min, 124px);
  margin: 0;
  padding: 0 !important;
  scroll-snap-align: start;
}

.fn-ui #mdlFrame .fn-index-strip > .item:last-child {
  scroll-snap-align: end;
}

.fn-ui #mdlFrame .allchartdiv {
  border: 0;
}


/* --------------------------------------------------------------------------
   Navigation arrows
   --------------------------------------------------------------------------
   Present only while the strip genuinely overflows — chart-live.js toggles
   .has-index-nav on the wrap from a ResizeObserver, so narrowing the window
   or zooming the browser brings them back the moment eight cards stop
   fitting, and takes them away again when they do.

   They do NOT overlay the cards. The first version did, and an arrow sitting
   on top of a card means a mis-tap opens a market page instead of paging the
   row — and the hit test proved it: elementFromPoint at the arrow's centre
   returned the card under it. So the strip takes matching inline PADDING
   while the arrows are up, and the cards start after them.

   That padding cannot oscillate: it is only added once the row already
   overflows, and adding it keeps the row overflowing; it is only removed
   once the row fits WITH the padding, and removing it leaves more room, not
   less. Each state is self-consistent, so a slow resize cannot make the
   arrows flicker.

   Logical insets: `inset-inline-start` is the reading edge (right in RTL),
   so "previous" is on the right and "next" on the left without a direction
   branch anywhere.
   -------------------------------------------------------------------------- */

.fn-ui #mdlFrame .indices-carousel-wrap.has-index-nav .fn-index-strip {
  padding-inline: var(--fn-index-nav-gutter, 36px);
  /* Snapping must land a card past the arrow, not under it. */
  scroll-padding-inline: var(--fn-index-nav-gutter, 36px);
}

.fn-ui #mdlFrame .fn-index-nav {
  position: absolute;
  top: 50%;
  z-index: 6;
  display: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid var(--fn-border-strong);
  border-radius: var(--fn-radius-pill);
  background: var(--fn-bg-surface);
  box-shadow: var(--fn-shadow-md);
  color: var(--fn-text-2);
  cursor: pointer;
  transition:
    opacity var(--fn-dur-fast) var(--fn-ease),
    border-color var(--fn-dur-fast) var(--fn-ease),
    color var(--fn-dur-fast) var(--fn-ease),
    transform var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui #mdlFrame .indices-carousel-wrap.has-index-nav .fn-index-nav {
  display: flex;
}

.fn-ui #mdlFrame .fn-index-nav--prev { inset-inline-start: 2px; }
.fn-ui #mdlFrame .fn-index-nav--next { inset-inline-end: 2px; }

/* A chevron drawn from a rotated corner — no icon font, no SVG request.
   The borders are physical, on purpose. `border-inline-start` flips in RTL
   while these rotation angles do not, and the pair was painting an up-caret
   on the left button and a down-caret on the right. Same corner the hero
   uses: right + bottom, then turned. Prev sits on the right and points
   right (back toward the start); next sits on the left and points left. */
.fn-ui #mdlFrame .fn-index-nav__icon {
  width: 7px;
  height: 7px;
  border-style: solid;
  border-width: 0 2px 2px 0;
  border-color: currentColor;
}

.fn-ui #mdlFrame .fn-index-nav--prev .fn-index-nav__icon {
  transform: rotate(-45deg);
  margin-left: -2px;
}

.fn-ui #mdlFrame .fn-index-nav--next .fn-index-nav__icon {
  transform: rotate(135deg);
  margin-right: -2px;
}

.fn-ui #mdlFrame .fn-index-nav:hover:not(:disabled) {
  border-color: var(--fn-interactive);
  color: var(--fn-interactive-ink);
}

.fn-ui #mdlFrame .fn-index-nav:active:not(:disabled) {
  transform: translateY(-50%) scale(0.94);
}

.fn-ui #mdlFrame .fn-index-nav:focus-visible {
  outline: var(--fn-focus-width) solid var(--fn-focus);
  outline-offset: 2px;
}

/* At an end the arrow stays in place and stops responding — removing it
   would move the other one and make the row twitch at every boundary. */
.fn-ui #mdlFrame .fn-index-nav:disabled {
  opacity: 0.32;
  cursor: default;
  pointer-events: none;
}

/* Touch scrolls the row directly; arrows would only cost it thumb room. */
@media (max-width: 767px) {
  .fn-ui #mdlFrame .indices-carousel-wrap.has-index-nav .fn-index-nav,
  .fn-ui #mdlFrame .fn-index-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui #mdlFrame .fn-index-nav,
  .fn-ui #mdlFrame .fn-index-nav:active:not(:disabled) {
    transition: none;
    transform: translateY(-50%);
  }
}
/* ---- Card fills Owl slot ------------------------------------------------ */

.fn-ui #mdlFrame .fn-index-card {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  /* Content-driven height — aspect-ratio 3/4 forced empty air above/below text */
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--fn-idx-radius);
  background: var(--fn-bg-surface);
  box-shadow: none;
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  transition:
    border-color var(--fn-dur-fast) var(--fn-ease),
    background-color var(--fn-dur-fast) var(--fn-ease),
    box-shadow var(--fn-dur-fast) var(--fn-ease),
    transform var(--fn-dur-fast) var(--fn-ease);
}

.fn-ui #mdlFrame .fn-index-card,
.fn-ui #mdlFrame .fn-index-card.bdrgreen,
.fn-ui #mdlFrame .fn-index-card.bdrred,
.fn-ui #mdlFrame .item.bdrgreen,
.fn-ui #mdlFrame .item.bdrred,
.fn-ui #mdlFrame .item {
  border-color: transparent !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-left-width: 1px !important;
  border-right-width: 1px !important;
}

/*
  Accent bar — ::before (NOT border). Thin horizontal cap along the top
  edge. Card overflow:hidden + matching top radii keep it inside the
  card corners on both mobile and desktop.
*/
.fn-ui #mdlFrame .fn-index-card::before {
  content: "";
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  bottom: auto;
  width: auto;
  height: var(--fn-idx-accent-h);
  border-radius: var(--fn-idx-radius) var(--fn-idx-radius) 0 0;
  background: var(--fn-neutral);
  pointer-events: none;
  z-index: 5;
}

.fn-ui #mdlFrame .fn-index-card.bdrgreen::before {
  background: var(--fn-market-up);
}

.fn-ui #mdlFrame .fn-index-card.bdrred::before {
  background: var(--fn-market-down);
}

.fn-ui #mdlFrame .fn-index-card::after {
  content: none !important;
  display: none !important;
}

/* Desktop hover — tiny lift only (don't wipe market accent) */
@media (hover: hover) and (pointer: fine) {
  .fn-ui #mdlFrame .fn-index-card:hover {
    transform: translateY(-1px);
    z-index: 2;
  }
}

.fn-ui #mdlFrame .fn-index-card:active {
  transform: scale(0.985);
  transition-duration: 80ms;
}

.fn-ui #mdlFrame .fn-index-card__top {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 12px 10px 8px;
  min-height: 0;
  overflow: hidden;
}

/* Hierarchy: name → % → chart */
.fn-ui #mdlFrame .fn-index-card__name,
.fn-ui #mdlFrame .fn-index-card .sctitile {
  width: 100%;
  float: none;
  min-height: 0;
  margin: 0;
  padding: 0 2px;
  padding-block: var(--fn-ink-pad);
  margin-block: calc(var(--fn-ink-pad) * -1);
  font-family: var(--fn-font-ui);
  font-size: 16px;
  font-weight: var(--fn-fw-medium);
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--fn-text-1);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fn-ui #mdlFrame .fn-index-card__name:hover,
.fn-ui #mdlFrame .fn-index-card .sctitile:hover {
  text-decoration: none;
}

.fn-ui #mdlFrame .fn-index-card__name strong,
.fn-ui #mdlFrame .fn-index-card .sctitile strong {
  font-weight: inherit;
  color: inherit;
}

/* The index level — bottom-right corner of the card, over the chart band.
   ------------------------------------------------------------------------
   Udi asked for it back ("the price matters, after we removed it I found
   myself looking for it") and for where: "snug to the bottom-right corner
   of the rectangle". Absolute, so every card keeps its height and the
   strip does not grow a row. A chip of the card's own surface at 82%
   keeps the figure legible where the line runs under it, while the line
   still shows through. The dollar card, which used to show its rate next
   to the %, now uses the same corner as every other index. */
.fn-ui #mdlFrame .fn-index-card__rate,
.fn-ui #mdlFrame .fn-index-card__rate.w2 {
  position: absolute;
  z-index: 3;
  right: 4px;
  bottom: 3px;
  left: auto;
  width: auto;
  float: none;
  margin: 0;
  padding: 0 4px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--fn-idx-card-bg, var(--fn-bg-surface)) 82%, transparent);
  font-family: var(--fn-font-num);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  color: var(--fn-text-2);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  pointer-events: none;
}

.fn-ui #mdlFrame .fn-index-card__rate.fn-index-card__rate--none {
  display: none;
}

.fn-ui #mdlFrame .fn-index-card__cng,
.fn-ui #mdlFrame .fn-index-card__cng.w2,
.fn-ui #mdlFrame .fn-index-card .sctitile2 {
  width: 100%;
  float: none;
  margin: 0;
  padding: 0;
  font-family: var(--fn-font-num);
  font-size: 22px;
  font-weight: var(--fn-fw-medium); /* 600 — visual hero */
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: center;
}

.fn-ui #mdlFrame .fn-index-card .pnum {
  color: var(--fn-market-up);
}

.fn-ui #mdlFrame .fn-index-card .mnum {
  color: var(--fn-market-down);
  direction: ltr;
}

/* No sparkline series.
   --------------------------------------------------------------------------
   This used to collapse the card: max-height:none, height:auto, and the chart
   band display:none. Measured against the real feed that is the whole bug.
   Outside trading hours most indices come back with rate 0 and a series of
   139 "miss" values, so only the dollar draws a line — and a flex row sizes
   every card to the tallest one, visible or not (Owl did the same to its
   stage). That left dead space under the cards whose band had collapsed,
   including cards whose tall neighbour was scrolled off-screen entirely.

   So the band keeps its place. A card is one shape whether or not the market
   is open, which kills the dead space, removes the layout shift when a series
   arrives mid-session, and holds up the day the feed starts returning data for
   everything. What fills the band is an honest quiet state — a flat baseline
   at the rest position — never a drawn line standing in for data we lack. */
/* An index with no quote behind it. Neutral by design: the value and the
   change are em-dashes in the muted ink, and the card carries no market accent,
   because there is no direction to report. */
.fn-ui #mdlFrame .fn-index-card__cng.fn-index-card--novalue,
.fn-ui #mdlFrame .fn-index-card__cng.fn-index-card--novalue span {
  color: var(--fn-text-3);
  font-weight: var(--fn-fw-regular);
}

/* Chart region — bottom band only; stops before accent bar */
.fn-ui #mdlFrame .fn-index-card__chart,
.fn-ui #mdlFrame .fn-index-card .schart {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 var(--fn-idx-chart-h);
  width: 100%;
  height: var(--fn-idx-chart-h);
  min-height: var(--fn-idx-chart-h);
  max-height: var(--fn-idx-chart-h);
  margin: 0;
  margin-bottom: 0;
  padding: 0;
  float: none;
  overflow: hidden;
  z-index: 1;
  border-radius: 0 0 calc(var(--fn-idx-radius) - 1px) calc(var(--fn-idx-radius) - 1px);
  pointer-events: none;
  contain: paint;
  clip-path: inset(0 round 0 0 calc(var(--fn-idx-radius) - 1px) calc(var(--fn-idx-radius) - 1px));
}

/* Quiet / no-trading state — AFTER the shared chart band rules so flex
   centering wins over the absolute top:58% + margin-top geometry that
   clipped "אין מסחר" under the 28–30px mobile chart height. */
.fn-ui #mdlFrame .fn-index-card.fn-index-card--no-chart .fn-index-card__chart,
.fn-ui #mdlFrame .fn-index-card.fn-index-card--no-chart .schart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  /* Keep the accent clearance from the shared rule; only add tiny vertical air. */
  padding-block: 2px;
  box-sizing: border-box;
}

/* The baseline: one hairline where a flat series would sit. */
.fn-ui #mdlFrame .fn-index-card--no-chart .fn-index-card__chart::before {
  content: "";
  position: static;
  flex: 0 0 1px;
  width: 72%;
  height: 1px;
  margin: 0;
  background: currentColor;
  color: var(--fn-text-3);
  opacity: 0.28;
}

/* And the reason, said once, quietly — inside the band, never clipped. */
.fn-ui #mdlFrame .fn-index-card--no-chart .fn-index-card__chart::after {
  content: attr(data-empty-label);
  position: static;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  color: var(--fn-text-3);
  font-family: var(--fn-font-ui);
  font-size: 9px;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
  opacity: 0.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-inline: 2px;
}

.fn-ui #mdlFrame .fn-index-card .fn-sparkline {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
}

.fn-ui #mdlFrame .fn-index-card .schart.schart-draw-pending {
  opacity: 0;
}

.fn-ui #mdlFrame .fn-index-card .schart.schart-drawing {
  opacity: 1;
  transition: opacity 0.35s ease-out;
}

.fn-ui #mdlFrame .blinkitr,
.fn-ui #mdlFrame .blinkitg {
  font-weight: inherit;
  background-color: transparent !important;
}

/* ---- Surfaces: Light / Dark --------------------------------------------- */

:root:not([data-fn-theme="dark"]) .fn-ui #mdlFrame .fn-index-card {
  --fn-idx-card-bg: var(--fn-gray-0);
  background: var(--fn-gray-0);
  border-color: rgba(22, 28, 23, 0.08) !important;
  box-shadow: 0 1px 2px rgba(22, 28, 23, 0.04);
}

:root:not([data-fn-theme="dark"]) .fn-ui #mdlFrame .fn-index-card:hover {
  border-color: rgba(22, 28, 23, 0.14) !important;
  box-shadow: 0 2px 6px rgba(22, 28, 23, 0.06);
}

:root[data-fn-theme="dark"] .fn-ui #mdlFrame .fn-index-card {
  --fn-idx-card-bg: #1A211B;
  background: #1A211B;
  border-color: rgba(255, 255, 255, 0.06) !important;
  box-shadow: none;
}

:root[data-fn-theme="dark"] .fn-ui #mdlFrame .fn-index-card:hover {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: #1E2620;
}

/* ---- Desktop density — compact market strip (not dashboard cards) ------ */

@media (min-width: 1000px) {
  .fn-ui #mdlFrame,
  .fn-ui .mainindex #mdlFrame {
    --fn-idx-chart-h: 34px;
    --fn-idx-accent-h: 3px;
  }

  /* 8 cards share ~1110px of container: ~130px each, comfortably past the
     124px floor, so the row never scrolls at this width. */
  .fn-ui #mdlFrame,
  .fn-ui .mainindex #mdlFrame {
    --fn-idx-card-min: 118px;
  }

  .fn-ui #mdlFrame .fn-index-card__top {
    padding: 8px 8px 6px;
    gap: 2px;
  }

  .fn-ui #mdlFrame .fn-index-card__name,
  .fn-ui #mdlFrame .fn-index-card .sctitile {
    font-size: 13px;
    line-height: 1.2;
  }

  .fn-ui #mdlFrame .fn-index-card__cng,
  .fn-ui #mdlFrame .fn-index-card__cng.w2,
  .fn-ui #mdlFrame .fn-index-card .sctitile2 {
    font-size: 17px;
    margin-top: 0;
  }
}

@media (min-width: 1400px) {
  .fn-ui #mdlFrame,
  .fn-ui .mainindex #mdlFrame {
    --fn-idx-chart-h: 38px;
  }

  .fn-ui #mdlFrame .fn-index-card__top {
    padding: 9px 9px 6px;
  }

  .fn-ui #mdlFrame .fn-index-card__name,
  .fn-ui #mdlFrame .fn-index-card .sctitile {
    font-size: 14px;
  }

  .fn-ui #mdlFrame .fn-index-card__cng,
  .fn-ui #mdlFrame .fn-index-card__cng.w2,
  .fn-ui #mdlFrame .fn-index-card .sctitile2 {
    font-size: 18px;
  }
}

/* Market status — a transparent well. Closed on desktop; on a phone the
   physical left stays open so the strip reads as a carousel. Hairline is
   --fn-bubble-border. */
.fn-ui #mdlFrame .fn-index-row {
  display: block;
  position: relative;
}

.fn-ui #mdlFrame .fn-index-row > .indices-carousel-wrap {
  width: 100%;
}

.fn-ui #mdlFrame .indices-carousel-wrap:has(> .fn-market-status:not([hidden])) {
  /* Desktop: the one unified radius. Phones: --fn-radius-desktop is unset,
     so the concentric fallback (card + padding) still applies. */
  --fn-idx-plate-radius: var(--fn-radius-desktop, calc(var(--fn-idx-radius) + 8px));
  box-sizing: border-box;
  padding: 6px 5px 5px;
  border: 0;
  border-radius: var(--fn-idx-plate-radius);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--fn-bubble-border, var(--fn-border));
}

.fn-ui #mdlFrame .indices-carousel-wrap:has(> .fn-market-status:not([hidden])) .fn-index-strip {
  padding: 0;
}

.fn-ui #mdlFrame .fn-market-status {
  position: absolute;
  z-index: 8;
  top: 6px;
  right: 4px;
  bottom: auto;
  transform: translateY(-50%);
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100% - 12px);
  margin: 0;
  padding: 5px 12px 5px 10px;
  border: 0;
  border-radius: var(--fn-radius-pill);
  background: var(--fn-bubble-bg, var(--fn-bg-surface));
  color: var(--fn-text-2);
  font-family: var(--fn-font-ui);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow:
    inset 0 0 0 1px var(--fn-bubble-border, var(--fn-border)),
    0 1px 2px rgba(16, 24, 20, 0.06),
    0 6px 14px -8px rgba(16, 24, 20, 0.2);
  pointer-events: none;
}

.fn-ui #mdlFrame .indices-carousel-wrap.has-index-nav .fn-market-status {
  right: 4px;
}

.fn-ui #mdlFrame .fn-market-status[hidden] {
  display: none;
}

.fn-ui #mdlFrame .fn-market-status__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fn-text-3);
}

.fn-ui #mdlFrame .fn-market-status__value {
  writing-mode: horizontal-tb;
  white-space: nowrap;
}

.fn-ui #mdlFrame .fn-market-status--live {
  color: var(--fn-market-up, var(--fn-up, #137333));
  background: var(--fn-up-bg, #E8F5EC);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--fn-market-up, var(--fn-up, #137333)) 28%, transparent),
    0 1px 2px rgba(16, 24, 20, 0.06),
    0 6px 14px -8px rgba(16, 24, 20, 0.2);
}

.fn-ui #mdlFrame .fn-market-status--live .fn-market-status__dot {
  background: var(--fn-market-up, var(--fn-up, #137333));
}

.fn-ui #mdlFrame .fn-market-status--closed {
  color: var(--fn-text-3);
}

.fn-ui #mdlFrame .fn-market-status--closed .fn-market-status__dot {
  background: var(--fn-text-3);
}

@media (prefers-reduced-motion: no-preference) {
  .fn-ui #mdlFrame .fn-market-status--live .fn-market-status__dot {
    animation: fn-market-pulse 1.8s ease-out infinite;
  }
}

:root:not([data-fn-theme="dark"]) .fn-ui #mdlFrame .fn-market-status:not(.fn-market-status--live) {
  background: var(--fn-gray-0);
}

:root[data-fn-theme="dark"] .fn-ui #mdlFrame .fn-market-status:not(.fn-market-status--live) {
  background: #1A211B;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.28);
}

:root[data-fn-theme="dark"] .fn-ui #mdlFrame .fn-market-status--live {
  background: var(--fn-up-bg, #10241A);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--fn-market-up, #5ED17C) 32%, transparent),
    0 1px 4px rgba(0, 0, 0, 0.28);
}

:root[data-fn-theme="soft"] .fn-ui #mdlFrame .fn-market-status:not(.fn-market-status--live) {
  background: var(--fn-bubble-bg, #FBFDF9);
}

@keyframes fn-market-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--fn-market-up, var(--fn-up, #137333)) 42%, transparent);
  }
  70% {
    box-shadow: 0 0 0 6px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* ---- Mobile -------------------------------------------------------------- */

@media (max-width: 767px) {
  .fn-ui #mdlFrame,
  .fn-ui .mainindex #mdlFrame {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    --fn-idx-chart-h: 28px;
    margin-bottom: 6px;
  }

  .fn-ui #mdlFrame .fn-market-status,
  .fn-ui #mdlFrame .indices-carousel-wrap.has-index-nav .fn-market-status {
    right: 3px;
    top: 5px;
    bottom: auto;
    transform: translateY(-50%);
    padding: 3px 9px 3px 7px;
    font-size: 11px;
  }

  .fn-ui #mdlFrame .indices-carousel-wrap {
    /* Same parent column as Hero — no extra horizontal inset. */
    padding: 0 !important;
    margin: 0 !important;
  }

  .fn-ui #mdlFrame .indices-carousel-wrap:has(> .fn-market-status:not([hidden])) {
    padding: 5px 4px 4px 0 !important;
    border: 1px solid var(--fn-bubble-border, var(--fn-border));
    border-left: 0;
    border-radius: 0 var(--fn-idx-plate-radius) var(--fn-idx-plate-radius) 0;
    box-shadow: none;
  }

  /* PHONE TUNING of the shared strip. Three cards fill the row, the same
     count the old carousel showed. The arrow gutter must not apply here:
     the buttons are hidden, but .has-index-nav is still set whenever the
     row overflows, and its 36px inline padding was the empty band on the
     right — and it also shrank the cards, because their width is a fraction
     of whatever is left after that padding. */

  .fn-ui #mdlFrame .indices-carousel-wrap.has-index-nav .fn-index-strip {
    padding-inline: 0;
    scroll-padding-inline: 0;
  }

  .fn-ui #mdlFrame .fn-index-strip > .item {
    flex: 0 0 auto;
    width: calc((100% - (2 * var(--fn-idx-gap))) / 3);
    min-width: 0;
  }
  /* Index cards take the same shell as every other bubble on the canvas. */
  .fn-ui #mdlFrame .fn-index-strip .fn-index-card {
    --fn-idx-card-bg: var(--fn-bubble-bg, var(--fn-bg-surface));
    border-radius: var(--fn-bubble-radius, var(--fn-idx-radius));
    background: var(--fn-bubble-bg, var(--fn-bg-surface));
    border-color: var(--fn-bubble-border, transparent) !important;
    box-shadow: var(--fn-bubble-shadow, none);
  }

  .fn-ui #mdlFrame .fn-index-strip .fn-index-card::before {
    border-radius: var(--fn-bubble-radius, var(--fn-idx-radius))
                   var(--fn-bubble-radius, var(--fn-idx-radius)) 0 0;
  }

  .fn-ui #mdlFrame .fn-index-card {
    padding: 0;
    max-height: none;
    aspect-ratio: auto;
  }

  .fn-ui #mdlFrame .fn-index-card:hover {
    transform: none;
    box-shadow: none;
  }

  .fn-ui #mdlFrame .fn-index-card:active {
    transform: scale(0.98);
    background: var(--fn-bg-hover);
  }

  /* Compact text band — sit above chart, no floating in empty air */
  .fn-ui #mdlFrame .fn-index-card .fn-index-card__top {
    flex: 0 0 auto;
    justify-content: flex-end;
    padding: 10px 6px 6px;
    gap: 3px;
    overflow: hidden;
  }

  .fn-ui #mdlFrame .fn-index-card__name,
  .fn-ui #mdlFrame .fn-index-card .sctitile {
    font-size: 13px;
    line-height: 1.2;
  }

  .fn-ui #mdlFrame .fn-index-card__cng,
  .fn-ui #mdlFrame .fn-index-card .sctitile2 {
    font-size: 17px;
    margin-top: 0;
    line-height: 1.15;
  }

  /* Phone cards are a third of the row; the corner figure steps down so
     a five-digit index level still leaves most of the line clear. */
  .fn-ui #mdlFrame .fn-index-card__rate {
    right: 3px;
    bottom: 2px;
    padding: 0 3px;
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .fn-ui #mdlFrame {
    --fn-idx-chart-h: 28px;
  }

  .fn-ui #mdlFrame .fn-index-card .fn-index-card__top {
    padding: 7px 5px 3px;
  }

  .fn-ui #mdlFrame .fn-index-card__name,
  .fn-ui #mdlFrame .fn-index-card .sctitile {
    font-size: 12px;
  }

  .fn-ui #mdlFrame .fn-index-card__cng,
  .fn-ui #mdlFrame .fn-index-card .sctitile2 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui #mdlFrame .fn-index-card,
  .fn-ui #mdlFrame .fn-index-card .schart.schart-drawing {
    transition: none;
  }

  .fn-ui #mdlFrame .fn-index-card:hover,
  .fn-ui #mdlFrame .fn-index-card:active {
    transform: none;
  }
}
