.discover-intro {
  margin-bottom: 12px;
}

.market-ticker {
  height: 38px;
  margin: -2px 0 12px;
  border: 1px solid #dbe9f4;
  border-radius: 13px;
  background: #f3f8fc;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  overflow: hidden;
}

.market-ticker-live {
  height: 100%;
  padding: 0 10px;
  border-right: 1px solid #dbe9f4;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #0a8f68;
  background: #fff;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .04em;
  z-index: 1;
}

.market-ticker-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20c98b;
  box-shadow: 0 0 0 4px rgba(32, 201, 139, .11);
}

.market-ticker-viewport {
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.market-ticker-track {
  width: max-content;
  display: flex;
  align-items: center;
  animation: market-ticker-move 36s linear infinite;
  will-change: transform;
}

.ticker-sequence {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-right: 22px;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 10px;
}

.ticker-item b { font-size: 10px; }
.ticker-item strong { font-size: 10px; }
.ticker-item em { font-size: 9px; font-style: normal; font-weight: 850; }
.ticker-item em.up,
.market-change-text.up { color: #0b986b; }
.ticker-item em.down,
.market-change-text.down { color: #d84b59; }
.ticker-item em.flat,
.market-change-text.flat { color: var(--muted); }

.ticker-placeholder {
  padding: 0 14px;
  color: var(--muted);
  font-size: 10px;
}

.market-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 10px 28px rgba(8, 53, 102, .05);
}

.common-market-section {
  padding-bottom: 11px;
  margin-bottom: 12px;
}

.common-market-strip {
  min-height: 126px;
  margin: 11px -14px 0;
  padding: 0 14px 3px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 14px;
  scrollbar-width: none;
}

.common-market-strip::-webkit-scrollbar { display: none; }

.common-market-card {
  flex: 0 0 calc((100% - 10px) / 2);
  min-width: 0;
  min-height: 122px;
  padding: 13px 12px;
  border: 1px solid #e3edf5;
  border-radius: 17px;
  background: #f8fbfd;
  color: var(--ink);
  display: grid;
  align-content: space-between;
  gap: 9px;
  text-align: left;
  scroll-snap-align: start;
}

.common-market-card-top {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.common-market-card .market-token-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.common-market-card-top > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.common-market-card-top b { font-size: 13px; }
.common-market-card-top small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-market-card > strong {
  overflow: hidden;
  font-size: 17px;
  letter-spacing: -.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.common-market-card > em {
  width: max-content;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.common-market-card > em.up { color: #0b986b; background: #eaf8f2; }
.common-market-card > em.down { color: #d84b59; background: #fff0f2; }
.common-market-card > em.flat { color: var(--muted); background: #eef2f5; }

.compact-loading {
  flex: 1 0 100%;
  min-height: 94px;
}

.market-heading,
.discover-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.market-heading > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.market-heading h2,
.discover-section-heading h2 {
  margin: 0;
  font-size: 17px;
}

.market-heading small {
  font-size: 10px;
  color: var(--muted);
}

.market-heading > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 900;
}

.market-heading > span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1ec98b;
  box-shadow: 0 0 0 4px rgba(30, 201, 139, .1);
}

.contract-watch-form {
  height: 42px;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  margin: 12px 0 5px;
  border-radius: 13px;
  background: #f3f6f8;
  overflow: hidden;
}

.contract-watch-form > span {
  display: grid;
  place-items: center;
}

.contract-watch-form img {
  width: 18px;
  height: 18px;
}

.contract-watch-form input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12px;
}

.contract-watch-form button {
  height: 30px;
  margin-right: 6px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.contract-watch-form button:disabled {
  opacity: .55;
}

.market-list {
  display: grid;
}

.market-row {
  display: grid;
  grid-template-columns: 1fr 28px;
  align-items: center;
  border-bottom: 1px solid #edf2f6;
}

.market-row:last-child {
  border-bottom: 0;
}

.market-row-main {
  min-width: 0;
  min-height: 64px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 39px minmax(62px, 1fr) minmax(74px, auto) 51px;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.market-token-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eef6fc;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.market-token-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.market-token-icon i {
  font-style: normal;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.market-token-name,
.market-token-price {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.market-token-name b,
.market-token-price b {
  font-size: 13px;
}

.market-token-name small,
.market-token-price small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9px;
}

.market-token-price {
  text-align: right;
}

.market-row-main > em {
  justify-self: end;
  min-width: 46px;
  padding: 6px 4px;
  border-radius: 9px;
  text-align: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.market-row-main > em.up {
  color: #0b986b;
  background: #eaf8f2;
}

.market-row-main > em.down {
  color: #d84b59;
  background: #fff0f2;
}

.market-row-main > em.flat {
  color: var(--muted);
  background: #f1f4f7;
}

.market-unwatch {
  width: 27px;
  height: 27px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  opacity: .45;
}

.market-unwatch img {
  width: 14px;
  height: 14px;
}

.market-source {
  margin: 4px 0 0;
  text-align: right;
  color: var(--muted);
  font-size: 9px;
}

.market-loading,
.market-empty {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
}

.market-loading > span {
  width: 24px;
  height: 24px;
  border: 2px solid #d9e8f4;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: market-spin .8s linear infinite;
}

.market-loading b,
.market-empty b {
  font-size: 11px;
}

.market-empty > span img {
  width: 25px;
  height: 25px;
}

.market-empty small {
  font-size: 10px;
}

.discover-section-heading {
  margin: 0 2px 9px;
}

.discover-section-heading button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
}

.dapp-search {
  height: 40px;
  margin-bottom: 9px;
  border-radius: 13px;
  background: #f3f6f8;
  border: 0;
}

.market-detail-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
}

.market-detail-head .market-token-icon {
  width: 48px;
  height: 48px;
}

.market-detail-head p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.market-detail-head b {
  font-size: 21px;
}

.market-detail-head small {
  font-size: 11px;
  color: var(--muted);
}

.market-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.market-stat-grid > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.market-stat-grid small {
  color: var(--muted);
  font-size: 10px;
}

.market-stat-grid b {
  font-size: 13px;
}

.market-contract-copy {
  width: 100%;
  min-height: 40px;
  margin-bottom: 10px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f6f9fb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: ui-monospace, monospace;
  font-size: 10px;
}

.market-contract-copy img {
  width: 17px;
  height: 17px;
}

.modal.market-pro-modal {
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: 100%;
  padding: calc(8px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  border-radius: 0;
  overscroll-behavior: contain;
}

.market-pro-modal .modal-header {
  position: sticky;
  top: calc(-8px - env(safe-area-inset-top));
  z-index: 5;
  min-height: 54px;
  margin: calc(-8px - env(safe-area-inset-top)) -16px 0;
  padding: calc(8px + env(safe-area-inset-top)) 16px 7px;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(219,229,237,.75);
  backdrop-filter: blur(16px);
}

.market-pro-modal .modal-header::before { display: none; }
.market-pro-modal .modal-header h2 { margin-top: 7px; }
.market-pro-modal .modal-close { margin-top: 7px; }

.market-pro-shell {
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.market-pro-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 11px;
}

.market-pro-head > .market-token-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.market-pro-head > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 9px;
}

.market-pro-head small {
  grid-column: 1 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-pro-head b {
  overflow: hidden;
  margin-top: 4px;
  font-size: 23px;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-pro-head em {
  padding-bottom: 3px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.market-pro-head em.up { color: #0b986b; }
.market-pro-head em.down { color: #d84b59; }
.market-pro-head em.flat { color: var(--muted); }

.market-pro-head > button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f8fb;
  display: grid;
  place-items: center;
}

.market-pro-head > button img { width: 18px; height: 18px; }

.market-intervals {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 13px;
  background: #f1f5f8;
}

.market-intervals button {
  height: 31px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.market-intervals button.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 3px 12px rgba(14,55,90,.09);
}

.market-chart-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
}

.market-chart-legend {
  min-height: 38px;
  padding: 10px 11px 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.market-chart-legend span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .08em;
}

.market-chart-legend b {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-candle-stage {
  width: 100%;
  min-height: 294px;
  background: #fff;
}

.market-chart-loading,
.market-chart-empty {
  min-height: 294px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
}

.market-chart-loading > span {
  width: 25px;
  height: 25px;
  border: 2px solid #d9e8f4;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: market-spin .8s linear infinite;
}

.market-chart-loading b,
.market-chart-empty b { font-size: 11px; }
.market-chart-empty > span img { width: 26px; height: 26px; }
.market-chart-empty small { font-size: 9px; }
.market-chart-empty button {
  min-width: 92px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

.market-chart-panel > footer {
  min-height: 34px;
  padding: 6px 10px 9px;
  border-top: 1px solid #edf2f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 8px;
}

.market-chart-panel > footer span { display: flex; align-items: center; gap: 5px; }
.market-chart-panel > footer i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #20c98b;
  box-shadow: 0 0 0 3px rgba(32,201,139,.11);
}

.market-pro-stats { margin-bottom: 0; }

.market-chart-attribution {
  color: var(--muted);
  text-align: center;
  font-size: 8px;
}

.market-chart-attribution a { color: var(--blue); text-decoration: none; }

html[data-theme="dark"] .market-pro-modal .modal-header {
  background: rgba(17,27,33,.94);
  border-color: #273842;
}

html[data-theme="dark"] .market-pro-head > button,
html[data-theme="dark"] .market-intervals { background: #17232a; border-color: #2a3a43; }
html[data-theme="dark"] .market-intervals button.active { background: #263640; color: #7bd4ff; box-shadow: none; }
html[data-theme="dark"] .market-chart-panel,
html[data-theme="dark"] .market-candle-stage { background: #111b21; border-color: #2a3a43; }
html[data-theme="dark"] .market-chart-panel > footer { border-color: #25353e; }
html[data-theme="dark"] .market-pro-stats > div,
html[data-theme="dark"] .market-contract-copy { background: #17232a; border-color: #2a3a43; }

@keyframes market-spin {
  to { transform: rotate(360deg); }
}

@keyframes market-ticker-move {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .market-ticker-viewport { overflow-x: auto; }
  .market-ticker-track { animation: none; }
  .market-ticker-track .ticker-sequence[aria-hidden="true"] { display: none; }
}
