.market-pulse {
  color-scheme: light;
  --mp-bg: transparent;
  --mp-panel: #e9ebfa;
  --mp-row: #e8edff;
  --mp-blue: #2389ff;
  --mp-green: #0ebc73;
  --mp-red: #ff5260;
  --mp-ink: #171a22;
  --mp-muted: #778199;
  --mp-border: #e0e5f4;
}

.market-pulse-page {
  min-height: 100vh;
  margin: 0;
  color: var(--mp-ink);
  background: #e9edfb;
  font-family: UtoTimes, Tahoma, Arial, sans-serif;
}

.market-pulse-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.market-pulse {
  position: relative;
  width: min(100%, 1360px);
  overflow: hidden;
  color: var(--mp-ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: inherit;
}

.market-pulse *,
.market-pulse *::before,
.market-pulse *::after { box-sizing: border-box; }

.market-pulse button { font: inherit; }

.market-pulse__tabs {
  min-height: 92px;
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: clamp(24px, 4vw, 30px);
  padding: 0 0 23px;
  overflow-x: auto;
  scrollbar-width: none;
}

.market-pulse__tabs::-webkit-scrollbar { display: none; }

.market-pulse__tab {
  position: relative;
  flex: 0 0 auto;
  color: #15171d;
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 18px !important;
  font-weight: 700 !important;
  transition: color 180ms ease;
}

.market-pulse__tab::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  content: "";
  background: var(--mp-blue);
  border-radius: 3px;
  opacity: 0;
  transform: scaleX(.45);
  transition: 180ms ease;
}

.market-pulse__tab:hover,
.market-pulse__tab.is-active { color: var(--mp-blue); }
.market-pulse__tab.is-active::after { opacity: 1; transform: scaleX(1); }

.market-pulse__content {
  display: grid;
  grid-template-columns: minmax(430px, .95fr) minmax(0, 1.4fr);
  grid-template-areas: "list chart";
  gap: 28px;
  padding: 0 0 26px;
  direction: ltr;
}

.market-pulse__chart-panel {
  grid-area: chart;
  min-width: 0;
  overflow: hidden;
  background: var(--mp-panel);
  border-radius: 0;
}

.market-pulse__chart-head {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px 4px;
  direction: rtl;
}

.market-pulse__chart-head > div { display: flex; align-items: baseline; gap: 10px; }
.market-pulse__chart-head strong { font-size: 16px; }
.market-pulse__eyebrow { color: var(--mp-muted); font-size: 12px; }
.market-pulse__last-value { direction: ltr; }
.market-pulse__last-value span { color: var(--mp-green); font-size: 13px; font-weight: 700; }
.market-pulse__last-value.is-negative span { color: var(--mp-red); }

.market-pulse__canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 760 / 410;
  min-height: 330px;
}

