:root {
  --market-bg: #090204;
  --market-panel: #10080b;
  --market-panel-strong: #13090d;
  --market-line: rgba(135, 55, 70, .42);
  --market-line-soft: rgba(135, 55, 70, .24);
  --market-red: #f73552;
  --market-red-dark: #8f172d;
  --market-muted: #9f9296;
}

body {
  background:
    radial-gradient(900px 520px at 82% -160px, rgba(139, 18, 43, .16), transparent 72%),
    radial-gradient(760px 440px at 5% 22%, rgba(94, 9, 30, .1), transparent 70%),
    var(--market-bg);
}

.topbar {
  border-bottom-color: rgba(126, 45, 61, .34);
  background: rgba(8, 3, 5, .94);
  backdrop-filter: blur(16px);
}

.market-page.wrap {
  width: min(1620px, calc(100% - 48px));
  max-width: none;
  padding-top: 22px;
}

.market-head {
  display: none;
}

.token-profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(310px, 1.05fr) minmax(480px, 1.2fr) minmax(280px, .75fr);
  align-items: center;
  gap: 0;
  min-height: 128px;
  margin-bottom: 14px;
  padding: 18px 22px;
  overflow: hidden;
  border-color: var(--market-line);
  border-radius: 16px;
  background:
    radial-gradient(420px 150px at 86% 0%, rgba(120, 15, 38, .13), transparent 75%),
    linear-gradient(112deg, rgba(21, 9, 14, .99), rgba(10, 6, 8, .99));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 18px 48px rgba(0, 0, 0, .2);
}

.token-profile::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #ff405b, #8f172d);
  box-shadow: 0 0 22px rgba(247, 53, 82, .35);
}

.token-profile-identity {
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding-right: 28px;
}

