@media (max-width: 900px) {
  body[data-page="markets"] .table-card .table-scroll {
    overflow: visible;
  }

  body[data-page="markets"] .screener-table,
  body[data-page="markets"] .screener-table tbody {
    display: block;
    width: 100%;
  }

  body[data-page="markets"] .screener-table thead {
    display: none;
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row {
    display: grid;
    grid-template-areas:
      "instrument action"
      "price change"
      "range range"
      "volume strategy";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 14px;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row:last-child {
    border-bottom: 0;
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row td {
    display: block;
    min-width: 0;
    padding: 0 !important;
    border: 0;
    text-align: left !important;
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(1) { grid-area: instrument; }
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(2) { grid-area: price; }
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(3) { grid-area: change; }
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(4) { grid-area: range; }
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(5) { grid-area: volume; }
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(6) { grid-area: strategy; }
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(7) {
    grid-area: action;
    align-self: start;
    justify-self: end;
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(7)::before {
    display: none;
  }

  body[data-page="markets"] .screener-table .range-cell {
    min-width: 0;
    max-width: none;
  }

  body[data-page="markets"] .screener-table .range-track {
    margin-block: 7px 5px;
  }

  body[data-page="markets"] .screener-table .bot-badge {
    min-height: 34px;
    box-sizing: border-box;
  }

  body[data-page="markets"] .screener-table .screener-trade-btn {
    min-height: 42px;
    justify-content: center;
  }
}

@media (max-width: 900px) {
  /* Cards sit flush inside a padding-less table card: give each row its own side padding
     so figures do not touch (or get clipped by) the rounded edge. */
  body[data-page="markets"] .screener-table tbody tr.screener-row {
    padding: 14px 14px;
    gap: 8px 12px;
  }

  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(3),
  body[data-page="markets"] .screener-table tbody tr.screener-row td:nth-child(6) {
    justify-self: end;
    text-align: right !important;
  }

  body[data-page="markets"] .screener-table .range-bounds {
    gap: 8px;
  }
}
