/* מניות ת"א-125: עולות ויורדות (homepage מבט מהיר). The figure is the
   point of the row: large, with the name on the right and the rank at the
   right edge. Two cards side by side, stacked on a phone. Flat tokens only
   — light and dark come from 01-tokens.css. */

/* The measure is the block's wrapper's, .fn-quick-block in 29-views.css,
   so the section header above the cards shares it. */
.fn-ui .fn-movers {
  margin: 0;
  padding: 6px 0 32px;
  font-family: var(--fn-font-sans);
  color: var(--fn-text-1);
  min-width: 0;
}

/* Loading / error / empty: one line, same voice as .fn-board__status. */
.fn-ui .fn-movers__status,
.fn-ui .fn-sectors__status {
  margin: 0;
  color: var(--fn-text-2);
  font-size: 13px;
}

.fn-ui .fn-movers__status:empty,
.fn-ui .fn-sectors__status:empty {
  display: none;
}

.fn-ui .fn-movers__cards {
  min-width: 0;
}

.fn-ui .fn-movers__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
}

.fn-ui .fn-movers__card {
  min-width: 0;
  padding: 12px 12px 2px;
  background: var(--fn-bubble-bg);
  border: 1px solid var(--fn-bubble-border);
  border-radius: var(--fn-radius-md);
  box-shadow: var(--fn-bubble-lift);
}

.fn-ui .fn-movers__card-title {
  margin: 0 2px 2px;
  font-size: 15px;
  font-weight: var(--fn-fw-bold);
  line-height: 1.3;
}

.fn-ui .fn-movers__card--up .fn-movers__card-title {
  color: var(--fn-up);
}

.fn-ui .fn-movers__card--down .fn-movers__card-title {
  color: var(--fn-down);
}

.fn-ui .fn-movers__empty {
  margin: 8px 2px 12px;
  font-size: var(--fn-fs-sm);
  color: var(--fn-text-3);
}

.fn-ui .fn-movers__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fn-ui .fn-movers__list > li + li {
  border-top: 1px solid var(--fn-border);
}

.fn-ui .fn-movers__link {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 9px 2px;
  border-radius: var(--fn-radius-compact);
  text-decoration: none;
  color: inherit;
}

/* Hover keeps the card's own surface and the name's own ink and underlines
   the name instead. Tinting the row with --fn-bg-hover took the name below
   4.5:1 in light and classic and the figure below it in dark. */
.fn-ui .fn-movers__link:hover {
  text-decoration: none;
}

.fn-ui .fn-movers__link:hover .fn-movers__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fn-ui .fn-movers__link:focus {
  outline: none;
}

.fn-ui .fn-movers__link:focus-visible {
  outline: 2px solid var(--fn-focus);
  outline-offset: 1px;
}

.fn-ui .fn-movers__rank {
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: var(--fn-fw-bold);
  line-height: 1;
  color: var(--fn-text-3);
  text-align: center;
}

.fn-ui .fn-movers__name {
  min-width: 0;
  font-size: 14.5px;
  font-weight: var(--fn-fw-semibold);
  line-height: 1.35;
  color: var(--fn-text-1);
  overflow-wrap: break-word;
}

.fn-ui .fn-movers__quote {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
}

.fn-ui .fn-movers__pct {
  display: block;
  font-family: var(--fn-font-num);
  font-weight: var(--fn-fw-extrabold);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Most traded: the turnover is the figure, the day's change sits under it. */
.fn-ui .fn-movers__turn {
  display: block;
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: var(--fn-fw-bold);
  line-height: 1.2;
  color: var(--fn-text-1);
  white-space: nowrap;
}

.fn-ui .fn-movers__sub {
  display: block;
  margin-top: 2px;
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: var(--fn-fw-bold);
  line-height: 1.2;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.fn-ui .fn-movers__pct--up {
  color: var(--fn-up);
}

.fn-ui .fn-movers__pct--down {
  color: var(--fn-down);
}

.fn-ui .fn-movers__pct--flat {
  color: var(--fn-text-2);
}

/* Market state bar: one quiet line above the cards. Live pulses a dot,
   closed and pre-open keep it still and neutral. */
.fn-ui .fn-qstate {
  margin-top: 6px;
  margin-bottom: 4px;
  font-family: var(--fn-font-ui);
  font-size: 13.5px;
  font-weight: var(--fn-fw-medium);
  line-height: 1.3;
  color: var(--fn-text-2);
}

.fn-ui .fn-qstate__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 8px;
  border-radius: 50%;
  background: var(--fn-text-3);
  vertical-align: middle;
}

.fn-ui .fn-qstate--live .fn-qstate__text {
  color: var(--fn-text-1);
}

.fn-ui .fn-qstate--live .fn-qstate__dot {
  background: var(--fn-up);
  animation: fn-qstate-pulse 1.8s ease-in-out infinite;
}

@keyframes fn-qstate-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Retry sits on the status line, beside the message. */
.fn-ui .fn-movers__retry {
  margin: 0;
  margin-inline-start: 8px;
}

/* Sector breadth: one line per sector — name, a bar of risers against
   fallers, the two counts, then the average moves where there is room. */
.fn-ui .fn-sectors {
  margin: 0;
  padding: 6px 0 32px;
  font-family: var(--fn-font-sans);
  color: var(--fn-text-1);
  min-width: 0;
}

.fn-ui .fn-sectors__list {
  list-style: none;
  margin: 0;
  padding: 4px 12px;
  background: var(--fn-bubble-bg);
  border: 1px solid var(--fn-bubble-border);
  border-radius: var(--fn-radius-md);
  box-shadow: var(--fn-bubble-lift);
}

.fn-ui .fn-sectors__list:empty {
  display: none;
}

.fn-ui .fn-sectors__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 88px;
  column-gap: 10px;
  align-items: center;
  padding: 9px 0;
  min-width: 0;
}

