.market-stats {
  min-inline-size: 0;
  align-self: center;
  display: grid;
}

.market-stats-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }

.market-stats-cell {
  min-inline-size: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121a24;
}

.market-stats-cell-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 10px; }
.market-stats-title { display: inline-flex; align-items: baseline; gap: 5px; min-inline-size: 0; }
.market-stats-market { font-size: 11px; font-weight: 700; color: #d6e2ef; white-space: nowrap; }
.market-stats-coverage { font-size: 9px; color: #e7bd7e; white-space: nowrap; }

.market-stats-summary {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: 9px;
  row-gap: 3px;
  line-height: 1.15;
}

.market-stats-counts { display: inline-flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.market-stats-value { display: inline-flex; align-items: baseline; gap: 3px; font-size: 10px; white-space: nowrap; }
.market-stats-value strong { font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 750; }
.market-stats-previous { color: #8fa0b3; }
.market-stats-previous strong { font-size: 11px; font-weight: 650; color: #bdcce0; }
.market-stats-rate { color: #b5d6ff; margin-inline-end: 3px; }
.market-stats-rate strong { font-size: 15px; font-weight: 800; color: #eaf3ff; letter-spacing: -.01em; }
.market-stats-profit { color: #8be7ae; }
.market-stats-stop { color: #ff9ba6; }

.market-stats-bar { block-size: 3px; border-radius: 2px; background: #ff9ba6; overflow: hidden; opacity: .9; }
.market-stats-bar[data-empty="true"] { background: #263341; }
.market-stats-bar-fill { display: block; block-size: 100%; background: #8be7ae; border-inline-end: 1px solid #121a24; transition: inline-size .4s ease; }
.market-stats-bar[data-empty="true"] .market-stats-bar-fill { border: 0; }

@media (max-width: 955px) {
  .topbar-inner.topbar-with-stats {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    padding-block: 9px;
  }

  .topbar-with-stats > .topbar-controls { display: contents; }
  .topbar-with-stats > .brand { grid-area: 1 / 1; }
  .topbar-with-stats .public-account-trigger { grid-area: 1 / 2; justify-self: end; }
  .topbar-with-stats .market-switch { grid-area: 2 / 1; justify-self: start; }
  .topbar-with-stats .topbar-quick-actions { grid-area: 2 / 2; justify-self: end; }
  .topbar-with-stats .market-stats {
    grid-area: 3 / 1 / 4 / 3;
  }
}

@media (max-width: 370px) {
  .market-stats-summary { display: grid; gap: 3px; }
}

@media (max-width: 314px) {
  .topbar-with-stats .market-switch { grid-area: 2 / 1 / 3 / -1; }
  .topbar-with-stats .topbar-quick-actions { grid-area: 3 / 1 / 4 / -1; justify-self: start; }
  .topbar-with-stats .market-stats { grid-area: 4 / 1 / 5 / -1; }
  .topbar-inner.topbar-with-stats > .market-notice { grid-area: 5 / 1 / 6 / -1; }
}