.token-profile-icon {
  flex-basis: 76px;
  width: 76px;
  height: 76px;
  border-color: rgba(247, 53, 82, .52);
  border-radius: 18px;
  background: linear-gradient(145deg, #16090d, #090607);
  box-shadow: inset 0 0 28px rgba(209, 25, 54, .12), 0 10px 28px rgba(0, 0, 0, .3);
  font-size: 28px;
}

.token-profile-kicker {
  display: none;
}

.token-profile-copy {
  min-width: 0;
}

.token-profile h2 {
  margin: 0;
  font-size: clamp(25px, 2.2vw, 36px);
  letter-spacing: -.045em;
}

.token-profile h2::after {
  content: '$' attr(data-symbol);
  display: inline-block;
  margin-left: 10px;
  color: #b7a9ad;
  font-size: .52em;
  font-weight: 600;
  letter-spacing: .01em;
}

.token-profile-description {
  max-width: 560px;
  margin-top: 6px;
  overflow: hidden;
  color: #a6979c;
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-socials {
  min-height: 24px;
  margin-top: 9px;
}

.token-socials a.social-icon-link {
  width: 24px;
  height: 24px;
  border-radius: 7px;
}

.token-socials .token-social-empty {
  color: #74676b;
  font-size: 9px;
}

.token-profile-market {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  min-width: 0;
  min-height: 76px;
  padding: 0 16px;
  border-right: 1px solid var(--market-line-soft);
  border-left: 1px solid var(--market-line-soft);
}

.token-profile-stat {
  min-width: 0;
  padding: 0 16px;
}

.token-profile-stat + .token-profile-stat {
  border-left: 1px solid var(--market-line-soft);
}

.token-profile-stat span,
.token-profile-stat strong {
  display: block;
}

.token-profile-stat span {
  color: #8e7f84;
  font: 700 9px/1 Manrope, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.token-profile-stat strong {
  margin-top: 9px;
  overflow: hidden;
  color: #fff;
  font: 800 clamp(17px, 1.65vw, 25px)/1.1 Manrope, sans-serif;
  letter-spacing: -.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-profile-change strong,
.token-profile-change strong.positive {
  color: #45df97;
}

.token-profile-change strong.negative {
  color: #ff6778;
}

.token-profile-facts {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  min-width: 0;
  padding-left: 24px;
}

.token-profile-fact {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  grid-column: 1;
  min-height: 48px;
  box-sizing: border-box;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--market-line-soft);
  border-radius: 0;
  background: transparent;
}

.token-profile-fact:last-of-type {
  border-bottom: 0;
}

.token-profile-fact span {
  color: #8e7f84;
  font: 700 9px/1 Manrope, sans-serif;
  letter-spacing: .08em;
}

.token-profile-fact b {
  margin: 0;
  min-width: 0;
  color: #ff7181;
  font-size: 11px;
}

.token-profile-fact .token-ca-row,
.token-fact-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.token-profile-fact .token-ca-row a,
.token-fact-value-row > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-profile-fact code {
  color: #ff7181;
  font-size: 10px;
}

.token-trust-badge {
  display: inline-flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(45, 190, 112, .48);
  border-radius: 999px;
  background: rgba(20, 107, 61, .13);
  color: #45df97;
  font: 800 8px/1 Manrope, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.token-trust-badge svg {
  width: 13px;
  height: 13px;
  fill: rgba(69, 223, 151, .18);
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.token-trust-badge.external {
  border-color: var(--market-line-soft);
  background: rgba(255, 255, 255, .025);
  color: #a99ca0;
}

.token-profile-hidden-facts {
  display: none;
}

.market-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--market-line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 10, 13, .96), rgba(10, 7, 8, .96));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025);
}

.market-stat {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 62px;
  padding: 10px 24px;
}

.market-stat + .market-stat::before {
  content: '';
  position: absolute;
  top: 13px;
  bottom: 13px;
  left: 0;
  width: 1px;
  background: var(--market-line-soft);
}

.market-stat span {
  color: var(--market-muted);
  font: 500 10px/1.2 'DM Sans', sans-serif;
}

.market-stat strong {
  margin-top: 5px;
  overflow: hidden;
  color: #fff;
  font: 800 clamp(15px, 1.3vw, 20px)/1.15 Manrope, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1450px) and (min-width: 1261px) {
  .token-trust-badge {
    padding: 6px;
  }
  .token-trust-badge span {
    display: none;
  }
}

.market-grid {
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 14px;
  align-items: start;
}

.market-main-column {
  gap: 14px;
}

.market-chart,
.market-chart iframe {
  min-height: 520px;
  height: 520px;
}

.market-chart {
  border-color: var(--market-line);
  border-radius: 14px;
  background: #0c0d11;
}

.market-chart-note {
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-color: rgba(134, 69, 81, .42);
  background: rgba(8, 7, 9, .82);
  backdrop-filter: blur(10px);
}

.trade-box {
  position: sticky;
  top: 90px;
  box-sizing: border-box;
  padding: 18px;
  border-color: var(--market-line);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(20, 11, 14, .99), rgba(10, 7, 9, .99));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 22px 70px rgba(0, 0, 0, .2);
}

.trade-box h2 {
  font-size: 25px;
  letter-spacing: -.025em;
}

.trade-box > p {
  margin-top: 4px;
  margin-bottom: 15px;
}

.order-type-tabs {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid #2f151a;
  border-radius: 999px;
  background: #160e10;
}

.order-type-tabs::before,
.trade-tabs::before,
.conditional-side-tabs::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--segment-w, 0px);
  border: 0;
  border-radius: 999px;
  background: #281016;
  box-shadow: inset 0 0 0 1px #6f2230, 0 5px 14px rgba(0, 0, 0, .18);
  pointer-events: none;
  transform: translate3d(var(--segment-x, 0px), 0, 0);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), width .3s cubic-bezier(.2, .8, .2, 1);
}

.order-type-tabs.segment-instant::before,
.trade-tabs.segment-instant::before,
.conditional-side-tabs.segment-instant::before {
  transition: none;
}