.fn-ui .fn-sectors__row + .fn-sectors__row {
  border-top: 1px solid var(--fn-border);
}

.fn-ui .fn-sectors__name {
  min-width: 0;
  font-size: 14px;
  font-weight: var(--fn-fw-semibold);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fn-ui .fn-sectors__bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--fn-border);
}

.fn-ui .fn-sectors__bar > i {
  display: block;
  flex-basis: 0;
  flex-shrink: 1;
  min-width: 2px;
}

.fn-ui .fn-sectors__up { background: var(--fn-up); }
.fn-ui .fn-sectors__down { background: var(--fn-down); }

.fn-ui .fn-sectors__cnt {
  display: flex;
  gap: 8px;
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: var(--fn-fw-bold);
  white-space: nowrap;
}

.fn-ui .fn-sectors__n--up { color: var(--fn-up); }
.fn-ui .fn-sectors__n--down { color: var(--fn-down); }

.fn-ui .fn-sectors__n--up::before { content: "▲ "; font-size: 9px; }
.fn-ui .fn-sectors__n--down::before { content: "▼ "; font-size: 9px; }

/* Average moves: only where the line has the room. */
.fn-ui .fn-sectors__avg {
  display: none;
  gap: 10px;
  font-family: var(--fn-font-num);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  white-space: nowrap;
}

/* Same order as the counts (risers first, on the same side), each figure
   read left-to-right on its own. */
.fn-ui .fn-sectors__avg > span {
  direction: ltr;
  unicode-bidi: isolate;
}

.fn-ui .fn-sectors__avg .fn-sectors__n--up::before,
.fn-ui .fn-sectors__avg .fn-sectors__n--down::before {
  content: none;
}

.fn-ui .fn-sectors__more {
  appearance: none;
  margin: 10px 0 0;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--fn-text-2) 35%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--fn-text-2);
  font-family: var(--fn-font-ui);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.fn-ui .fn-sectors__more[hidden] {
  display: none;
}

.fn-ui .fn-sectors__more:hover,
.fn-ui .fn-sectors__more:focus-visible {
  color: var(--fn-text-1);
  border-bottom-color: var(--fn-text-1);
}

.fn-ui .fn-sectors__more:focus-visible {
  outline: 2px solid var(--fn-focus);
  outline-offset: 2px;
}

/* Narrowest phones: the 88px count column stays (it holds 3+3 digit
   counts), so the bar and the gap give way to keep the sector name readable. */
@media (max-width: 359.98px) {
  .fn-ui .fn-sectors__row {
    grid-template-columns: minmax(0, 1fr) 32px 88px;
    column-gap: 6px;
  }
}

@media (min-width: 560px) {
  .fn-ui .fn-sectors__row {
    grid-template-columns: minmax(0, 1fr) 120px 88px 150px;
    column-gap: 14px;
  }

  .fn-ui .fn-sectors__avg {
    display: flex;
  }
}

@media (min-width: 768px) {
  .fn-ui .fn-movers__grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  .fn-ui .fn-movers__pct {
    font-size: 26px;
  }

  .fn-ui .fn-movers__name {
    font-size: 15px;
  }
}

@media (max-width: 359px) {
  .fn-ui .fn-movers__pct {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fn-ui .fn-movers__link {
    transition: none;
  }

  .fn-ui .fn-qstate--live .fn-qstate__dot {
    animation: none;
  }
}
