.markets-page #markets {
  min-width: 0;
  --markets-card: var(--card);
  --markets-border: color-mix(in srgb, var(--ink) 14%, var(--markets-card));
  --markets-soft: color-mix(in srgb, var(--ink) 7%, var(--markets-card));
  --markets-muted: color-mix(in srgb, var(--ink) 72%, var(--markets-card));
  --markets-ink: var(--ink);
  --markets-yes: #16613b;
  --markets-no: #9c2b24;
  --markets-yes-soft: #dff2e8;
  --markets-no-soft: #fbe3df;
  --markets-link: var(--accent-ink, var(--ink));
  color: var(--markets-ink);
}

.markets-page #markets .discovery-toolbar {
  margin-bottom: 18px;
  min-width: 0;
}

.markets-page #markets .category-row {
  gap: 5px;
  min-width: 0;
}

.markets-page #markets .category-row button {
  border: 1px solid transparent;
  box-shadow: none;
  border-radius: 999px;
  background: transparent;
  color: var(--markets-ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.035em;
  min-height: 38px;
  padding-inline: 12px;
  text-transform: uppercase;
}

.markets-spotlight:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.markets-spotlight:has(> :first-child:not([hidden]) + :not([hidden])) {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.markets-carousel {
  position: relative;
  min-width: 0;
  min-height: 400px;
  overflow: hidden;
  border: 1px solid var(--markets-border);
  border-radius: 20px;
  background: var(--markets-card);
  touch-action: pan-y;
}

.markets-carousel [data-carousel-slide] {
  min-width: 0;
}

.markets-featured-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr);
  gap: clamp(16px, 2vw, 26px);
  min-height: 400px;
  padding: 22px 24px 51px;
}

.markets-featured-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.markets-featured-meta,
.markets-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--markets-muted);
  font-size: 12px;
}

.markets-featured-meta .trade-share {
  margin-inline-start: auto;
}

.market-spotlight-tag {
  border-radius: 5px;
  padding: 3px 8px;
  color: var(--ink);
  background: var(--markets-soft);
  font-weight: 750;
  font-size: 12px;
}

.markets-featured-copy h2 {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.markets-title-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font: inherit;
  overflow-wrap: anywhere;
}

.markets-title-button:hover,
.markets-group-more:hover,
.markets-group-option:hover {
  text-decoration: underline;
}

.markets-featured-chance {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--markets-muted);
}