.order-type-tabs button {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #968b8d;
  font: 600 12px/1 Manrope, sans-serif;
  cursor: pointer;
  transition: color .18s ease, transform .14s ease;
}

.order-type-tabs button:hover {
  background: transparent;
  color: #fff;
}

.order-type-tabs button.active {
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.order-type-note {
  margin: 8px 2px 14px !important;
  color: #81757a !important;
  font-size: 9px !important;
}

.trade-tabs {
  position: relative;
  isolation: isolate;
  gap: 2px;
  padding: 4px;
  border: 1px solid #2f151a;
  border-radius: 999px;
  background: #160e10;
}

.trade-tabs button {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #968b8d;
  font: 600 12px/1 Manrope, sans-serif;
  cursor: pointer;
  transition: color .18s ease, transform .14s ease;
}

.trade-tabs button:hover {
  background: transparent;
  color: #fff;
}

.trade-tabs button.active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.conditional-side-tabs {
  position: relative;
  isolation: isolate;
  gap: 2px;
  padding: 4px;
  border: 1px solid #2f151a;
  border-radius: 999px;
  background: #160e10;
}

.conditional-side-tabs button {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #968b8d;
  font-weight: 600;
  transition: color .18s ease, transform .14s ease;
}

.conditional-side-tabs button.active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: #fff;
}

.order-type-tabs button.segment-pressed,
.trade-tabs button.segment-pressed,
.conditional-side-tabs button.segment-pressed {
  animation: market-segment-press .24s cubic-bezier(.22, 1, .36, 1);
}

