/* ========================================================================== */
/* AMPLITRA MARKETS                                                           */
/* /markets owns this file. Shared shell primitives live in style.css.         */
/* ========================================================================== */

.markets-shell {
  --market-bg: #07090a;
  --market-panel: #0d1012;
  --market-panel-2: #111417;
  --market-border: rgba(255,255,255,.075);
  --market-border-strong: rgba(255,255,255,.12);
  --market-text: #f2eee8;
  --market-muted: #8b9097;
  --market-faint: #646970;
  --market-green: #62d5aa;
  --market-red: #f17872;
  --market-amber: var(--ember-hi, #ffb33f);
  --market-orange: var(--ember, #ff6633);
  color: var(--market-text);
}

.markets-shell *, .markets-shell *::before, .markets-shell *::after { box-sizing: border-box; }
body:has(.markets-shell) {
  background:
    radial-gradient(760px 360px at 16% 0%, rgba(255,103,48,.06), transparent 70%),
    #07090a;
}

/* ------------------------------------------------------------------ shell */
main.markets.mkt-shell {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr) 260px;
  gap: 22px;
  width: min(calc(100% - 24px), 1560px);
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px 0 72px;
  align-items: start;
}
main.markets.mkt-shell > * { min-width: 0; }
.mkt-main { gap: 14px; }

/* Old full-bleed hero class is retained for the server contract, but the new
   Markets page uses it as an ordinary dashboard header. */
.mkt-shell .markets-hero {
  margin: 0;
  padding: 0;
  width: auto;
  overflow: visible;
  background: none;
  isolation: auto;
}
.mkt-shell .markets-hero::before,
.mkt-shell .markets-hero::after { display: none; }

/* --------------------------------------------------------------- page head */
.mkt-head {
  display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(560px, 1.55fr);
  align-items: center;
  gap: 28px;
}
main.mkt-shell .mkt-head h1 {
  margin: 0 0 7px;
  color: #f7f3ee;
  font: 720 30px/1.05 var(--sans);
  letter-spacing: -.035em;
}
.mkt-head-copy p {
  margin: 0;
  max-width: 48ch;
  color: #999da3;
  font: 13px/1.6 var(--sans);
}
.markets-health {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding: 6px 9px;
  border: 1px solid rgba(255,179,63,.22);
  border-radius: 999px;
  color: var(--market-amber);
  background: rgba(255,179,63,.05);
  font: 600 11px/1 var(--sans);
}
.markets-health::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

main.markets .mkt-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  border: 1px solid var(--market-border);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(13,16,18,.94);
}
main.markets .mkt-stat {
  min-width: 0;
  min-height: 72px;
  padding: 14px 16px;
  border: 0;
  border-left: 1px solid var(--market-border);
}
main.markets .mkt-stat:first-child { border-left: 0; }
main.markets .mkt-stat span {
  display: block;
  color: #787e85;
  font: 600 11px/1 var(--sans);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
main.markets .mkt-stat b {
  display: block;
  margin-top: 10px;
  color: #f4f1ed;
  font: 700 18px/1 var(--sans);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ------------------------------------------------------------ quick tools */
.mkt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.mkt-toolbar .mkt-pills {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}
.mkt-toolbar .mkt-pills::-webkit-scrollbar { display: none; }
.mkt-pill {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid var(--market-border);
  border-radius: 999px;
  background: #0d1012;
  color: #9da1a6;
  font: 500 11.5px/1 var(--sans);
}
.mkt-pill:hover { color: #f3eee8; border-color: rgba(255,255,255,.15); }
.mkt-pill.is-active {
  color: #fff5e9;
  border-color: rgba(255,179,63,.52);
  background: rgba(255,179,63,.07);
  box-shadow: 0 0 22px rgba(255,124,42,.055);
}
.mkt-pill-new {
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--discovery);
  background: var(--discovery-soft);
  font: 700 11px/1 var(--mono);
  letter-spacing: .06em;
  font-style: normal;
}
#markets-tools-root { flex: 0 0 auto; margin: 0; }
.market-filter { position: relative; }
.market-filter-trigger {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--market-border-strong);
  border-radius: 8px;
  color: #d5d0ca;
  background: #0d1012;
  font: 600 11.5px/1 var(--sans);
  cursor: pointer;
}
.market-filter-trigger:hover { border-color: rgba(255,179,63,.26); }
.market-filter-trigger svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.market-filter-trigger i { padding: 3px 5px; border-radius: 999px; color: var(--market-amber); background: rgba(255,179,63,.08); font: 700 11px/1 var(--sans); font-style: normal; text-transform: uppercase; }
.market-filter-trigger > span { color: #6f747a; transition: transform .16s; }
.market-filter-trigger[data-state="open"] > span { transform: rotate(180deg); }
.market-filter-content {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(720px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--market-border-strong);
  border-radius: 12px;
  background: rgba(11,13,15,.99);
  box-shadow: 0 24px 70px rgba(0,0,0,.64);
}
.market-filter-form { display: grid; grid-template-columns: minmax(220px,1fr) 150px 150px auto auto; align-items: end; gap: 9px; }
.market-filter-form label { display: grid; gap: 7px; min-width: 0; }
.market-filter-form label > span { color: #777d83; font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.market-filter-form input, .market-filter-form select {
  width: 100%; min-width: 0; min-height: 38px; padding: 0 10px;
  border: 1px solid var(--market-border-strong); border-radius: 7px;
  color: #ebe7e1; background: #080a0c; font: 500 11.5px/1 var(--sans); outline: none;
}
.market-filter-form input:focus, .market-filter-form select:focus { border-color: rgba(255,179,63,.38); box-shadow: 0 0 0 3px rgba(255,179,63,.06); }
.market-filter-search > div { position: relative; }
.market-filter-search svg { position: absolute; left: 10px; top: 11px; width: 15px; height: 15px; fill: none; stroke: #767b80; stroke-width: 1.7; }
.market-filter-search input { padding-left: 32px; }
.market-apply { min-height: 38px; padding: 0 14px; border: 0; border-radius: 7px; color: #170b06; background: linear-gradient(135deg,#ffc151,#ff7238); font: 700 11px/1 var(--sans); cursor: pointer; }
.market-reset { min-height: 38px; display: grid; place-items: center; padding: 0 8px; color: #94989d; font: 600 11px/1 var(--sans); text-decoration: none; }
.markets-enhanced .markets-controls-fallback { display: none; }
.markets-controls-fallback { margin: 0; }

/* --------------------------------------------------------------- sections */
.mkt-section {
  border: 1px solid var(--market-border);
  border-radius: 10px;
  background: rgba(13,16,18,.94);
  padding: 13px 10px 0;
  overflow: hidden;
}
.mkt-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px 11px;
  margin: 0;
}
.mkt-section-head h2 { margin: 0 0 3px; color: #f1ede8; font: 650 16px/1.2 var(--sans); letter-spacing: -.015em; }
.mkt-section-head p { margin: 0; max-width: 68ch; color: #7f848a; font: 11.5px/1.45 var(--sans); }
.mkt-view-all { flex: 0 0 auto; color: var(--market-amber); font: 600 11px/1 var(--sans); text-decoration: none; }
.mkt-view-all:hover { color: #ffd17a; }
.mkt-empty { margin: 4px 4px 15px; color: #858a90; font: 12px/1.55 var(--sans); }

/* ---------------------------------------------------------- compact tables */
.mkt-table-wrap { margin: 0 -10px; padding: 0; overflow-x: auto; }
main.markets .mkt-table { width: 100%; min-width: 810px; border-collapse: collapse; table-layout: auto; font-variant-numeric: tabular-nums; }
.mkt-table th {
  padding: 9px 9px;
  border-top: 1px solid var(--market-border);
  border-bottom: 1px solid var(--market-border);
  color: #70767c;
  background: rgba(255,255,255,.006);
  font: 600 11px/1 var(--sans);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
}
.mkt-table th.mkt-num, .mkt-table th.mkt-tok { text-align: left; }
.mkt-table td {
  padding: 10px 9px;
  border-top: 1px solid rgba(255,255,255,.045);
  color: #dcd8d2;
  text-align: right;
  white-space: nowrap;
}
.mkt-table tbody tr:first-child td { border-top: 0; }
.mkt-table tbody tr:hover { background: rgba(255,255,255,.018); }
.mkt-table td.mkt-num { width: 26px; color: #989da2; text-align: left; font: 500 11px/1 var(--mono); }
.mkt-table td.mkt-tok { min-width: 170px; text-align: left; }
.mkt-table td.num { font: 500 11.5px/1 var(--mono); }
.mkt-table td.dim { color: #a3a6aa; }
.mkt-table .mkt-split { border-left: 1px solid var(--market-border); }
.mkt-token { display: flex; align-items: center; gap: 9px; min-width: 0; text-decoration: none; }
.mkt-token .market-project-icon { width: 31px; height: 31px; border-radius: 50%; }
.mkt-token-text { min-width: 0; }
.mkt-token-text b { display: block; overflow: hidden; color: #f3efea; font: 600 12px/1.2 var(--sans); text-overflow: ellipsis; white-space: nowrap; }
.mkt-token-text i { display: block; margin-top: 3px; color: #777c81; font: 500 12px/1 var(--mono); font-style: normal; }
.mkt-heat { color: var(--market-amber); font: 700 11.5px/1 var(--mono); }
.mkt-ember { color: #d0b7ff; font: 650 11px/1 var(--mono); }
.mkt-rank { display: inline-grid; place-items: center; min-width: 31px; min-height: 25px; padding: 0 7px; border: 1px solid rgba(255,179,63,.28); border-radius: 6px; color: var(--market-amber); background: rgba(255,179,63,.04); font: 650 12px/1 var(--mono); text-decoration: none; }
.mkt-rank.is-throne { border-color: rgba(255,194,71,.52); background: rgba(255,194,71,.09); }
.market-change { display: inline-flex; align-items: center; justify-content: center; padding: 4px 6px; border-radius: 5px; font: 650 12px/1 var(--sans); }
.market-change.up { color: var(--market-green); background: rgba(98,213,170,.065); }
.market-change.down { color: var(--market-red); background: rgba(241,120,114,.065); }
.market-change.flat { color: #8d9297; background: rgba(255,255,255,.035); }
.market-unknown { color: #64696f !important; font-style: normal; }

/* -------------------------------------------------------- discovery cards */
.mkt-cards {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(198px, 1fr);
  gap: 10px;
  overflow-x: auto;
  margin: 0 -2px;
  padding: 0 2px 11px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
main.markets .mkt-card {
  scroll-snap-align: start;
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--market-border);
  border-radius: 8px;
  background: linear-gradient(180deg,#111418,#0c0f11);
}
.mkt-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mkt-badge-discovered { padding: 3px 6px; border: 1px solid var(--discovery-line); border-radius: 4px; color: #c5b5ff; background: var(--discovery-soft); font: 700 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.mkt-card-age { color: #777c82; font: 500 12px/1 var(--sans); }
.mkt-card-id { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.mkt-card-id .market-project-icon { width: 38px; height: 38px; border-radius: 50%; }
.mkt-card-id b { display: block; color: #f2eee8; font: 650 12.5px/1.2 var(--mono); }
.mkt-card-id i { display: block; margin-top: 3px; color: #8a8f94; font: 11px/1.2 var(--sans); font-style: normal; }
.mkt-card-chain { display: flex; align-items: center; gap: 5px; margin: 0; color: #72777d; font: 600 11px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; }
.mkt-card-lines { display: grid; gap: 5px; }
.mkt-card-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mkt-card-line span { color: #7c8187; font: 500 12px/1 var(--sans); }
.mkt-card-line b { color: #e4e0da; font: 600 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.mkt-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,.05); }
.mkt-starter { color: var(--market-amber); font: 650 12px/1 var(--mono); }
.mkt-card-unclaimed { color: #777c82; font: 600 12px/1 var(--sans); }
.mkt-card-view { color: var(--market-amber); font: 650 12px/1 var(--sans); text-decoration: none; }

/* ------------------------------------------------------------- right rail */
.mkt-insights { position: sticky; top: 74px; display: grid; gap: 12px; }
main.markets .mkt-insight { padding: 13px; border: 1px solid var(--market-border); border-radius: 8px; background: rgba(13,16,18,.94); }
.mkt-insight h3 { display: flex; align-items: baseline; gap: 6px; margin: 0 0 11px; color: #eeeae5; font: 650 11.5px/1 var(--sans); }
.mkt-insight h3 i { color: #74797f; font: 500 12px/1 var(--sans); font-style: normal; }
.mkt-def { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.045); }
.mkt-def:first-of-type { border-top: 0; padding-top: 0; }
.mkt-def p { margin: 0 0 0 2px; color: #7e8389; font: 12px/1.45 var(--sans); }
.mkt-learn { display: block; margin-top: 6px; padding: 7px; border: 1px solid rgba(255,179,63,.28); border-radius: 6px; color: var(--market-amber); text-align: center; font: 600 12px/1 var(--sans); text-decoration: none; }
.mkt-mini { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.mkt-mini li { display: flex; align-items: center; gap: 7px; min-width: 0; }
.mkt-mini-rank { width: 12px; color: #73787e; font: 500 12px/1 var(--mono); }
.mkt-mini a { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; text-decoration: none; }
.mkt-mini .market-project-icon { width: 22px; height: 22px; border-radius: 50%; }
.mkt-mini a b { overflow: hidden; color: #e6e2dc; font: 600 12px/1 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.mkt-mini .market-change, .mkt-mini .mkt-heat { flex: 0 0 auto; font-size: 12px; }
.mkt-insight-note { margin: 9px 0 0; color: #6e7379; font: 12px/1.4 var(--sans); }
.mkt-empty-mini { margin: 0; color: #73787e; font: 12px/1.45 var(--sans); }

/* ----------------------------------------------------- filtered full table */
.mkt-results-frame { margin: 0 -10px; border-width: 1px 0 0; border-radius: 0; box-shadow: none; }
.mkt-results-frame .markets-meta { min-height: 44px; padding: 0 14px; }
.mkt-results-frame .markets-table { min-width: 940px; }
.markets-footnote { display: flex; gap: 8px; align-items: flex-start; margin: 12px 2px 14px; color: #73787e; font: 12px/1.5 var(--sans); }
.markets-footnote svg { width: 14px; height: 14px; flex: none; margin-top: 1px; fill: none; stroke: #8da7c7; stroke-width: 1.7; }
.markets-footnote a { color: #aaaeb3; }
.markets-delayed { color: var(--market-amber); }
.markets-current { color: var(--market-green); }

/* ----------------------------------------------------------- search match */
.market-discovery-results { border-radius: 10px; }
.market-discovery-card { border-radius: 8px; }

/* --------------------------------------------------------------- focus */
.mkt-pill:focus-visible,
.market-filter-trigger:focus-visible,
.market-apply:focus-visible,
.market-reset:focus-visible,
.mkt-token:focus-visible,
.mkt-card a:focus-visible,
.mkt-rank:focus-visible {
  outline: 2px solid rgba(255,179,63,.65);
  outline-offset: 2px;
}

/* ========================================================================== */
/* RESPONSIVE                                                                 */
/* ========================================================================== */

@media (max-width: 1280px) {
  main.markets.mkt-shell { grid-template-columns: 200px minmax(0,1fr); gap: 18px; }
  .mkt-insights { display: none; }
  .mkt-head { grid-template-columns: minmax(220px,.65fr) minmax(500px,1.35fr); gap: 18px; }
  main.markets .mkt-stat { padding-inline: 12px; }
}

@media (max-width: 1040px) {
  main.markets.mkt-shell { grid-template-columns: minmax(0,1fr); width: min(calc(100% - 28px), 980px); }
  .mkt-sidebar { display: none; }
  .mkt-head { grid-template-columns: 1fr; gap: 14px; }
  main.markets .mkt-stats { grid-template-columns: repeat(4,minmax(0,1fr)); }
}

@media (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: clip; }
  main.markets.mkt-shell { width: 100%; padding: 14px 14px 76px; }
  .mkt-main { gap: 12px; }
  main.mkt-shell .mkt-head h1 { font-size: 27px; }
  .mkt-head-copy p { font-size: 12.5px; }
  main.markets .mkt-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  main.markets .mkt-stat { min-height: 64px; padding: 12px; border-left: 1px solid var(--market-border); border-top: 1px solid var(--market-border); }
  main.markets .mkt-stat:nth-child(odd) { border-left: 0; }
  main.markets .mkt-stat:nth-child(-n+2) { border-top: 0; }
  main.markets .mkt-stat span { font-size: 11px; }
  main.markets .mkt-stat b { margin-top: 8px; font-size: 16px; }

  .mkt-toolbar { align-items: stretch; }
  .mkt-toolbar .mkt-pills { order: 1; }
  #markets-tools-root { order: 2; }
  .market-filter-trigger { min-height: 32px; padding-inline: 10px; }
  .market-filter-trigger > span { display: none; }
  .market-filter-content { position: fixed; left: 12px; right: 12px; top: 72px; width: auto; max-height: calc(100vh - 90px); overflow-y: auto; }
  .market-filter-form { grid-template-columns: 1fr; }
  .market-filter-search { grid-column: auto; }

  .mkt-section { padding: 13px 12px 0; border-radius: 9px; }
  .mkt-section-head { padding-bottom: 10px; }
  .mkt-section-head h2 { font-size: 15px; }
  .mkt-section-head p { font-size: 11px; }

  /* Overview/category tables become real mobile cards rather than a desktop
     table in a horizontal scroller. */
  .mkt-table-wrap { margin: 0 -12px; overflow: visible; }
  .mkt-table { min-width: 0; display: block; }
  .mkt-table thead { display: none; }
  .mkt-table tbody { display: grid; }
  .mkt-table tr {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-areas:
      "token rank"
      "price change"
      "volume volume"
      "mcap mcap"
      "attention ember";
    gap: 0 12px;
    padding: 12px;
    border-top: 1px solid var(--market-border);
    background: transparent;
  }
  .mkt-table tbody tr:first-child { border-top: 1px solid var(--market-border); }
  .mkt-table td { display: block; padding: 0; border: 0 !important; text-align: left; white-space: normal; }
  .mkt-table td::before { display: block; margin-bottom: 4px; color: #696f75; font: 600 11px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; }
  .mkt-table td.mkt-num { display: none; }
  .mkt-table td.mkt-tok { grid-area: token; min-width: 0; padding-bottom: 10px; }
  .mkt-table td.mkt-amplitra-rank { grid-area: rank; justify-self: end; }
  .mkt-table td.mkt-price { grid-area: price; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.045) !important; }
  .mkt-table td.mkt-price::before { content: "Price"; }
  .mkt-table td.mkt-change-cell { grid-area: change; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.045) !important; text-align: right; }
  .mkt-table td.mkt-change-cell::before { content: "24h"; text-align: right; }
  .mkt-table td.mkt-volume { grid-area: volume; padding: 8px 0 0; }
  .mkt-table td.mkt-volume::before { content: "24h volume"; display: inline; margin-right: 7px; }
  .mkt-table td.mkt-liquidity { display: none; }
  .mkt-table td.mkt-mcap { grid-area: mcap; padding: 6px 0 9px; }
  .mkt-table td.mkt-mcap::before { content: "Market cap"; display: inline; margin-right: 7px; }
  .mkt-table td.mkt-paid-heat { grid-area: attention; display: inline-flex; align-items: center; padding: 9px 0 11px; border-top: 1px solid rgba(255,179,63,.12) !important; }
  .mkt-table td.mkt-paid-heat::before { content: "Amplitra"; margin: 0 10px 0 0; }
  .mkt-table td.mkt-ember-power { grid-area: ember; justify-self: center; align-self: center; padding-top: 9px; }
  .mkt-table td.mkt-amplitra-rank { align-self: start; }
  .mkt-token .market-project-icon { width: 36px; height: 36px; }
  .mkt-token-text b { font-size: 13px; }

  .mkt-cards { grid-auto-columns: min(82vw, 300px); padding-bottom: 12px; scroll-snap-type: x mandatory; }

  /* The legacy results table already becomes cards in style.css. This file
     only prevents an old desktop min-width from surviving into that layout. */
  .mkt-results-frame .markets-table { min-width: 0; }
  .mkt-results-frame { margin-inline: -12px; }
}

@media (max-width: 430px) {
  main.markets.mkt-shell { padding-inline: 12px; }
  .mkt-toolbar { gap: 8px; }
  .mkt-pill { min-height: 31px; padding-inline: 11px; font-size: 11px; }
  .mkt-cards { grid-auto-columns: min(84vw, 286px); }
  .mkt-card { padding: 10px; }
  .mkt-section-head { gap: 10px; }
  .mkt-view-all { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-filter-trigger > span,
  .mkt-cards { scroll-behavior: auto; transition: none; }
}

/* ==========================================================================
   TOKEN ARTWORK HARD SIZE GUARD
   Remote project logos must never be allowed to size the market table.
   ========================================================================== */

.mkt-token {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.mkt-token .market-project-icon {
  position: relative;
  width: 31px;
  height: 31px;
  min-width: 31px;
  min-height: 31px;
  max-width: 31px;
  max-height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  line-height: 1;
  contain: layout paint;
}

.mkt-token .market-project-icon > span {
  position: relative;
  z-index: 0;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.mkt-token .market-project-icon img {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

.mkt-token-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.mkt-token-text > b,
.mkt-token-text > i {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mkt-card-id .market-project-icon img,
.mkt-mini .market-project-icon img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
}

@media (max-width: 720px) {
  .mkt-token .market-project-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    flex-basis: 36px;
  }
}

/* Final remote-art containment fallback.
   The server also emits dimensions inline so a third-party logo can never
   expand the Markets layout even before stylesheet application completes. */
main.markets .market-project-icon {
  box-sizing: border-box !important;
  overflow: hidden !important;
}
main.markets .market-project-icon > img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center !important;
}