.markets-featured-chance strong {
  color: var(--ink);
  font-size: 52px;
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.markets-chance-change {
  color: var(--markets-yes);
  white-space: nowrap;
}

.markets-chance-change.is-negative {
  color: var(--markets-no);
}

.markets-chance-change.is-flat {
  color: var(--markets-muted);
}

.markets-featured-description {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 2px 0 16px;
  max-width: 36ch;
  color: var(--markets-muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.markets-featured-options,
.markets-featured-copy > .markets-quote-actions {
  margin-top: auto;
}

.markets-featured-options button,
.markets-group-option,
.markets-group-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.markets-featured-options button {
  min-height: 39px;
  border-top: 1px solid var(--markets-border);
}

.markets-featured-options button span:first-child,
.markets-group-option span,
.markets-movers button > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.markets-featured-options .markets-group-more,
.markets-group-more {
  color: var(--markets-link);
  font-size: 12px;
  font-weight: 750;
}

.markets-quote-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.markets-quote-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--markets-yes);
  background: var(--markets-yes-soft);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.markets-quote-actions .markets-quote-no {
  color: var(--markets-no);
  background: var(--markets-no-soft);
}

.markets-quote-actions button:disabled {
  opacity: 0.55;
}

.markets-quote-actions button:not(:disabled):hover {
  border-color: currentColor;
}

.markets-featured-body .markets-quote-actions button {
  min-height: 42px;
  font-size: 14px;
}

.markets-carousel-controls {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.markets-carousel-controls[hidden] {
  display: none;
}

.markets-carousel-button {
  display: grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  padding: 0 5px;
  border: 1px solid var(--markets-border);
  border-radius: 8px;
  color: var(--ink);
  background: var(--markets-soft);
  font:
    750 16px/1 system-ui,
    sans-serif;
}

.markets-carousel-button:hover {
  border-color: currentColor;
}

.markets-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-width: 0;
}

.markets-carousel-dots .markets-carousel-button {
  min-width: 19px;
  height: 27px;
  border: 0;
  background: transparent;
}

.markets-carousel-dots button::before {
  width: 6px;
  height: 6px;
  border-radius: 8px;
  background: currentColor;
  opacity: 0.5;
  content: "";
}

.markets-carousel-dots button[aria-current="true"]::before {
  width: 17px;
  opacity: 1;
}

.markets-carousel-progress {
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  pointer-events: none;
}

.markets-carousel-progress > div {
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.markets-promotions {
  min-height: 400px;
  background: #0b0b0b;
}

.markets-promotions:not([hidden]) {
  display: grid;
}

.markets-spotlight.is-filtered .markets-promotions,
.markets-spotlight > .markets-featured[hidden] + .markets-promotions {
  min-height: 230px;
}

.markets-promotions [data-carousel-slide] {
  position: relative;
  display: grid;
}

.markets-promotion-image {
  position: absolute;
  inset: 0;
  min-width: 0;
}

.markets-promotion-image {
  display: grid;
  place-items: center;
  padding-bottom: 41px;
  color: white;
  text-align: center;
}

.markets-promotions:has([data-carousel-controls][hidden])
  .markets-promotion-image {
  padding-bottom: 0;
}

.markets-promotion-image img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.markets-promotions .markets-carousel-controls {
  left: 16px;
}

.markets-promotions .markets-carousel-button {
  color: white;
  border-color: #fff3;
  background: #fff2;
}

.markets-promotions .markets-carousel-dots {
  margin-inline-end: auto;
  max-height: 42px;
  overflow: auto;
}

.markets-promotions .markets-carousel-dots button {
  background: transparent;
  height: 27px;
  border: 0;
}

body:has(.markets-page:not([hidden]) #markets:not([hidden])) main {
  width: min(1217px, calc(100% - 48px));
  padding: 0;
}

html[data-theme="dark"] .markets-page #markets {
  --markets-card: var(--paper);
  --markets-ink: color-mix(in srgb, var(--ink) 55%, white);
  --markets-muted: color-mix(
    in srgb,
    var(--markets-ink) 68%,
    var(--markets-card)
  );
  --markets-yes: #81d7a6;
  --markets-no: #ff9e92;
  --markets-yes-soft: #1b3429;
  --markets-no-soft: #392321;
  --markets-link: var(--accent);
}

body:has(.markets-page:not([hidden]) #markets:not([hidden])) .app-shell {
  background: color-mix(in srgb, var(--paper) 50%, #edf0f1);
}

html[data-theme="dark"]
  body:has(.markets-page:not([hidden]) #markets:not([hidden]))
  .app-shell {
  background: color-mix(in srgb, var(--paper) 55%, black);
}

.markets-page #markets .category-row button.active,
.markets-page #markets .category-row button[aria-pressed="true"],
.markets-page #markets .category-row button:hover {
  color: var(--markets-ink);
  background: var(--markets-soft);
  border-color: var(--markets-border);
}

.markets-featured-body .markets-quote-yes {
  background: #d9f2e3;
  color: #165e36;
}

.markets-featured-body .markets-quote-no {
  background: #fde0e0;
  color: #952521;
}

.markets-featured-meta .trade-share {
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  color: var(--markets-muted);
}

.markets-spotlight.is-filtered .markets-promotion-image {
  padding-bottom: 38px;
}

.markets-promotions:has(.market-category-banner) .markets-carousel-button {
  background: #0004;
}

.markets-promotions:has(.market-category-banner) .markets-carousel-dots button {
  background: transparent;
}

@media (max-width: 1040px) {
  .markets-spotlight:has(> :first-child:not([hidden]) + :not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 242px;
  }
  .markets-featured-body {
    gap: 16px;
    padding-inline: 18px;
  }
}

@media (max-width: 600px) {
  body:has(.markets-page:not([hidden]) #markets:not([hidden])) main {
    width: calc(100% - 32px);
  }
  .markets-page #markets {
    padding-inline: 0;
  }
  .markets-featured-chance strong {
    font-size: 43px;
  }
}