@keyframes market-segment-press {
  0% { transform: scale(1); }
  45% { transform: scale(.96); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .order-type-tabs::before,
  .trade-tabs::before,
  .conditional-side-tabs::before {
    transition: none;
  }

  .order-type-tabs button.segment-pressed,
  .trade-tabs button.segment-pressed,
  .conditional-side-tabs button.segment-pressed {
    animation: none;
  }
}

.trade-balance {
  margin-bottom: 10px;
}

.trade-input input {
  height: 54px;
  border-color: var(--market-line-soft);
  border-radius: 10px;
  background: rgba(5, 4, 5, .66);
  font-size: 17px;
}

.trade-input span {
  top: 18px;
}

.trade-input .trade-asset-inline {
  position: static !important;
  inset: auto !important;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transform: translateY(-.06em);
}

.trade-asset-inline img,
.trade-asset-fallback {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 50%;
  object-fit: cover;
}

.trade-asset-fallback {
  background: linear-gradient(145deg, #ff405b, #8f1028);
  color: #fff;
  font: 800 8px/1 Manrope, sans-serif;
  font-style: normal;
}

.trade-asset-fallback[hidden] {
  display: none;
}

.trade-quote {
  min-height: 22px;
  align-items: center;
  padding: 8px 2px;
  border-top-color: rgba(100, 61, 69, .28);
}

.trade-action,
.conditional-order-action,
.creator-reward-action {
  min-height: 46px;
  border-radius: 9px;
  background: linear-gradient(135deg, #ff405b, #d61539);
  box-shadow: 0 12px 30px rgba(201, 19, 54, .2);
}

.creator-rewards-inline {
  border-color: rgba(165, 48, 69, .48);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(42, 12, 21, .72), rgba(15, 8, 11, .92));
}

.creator-reward-balance {
  background: rgba(5, 4, 5, .42);
}

.market-meta {
  display: none !important;
}

.market-actions {
  margin-top: 12px;
}

.market-meta-item,
.market-actions a {
  border-color: var(--market-line-soft);
  background: rgba(255, 255, 255, .012);
}

.open-orders-panel,
.traders-panel {
  border-color: var(--market-line);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(18, 9, 13, .98), rgba(9, 7, 8, .98));
}

.open-orders-panel {
  padding: 17px 20px;
}

.trader-feed-nav {
  min-height: 52px;
  gap: 32px;
  padding: 0 22px;
  border-bottom-color: var(--market-line-soft);
}

.trader-feed-nav span,
.trader-feed-nav button {
  height: 52px;
  font-size: 12px;
}

.traders-panel-body {
  padding: 18px 20px 20px;
}

.trades-table td {
  background: transparent;
}

@media (max-width: 1260px) {
  .market-page.wrap {
    width: min(1180px, calc(100% - 32px));
  }
  .token-profile {
    grid-template-columns: minmax(290px, .95fr) minmax(430px, 1.2fr) minmax(260px, .7fr);
    padding-inline: 18px;
  }
  .token-profile-identity {
    padding-right: 18px;
  }
  .token-profile-market {
    padding-inline: 10px;
  }
  .token-profile-stat {
    padding-inline: 12px;
  }
  .token-profile-facts {
    padding-left: 16px;
  }
  .token-trust-badge {
    display: none;
  }
  .market-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .market-stat {
    padding-inline: 16px;
  }
}

@media (max-width: 980px) {
  .market-page.wrap {
    width: min(820px, calc(100% - 24px));
  }
  .token-profile {
    grid-template-columns: minmax(0, 1fr) minmax(290px, .8fr);
    gap: 14px 0;
  }
  .token-profile-market {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 15px;
    padding-bottom: 2px;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-top: 1px solid var(--market-line-soft);
  }
  .token-profile-facts {
    grid-column: 2;
    grid-row: 1;
    padding-left: 18px;
    border-left: 1px solid var(--market-line-soft);
  }
  .market-stat-strip {
    grid-template-columns: repeat(4, 1fr);
  }
  .market-grid {
    grid-template-columns: 1fr;
  }
  .trade-box {
    position: static;
    order: -1;
  }
  .market-chart,
  .market-chart iframe {
    min-height: 460px;
    height: 460px;
  }
}

@media (max-width: 620px) {
  .market-page.wrap {
    width: calc(100% - 20px);
    padding-top: 14px;
  }
  .token-profile {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 0;
    padding: 15px;
    overflow: visible;
  }
  .token-profile-identity {
    grid-column: 1;
    grid-row: 1;
    padding: 0 0 14px;
  }
  .token-profile-icon {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }
  .token-profile h2 {
    font-size: 23px;
  }
  .token-profile-description {
    max-width: calc(100vw - 120px);
    white-space: nowrap;
  }
  .token-socials {
    min-height: 0;
    margin-top: 7px;
  }
  .token-profile-market {
    grid-column: 1;
    grid-row: 2;
    min-height: 66px;
    padding: 13px 0;
    border-top: 1px solid var(--market-line-soft);
    border-bottom: 1px solid var(--market-line-soft);
  }
  .token-profile-stat {
    padding-inline: 10px;
  }
  .token-profile-stat:first-child {
    padding-left: 0;
  }
  .token-profile-stat:last-child {
    padding-right: 0;
  }
  .token-profile-stat strong {
    margin-top: 7px;
    font-size: 16px;
  }
  .token-profile-facts {
    grid-column: 1;
    grid-row: 3;
    padding: 10px 0 0;
    border-left: 0;
  }
  .token-profile-fact {
    grid-template-columns: 58px minmax(0, 1fr);
    min-height: 42px;
    padding-inline: 0;
  }
  .token-profile-fact b {
    font-size: 10px;
  }
  .token-ca-copy {
    flex-basis: 26px;
    width: 26px;
    height: 26px;
  }
  .market-stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .market-stat {
    min-height: 65px;
    padding: 10px 13px;
  }
  .market-stat:nth-child(odd)::before {
    display: none;
  }
  .market-stat:nth-child(n + 3) {
    border-top: 1px solid var(--market-line-soft);
  }
  .market-stat strong {
    font-size: 16px;
  }
  .trade-box {
    padding: 14px;
  }
  .market-chart,
  .market-chart iframe {
    min-height: 355px;
    height: 355px;
  }
  .trader-feed-nav {
    gap: 22px;
    padding-inline: 15px;
  }
  .traders-panel-body {
    padding: 14px;
  }
}
