.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
}

.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--chrome);
  font-size: 13px;
  font-weight: 900;
}

.legend span {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.legend-red {
  background: hsl(0, 60%, 25%);
}

.legend-mid {
  background: hsl(180, 5%, 18%);
}

.legend-green {
  background: hsl(120, 60%, 35%);
}

.heatmap {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(6, 16, 15, 0.58);
}

.heatmap-head,
.heatmap-row {
  display: grid;
  grid-template-columns: minmax(168px, 1.08fr) repeat(3, minmax(0, 1fr));
  gap: 1px;
}

.heatmap-head {
  background: rgba(20, 217, 197, 0.16);
}

.heatmap-head span,
.row-label,
.cell {
  min-width: 0;
}

.heatmap-head span {
  padding: 12px 14px;
  color: var(--teal-soft);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.heatmap-rows {
  display: grid;
  gap: 1px;
  background: rgba(110, 245, 232, 0.16);
}

.heatmap-row {
  background: rgba(6, 16, 15, 0.84);
}

.row-label {
  display: grid;
  align-content: center;
  gap: 4px;
  border: 0;
  padding: 9px 14px;
  color: inherit;
  background: rgba(13, 36, 34, 0.9);
  text-align: left;
}

.row-label strong {
  color: #fff;
  font-size: 16px;
  font-weight: 1000;
}

.row-label small {
  color: var(--chrome);
  font-size: 12px;
  font-weight: 900;
}

button.row-label:hover,
button.row-label:focus-visible {
  z-index: 2;
  outline: 0;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(247, 201, 72, 0.72);
}

.cell {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 4px;
  min-height: 72px;
  border: 0;
  padding: 9px 12px;
  color: #fff;
  text-align: left;
  text-decoration: none;
  transition: box-shadow 160ms ease, transform 160ms ease, filter 160ms ease;
}

button.cell:hover,
button.cell:focus-visible {
  z-index: 2;
  outline: 0;
  transform: translateY(-1px);
  filter: saturate(1.12);
  box-shadow: 0 0 0 1px rgba(110, 245, 232, 0.78), 0 0 28px rgba(20, 217, 197, 0.42);
}

.cell.is-sdoge {
  box-shadow: inset 0 0 0 2px var(--yellow), 0 0 20px rgba(247, 201, 72, 0.35);
}

.cell-count {
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 1000;
  line-height: 1;
}

.cell-change {
  align-self: center;
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
}

.cell-volume {
  align-self: end;
  color: rgba(255, 255, 255, 0.82);
  font-size: 11px;
  font-weight: 900;
}

.cell.empty {
  place-items: center;
  color: rgba(232, 255, 251, 0.36);
  background: rgba(4, 9, 9, 0.82);
  font-weight: 1000;
}

.cell.is-pulse-buy {
  animation: cellPulseBuy 0.6s ease-out;
}

.cell.is-pulse-sell {
  animation: cellPulseSell 0.6s ease-out;
}

.is-skeleton .cell,
.is-skeleton .row-label {
  color: rgba(232, 255, 251, 0.5);
}

.top-section {
  min-height: 0;
}

.top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.top-panel {
  padding: 11px 12px;
}

.top-section .section-title {
  font-size: clamp(20px, 2.1vw, 25px);
}

.top-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border: 1px solid rgba(110, 245, 232, 0.18);
  border-radius: 7px;
  padding: 7px 8px;
  color: #e8fffb;
  background: rgba(6, 16, 15, 0.72);
  text-decoration: none;
}

.top-row:hover,
.top-row:focus-visible {
  outline: 0;
  border-color: rgba(247, 201, 72, 0.78);
}

.top-token {
  min-width: 0;
}

.top-token strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-token small,
.top-value small {
  display: block;
  color: var(--chrome);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.top-value {
  color: var(--teal-soft);
  font-size: 12px;
  font-weight: 1000;
  text-align: right;
  white-space: nowrap;
}

.top-value.is-hot {
  color: var(--yellow);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 18px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.68);
}

.modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #071513;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: inherit;
}

.modal-summary {
  margin: 8px 0 0;
  color: var(--chrome);
  font-size: 13px;
  font-weight: 900;
}

.close-button {
  border: 1px solid rgba(247, 201, 72, 0.58);
  border-radius: 7px;
  padding: 8px 12px;
  color: #06100f;
  background: var(--yellow);
  font-weight: 1000;
}

.modal-body,
.token-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(80vh, calc(100vh - 96px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.token-table {
  min-width: 820px;
}

.token-table-head,
.token-row {
  display: grid;
  grid-template-columns: minmax(172px, 1.2fr) repeat(5, minmax(92px, 0.72fr)) 64px;
  gap: 10px;
  align-items: center;
}

.token-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 18px;
  color: var(--teal-soft);
  background: #071513;
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.token-row {
  padding: 12px 18px;
  border-top: 1px solid rgba(110, 245, 232, 0.12);
  color: #e8fffb;
}

.token-row strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-row small {
  display: block;
  overflow: hidden;
  color: var(--chrome);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.num {
  font-weight: 1000;
  white-space: nowrap;
}

.token-link {
  color: var(--yellow);
  font-weight: 1000;
  text-decoration: none;
}

.token-link:hover,
.token-link:focus-visible {
  text-decoration: underline;
}

.sub-bucket-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  border-top: 1px solid rgba(247, 201, 72, 0.26);
  color: var(--yellow);
  background: rgba(13, 36, 34, 0.94);
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

body.modal-open {
  overflow: hidden;
}

@keyframes cellPulseBuy {
  0% {
    box-shadow: 0 0 0 0 rgba(138, 255, 149, 0.92), inset 0 0 0 1px rgba(138, 255, 149, 0.88);
  }

  100% {
    box-shadow: 0 0 0 16px rgba(138, 255, 149, 0), inset 0 0 0 1px rgba(138, 255, 149, 0);
  }
}

@keyframes cellPulseSell {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 86, 86, 0.9), inset 0 0 0 1px rgba(255, 86, 86, 0.84);
  }

  100% {
    box-shadow: 0 0 0 16px rgba(255, 86, 86, 0), inset 0 0 0 1px rgba(255, 86, 86, 0);
  }
}

@media (min-width: 1100px) {
  .top-grid {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 11px;
    min-height: 0;
  }

  .top-panel:last-child {
    flex: 1;
  }
}

@media (max-width: 900px) {
  .top-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .section-head,
  .top-grid,
  .modal-head {
    grid-template-columns: 1fr;
  }

  .heatmap {
    border: 0;
    background: transparent;
  }

  .heatmap-head {
    display: none;
  }

  .heatmap-rows {
    gap: 12px;
    background: transparent;
  }

  .heatmap-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .row-label {
    grid-column: 1 / -1;
  }

  .cell {
    min-height: 94px;
    padding: 10px;
  }

  .legend {
    justify-self: start;
  }

  .top-panel:last-child {
    grid-column: auto;
  }

  .modal {
    padding: 10px;
  }

  .modal-dialog {
    max-height: calc(100vh - 20px);
  }
}

@media (max-width: 460px) {
  .cell-volume {
    font-size: 11px;
  }
}