.market-pulse__canvas svg { display: block; width: 100%; height: 100%; overflow: visible; }
.market-pulse__grid line { stroke: #e8ebf5; stroke-width: 1; }
.market-pulse__grid text,
.market-pulse__axis text { fill: #778199; font-size: 13px; font-family: inherit; }
.market-pulse__axis text { text-anchor: middle; }

.market-pulse__line,
.market-pulse__forecast,
.market-pulse__area {
  vector-effect: non-scaling-stroke;
}

.market-pulse__line { fill: none; stroke: #30343d; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.market-pulse__forecast { fill: none; stroke: var(--mp-blue); stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.market-pulse__area { fill: url("#market-pulse-fill"); opacity: .22; stroke: none; }
.market-pulse__divider { stroke: #98a2b9; stroke-width: 1; stroke-dasharray: 5 8; }
.market-pulse__volumes line { stroke: #4b505c; stroke-width: 1.4; opacity: .62; }
.market-pulse__cursor { opacity: 0; pointer-events: none; transition: opacity 120ms; }
.market-pulse__cursor line { stroke: #8f9bb2; stroke-width: 1; stroke-dasharray: 3 4; }
.market-pulse__cursor circle { fill: #fff; stroke: var(--mp-blue); stroke-width: 2.5; }
.market-pulse__canvas:hover .market-pulse__cursor { opacity: 1; }

.market-pulse__tooltip {
  position: absolute;
  z-index: 3;
  min-width: 94px;
  padding: 8px 10px;
  color: #fff;
  background: rgb(25 30 41 / 90%);
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
  pointer-events: none;
  transform: translate(-50%, -115%);
  box-shadow: 0 7px 20px rgb(18 25 44 / 18%);
}

.market-pulse__ranges {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 8px;
  padding: 7px 16px;
  direction: rtl;
  background: #e9eeff;
}

.market-pulse__ranges button {
  padding: 8px 10px;
  color: #7693bb;
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.market-pulse__ranges button:hover { background: rgb(255 255 255 / 50%); }
.market-pulse__ranges button.is-active { color: #354b70; font-weight: 700; background: rgb(255 255 255 / 68%); }

.market-pulse__watchlist {
  grid-area: list;
  align-self: start;
  height: 532px;
  max-height: 532px;
  min-height: 490px;
  overflow: auto;
  direction: rtl;
  background: var(--mp-panel);
  border-radius: 0;
  scrollbar-color: #cbd4eb transparent;
  scrollbar-width: thin;
}

.market-pulse__watchlist::-webkit-scrollbar { width: 7px; height: 7px; }
.market-pulse__watchlist::-webkit-scrollbar-track { background: transparent; }
.market-pulse__watchlist::-webkit-scrollbar-thumb { background: #cbd4eb; border-radius: 10px; }

.market-pulse__table-head,
.market-pulse__row {
  display: grid;
  grid-template-columns: var(--mp-columns, repeat(4, minmax(100px, 1fr)));
  align-items: center;
  gap: 12px;
  min-width: var(--mp-table-width, 100%);
  direction: rtl;
}

.market-pulse__table-head {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 42px;
  padding: 0 24px;
  color: #9199aa;
  background: var(--mp-panel);
  font-size: 11px;
}

.market-pulse__table-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-pulse__list {
  padding-inline-start: 7px;
}

.market-pulse__row {
  width: 100%;
  min-height: 73px;
  padding: 0 24px;
  color: var(--mp-ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--mp-border);
  cursor: pointer;
  text-align: right;
  transition: background 160ms ease;
}

.market-pulse__row:hover { background: rgb(232 237 255 / 55%); }
.market-pulse__row.is-active { background: var(--mp-row); }
.market-pulse__row-name { font-weight: 700; }
.market-pulse__row-price { direction: ltr; text-align: right; color: #353a46; }
.market-pulse__row-change,
.market-pulse__row-percent { direction: ltr; text-align: center; color: var(--mp-green); font-weight: 700; }
.market-pulse__row.is-negative .market-pulse__row-change,
.market-pulse__row.is-negative .market-pulse__row-percent { color: var(--mp-red); }

.market-pulse__cell {
  overflow: hidden;
  color: #353a46;
  direction: ltr;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-pulse__cell:first-child { color: var(--mp-ink); font-weight: 700; }
.market-pulse__cell.is-positive { color: var(--mp-green); font-weight: 700; }
.market-pulse__cell.is-negative { color: var(--mp-red); font-weight: 700; }

.market-pulse__empty {
  min-width: 100%;
  padding: 58px 24px;
  color: var(--mp-muted);
  font-size: 14px;
  text-align: center;
}

.market-pulse__status {
  min-height: 20px;
  margin: -12px 32px 18px;
  color: var(--mp-muted);
  font-size: 13px;
  text-align: center;
}

.market-pulse__status.is-error { color: var(--mp-red); }

.market-pulse__loading {
  position: absolute;
  z-index: 20;
  inset: 92px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #596174;
  background: rgb(240 243 255 / 78%);
  font-size: 14px;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.market-pulse__loading[hidden] { display: none; }

.market-pulse__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #d7dff3;
  border-top-color: var(--mp-blue);
  border-radius: 50%;
  animation: market-pulse-spin 750ms linear infinite;
}

@keyframes market-pulse-spin { to { transform: rotate(1turn); } }

@media (max-width: 960px) {
  .market-pulse__content { grid-template-columns: 1fr; grid-template-areas: "chart" "list"; }
  .market-pulse__watchlist { width: 100%; height: 370px; min-height: 0; max-height: 370px; }
}

@media (max-width: 600px) {
  .market-pulse-shell { padding: 0; }
  .market-pulse { border-radius: 0; }
  .market-pulse__tabs { min-height: 76px; gap: 26px; padding: 0 0 16px; }
  .market-pulse__loading { inset-block-start: 76px; }
  .market-pulse__tab { font-size: 16px; }
  .market-pulse__content { gap: 16px; padding: 0 0 14px; }
  .market-pulse__chart-head { padding-inline: 14px; }
  .market-pulse__eyebrow { display: none; }
  .market-pulse__canvas { min-height: 280px; }
  .market-pulse__ranges { justify-content: flex-start; overflow-x: auto; }
  .market-pulse__table-head,
  .market-pulse__row { padding-inline: 14px; }
  .market-pulse__status { margin-inline: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-pulse *, .market-pulse *::before, .market-pulse *::after { transition-duration: 0.01ms !important; }
}
